installer: Install the kernel used to install the system to /boot/kernel.
authorSascha Wildner <saw@online.de>
Wed, 27 Oct 2010 07:08:48 +0000 (09:08 +0200)
committerSascha Wildner <saw@online.de>
Wed, 27 Oct 2010 07:31:02 +0000 (09:31 +0200)
We assume that the kernel the user booted the LiveCD/image with for
installing his system will be the kernel he wants to boot the system
from, too.

share/installer/cmdnames.conf
usr.sbin/installer/dfuibe_installer/fn_install.c

index e83baa8..7e8726e 100644 (file)
@@ -40,6 +40,7 @@ NEWFS_HAMMER=sbin/newfs_hammer
 NEWFS_MSDOS=sbin/newfs_msdos
 NFSD=sbin/nfsd
 ROUTE=sbin/route
+SYSCTL=sbin/sysctl
 SWAPOFF=sbin/swapoff
 SWAPON=sbin/swapon
 UMOUNT=sbin/umount
@@ -47,6 +48,7 @@ UMOUNT=sbin/umount
 AWK=usr/bin/awk
 BUNZIP2=usr/bin/bunzip2
 CHFLAGS=usr/bin/chflags
+DIRNAME=usr/bin/dirname
 GREP=usr/bin/grep
 KILLALL=usr/bin/killall
 SED=usr/bin/sed
index a9cf268..4d89072 100644 (file)
@@ -603,6 +603,25 @@ fn_install_os(struct i_fn_args *a)
        command_add(cmds, "%s%s 600 %smnt/var/log/install.log",
            a->os_root, cmd_name(a, "CHMOD"), a->os_root);
 
+       /*
+        * XXX
+        * Move the kernel used for booting (UP or SMP) to /boot/kernel
+        * and remove the other kernel
+        */
+       command_add(cmds,
+           "%s%s %smnt`%s%s $(%s%s -n kern.bootfile)` %smnt/boot/kernel",
+           a->os_root, cmd_name(a, "MV"),
+           a->os_root,
+           a->os_root, cmd_name(a, "DIRNAME"),
+           a->os_root, cmd_name(a, "SYSCTL"),
+           a->os_root);
+       command_add(cmds,
+           "%s%s -R noschg %smnt/boot/[A-Z][A-Z]*; %s%s -rf %smnt/boot/[A-Z][A-Z]*",
+           a->os_root, cmd_name(a, "CHFLAGS"),
+           a->os_root,
+           a->os_root, cmd_name(a, "RM"),
+           a->os_root);
+
        /* Customize stuff here */
        if(is_file("%susr/local/bin/after_installation_routines.sh", a->os_root)) {
                command_add(cmds, "%susr/local/bin/after_installation_routines.sh",