installkernel - Fix kernel.old/kernel overwrite
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 7 Sep 2010 01:58:54 +0000 (18:58 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 7 Sep 2010 01:58:54 +0000 (18:58 -0700)
* The kernel was being copied to kernel.old/kernel twice, once normally,
  and once (after the new kernel was installed) by the module objcopy.

  This left kernel.old/kernel as the new kernel instead of the old kernel.

* Fix by restricting the module copy to .ko files.

sys/conf/kern.post.mk

index d53389e..6d67eb6 100644 (file)
@@ -218,7 +218,7 @@ modules-tags:
 modules-install: kernel-installable
 .if !defined(NO_MODULES_OLD)
 .  ifdef NO_KERNEL_OLD_STRIP
-       set -- ${DESTDIR}${DESTKERNDIR}/*;                      \
+       set -- ${DESTDIR}${DESTKERNDIR}/*.ko;                   \
        if [ -f "$$1" ]; then                                   \
                if [ -f ${DESTDIR}${DESTKERNDIR}.old ]; then    \
                    rm -f ${DESTDIR}${DESTKERNDIR}.old;         \
@@ -229,7 +229,7 @@ modules-install: kernel-installable
                done;                                           \
        fi
 .  else
-       set -- ${DESTDIR}${DESTKERNDIR}/*;                      \
+       set -- ${DESTDIR}${DESTKERNDIR}/*.ko;                   \
        if [ -f "$$1" ]; then                                   \
                if [ -f ${DESTDIR}${DESTKERNDIR}.old ]; then    \
                    rm -f ${DESTDIR}${DESTKERNDIR}.old;         \