summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1999-11-24 09:45:36 +0000
committerjkh <jkh@FreeBSD.org>1999-11-24 09:45:36 +0000
commit8a92380eef1fe9eb95638c9cda3a6dd7d1d1df1c (patch)
treefc59e66fb865bf8fd50e4ac6d009d9c12dbc917a /usr.sbin/sysinstall
parent1d045a004297a3742d422bdd8a030f869d78aa1e (diff)
downloadFreeBSD-src-8a92380eef1fe9eb95638c9cda3a6dd7d1d1df1c.zip
FreeBSD-src-8a92380eef1fe9eb95638c9cda3a6dd7d1d1df1c.tar.gz
Clean up the loader.conf write-out code.
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r--usr.sbin/sysinstall/install.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c
index 98f7d6f..82a5622 100644
--- a/usr.sbin/sysinstall/install.c
+++ b/usr.sbin/sysinstall/install.c
@@ -732,6 +732,8 @@ installFixupBin(dialogMenuItem *self)
Device **devs;
char *cp;
int i;
+ FILE *fp;
+ int kstat;
/* All of this is done only as init, just to be safe */
if (RunningAsInit) {
@@ -747,21 +749,18 @@ installFixupBin(dialogMenuItem *self)
/* Snapshot any boot -c changes back to the new kernel */
cp = variable_get(VAR_KGET);
if (cp && (*cp == 'Y' || *cp == 'y')) {
- if (kget("/boot/kernel.conf")) {
+ if (kstat = kget("/boot/kernel.conf")) {
msgConfirm("Kernel copied OK, but unable to save boot -c changes\n"
"to it. See the debug screen (ALT-F2) for details.");
}
- else if (file_readable("/boot/kernel.conf")) {
- FILE *fp;
-
- if ((fp = fopen("/boot/loader.conf", "a")) != NULL) {
- fprintf(fp, "# -- sysinstall generated deltas -- #\n");
- fprintf(fp, "userconfig_script_load=\"YES\"\n");
- if (!OnVTY)
- fprintf(fp, "console=\"comconsole\"\n");
- fclose(fp);
- }
- }
+ }
+ if ((fp = fopen("/boot/loader.conf", "a")) != NULL) {
+ fprintf(fp, "# -- sysinstall generated deltas -- #\n");
+ if (!kstat)
+ fprintf(fp, "userconfig_script_load=\"YES\"\n");
+ if (!OnVTY)
+ fprintf(fp, "console=\"comconsole\"\n");
+ fclose(fp);
}
#endif
}
OpenPOWER on IntegriCloud