Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Linux Software

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).
This discussion has been archived. No new comments can be posted.

Automagical Kernel Update Utils?

Comments Filter:
  • Check out http://www.kaybee.org/~kirk/html/linux.html for information on autorpm. It is pretty handy for keeping track of which rpms need to be updated. It comes configured for RedHat, but it can be pointed at any ftp sites that you want, so it should be usable with Mandrake as well

  • If this is really something that should be done. Generally, there are only 2 reasons I upgrade a working kernel:
    • Because a new kernel has new functionality I could use
    • Because I get a new device or something, and need to recompile the kernel anyway to add something. I'll generally just snag the latest if I have to re-kernel anyhoo.
    So, in either case, an auto-kernel-update thing wouldn't be much use, since I'd still have to make config and select new stuff to compile in. Overall point here, don't get too sucked in to updating the kernel whenever one comes out. If everyhting works, stick with it till you know you'll get some benefit from updating.

    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 :-)

  • by Zurk ( 37028 )
    thats what the crontab command is for. alternatively theres an auto updating rpm utility to do it somewhere on rufus.w3.org....if d/ling the kernel as an rpm. note that you need to save your configs between kernel version so a small script might help if youre using tar.gz
  • 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

  • Linux's weakness is that its not easy to use. This is being rectified slowly though.. RPMs (althought they have their own problems), easier distribution installers, friendler desktops..
    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?
  • I use Red Hat Linux myself and I'm constanly updating stuff, but I heard that BSD has something that automatically updates the kernel. True?
  • OK, here are some thoughts:

    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 .config, make oldconfig again, and answer the questions the way you think they should be answered.

    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/lin ux-2.2.12.tar.bz2

    #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 /usr/src/linux as a link to /usr/src/linux-{ver}

    rm /usr/src/linux
    mkdir /usr/src/linux-`uname -r {+1}` #this doesn't work, I just forgot how to add.
    ln -s /usr/src/linux-`uname -r {+1}` /usr/src/linux
    rm oldlinux
    ln -s /usr/src/linux-`uname -r` /usr/src/oldlinux
    bzcat linux-{version}.tar.bz2 | tar x

    # will this work?
    # not quite
    # cp /usr/src/linux/.config .
    cp /usr/src/oldlinux/.config /usr/src/linux
    /usr/local/bin/some-expect-script-that-calls-mak e-oldconfig

    make dep
    make bzImage
    make modules
    make modules_install
    # and then
    cp /boot/vmlinux.new /boot/vmlinux.old
    cp /usr/src/linux/arch/i386/boot/compressed/vmlinux /boot/vmlinux.new
    lilo



    Then you have a lilo.conf that looks like this:



    # LILO configuration file
    # generated by 'liloconfig'
    #
    # Start LILO global section
    boot = /dev/sda
    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 = /vmlinuz.new
    root = /dev/sda1
    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 = /vmlinuz.old
    root = /dev/sda1
    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 = /vmlinuz.reallystable
    root = /dev/sda1
    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.

For God's sake, stop researching for a while and begin to think!

Working...