Deleted Added
full compact
installUpgrade.c (15091) installUpgrade.c (15242)
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
6 *
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
6 *
7 * $Id: installUpgrade.c,v 1.18 1995/11/17 14:17:12 jkh Exp $
7 * $Id: installUpgrade.c,v 1.19 1996/04/07 03:52:29 jkh Exp $
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.
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 * 3. All advertising materials mentioning features or use of this software
23 * must display the following acknowledgement:
24 * This product includes software developed by Jordan Hubbard
25 * for the FreeBSD Project.
26 * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
27 * endorse or promote products derived from this software without specific
28 * prior written permission.
29 *
30 * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
31 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)

--- 153 unchanged lines hidden (view full) ---

190 char *saved_etc = NULL;
191 Boolean extractingBin = TRUE;
192 struct termios foo;
193
194 if (!RunningAsInit) {
195 dialog_clear();
196 msgConfirm("You can only perform this procedure when booted off the installation\n"
197 "floppy.");
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)

--- 153 unchanged lines hidden (view full) ---

183 char *saved_etc = NULL;
184 Boolean extractingBin = TRUE;
185 struct termios foo;
186
187 if (!RunningAsInit) {
188 dialog_clear();
189 msgConfirm("You can only perform this procedure when booted off the installation\n"
190 "floppy.");
198 return RET_FAIL;
191 return DITEM_FAILURE;
199 }
200
201 variable_set2(SYSTEM_STATE, "upgrade");
202 systemDisplayHelp("upgrade");
203
204 if (msgYesNo("Given all that scary stuff you just read, are you sure you want to\n"
205 "risk it all and proceed with this upgrade?"))
192 }
193
194 variable_set2(SYSTEM_STATE, "upgrade");
195 systemDisplayHelp("upgrade");
196
197 if (msgYesNo("Given all that scary stuff you just read, are you sure you want to\n"
198 "risk it all and proceed with this upgrade?"))
206 return RET_FAIL;
199 return DITEM_FAILURE;
207
208 if (!Dists) {
209 dialog_clear();
210 msgConfirm("You haven't specified any distributions yet. The upgrade procedure will\n"
211 "only upgrade those portions of the system for which a distribution has\n"
212 "been selected. In the next screen, we'll go to the Distributions menu\n"
213 "to select those portions of 2.1 you wish to install on top of your 2.0.5\n"
214 "system.");
215 if (!dmenuOpenSimple(&MenuDistributions))
200
201 if (!Dists) {
202 dialog_clear();
203 msgConfirm("You haven't specified any distributions yet. The upgrade procedure will\n"
204 "only upgrade those portions of the system for which a distribution has\n"
205 "been selected. In the next screen, we'll go to the Distributions menu\n"
206 "to select those portions of 2.1 you wish to install on top of your 2.0.5\n"
207 "system.");
208 if (!dmenuOpenSimple(&MenuDistributions))
216 return RET_FAIL;
209 return DITEM_FAILURE;
217 }
218
219 /* No bin selected? Not much of an upgrade.. */
220 if (!(Dists & DIST_BIN)) {
221 dialog_clear();
222 if (msgYesNo("You didn't select the bin distribution as one of the distributons to load.\n"
223 "This one is pretty vital to a successful 2.1 upgrade. Are you SURE you don't\n"
224 "want to select the bin distribution? Chose _No_ to bring up the Distributions\n"

--- 5 unchanged lines hidden (view full) ---

230 /* Still?! OK! They must know what they're doing.. */
231 if (!(Dists & DIST_BIN))
232 extractingBin = FALSE;
233
234 if (!mediaDevice) {
235 dialog_clear();
236 msgConfirm("Now you must specify an installation medium for the upgrade.");
237 if (!dmenuOpenSimple(&MenuMedia) || !mediaDevice)
210 }
211
212 /* No bin selected? Not much of an upgrade.. */
213 if (!(Dists & DIST_BIN)) {
214 dialog_clear();
215 if (msgYesNo("You didn't select the bin distribution as one of the distributons to load.\n"
216 "This one is pretty vital to a successful 2.1 upgrade. Are you SURE you don't\n"
217 "want to select the bin distribution? Chose _No_ to bring up the Distributions\n"

--- 5 unchanged lines hidden (view full) ---

223 /* Still?! OK! They must know what they're doing.. */
224 if (!(Dists & DIST_BIN))
225 extractingBin = FALSE;
226
227 if (!mediaDevice) {
228 dialog_clear();
229 msgConfirm("Now you must specify an installation medium for the upgrade.");
230 if (!dmenuOpenSimple(&MenuMedia) || !mediaDevice)
238 return RET_FAIL;
231 return DITEM_FAILURE;
239 }
240
241 dialog_clear();
242 msgConfirm("OK. First, we're going to go to the disk label editor. In this editor\n"
243 "you will be expected to *Mount* any partitions you're interested in\n"
244 "upgrading. Don't set the Newfs flag to Y on anything in the label editor\n"
245 "unless you're absolutely sure you know what you're doing! In this\n"
246 "instance, you'll be using the label editor as little more than a fancy\n"
247 "screen-oriented filesystem mounting utility, so think of it that way.\n\n"
248 "Once you're done in the label editor, press Q to return here for the next\n"
249 "step.");
250
232 }
233
234 dialog_clear();
235 msgConfirm("OK. First, we're going to go to the disk label editor. In this editor\n"
236 "you will be expected to *Mount* any partitions you're interested in\n"
237 "upgrading. Don't set the Newfs flag to Y on anything in the label editor\n"
238 "unless you're absolutely sure you know what you're doing! In this\n"
239 "instance, you'll be using the label editor as little more than a fancy\n"
240 "screen-oriented filesystem mounting utility, so think of it that way.\n\n"
241 "Once you're done in the label editor, press Q to return here for the next\n"
242 "step.");
243
251 if (diskLabelEditor(self) == RET_FAIL) {
244 if (diskLabelEditor(self) == DITEM_FAILURE) {
252 dialog_clear();
253 msgConfirm("The disk label editor failed to work properly! Upgrade operation\n"
254 "aborted.");
245 dialog_clear();
246 msgConfirm("The disk label editor failed to work properly! Upgrade operation\n"
247 "aborted.");
255 return RET_FAIL;
248 return DITEM_FAILURE;
256 }
257
258 /* Don't write out MBR info */
259 variable_set2(DISK_PARTITIONED, "written");
249 }
250
251 /* Don't write out MBR info */
252 variable_set2(DISK_PARTITIONED, "written");
260 if (diskLabelCommit(self) == RET_FAIL) {
253 if (diskLabelCommit(self) == DITEM_FAILURE) {
261 dialog_clear();
262 msgConfirm("Not all file systems were properly mounted. Upgrade operation\n"
263 "aborted.");
264 variable_unset(DISK_PARTITIONED);
254 dialog_clear();
255 msgConfirm("Not all file systems were properly mounted. Upgrade operation\n"
256 "aborted.");
257 variable_unset(DISK_PARTITIONED);
265 return RET_FAIL;
258 return DITEM_FAILURE;
266 }
267
268 if (!copySelf()) {
269 dialog_clear();
270 msgConfirm("Couldn't clone the boot floppy onto the root file system.\n"
271 "Aborting.");
259 }
260
261 if (!copySelf()) {
262 dialog_clear();
263 msgConfirm("Couldn't clone the boot floppy onto the root file system.\n"
264 "Aborting.");
272 return RET_FAIL;
265 return DITEM_FAILURE;
273 }
274
266 }
267
275 if (chroot("/mnt") == RET_FAIL) {
268 if (chroot("/mnt") == DITEM_FAILURE) {
276 dialog_clear();
277 msgConfirm("Unable to chroot to /mnt - something is wrong with the\n"
278 "root partition or the way it's mounted if this doesn't work.");
279 variable_unset(DISK_PARTITIONED);
269 dialog_clear();
270 msgConfirm("Unable to chroot to /mnt - something is wrong with the\n"
271 "root partition or the way it's mounted if this doesn't work.");
272 variable_unset(DISK_PARTITIONED);
280 return RET_FAIL;
273 return DITEM_FAILURE;
281 }
282
283 chdir("/");
284 systemCreateHoloshell();
285
286 if (!rootExtract()) {
287 dialog_clear();
288 msgConfirm("Failed to load the ROOT distribution. Please correct\n"

--- 28 unchanged lines hidden (view full) ---

317 "and start over from the beginning. Select Yes to reboot now")) {
318 reboot(0);
319 }
320 }
321 }
322 }
323
324 msgNotify("Beginning extraction of distributions..");
274 }
275
276 chdir("/");
277 systemCreateHoloshell();
278
279 if (!rootExtract()) {
280 dialog_clear();
281 msgConfirm("Failed to load the ROOT distribution. Please correct\n"

--- 28 unchanged lines hidden (view full) ---

310 "and start over from the beginning. Select Yes to reboot now")) {
311 reboot(0);
312 }
313 }
314 }
315 }
316
317 msgNotify("Beginning extraction of distributions..");
325 if (distExtractAll(self) == RET_FAIL) {
318 if (distExtractAll(self) == DITEM_FAILURE) {
326 if (extractingBin && (Dists & DIST_BIN)) {
327 dialog_clear();
328 msgConfirm("Hmmmm. We couldn't even extract the bin distribution. This upgrade\n"
329 "should be considered a failure and started from the beginning, sorry!\n"
330 "The system will reboot now.");
331 reboot(0);
332 }
333 dialog_clear();
334 msgConfirm("The extraction process seems to have had some problems, but we got most\n"
335 "of the essentials. We'll treat this as a warning since it may have been\n"
336 "only non-essential distributions which failed to load.");
337 }
338
339 if (extractingBin) {
340 msgNotify("OK, now it's time to go pound on your root a little bit to create all the\n"
341 "/dev entries and such that a 2.1 system expects to see. I'll also perform a\n"
342 "few \"fixup\" operations to repair the effects of splatting a bin distribution\n"
343 "on top of an existing system..");
319 if (extractingBin && (Dists & DIST_BIN)) {
320 dialog_clear();
321 msgConfirm("Hmmmm. We couldn't even extract the bin distribution. This upgrade\n"
322 "should be considered a failure and started from the beginning, sorry!\n"
323 "The system will reboot now.");
324 reboot(0);
325 }
326 dialog_clear();
327 msgConfirm("The extraction process seems to have had some problems, but we got most\n"
328 "of the essentials. We'll treat this as a warning since it may have been\n"
329 "only non-essential distributions which failed to load.");
330 }
331
332 if (extractingBin) {
333 msgNotify("OK, now it's time to go pound on your root a little bit to create all the\n"
334 "/dev entries and such that a 2.1 system expects to see. I'll also perform a\n"
335 "few \"fixup\" operations to repair the effects of splatting a bin distribution\n"
336 "on top of an existing system..");
344 if (installFixup(self) == RET_FAIL) {
337 if (installFixup(self) == DITEM_FAILURE) {
345 dialog_clear();
346 msgConfirm("Hmmmmm. The fixups don't seem to have been very happy.\n"
347 "You may wish to examine the system a little more closely when\n"
348 "it comes time to merge your /etc customizations back.");
349 }
350 }
351
352 dialog_clear();

--- 45 unchanged lines hidden ---
338 dialog_clear();
339 msgConfirm("Hmmmmm. The fixups don't seem to have been very happy.\n"
340 "You may wish to examine the system a little more closely when\n"
341 "it comes time to merge your /etc customizations back.");
342 }
343 }
344
345 dialog_clear();

--- 45 unchanged lines hidden ---