View previous topic :: View next topic |
Author |
Message |
JROCK2004 Guru


Joined: 02 Mar 2004 Posts: 450 Location: PA
|
Posted: Thu May 05, 2005 12:04 am Post subject: Changing kernel |
|
|
So right now I have a working kernel. I need to make some changes to it to get other things to work. After I make the changes and save it, do I just recopy the bzImage and the System.map or do I have to recompile everything? Thanks |
|
Back to top |
|
 |
Gherald Veteran


Joined: 23 Aug 2004 Posts: 1399 Location: CLUAConsole
|
Posted: Thu May 05, 2005 12:12 am Post subject: |
|
|
you have to recompile everything ("make") but it will be much quicker after the first time (only the parts that need changing get rebuilt) |
|
Back to top |
|
 |
JROCK2004 Guru


Joined: 02 Mar 2004 Posts: 450 Location: PA
|
Posted: Thu May 05, 2005 12:17 am Post subject: |
|
|
and then reboot I guess. Thanks |
|
Back to top |
|
 |
mikegpitt Advocate


Joined: 22 May 2004 Posts: 3224
|
Posted: Thu May 05, 2005 1:47 am Post subject: |
|
|
You need to copy over the bzimage and the System.map as you mentioned above. If by compile everything again, you mean all the binaries on the system, you don't have to do this.
What I would suggest is to name the new copies of bzimage and System.map somethign new, so you don't wreck you system (as you will ahve the old version to fall back on).
Also make your you put a new entry in your grub.conf or whatever it is called for lilo. |
|
Back to top |
|
 |
Gherald Veteran


Joined: 23 Aug 2004 Posts: 1399 Location: CLUAConsole
|
Posted: Thu May 05, 2005 2:02 am Post subject: |
|
|
Mmm yes, different name. 'tis bad practice to replace a current, working bzImage with a new (possibly non-working) one.
Here's the crude bash I use to bump my kernel's version. Might be of interest, might not, or you may just think it's really, really ugly:
Code: | function curconfig {
_date=`date +%F@%T`
_newconf="grub.$_date.conf"
_name="$(basename `readlink /usr/src/linux`)-$_date"
mount /boot
cd /usr/src/linux
zcat /proc/config.gz >| .config-new
cp -i .config-new .config
if [ "$1" = "-menu" ]; then
make menuconfig
fi
nice make && make modules_install
# mu happens to be my laptop, where I find myself having to re-emerge
# certain things...
if [ "$HOSTNAME" == "mu" ]; then
emerge madwifi-driver
emerge shfs
# emerge nvidia-kernel
# emerge alsa-driver
# emerge ibm-acpi
fi
[ $? == 0 ] || return $? #quit here if the build failed
if [ $HOSTTYPE == "x86_64" ]; then
cp arch/x86_64/boot/bzImage /boot/$_name
else
cp arch/i386/boot/bzImage /boot/$_name
fi
cp .config "/boot/config-$_name"
cp System.map /boot
if [ -e /boot/$_name ]; then
cd /boot/grub
mv grub.conf $_newconf
echo "title=$_name" >> grub.conf
echo "`grep "\ *root\ *(" $_newconf | head -n 1`" >> grub.conf
echo "kernel /$_name" >> grub.conf
cat $_newconf >> grub.conf
$EDITOR grub.conf
else
echo "Error: kernel image not found!"
return 1
fi
} |
|
|
Back to top |
|
 |
cubchai n00b


Joined: 11 Sep 2004 Posts: 70
|
Posted: Fri Jun 10, 2005 7:53 am Post subject: |
|
|
currently i'm using gentoo-dev-sources. i want to try the ck-sources. acni just use back the old config and compile the ck sources? |
|
Back to top |
|
 |
b-llwyd Guru


Joined: 24 Jul 2002 Posts: 302 Location: Uppsala, Sweden
|
Posted: Fri Jun 10, 2005 10:51 am Post subject: |
|
|
In response to Gheralds note,
I have set up two menu items in Grub to point at 1) vmlinuz 2) vmlinuz.old, so whenever I recompile and run "make install", I will have the new kernel as menu item "Current" and the the kernel before that (the previously working) as the other menu item. Maybe you thought of this already (I admit, I didnt read your script ), but the make install process is quite convenient (installing the new vmlinuz, moving the old one to vmlinuz.old) |
|
Back to top |
|
 |
mikegpitt Advocate


Joined: 22 May 2004 Posts: 3224
|
Posted: Fri Jun 10, 2005 12:58 pm Post subject: |
|
|
cubchai wrote: | currently i'm using gentoo-dev-sources. i want to try the ck-sources. acni just use back the old config and compile the ck sources? |
If the ck sources are the same kernel version as the one you are currently using then you can use the same config. If not I would suggest using the same config, but running 'make oldconfig' 1'st. |
|
Back to top |
|
 |
cubchai n00b


Joined: 11 Sep 2004 Posts: 70
|
Posted: Fri Jun 10, 2005 1:33 pm Post subject: |
|
|
mikegpitt wrote: | cubchai wrote: | currently i'm using gentoo-dev-sources. i want to try the ck-sources. acni just use back the old config and compile the ck sources? |
If the ck sources are the same kernel version as the one you are currently using then you can use the same config. If not I would suggest using the same config, but running 'make oldconfig' 1'st. |
my current kernel is 2.6.11-gentoo-r4. but the ck-sources is 2.6.11_p9, i guess it's not same. so i have to recompile using old config right? |
|
Back to top |
|
 |
mikegpitt Advocate


Joined: 22 May 2004 Posts: 3224
|
Posted: Fri Jun 10, 2005 2:30 pm Post subject: |
|
|
cubchai wrote: | my current kernel is 2.6.11-gentoo-r4. but the ck-sources is 2.6.11_p9, i guess it's not same. so i have to recompile using old config right? |
To be safe you probably should, although I can't imagine that much changing. |
|
Back to top |
|
 |
cubchai n00b


Joined: 11 Sep 2004 Posts: 70
|
Posted: Fri Jun 10, 2005 2:35 pm Post subject: |
|
|
thank you for your help. as i read above, i somehow learnt that, 2 kernels can be installed at the same time, selection will be done thru bootloader. did i misunderstood from the above post? if i can choose between kernels , how can i do it? |
|
Back to top |
|
 |
|