Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] Re-emerge custom kernel modules when updating kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
drinkcat
n00b
n00b


Joined: 03 Apr 2006
Posts: 2

PostPosted: Mon Apr 03, 2006 4:10 pm    Post subject: [HOWTO] Re-emerge custom kernel modules when updating kernel Reply with quote

Hi,

I have several custom kernel modules (nvidia-kernel, ipp2p, bluetooth-alsa), and, each time I build a new kernel, I had to re-emerge them manually (and I had to remember which one were installed).

So I created a small script to rebuild kernel modules (I called it "eupdate_modules"):

Code:
#!/bin/bash

echo "Searching for ebuilds containing files in /lib/modules..."

LIST=`grep " /lib/modules/$KERNEL" /var/db/pkg/*/*/CONTENTS | grep ".ko" | sed -e 's/^\/var\/db\/pkg\/\(.*\)\/CONTENTS.*$/>=\1/'`

CMD="emerge -a"

for i in $LIST; do
   CMD="$CMD $i"
done

echo "Running \"$CMD\"..."

exec $CMD


The general procedure to build a new kernel is the following:
Code:
cd /usr/src
rm linux
ln -s linux-2.6.your-version linux (This is important because most ebuilds won't build against the correct kernel if you don't set the /usr/src/linux symlink)
cd linux
(configure your kernel and install it)
/path_to/eupdate_modules (my script)
(reboot)


I don't know if it could be integrated in genkernel (I build my kernels manually).

I hope it'll be useful for some of you, and if you think it is worth a HOWTO in the Wiki tell me so and I'll create a page.
Back to top
View user's profile Send private message
neysx
Retired Dev
Retired Dev


Joined: 27 Jan 2003
Posts: 795

PostPosted: Mon Apr 03, 2006 4:23 pm    Post subject: Reply with quote

Looks like you reinvented module-rebuild.
See also the kernel upgrade guide
Back to top
View user's profile Send private message
drinkcat
n00b
n00b


Joined: 03 Apr 2006
Posts: 2

PostPosted: Mon Apr 03, 2006 4:32 pm    Post subject: Reply with quote

Oops... Thanks for the info... I missed that one .-)

Sorry, moderators: feel free to lock or delete this thread.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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