* Add merge_etc() in upgrade.c. Copies /etc.old/fstab to /etc/fstab

as last step of upgrade, so /etc/fstab exists after reboot.

*  util.c: correct sense of test in sanity-check helper check_for().
   Change variable name to `found' for readability.
This commit is contained in:
jonathan 1997-11-06 09:02:36 +00:00
parent b2b71ad982
commit 121b2869f7
2 changed files with 25 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: upgrade.c,v 1.9 1997/11/05 07:28:37 jonathan Exp $ */
/* $NetBSD: upgrade.c,v 1.10 1997/11/06 09:02:36 jonathan Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -48,8 +48,9 @@
/*
* local prototypes
*/
void check_prereqs(void);
int save_etc(void);
void check_prereqs __P((void));
int save_etc __P((void));
int merge_etc __P((void));
/* Do the system upgrade. */
void do_upgrade(void)
@ -85,6 +86,9 @@ void do_upgrade(void)
get_and_unpack_sets(MSG_upgrcomplete, MSG_abortupgr);
/* Copy back any files we shuld restore after the upgrade.*/
merge_etc();
sanity_check();
}
@ -144,3 +148,16 @@ int save_etc(void)
return 0;
}
/*
* Merge back saved target /etc files after unpacking the new
* sets has completed.
*/
int merge_etc(void)
{
/* just move back fstab, so we can boot cleanly. */
cp_within_target("/etc.old/fstab", "/etc/");
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: util.c,v 1.17 1997/11/05 23:32:54 phil Exp $ */
/* $NetBSD: util.c,v 1.18 1997/11/06 09:02:37 jonathan Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -415,12 +415,12 @@ struct check_table { const char *testarg; const char *path;} checks[] = {
*/
static int check_for(const char *type, const char *pathname)
{
int result;
int found;
result = (target_test(type, pathname) == 0);
if (result != 0)
found = (target_test(type, pathname) == 0);
if (found == 0)
msg_display(MSG_rootmissing, pathname);
return result;
return found;
}
int