MFC revisions 1.92, 1.94 and 1.95.
This commit is contained in:
parent
5f7c40b169
commit
88f5aa6041
@ -260,7 +260,7 @@ installUpgrade(dialogMenuItem *self)
|
||||
|
||||
saved_etc[0] = '\0';
|
||||
|
||||
/* Don't allow sources to be upgraded unless if we have src already */
|
||||
/* Don't allow sources to be upgraded if we have src already */
|
||||
if (directory_exists("/usr/src/") && (Dists & DIST_SRC)) {
|
||||
Dists &= ~DIST_SRC;
|
||||
SrcDists = 0;
|
||||
@ -300,6 +300,15 @@ installUpgrade(dialogMenuItem *self)
|
||||
(void)vsystem("chflags -R noschg /bin /sbin /lib /libexec /usr/bin /usr/sbin /usr/lib /usr/libexec /var/empty /boot/kernel*");
|
||||
|
||||
if (directory_exists("/boot/kernel")) {
|
||||
if (directory_exists("/boot/kernel.prev")) {
|
||||
msgNotify("Removing /boot/kernel.prev");
|
||||
if (system("rm -fr /boot/kernel.prev")) {
|
||||
msgConfirm("NOTICE: I'm trying to back up /boot/kernel to\n"
|
||||
"/boot/kernel.prev, but /boot/kernel.prev exists and I\n"
|
||||
"can't remove it. This means that the backup will, in\n"
|
||||
"all probability, fail.");
|
||||
}
|
||||
}
|
||||
msgNotify("Moving old kernel to /boot/kernel.prev");
|
||||
if (system("mv /boot/kernel /boot/kernel.prev")) {
|
||||
if (!msgYesNo("Hmmm! I couldn't move the old kernel over! Do you want to\n"
|
||||
@ -467,13 +476,23 @@ 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")) {
|
||||
if (directory_exists("/boot/kernel.prev")) {
|
||||
msgNotify("Removing /boot/kernel.prev");
|
||||
if (system("rm -fr /boot/kernel.prev")) {
|
||||
msgConfirm("NOTICE: I'm trying to back up /boot/kernel to\n"
|
||||
"/boot/kernel.prev, but /boot/kernel.prev exists and I\n"
|
||||
"can't remove it. This means that the backup will, in\n"
|
||||
"all probability, fail.");
|
||||
}
|
||||
}
|
||||
}
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user