diff options
-rw-r--r-- | installkernel | 31 | ||||
-rw-r--r-- | installkernel.8 | 19 |
2 files changed, 25 insertions, 25 deletions
diff --git a/installkernel b/installkernel index 8f1010f..e4e1079 100644 --- a/installkernel +++ b/installkernel @@ -14,6 +14,7 @@ set -e +# Parse the command line options if [ $# -eq 3 ] || [ $# -eq 4 ] ; then img="$2" map="$3" @@ -28,6 +29,7 @@ else exit 1 fi +# Create backups of older versions before installing updatever () { if [ -f "$dir/$1-$ver" ] ; then mv "$dir/$1-$ver" "$dir/$1-$ver.old" @@ -35,16 +37,20 @@ updatever () { cat "$2" > "$dir/$1-$ver" + # This section is for backwards compatibility only if test -f "$dir/$1" ; then + # The presence of "$dir/$1" is unusual in modern intallations, and + # the results are mostly unused. So only recreate them if they + # already existed. if test -L "$dir/$1" && - [ "$(readlink -f ${dir}/${1})" = "${dir}/${1}-${ver}" ]; then - ln -sf "$1-$ver.old" "$dir/$1.old" + [ "$(readlink -f ${dir}/${1})" = "${dir}/${1}-${ver}" ]; then + ln -sf "$1-$ver.old" "$dir/$1.old" + ln -sf "$1-$ver" "$dir/$1" else - mv "$dir/$1" "$dir/$1.old" + mv "$dir/$1" "$dir/$1.old" + cat "$2" > "$dir/$1" fi fi - - ln -sf "$1-$ver" "$dir/$1" } if [ "$(basename $img)" = "vmlinux" ] ; then @@ -60,8 +66,13 @@ if [ -f "$config" ] ; then updatever config "$config" fi -if [ "$(basename $img)" = "vmlinux" ] && [ "$(id -u)" = "0" ] ; then - mkboot -i ${dir}/vmlinux-${ver} -else - mkboot -i ${dir}/vmlinuz-${ver} -fi +## This is very far from existing practice in modern Debian installations +######################################################################## +# if [ "$(basename $img)" = "vmlinux" ] && [ "$(id -u)" = "0" ] ; then # +# mkboot -i ${dir}/vmlinux-${ver} # +# else # +# mkboot -i ${dir}/vmlinuz-${ver} # +# fi # +######################################################################## + +exit 0 diff --git a/installkernel.8 b/installkernel.8 index 14511c3..1749c6e 100644 --- a/installkernel.8 +++ b/installkernel.8 @@ -12,27 +12,16 @@ tree. It is called by the Linux kernel makefiles when is invoked there. .P The new kernel is installed into -.IR {directory}/vmlinuz-{version} , -a link is made from +.IR {directory}/vmlinuz-{version} . +If a symbolic link +.I {directory}/vmlinuz +already exists, it is refreshed by making a link from .I {directory}/vmlinuz to the new kernel, and the previously installed kernel is available as .IR {directory}/vmlinuz.old . -If you use LILO, -.I /etc/lilo.conf -should contain entries for the images -.IR {directory}/vmlinuz " and " {directory}/vmlinuz.old . -.RI ( {version} -is the new kernel's version.) -.P -.B installkernel -calls -.B mkboot -i -to make the system bootable after the kernel is installed. .SH BUGS installkernel resides in /sbin only because the Linux kernel makefiles call it from there. It should really be in /usr/sbin. It isn't needed to boot a system, and it calls .BR mkboot , which depends on the /usr partition being mounted. -.SH "SEE ALSO" -mkboot(8), lilo(8), lilo.conf(5) |