Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/utils/sysinst Remove all the code (mostly already un...
details: https://anonhg.NetBSD.org/src/rev/1a549c0a4af4
branches: trunk
changeset: 566854:1a549c0a4af4
user: dsl <dsl%NetBSD.org@localhost>
date: Sat May 22 17:31:37 2004 +0000
description:
Remove all the code (mostly already under #if 0) that played around
with etc.old
diffstat:
distrib/utils/sysinst/upgrade.c | 121 +---------------------------------------
1 files changed, 1 insertions(+), 120 deletions(-)
diffs (161 lines):
diff -r 82a69ef987e3 -r 1a549c0a4af4 distrib/utils/sysinst/upgrade.c
--- a/distrib/utils/sysinst/upgrade.c Sat May 22 17:19:25 2004 +0000
+++ b/distrib/utils/sysinst/upgrade.c Sat May 22 17:31:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: upgrade.c,v 1.45 2004/04/18 21:34:56 dsl Exp $ */
+/* $NetBSD: upgrade.c,v 1.46 2004/05/22 17:31:37 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -49,7 +49,6 @@
* local prototypes
*/
static int save_etc(void);
-static int merge_etc(void);
static int save_X(void);
static int merge_X(void);
@@ -87,17 +86,6 @@
if (save_X())
return;
-#if 0
- /*
- * Move target /etc -> target /etc.old so existing configuration
- * isn't overwritten by upgrade.
- */
- if (sets_selected & SET_ETC && save_etc()) {
- merge_X();
- return;
- }
-#endif
-
/* Do any md updating of the file systems ... e.g. bootblocks,
copy file systems ... */
if (!md_update())
@@ -114,100 +102,11 @@
if (get_and_unpack_sets(1, MSG_upgrcomplete, MSG_abortupgr) != 0)
return;
-#if 0
- /* Copy back any files we should restore after the upgrade.*/
- if (sets_installed & SET_ETC)
- merge_etc();
-#endif
merge_X();
sanity_check();
}
-#if 0
-/*
- * save target /etc files.
- * if target /etc.old exists, print a warning message and give up.
- * otherwise move /etc into target /etc.old, and then copy
- * back files we might want during the installation -- in case
- * we are upgrading the target root.
- */
-static int
-save_etc(void)
-{
-
- if (target_dir_exists_p("/etc.old")) {
- msg_display(MSG_etc_oldexists);
- process_menu(MENU_ok, NULL);
- return EEXIST;
- }
-
-#ifdef DEBUG
- printf("saving /etc as /etc.old...");
-#endif
-
- /* Move target /etc to /etc.old. Abort on error. */
- mv_within_target_or_die("/etc", "/etc.old");
-
- etc_saved = 1;
-
- /* now make an /etc that should let the user reboot. */
- make_target_dir("/etc");
-
-#ifdef DEBUG
- printf("Copying essential files back into new /etc...");
-#endif
- /* essential stuff */
- cp_within_target("/etc.old/ld.so.cache", "/etc/", 1);
- cp_within_target("/etc.old/ld.so.conf", "/etc/", 0);
- cp_within_target("/etc.old/resolv.conf", "/etc/", 1);
-
- /*
- * do NOT create fstab so that restarting an incomplete
- * upgrade (eg., after power failure) will fail, and
- * force the user to check and restore their old /etc.
- */
-
- /* general config */
- cp_within_target("/etc.old/rc", "/etc/", 0);
- cp_within_target("/etc.old/rc.conf", "/etc/", 0);
- cp_within_target("/etc.old/rc.local", "/etc/", 0);
-
- /* network config */
- cp_within_target("/etc.old/ifconfig.*", "/etc/", 0);
- /* these should become parts of rc.conf */
- cp_within_target("/etc.old/myname", "/etc/", 1);
- cp_within_target("/etc.old/mygate", "/etc/", 1);
- cp_within_target("/etc.old/defaultdomain", "/etc/", 1);
-
- /* old-style network config */
- cp_within_target("/etc.old/hostname.*", "/etc/", 1);
-
- return 0;
-}
-
-/*
- * Attempt to undo save_etc() if the install fails
- */
-
-void
-restore_etc(void)
-{
- const char *tp;
-
- if (!etc_saved)
- return;
- if (sets_installed & SET_ETC)
- return;
-
- tp = target_prefix();
- run_program(0, "mv -f %s/etc.old/* %s/etc", tp, tp);
- /* rmdir isn't in our root, chroot and use the one in the target */
- run_program(RUN_CHROOT, "rmdir /etc.old");
- etc_saved = 0;
-}
-#endif
-
/*
* Save X symlink to X.old so it can be recovered later
*/
@@ -235,24 +134,6 @@
}
/*
- * Merge back saved target /etc files after unpacking the new
- * sets has completed.
- */
-static int
-merge_etc(void)
-{
-
- if (etc_saved == 0)
- return 0;
- etc_saved = 0;
-
- /* just move back fstab, so we can boot cleanly. */
- cp_within_target("/etc.old/fstab", "/etc/", 0);
-
- return 0;
-}
-
-/*
* Merge back saved target X files after unpacking the new
* sets has completed.
*/
Home |
Main Index |
Thread Index |
Old Index