Be more cautious about leaving user with a workable kernel during the

upgrade process.
Submitted by:	Mikael Karpberg <karpen@ocean.campus.luth.se>
This commit is contained in:
Jordan K. Hubbard 1997-09-09 09:19:30 +00:00
parent 51c63b7d63
commit b79a0997ab
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=29236
2 changed files with 14 additions and 4 deletions

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: installUpgrade.c,v 1.49 1997/05/09 07:44:19 jkh Exp $
* $Id: installUpgrade.c,v 1.50 1997/09/08 11:09:09 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -295,6 +295,8 @@ installUpgrade(dialogMenuItem *self)
"and start over from the beginning. Select Yes to reboot now"))
systemShutdown(1);
}
else /* Give us a working kernel in case we crash and reboot */
system("cp /kernel.prev /kernel");
}
}
@ -444,7 +446,10 @@ installUpgradeNonInteractive(dialogMenuItem *self)
if (file_readable("/kernel")) {
msgNotify("Moving old kernel to /kernel.prev");
system("chflags noschg /kernel && mv /kernel /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");
}
}
msgNotify("Beginning extraction of distributions..");

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: installUpgrade.c,v 1.49 1997/05/09 07:44:19 jkh Exp $
* $Id: installUpgrade.c,v 1.50 1997/09/08 11:09:09 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -295,6 +295,8 @@ installUpgrade(dialogMenuItem *self)
"and start over from the beginning. Select Yes to reboot now"))
systemShutdown(1);
}
else /* Give us a working kernel in case we crash and reboot */
system("cp /kernel.prev /kernel");
}
}
@ -444,7 +446,10 @@ installUpgradeNonInteractive(dialogMenuItem *self)
if (file_readable("/kernel")) {
msgNotify("Moving old kernel to /kernel.prev");
system("chflags noschg /kernel && mv /kernel /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");
}
}
msgNotify("Beginning extraction of distributions..");