avitase,
First of all, make the intel card work alone. Remove the nvidia-drivers binary blob so it can't interfere.
Set up the kernel for intel, put intel into VIDEO_CARDS, if its not there already.
Rebuild mesa if needed and get the xf86-video-intel driver, if its not already installed.
This should justwork, with no additions to Xorg configuration.
You will get a right handed mouse and a USA keymap, which is good enough to get you going.
When this works, make a copy of your kernel tree, thats whatever /usr/src/linux points at.
The original tree will be for intel, the copy will be for nvidia.
Code: Select all
ls /usr/src/ -l
total 24
lrwxrwxrwx 1 root root 19 Jul 26 14:04 linux -> linux-4.12.3-gentoo
linux-4.12.3-gentoo
linux-4.12.3-gentoo-nvidia
We want to change linux-4.12.3-gentoo-nvidia to set up for the nVidia drivers but first, go into linux-4.12.3-gentoo-nvidia/Makefile
and at the top,
Code: Select all
VERSION = 4
PATCHLEVEL = 12
SUBLEVEL = 3
EXTRAVERSION = -gentoo
NAME = Fearless Coyote
change the EXTRAVERSION to say, -gentoo-nvidia
This ensures the installed modules are kept separate.
Update the /usr/src/linux symlink to point to your -gentoo-nvidia kernel.
Run
to get rid of the old binaries.
Set this kernel up to use the nVidia binary blob.
Install it to /boot in the normal way beside your Intel kernel.
Fix your boot loader to offer you a choice at boot time.
Go into the BIOS and choose the nVidia card.
Boot the nVidia kernel.
Install and set up nvidia-drivers and make it work.
When you do this you will create a stub Xorg.conf with about 3 lines in it.
At this stage, you have two kernels, a default setup for Xorg, that words with Intel and a xorg.conf that is only needed for nVidia.
The nvidia-drivers kernel module is only build against the -nvidia kernel, so it can't load when you boot the original (intel) kernel.
To switch backwards and forwards, you select the video card in the BIOS, choose the kernel and switch the xorg.conf in and out.
Switching the xorg.conf in and out can be automated, depending on nvidia appearing in lsmod or not.
Step 1 Make Intel work alone.
Step 2 Make nVidia work alone
Step 3 Switch between them.