Automagical Kernel Update Utils? 11
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).
Autorpm will collect the rpms for you (Score:1)
First ask yourself... (Score:1)
Ok, that said, I can also see the coolness factor here :-). So here's how I'd do it, probably. First, I'd make sure there was a working .config file somewhere. Then, I'd whip up something that I could attach to a button on my gnome panel, probably in gtk/perl or tk/perl that asked a coupla basic questions: Where should I find the kernel/patch? When should I do this? Where's the config file?
That little doo-dad would edit the crontab (have to be root's crontab) to run another perl script at xx:00 (whenever you said to run it). That second script would fetch the patch/source, config it with your pre-defined file, make dep, make clean, make install (and do some trickery w/lilo to keep the old kernel accessable-- maybe make install does this already? I forget.), make modules, make modules_install, then (this bit's important)-- I'd have it write a line into /etc/rc.d/rc.local that would run a third script on successful reboot. Then run /sbin/init 6, and wait till the box comes back up. On clean reboot, your third script would clean out the crontab, delete it's own calling line in rc.local, check out the system, and email some stats and a success report to root, or whoever.
Now what if the new kernel bombed? Hmm. I don't know, honestly. To reboot into it, you'd have to set it as default in lilo, and if it died, there's no way a user app could regain control. I guess it'd sit there until you checked the next morning. But if it got all the way through the compile/install, then chances are slim the system wouldn't work at all. Wow. This ended up being really long. I guess I'll stop now. If anyone wants to write this, I'd probably help. Drop an email :-)
duh.. (Score:1)
Re:AutoUpdate (Score:1)
The FreeBSD project, and many other projects, keeps all their source code available from a CVS server. CVS is a source code control system, and a CVS server can be made available over the Internet. A FreeBSD user can log into a CVS server and download the source code or a patch or whatever is needed for a particular component (including the kernel).
SysAdmin Magazine [samag.com] did an article on FreeBSD and CVS [samag.com] in the September 1999 [samag.com] issue. They also ran an article in June 1999 [samag.com] called 'The Linux Kernel: A Case Study for CVS', which unfortunately is not available online.
A company called Cyclic [cyclic.com] does commercial support for CVS, and has some information available online [cyclic.com].
darren
Easy Kernel Updates (Score:1)
Kernel updating though still isn't quite there though... but, then, does it have to be? For the average new-to-linux person, how often do they have update their kernel? If it is a security kernel fix, which major distribution doesn't put them into its own package format and put it on their ftp site...? And which which distribution doesn't have an easy to use package installer/upgrader tool?
So, perhaps the question should be... does the user know where to look for these?
AutoUpdate (Score:1)
Re:RPM / Shell Script (Score:2)
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.