Messages in this thread | | | Date | Wed, 16 Jun 1999 13:22:36 +0100 (GMT) | From | Riley Williams <> | Subject | Re: proc entry for actual kernel filename |
| |
Hi Mike.
> I tend to keep several builds of the same kernel version in > /boot. I name them with a suffix to keep them straight example: > linux-2.2.9mb5, linux-2.2.9mb6, linux-2.2.9mb7, etc. Each > suffix is actually the build number from /usr/src/linux/.version > with my initials. Occasionally I'll have names like > linux-2.2.9ac3mb2 when using Alan's patches.
> I enter these names directly into lilo.conf image= with a simple > label= to boot them. It's a simple system, but it works and > lets me keep them fairly organized. I've written scripts which > do almost everything from building and copying the kernels to > /boot with the proper names, copying each one's .config with a > proper name to an archive directory, etc.
> What I attempted to do now was modify my rc.sysinit to link the > proper System.map (which all have similar names > System.map-2.2.9mb5, etc.) to /boot/System.map based on which > kernel I booted. But I've come to a brick wall that I can't > seem to figure a way around. I can get the kernel version from > several places, but nowhere can I find the actual kernel > filename that was booted. Several entries in /proc give the > version that I can parse. Has anyone ever thought of creating a > /proc entry with the actual filename? Perhaps it's a more > difficult task than I imagine or maybe I just missed it already > available somewhere. Any help would be appreciated.
There are several ways you could go about this:
1. /proc/cmdline gives you the label in /etc/lilo.conf that was used, and the following script should return the associated filename:
Q> #!/bin/bash Q> LABEL=`sed 's/^.*BOOT_IMAGE=\([^ ]*\) .*$/\1/'` Q> A=`grep -n "$LABEL" | head -1 | cut -d : -f 1` Q> B=`head -$A /etc/lilo.conf | grep -i '^image' | tail -1` Q> echo $B | cut -d = -f 2-
2. It should be a simple modifcation to the makefile to automatically append the relevant characters to the existing EVTRAVERSION value, then `uname -r` would supply the relevant text string.
3. You could always try the following:
Q> VSN=`uname -a | cut -d ' ' -f 3-4 | sed 's/ #/-/'`
Comments?
Best wishes from Riley.
+----------------------------------------------------------------------+ | There is something frustrating about the quality and speed of Linux | | development, ie., the quality is too high and the speed is too high, | | in other words, I can implement this XXXX feature, but I bet someone | | else has already done so and is just about to release their patch. | +----------------------------------------------------------------------+ * ftp://ftp.MemAlpha.cx/pub/rhw/Linux * http://www.MemAlpha.cx/kernel.versions.html
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |