Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Do I have to install bbswitch everytime I upgrade the kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
LegionOfHell
Apprentice
Apprentice


Joined: 16 Mar 2019
Posts: 249
Location: Toronto, Canada

PostPosted: Mon Dec 09, 2019 3:42 am    Post subject: Do I have to install bbswitch everytime I upgrade the kernel Reply with quote

I have an optimus laptop, I want to install bbswitch so that the dGPU is always off...I want to use the iGPU for everything and forever..

so I emerge bbswitch and configure the module like:

nano -w /etc/modprobe.d/bbswitch.conf and add the following:
options bbswitch load_state=0 unload_state=1

nano -w /etc/modules-load.d/bbswitch.conf and add the following:
bbswitch

Does this survive a kernel upgrade ? if not, What is the work around ?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46666
Location: 56N 3W

PostPosted: Mon Dec 09, 2019 12:11 pm    Post subject: Reply with quote

LegionOfHell,

The part you posted survives kernel upgrades. As bbswitch builds a kernel module, you need to build that against every kernel.

During the kernel update, be sure that the /usr/src/linux symlink points to your newly built but not yet running kernel.
Run
Code:
emerge @module-rebuild
to rebuild all of your out of tree kernel modules.

emerge @module-rebuild will rebuild all of your out of kernel tree modules, including bbswitch.
When you reboot into the new kernel, it should just work.

The order is important. emerge @module-rebuild follows the /usr/src/linux symlink to know which kernel to build against.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LegionOfHell
Apprentice
Apprentice


Joined: 16 Mar 2019
Posts: 249
Location: Toronto, Canada

PostPosted: Sun Dec 15, 2019 3:19 am    Post subject: Reply with quote

Can you confirm that the steps below are correct:

1- Fetch the new kernel source: emerge --ask sys-kernel/gentoo-sources

2- Backup the current .config: cp /usr/src/linux/.config ~/kernel-config-`uname -r`

3- Make the symlink: ln -sf /usr/src/linux-3.16.3-gentoo /usr/src/linux

4- Copy the old .config : cp /usr/src/linux-3.14.14-gentoo/.config /usr/src/linux/

5- Go to the new kernel source dir: cd /usr/src/linux

6- Update the .config file: make olddefconfig

7- Build the kernel: make -j6 && make modules_install

8- Install the kernel: make install

9- Update Grub: grub-mkconfig -o /boot/grub/grub.cfg

10- Re-install external modules: emerge --ask @module-rebuild

Is the above procedure correct for upgrading a kernel when external modules are present ?

Do I have to run "make modules_prepare" before "emerge --ask @module-rebuild" in the procedure above ?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46666
Location: 56N 3W

PostPosted: Sun Dec 15, 2019 12:27 pm    Post subject: Reply with quote

LegionOfHell,

Step 7a. Mount /boot

As long as the kernel has been compiled, make modules_prepare is not required.
It was done during the kernel build.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LegionOfHell
Apprentice
Apprentice


Joined: 16 Mar 2019
Posts: 249
Location: Toronto, Canada

PostPosted: Sun Dec 22, 2019 3:16 am    Post subject: Reply with quote

Sorry, Another questions:

If I have an initramfs, at which step should I update it ? before "grub-mkconfig -o /boot/grub/grub.cfg" or after ?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46666
Location: 56N 3W

PostPosted: Sun Dec 22, 2019 10:37 am    Post subject: Reply with quote

LegionOfHell,

Your initrd needs to be in /boot before you run
Code:
grub-mkconfig -o /boot/grub/grub.cfg
or it won't be found.
An initrd update is only required if its content has changed, eg CPU microcode, kernel modules ...
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum