Automagical Kernel Update Utils?
Eric^2 asks: "I'm fairly new to the linux OS but I managed to get my Gateway Solo 9100 running Mandrake. After seeing how often the kernel gets updated, I was wondering if there are any GUI tools available to automatically download, compile, and update the linux kernel. I know this sounds a lot like Microsoft Windows Update (which is terribly slow and fails about half the time), but it would be really nice to tell my laptop "go get this kernel and install it tonight at 11:30 and if anything fails, go back to my current kernel" and be done with it instead of having to download a patch or full version, backup, compile, and so on. There's just too much for a novice like myself to *$@% up. Suggestions? " Something like this will be necessary if Linux is to successfully move to the desktop. The masses must have an easy way to update there systems for things like bug fixes or new features. Remember: Joe User doesn't necessarily know how to compile, even if it is as simple as "configure; make; make install" (and to be honest, it isn't 100% there yet).
OK, here are some thoughts:
.config, make oldconfig again, and answer the questions the way you think they should be answered.
n ux-2.2.12.tar.bz2
/usr/src/linux as a link to /usr/src/linux-{ver}
/usr/src/linux /usr/src/linux-`uname -r {+1}` #this doesn't work, I just forgot how to add. /usr/src/linux-`uname -r {+1}` /usr/src/linux /usr/src/linux-`uname -r` /usr/src/oldlinux
/usr/src/linux/.config . /usr/src/oldlinux/.config /usr/src/linux k e-oldconfig
/boot/vmlinux.new /boot/vmlinux.old /usr/src/linux/arch/i386/boot/compressed/vmlinux /boot/vmlinux.new
/dev/sda /vmlinuz.new /dev/sda1 /vmlinuz.old /dev/sda1 /vmlinuz.reallystable /dev/sda1
make oldconfig does ask questions, however it should be pretty easy to write a small expect script to run make oldconfig for you, and answer yes to everything. I'm not suggesting that this will make a more stable kernel, but it will make one. Chances are you could even have the script call up the help on each option, and have that as output from the program, which would in turn get mailed back to you by cron. In the morning check and see if the answers made sense, if they did reboot, if they didn't recopy
Now, as for the script itself... I have a few (lame) suggestions:
#!/bin/sh
cd ~/
# replace this with the correct URL
wget http://www.XX.kernel.org/pub/linux/kernel/v2.2/li
#I don't know about wget. It would be nice to be able to have it first look for
#LATEST-IS-* and then get linux-(whatever).tar.bz2
#or even better, have your script add one to uname -r and try
#to get that file. If it doesn't exist, exit.
# bzcat linux-2.2.12.tar.bz2 | tar xv
# rm -f linux-2.2.12.tar.bz2
# cd ~/linux
#I would suggest as an alternative keeping
rm
mkdir
ln -s
rm oldlinux
ln -s
bzcat linux-{version}.tar.bz2 | tar x
# will this work?
# not quite
# cp
cp
/usr/local/bin/some-expect-script-that-calls-ma
make dep
make bzImage
make modules
make modules_install
# and then
cp
cp
lilo
Then you have a lilo.conf that looks like this:
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot =
append = "ether=0,0,eth1"
#compact # faster, but won't work on all systems.
delay = 50
vga = normal # force sane state
# ramdisk = 0 # paranoia setting
# Linux bootable partition config begins
image =
root =
label = lin
read-only # Non-UMSDOS filesystems should be mounted read-only for checking
# Linux bootable partition config ends
# Linux bootable partition config begins
image =
root =
label = backup
read-only # Non-UMSDOS filesystems should be mounted read-only for checking
# Linux bootable partition config ends
# Linux bootable partition config begins
image =
root =
label = original
read-only # Non-UMSDOS filesystems should be mounted read-only for checking
# Linux bootable partition config ends
# End LILO global section
horizon:~#
have cron run this every night, and every once in a while you'll wake up and find e-mail telling you that you've got a new kernel. If everything looks OK, just reboot and it's active.
Pound! Bang! Bin! Bash! is this a shell script or a Batman comic?