diff options
author | ceri <ceri@FreeBSD.org> | 2006-11-11 10:42:04 +0000 |
---|---|---|
committer | ceri <ceri@FreeBSD.org> | 2006-11-11 10:42:04 +0000 |
commit | 92e293b46f2f3100f87666ff77dff000a40bc93e (patch) | |
tree | 03b2b18da4f8827c5171a75b6b82a7833cce7a70 | |
parent | 6c2d6c7fb83f0794dea711afcb38e098aaca9bf1 (diff) | |
download | FreeBSD-src-92e293b46f2f3100f87666ff77dff000a40bc93e.zip FreeBSD-src-92e293b46f2f3100f87666ff77dff000a40bc93e.tar.gz |
Back up /boot/kernel rather than /kernel for non-interactive upgrades.
Approved by: ru (mentor)
MFC after: 4 days
-rw-r--r-- | usr.sbin/sysinstall/installUpgrade.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/sysinstall/installUpgrade.c b/usr.sbin/sysinstall/installUpgrade.c index e43819c..d34d5d6 100644 --- a/usr.sbin/sysinstall/installUpgrade.c +++ b/usr.sbin/sysinstall/installUpgrade.c @@ -467,13 +467,14 @@ installUpgradeNonInteractive(dialogMenuItem *self) return DITEM_FAILURE; } - if (file_readable("/kernel")) { - msgNotify("Moving old kernel to /kernel.prev"); - if (!system("chflags noschg /kernel && mv /kernel /kernel.prev")) { - /* Give us a working kernel in case we crash and reboot */ - system("cp /kernel.prev /kernel"); - } - } + /* + * Back up the old kernel, leaving it in place in case we + * crash and reboot. + */ + if (directory_exists("/boot/kernel")) { + msgNotify("Copying old kernel to /boot/kernel.prev"); + vsystem("cp -Rp /boot/kernel /boot/kernel.prev"); + } msgNotify("Beginning extraction of distributions.."); if (DITEM_STATUS(distExtractAll(self)) == DITEM_FAILURE) { |