8 * 9 * Copyright (c) 1995 10 * Jordan Hubbard. All rights reserved. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 * 1. Redistributions of source code must retain the above copyright 16 * notice, this list of conditions and the following disclaimer, 17 * verbatim and that no modifications are made prior to this 18 * point in the file. 19 * 2. Redistributions in binary form must reproduce the above copyright 20 * notice, this list of conditions and the following disclaimer in the 21 * documentation and/or other materials provided with the distribution. 22 * 23 * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND 24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 */ 36 37#include "sysinstall.h" 38#include <sys/disklabel.h> 39#include <sys/errno.h> 40#include <sys/ioctl.h> 41#include <sys/fcntl.h> 42#include <sys/wait.h> 43#include <sys/param.h> 44#include <sys/stat.h> 45#include <unistd.h> 46#include <sys/mount.h> 47 48static int installUpgradeNonInteractive(dialogMenuItem *self); 49 50typedef struct _hitList { 51 enum { JUST_COPY, CALL_HANDLER } action ; 52 char *name; 53 Boolean optional; 54 void (*handler)(struct _hitList *self); 55} HitList; 56 57/* These are the only meaningful files I know about */ 58static HitList etc_files [] = { 59 { JUST_COPY, "Xaccel.ini", TRUE, NULL }, 60 { JUST_COPY, "XF86Config", TRUE, NULL }, 61 { JUST_COPY, "adduser.conf", TRUE, NULL }, 62 { JUST_COPY, "aliases", TRUE, NULL }, 63 { JUST_COPY, "aliases.db", TRUE, NULL }, 64 { JUST_COPY, "amd.map", TRUE, NULL }, 65 { JUST_COPY, "auth.conf", TRUE, NULL }, 66 { JUST_COPY, "crontab", TRUE, NULL }, 67 { JUST_COPY, "csh.cshrc", TRUE, NULL }, 68 { JUST_COPY, "csh.login", TRUE, NULL }, 69 { JUST_COPY, "csh.logout", TRUE, NULL }, 70 { JUST_COPY, "cvsupfile", TRUE, NULL }, 71 { JUST_COPY, "dhclient.conf", TRUE, NULL }, 72 { JUST_COPY, "disktab", TRUE, NULL }, 73 { JUST_COPY, "dm.conf", TRUE, NULL }, 74 { JUST_COPY, "dumpdates", TRUE, NULL }, 75 { JUST_COPY, "exports", TRUE, NULL }, 76 { JUST_COPY, "fbtab", TRUE, NULL }, 77 { JUST_COPY, "fstab", FALSE, NULL }, 78 { JUST_COPY, "ftpusers", TRUE, NULL }, 79 { JUST_COPY, "gettytab", TRUE, NULL }, 80 { JUST_COPY, "gnats", TRUE, NULL }, 81 { JUST_COPY, "group", FALSE, NULL }, 82 { JUST_COPY, "hosts", TRUE, NULL }, 83 { JUST_COPY, "hosts.allow", TRUE, NULL }, 84 { JUST_COPY, "hosts.equiv", TRUE, NULL }, 85 { JUST_COPY, "hosts.lpd", TRUE, NULL }, 86 { JUST_COPY, "inetd.conf", TRUE, NULL }, 87 { JUST_COPY, "kerberosIV", TRUE, NULL }, 88 { JUST_COPY, "localtime", TRUE, NULL }, 89 { JUST_COPY, "login.access", TRUE, NULL }, 90 { JUST_COPY, "login.conf", TRUE, NULL }, 91 { JUST_COPY, "mail", TRUE, NULL }, 92 { JUST_COPY, "mail.rc", TRUE, NULL }, 93 { JUST_COPY, "make.conf", TRUE, NULL }, 94 { JUST_COPY, "manpath.config", TRUE, NULL }, 95 { JUST_COPY, "master.passwd", FALSE, NULL }, 96 { JUST_COPY, "modems", TRUE, NULL }, 97 { JUST_COPY, "motd", TRUE, NULL }, 98 { JUST_COPY, "namedb", TRUE, NULL }, 99 { JUST_COPY, "networks", TRUE, NULL }, 100 { JUST_COPY, "newsyslog.conf", TRUE, NULL }, 101 { JUST_COPY, "nsmb.conf", TRUE, NULL }, 102 { JUST_COPY, "nsswitch.conf", TRUE, NULL }, 103 { JUST_COPY, "pam.conf", TRUE, NULL }, 104 { JUST_COPY, "passwd", TRUE, NULL }, 105 { JUST_COPY, "periodic", TRUE, NULL }, 106 { JUST_COPY, "ppp", TRUE, NULL }, 107 { JUST_COPY, "printcap", TRUE, NULL }, 108 { JUST_COPY, "profile", TRUE, NULL }, 109 { JUST_COPY, "pwd.db", TRUE, NULL }, 110 { JUST_COPY, "rc.local", TRUE, NULL }, 111 { JUST_COPY, "rc.firewall", TRUE, NULL }, 112 { JUST_COPY, "rc.conf.local", TRUE, NULL }, 113 { JUST_COPY, "remote", TRUE, NULL }, 114 { JUST_COPY, "resolv.conf", TRUE, NULL }, 115 { JUST_COPY, "rmt", TRUE, NULL }, 116 { JUST_COPY, "sendmail.cf", TRUE, NULL }, 117 { JUST_COPY, "sendmail.cw", TRUE, NULL }, 118 { JUST_COPY, "services", TRUE, NULL }, 119 { JUST_COPY, "shells", TRUE, NULL }, 120 { JUST_COPY, "skeykeys", TRUE, NULL }, 121 { JUST_COPY, "spwd.db", TRUE, NULL }, 122 { JUST_COPY, "ssh", TRUE, NULL }, 123 { JUST_COPY, "syslog.conf", TRUE, NULL }, 124 { JUST_COPY, "ttys", TRUE, NULL }, 125 { JUST_COPY, "uucp", TRUE, NULL }, 126 { 0 }, 127}; 128 129void 130traverseHitlist(HitList *h) 131{ 132 system("rm -rf /etc/upgrade"); 133 Mkdir("/etc/upgrade"); 134 while (h->name) { 135 if (!file_readable(h->name)) { 136 if (!h->optional) 137 msgConfirm("Unable to find an old /etc/%s file! That is decidedly non-standard and\n" 138 "your upgraded system may function a little strangely as a result.", h->name); 139 } 140 else { 141 if (h->action == JUST_COPY) { 142 /* Move the just-loaded copy aside */ 143 vsystem("mv /etc/%s /etc/upgrade/%s", h->name, h->name); 144 145 /* Copy the old one into its place */ 146 msgNotify("Resurrecting %s..", h->name); 147 /* Do this with tar so that symlinks and such are preserved */ 148 if (vsystem("tar cf - %s | tar xpf - -C /etc", h->name)) 149 msgConfirm("Unable to resurrect your old /etc/%s! Hmmmm.", h->name); 150 } 151 else /* call handler */ 152 h->handler(h); 153 } 154 ++h; 155 } 156} 157 158int 159installUpgrade(dialogMenuItem *self) 160{ 161 char saved_etc[FILENAME_MAX]; 162 Boolean extractingBin = TRUE; 163 164 if (variable_get(VAR_NONINTERACTIVE)) 165 return installUpgradeNonInteractive(self); 166 167 variable_set2(SYSTEM_STATE, "upgrade", 0); 168 dialog_clear(); 169 170 if (msgYesNo("Before beginning a binary upgrade, please review the upgrade instructions,\n" 171 "which are located in the \"Install\" document under the main documentation\n" 172 "menu. Given that you have read these instructions and understand the risks\n" 173 "and precautions involved, are you sure that you want to proceed with\n" 174 "this upgrade?") != 0) 175 return DITEM_FAILURE; 176 177 if (!Dists) { 178 msgConfirm("First, you must select some distribution components. The upgrade procedure\n" 179 "will only upgrade the distributions you select in the next set of menus."); 180 if (!dmenuOpenSimple(&MenuDistributions, FALSE) || !Dists) 181 return DITEM_FAILURE; 182 } 183 else if (!(Dists & DIST_BIN)) { /* No bin selected? Not much of an upgrade.. */ 184 if (msgYesNo("You didn't select the bin distribution as one of the distributons to load.\n" 185 "This one is pretty vital to a successful upgrade. Are you SURE you don't\n" 186 "want to select the bin distribution? Chose No to bring up the Distributions\n" 187 "menu again.") != 0) { 188 if (!dmenuOpenSimple(&MenuDistributions, FALSE)) 189 return DITEM_FAILURE; 190 } 191 } 192 193 /* Still?! OK! They must know what they're doing.. */ 194 if (!(Dists & DIST_BIN)) 195 extractingBin = FALSE; 196 197 if (RunningAsInit) { 198 Device **devs; 199 int i, cnt; 200 char *cp; 201 202 cp = variable_get(VAR_DISK); 203 devs = deviceFind(cp, DEVICE_TYPE_DISK); 204 cnt = deviceCount(devs); 205 if (!cnt) { 206 msgConfirm("No disks found! Please verify that your disk controller is being\n" 207 "properly probed at boot time. See the Hardware Guide on the\n" 208 "Documentation menu for clues on diagnosing this type of problem."); 209 return DITEM_FAILURE | DITEM_RESTORE; 210 } 211 else { 212 /* Enable all the drives before we start */ 213 for (i = 0; i < cnt; i++) 214 devs[i]->enabled = TRUE; 215 } 216 217 msgConfirm("OK. First, we're going to go to the disk label editor. In this editor\n" 218 "you will be expected to Mount any partitions you're interested in\n" 219 "upgrading. DO NOT set the Newfs flag to Y on anything in the label editor\n" 220 "unless you're absolutely sure you know what you're doing! In this\n" 221 "instance, you'll be using the label editor as little more than a fancy\n" 222 "screen-oriented partition mounting tool.\n\n" 223 "Once you're done in the label editor, press Q to return here for the next\n" 224 "step."); 225 226 if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) { 227 msgConfirm("The disk label editor returned an error status. Upgrade operation\n" 228 "aborted."); 229 return DITEM_FAILURE | DITEM_RESTORE; 230 } 231 232 /* Don't write out MBR info */ 233 variable_set2(DISK_PARTITIONED, "written", 0); 234 if (DITEM_STATUS(diskLabelCommit(self)) == DITEM_FAILURE) { 235 msgConfirm("Not all file systems were properly mounted. Upgrade operation\n" 236 "aborted."); 237 variable_unset(DISK_PARTITIONED); 238 return DITEM_FAILURE | DITEM_RESTORE; 239 } 240 241 msgNotify("Updating /stand on root filesystem"); 242 (void)vsystem("find -x /stand | cpio %s -pdum /mnt", cpioVerbosity()); 243 244 if (DITEM_STATUS(chroot("/mnt")) == DITEM_FAILURE) { 245 msgConfirm("Unable to chroot to /mnt - something is wrong with the\n" 246 "root partition or the way it's mounted if this doesn't work."); 247 variable_unset(DISK_PARTITIONED); 248 return DITEM_FAILURE | DITEM_RESTORE; 249 } 250 chdir("/"); 251 installEnvironment(); 252 systemCreateHoloshell(); 253 } 254 255 saved_etc[0] = '\0'; 256 257 /* Don't allow sources to be upgraded unless if we have src already */ 258 if (directory_exists("/usr/src/") && (Dists & DIST_SRC)) { 259 Dists &= ~DIST_SRC; 260 SrcDists = 0; 261 msgConfirm("Warning: /usr/src exists and sources were selected as upgrade\n" 262 "targets. Unfortunately, this is not the way to upgrade your\n" 263 "sources - please use CTM or CVSup or some other method which\n" 264 "handles ``deletion events'', unlike this particular feature.\n\n" 265 "Your existing /usr/src will not be affected by this upgrade.\n"); 266 } 267 268 if (extractingBin) { 269 while (!*saved_etc) {
| 8 * 9 * Copyright (c) 1995 10 * Jordan Hubbard. All rights reserved. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 * 1. Redistributions of source code must retain the above copyright 16 * notice, this list of conditions and the following disclaimer, 17 * verbatim and that no modifications are made prior to this 18 * point in the file. 19 * 2. Redistributions in binary form must reproduce the above copyright 20 * notice, this list of conditions and the following disclaimer in the 21 * documentation and/or other materials provided with the distribution. 22 * 23 * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND 24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 */ 36 37#include "sysinstall.h" 38#include <sys/disklabel.h> 39#include <sys/errno.h> 40#include <sys/ioctl.h> 41#include <sys/fcntl.h> 42#include <sys/wait.h> 43#include <sys/param.h> 44#include <sys/stat.h> 45#include <unistd.h> 46#include <sys/mount.h> 47 48static int installUpgradeNonInteractive(dialogMenuItem *self); 49 50typedef struct _hitList { 51 enum { JUST_COPY, CALL_HANDLER } action ; 52 char *name; 53 Boolean optional; 54 void (*handler)(struct _hitList *self); 55} HitList; 56 57/* These are the only meaningful files I know about */ 58static HitList etc_files [] = { 59 { JUST_COPY, "Xaccel.ini", TRUE, NULL }, 60 { JUST_COPY, "XF86Config", TRUE, NULL }, 61 { JUST_COPY, "adduser.conf", TRUE, NULL }, 62 { JUST_COPY, "aliases", TRUE, NULL }, 63 { JUST_COPY, "aliases.db", TRUE, NULL }, 64 { JUST_COPY, "amd.map", TRUE, NULL }, 65 { JUST_COPY, "auth.conf", TRUE, NULL }, 66 { JUST_COPY, "crontab", TRUE, NULL }, 67 { JUST_COPY, "csh.cshrc", TRUE, NULL }, 68 { JUST_COPY, "csh.login", TRUE, NULL }, 69 { JUST_COPY, "csh.logout", TRUE, NULL }, 70 { JUST_COPY, "cvsupfile", TRUE, NULL }, 71 { JUST_COPY, "dhclient.conf", TRUE, NULL }, 72 { JUST_COPY, "disktab", TRUE, NULL }, 73 { JUST_COPY, "dm.conf", TRUE, NULL }, 74 { JUST_COPY, "dumpdates", TRUE, NULL }, 75 { JUST_COPY, "exports", TRUE, NULL }, 76 { JUST_COPY, "fbtab", TRUE, NULL }, 77 { JUST_COPY, "fstab", FALSE, NULL }, 78 { JUST_COPY, "ftpusers", TRUE, NULL }, 79 { JUST_COPY, "gettytab", TRUE, NULL }, 80 { JUST_COPY, "gnats", TRUE, NULL }, 81 { JUST_COPY, "group", FALSE, NULL }, 82 { JUST_COPY, "hosts", TRUE, NULL }, 83 { JUST_COPY, "hosts.allow", TRUE, NULL }, 84 { JUST_COPY, "hosts.equiv", TRUE, NULL }, 85 { JUST_COPY, "hosts.lpd", TRUE, NULL }, 86 { JUST_COPY, "inetd.conf", TRUE, NULL }, 87 { JUST_COPY, "kerberosIV", TRUE, NULL }, 88 { JUST_COPY, "localtime", TRUE, NULL }, 89 { JUST_COPY, "login.access", TRUE, NULL }, 90 { JUST_COPY, "login.conf", TRUE, NULL }, 91 { JUST_COPY, "mail", TRUE, NULL }, 92 { JUST_COPY, "mail.rc", TRUE, NULL }, 93 { JUST_COPY, "make.conf", TRUE, NULL }, 94 { JUST_COPY, "manpath.config", TRUE, NULL }, 95 { JUST_COPY, "master.passwd", FALSE, NULL }, 96 { JUST_COPY, "modems", TRUE, NULL }, 97 { JUST_COPY, "motd", TRUE, NULL }, 98 { JUST_COPY, "namedb", TRUE, NULL }, 99 { JUST_COPY, "networks", TRUE, NULL }, 100 { JUST_COPY, "newsyslog.conf", TRUE, NULL }, 101 { JUST_COPY, "nsmb.conf", TRUE, NULL }, 102 { JUST_COPY, "nsswitch.conf", TRUE, NULL }, 103 { JUST_COPY, "pam.conf", TRUE, NULL }, 104 { JUST_COPY, "passwd", TRUE, NULL }, 105 { JUST_COPY, "periodic", TRUE, NULL }, 106 { JUST_COPY, "ppp", TRUE, NULL }, 107 { JUST_COPY, "printcap", TRUE, NULL }, 108 { JUST_COPY, "profile", TRUE, NULL }, 109 { JUST_COPY, "pwd.db", TRUE, NULL }, 110 { JUST_COPY, "rc.local", TRUE, NULL }, 111 { JUST_COPY, "rc.firewall", TRUE, NULL }, 112 { JUST_COPY, "rc.conf.local", TRUE, NULL }, 113 { JUST_COPY, "remote", TRUE, NULL }, 114 { JUST_COPY, "resolv.conf", TRUE, NULL }, 115 { JUST_COPY, "rmt", TRUE, NULL }, 116 { JUST_COPY, "sendmail.cf", TRUE, NULL }, 117 { JUST_COPY, "sendmail.cw", TRUE, NULL }, 118 { JUST_COPY, "services", TRUE, NULL }, 119 { JUST_COPY, "shells", TRUE, NULL }, 120 { JUST_COPY, "skeykeys", TRUE, NULL }, 121 { JUST_COPY, "spwd.db", TRUE, NULL }, 122 { JUST_COPY, "ssh", TRUE, NULL }, 123 { JUST_COPY, "syslog.conf", TRUE, NULL }, 124 { JUST_COPY, "ttys", TRUE, NULL }, 125 { JUST_COPY, "uucp", TRUE, NULL }, 126 { 0 }, 127}; 128 129void 130traverseHitlist(HitList *h) 131{ 132 system("rm -rf /etc/upgrade"); 133 Mkdir("/etc/upgrade"); 134 while (h->name) { 135 if (!file_readable(h->name)) { 136 if (!h->optional) 137 msgConfirm("Unable to find an old /etc/%s file! That is decidedly non-standard and\n" 138 "your upgraded system may function a little strangely as a result.", h->name); 139 } 140 else { 141 if (h->action == JUST_COPY) { 142 /* Move the just-loaded copy aside */ 143 vsystem("mv /etc/%s /etc/upgrade/%s", h->name, h->name); 144 145 /* Copy the old one into its place */ 146 msgNotify("Resurrecting %s..", h->name); 147 /* Do this with tar so that symlinks and such are preserved */ 148 if (vsystem("tar cf - %s | tar xpf - -C /etc", h->name)) 149 msgConfirm("Unable to resurrect your old /etc/%s! Hmmmm.", h->name); 150 } 151 else /* call handler */ 152 h->handler(h); 153 } 154 ++h; 155 } 156} 157 158int 159installUpgrade(dialogMenuItem *self) 160{ 161 char saved_etc[FILENAME_MAX]; 162 Boolean extractingBin = TRUE; 163 164 if (variable_get(VAR_NONINTERACTIVE)) 165 return installUpgradeNonInteractive(self); 166 167 variable_set2(SYSTEM_STATE, "upgrade", 0); 168 dialog_clear(); 169 170 if (msgYesNo("Before beginning a binary upgrade, please review the upgrade instructions,\n" 171 "which are located in the \"Install\" document under the main documentation\n" 172 "menu. Given that you have read these instructions and understand the risks\n" 173 "and precautions involved, are you sure that you want to proceed with\n" 174 "this upgrade?") != 0) 175 return DITEM_FAILURE; 176 177 if (!Dists) { 178 msgConfirm("First, you must select some distribution components. The upgrade procedure\n" 179 "will only upgrade the distributions you select in the next set of menus."); 180 if (!dmenuOpenSimple(&MenuDistributions, FALSE) || !Dists) 181 return DITEM_FAILURE; 182 } 183 else if (!(Dists & DIST_BIN)) { /* No bin selected? Not much of an upgrade.. */ 184 if (msgYesNo("You didn't select the bin distribution as one of the distributons to load.\n" 185 "This one is pretty vital to a successful upgrade. Are you SURE you don't\n" 186 "want to select the bin distribution? Chose No to bring up the Distributions\n" 187 "menu again.") != 0) { 188 if (!dmenuOpenSimple(&MenuDistributions, FALSE)) 189 return DITEM_FAILURE; 190 } 191 } 192 193 /* Still?! OK! They must know what they're doing.. */ 194 if (!(Dists & DIST_BIN)) 195 extractingBin = FALSE; 196 197 if (RunningAsInit) { 198 Device **devs; 199 int i, cnt; 200 char *cp; 201 202 cp = variable_get(VAR_DISK); 203 devs = deviceFind(cp, DEVICE_TYPE_DISK); 204 cnt = deviceCount(devs); 205 if (!cnt) { 206 msgConfirm("No disks found! Please verify that your disk controller is being\n" 207 "properly probed at boot time. See the Hardware Guide on the\n" 208 "Documentation menu for clues on diagnosing this type of problem."); 209 return DITEM_FAILURE | DITEM_RESTORE; 210 } 211 else { 212 /* Enable all the drives before we start */ 213 for (i = 0; i < cnt; i++) 214 devs[i]->enabled = TRUE; 215 } 216 217 msgConfirm("OK. First, we're going to go to the disk label editor. In this editor\n" 218 "you will be expected to Mount any partitions you're interested in\n" 219 "upgrading. DO NOT set the Newfs flag to Y on anything in the label editor\n" 220 "unless you're absolutely sure you know what you're doing! In this\n" 221 "instance, you'll be using the label editor as little more than a fancy\n" 222 "screen-oriented partition mounting tool.\n\n" 223 "Once you're done in the label editor, press Q to return here for the next\n" 224 "step."); 225 226 if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) { 227 msgConfirm("The disk label editor returned an error status. Upgrade operation\n" 228 "aborted."); 229 return DITEM_FAILURE | DITEM_RESTORE; 230 } 231 232 /* Don't write out MBR info */ 233 variable_set2(DISK_PARTITIONED, "written", 0); 234 if (DITEM_STATUS(diskLabelCommit(self)) == DITEM_FAILURE) { 235 msgConfirm("Not all file systems were properly mounted. Upgrade operation\n" 236 "aborted."); 237 variable_unset(DISK_PARTITIONED); 238 return DITEM_FAILURE | DITEM_RESTORE; 239 } 240 241 msgNotify("Updating /stand on root filesystem"); 242 (void)vsystem("find -x /stand | cpio %s -pdum /mnt", cpioVerbosity()); 243 244 if (DITEM_STATUS(chroot("/mnt")) == DITEM_FAILURE) { 245 msgConfirm("Unable to chroot to /mnt - something is wrong with the\n" 246 "root partition or the way it's mounted if this doesn't work."); 247 variable_unset(DISK_PARTITIONED); 248 return DITEM_FAILURE | DITEM_RESTORE; 249 } 250 chdir("/"); 251 installEnvironment(); 252 systemCreateHoloshell(); 253 } 254 255 saved_etc[0] = '\0'; 256 257 /* Don't allow sources to be upgraded unless if we have src already */ 258 if (directory_exists("/usr/src/") && (Dists & DIST_SRC)) { 259 Dists &= ~DIST_SRC; 260 SrcDists = 0; 261 msgConfirm("Warning: /usr/src exists and sources were selected as upgrade\n" 262 "targets. Unfortunately, this is not the way to upgrade your\n" 263 "sources - please use CTM or CVSup or some other method which\n" 264 "handles ``deletion events'', unlike this particular feature.\n\n" 265 "Your existing /usr/src will not be affected by this upgrade.\n"); 266 } 267 268 if (extractingBin) { 269 while (!*saved_etc) {
|