summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2008-06-08 14:17:17 -0500
committerClint Adams <schizo@debian.org>2008-06-08 18:13:39 -0400
commitb748ce4e8e996485d1eacdb2f2887e01ca7f2999 (patch)
treef5f40e08086da17ca78c0660332aedad8b9cf4a6
parent5174080975d5afabef2728e2a2136e636233de2f (diff)
downloaddebianutils-b748ce4e8e996485d1eacdb2f2887e01ca7f2999.tar.gz
This patch updates the installkernel script to be useful on modern
Debian installations, which now default to grub, and not LILO, and also tend to run initial RAM fs creators, and other post processing steps, before hooking in their boot manager update scripts. mkboot has not been the default way to setup a newly installed kernel in about a decade or so. installkernel also unconditionally created symbolic links in $DESTDIR (nominally /boot). The symlinks created were: $DESTDIR/{config,System.map,vmlinu[xz]} These symlinks are not useful if you use grub, or use official kernel images. Creating these links make it less useful when used to create kernel image packages. (running mkboot is even worse when building a kernel image package). Ideally, the symbolic links should be updated if they exist, but should not be created when they do not, which is what this patch does. Next, the modern Debian installation has kernel images run scripts which have been dropped into /etc/kernel/{pre,post}{inst,rm}.d/ directories, or put into /etc/kernel-img.conf -- and installkernel does not do anything like this. When installkernel is called (by running make install in a kernel source directory), the modules might not yet have been installed, so running the scripts would be wrong (intramfs, for instance, depends on the modules being around) Signed-off-by: Manoj Srivastava <srivasta@debian.org>
-rw-r--r--installkernel31
-rw-r--r--installkernel.819
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)