diff options
author | jkh <jkh@FreeBSD.org> | 1997-01-24 07:47:17 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-01-24 07:47:17 +0000 |
commit | 59d748d531a74d6c2828bcf19995d5f5f10febe6 (patch) | |
tree | 940c1bd16f1ab77767b69b096d717e77cd20db11 /usr.sbin/sade | |
parent | 665db5b3e7479a15dcdb878e11d1958774ff6b8b (diff) | |
download | FreeBSD-src-59d748d531a74d6c2828bcf19995d5f5f10febe6.zip FreeBSD-src-59d748d531a74d6c2828bcf19995d5f5f10febe6.tar.gz |
This is a patch that makes some of the "partitions" --> "slice" to be
more consistant in our use of the terms for differentiation between PC
partitions and traditional BSD partitions.
Submitted-By: obrien@cs.ucdavis.edu (David O'Brien)
Diffstat (limited to 'usr.sbin/sade')
-rw-r--r-- | usr.sbin/sade/disks.c | 22 | ||||
-rw-r--r-- | usr.sbin/sade/help/slice.hlp | 32 | ||||
-rw-r--r-- | usr.sbin/sade/install.c | 63 | ||||
-rw-r--r-- | usr.sbin/sade/label.c | 2 | ||||
-rw-r--r-- | usr.sbin/sade/sade.h | 2 |
5 files changed, 83 insertions, 38 deletions
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index d315468..44deb3e 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/disks.c @@ -117,11 +117,11 @@ static void print_command_summary() { mvprintw(14, 0, "The following commands are supported (in upper or lower case):"); - mvprintw(16, 0, "A = Use Entire Disk B = Bad Block Scan C = Create Partition"); - mvprintw(17, 0, "D = Delete Partition G = Set Drive Geometry S = Set Bootable"); + mvprintw(16, 0, "A = Use Entire Disk B = Bad Block Scan C = Create Slice"); + mvprintw(17, 0, "D = Delete Slice G = Set Drive Geometry S = Set Bootable"); mvprintw(18, 0, "U = Undo All Changes Q = Finish"); if (!RunningAsInit) - mvprintw(18, 46, "W = Write Changes"); + mvprintw(18, 48, "W = Write Changes"); mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to select."); move(0, 0); } @@ -270,7 +270,7 @@ diskPartition(Device *dev, Disk *d) case 'B': if (chunk_info[current_chunk]->type != freebsd) - msg = "Can only scan for bad blocks in FreeBSD partition."; + msg = "Can only scan for bad blocks in FreeBSD slice."; else if (strncmp(d->name, "sd", 2) || !msgYesNo("This typically makes sense only for ESDI, IDE or MFM drives.\n" "Are you sure you want to do this on a SCSI disk?")) { @@ -284,14 +284,14 @@ diskPartition(Device *dev, Disk *d) case 'C': if (chunk_info[current_chunk]->type != unused) - msg = "Partition in use, delete it first or move to an unused one."; + msg = "Slice in use, delete it first or move to an unused one."; else { char *val, tmp[20], *cp; int size, subtype; chunk_e partitiontype; snprintf(tmp, 20, "%d", chunk_info[current_chunk]->size); - val = msgGetInput(tmp, "Please specify the size for new FreeBSD partition in blocks\n" + val = msgGetInput(tmp, "Please specify the size for new FreeBSD slice in blocks\n" "or append a trailing `M' for megabytes (e.g. 20M)."); if (val && (size = strtol(val, &cp, 0)) > 0) { if (*cp && toupper(*cp) == 'M') @@ -299,7 +299,7 @@ diskPartition(Device *dev, Disk *d) strcpy(tmp, "165"); val = msgGetInput(tmp, "Enter type of partition to create:\n\n" "Pressing Enter will choose the default, a native FreeBSD\n" - "partition (type 165). You can choose other types, 6 for a\n" + "slice (type 165). You can choose other types, 6 for a\n" "DOS partition or 131 for a Linux partition, for example.\n\n" "Note: If you choose a non-FreeBSD partition type, it will not\n" "be formatted or otherwise prepared, it will simply reserve space\n" @@ -325,7 +325,7 @@ diskPartition(Device *dev, Disk *d) case KEY_DC: case 'D': if (chunk_info[current_chunk]->type == unused) - msg = "Partition is already unused!"; + msg = "Slice is already unused!"; else { Delete_Chunk(d, chunk_info[current_chunk]); variable_set2(DISK_PARTITIONED, "yes"); @@ -440,9 +440,9 @@ diskPartition(Device *dev, Disk *d) char buf[FILENAME_MAX]; dialog_clear_norefresh(); - use_helpline("Press F1 to read more about disk partitioning."); + use_helpline("Press F1 to read more about disk slices."); use_helpfile(systemHelpFile("partition", buf)); - dialog_mesgbox("Disk partitioning warning:", p, -1, -1); + dialog_mesgbox("Disk slicing warning:", p, -1, -1); free(p); } restorescr(w); @@ -560,7 +560,7 @@ diskPartitionWrite(dialogMenuItem *self) if (c1->flags & CHUNK_BAD144) { int ret; - msgNotify("Running bad block scan on partition %s", c1->name); + msgNotify("Running bad block scan on slice %s", c1->name); if (!Fake) { ret = vsystem("bad144 -v /dev/r%s 1234", c1->name); if (ret) diff --git a/usr.sbin/sade/help/slice.hlp b/usr.sbin/sade/help/slice.hlp index 135a765..22ca1e6 100644 --- a/usr.sbin/sade/help/slice.hlp +++ b/usr.sbin/sade/help/slice.hlp @@ -1,15 +1,15 @@ -This is the Main Partition (or ``FDISK'') Editor. +This is the Main Slice (or ``FDISK'' Partition) Editor. Possible commands are printed at the bottom and the Master Boot Record contents are shown at the top. You can move up and down with the -arrow keys and (C)reate a new partition whenever the highlighted -selection bar is over a partition whose type is marked as "unused." +arrow keys and (C)reate a new slice whenever the highlighted +selection bar is over a slice whose type is marked as "unused." -You are expected to leave this screen with at least one partition +You are expected to leave this screen with at least one slice marked "FreeBSD." Note that unlike Linux, you don't need to create -multiple FreeBSD fdisk partition entries for different things like +multiple FreeBSD fdisk slice entries for different things like swap, file systems, etc. The usual convention is to create ONE -FreeBSD partition per drive and then subsection this partition into +FreeBSD slice per drive and then subsection this slice into swap and file systems with the Label editor. No actual changes will be made to the disk until you (C)ommit from the @@ -28,7 +28,7 @@ For the truly dedicated disk case, you can select `No' at the compatibility prompt. In that case, all BIOS geometry considerations will no longer be in effect and you can safely ignore any ``The detected geometry is invalid'' warning messages you may later -see. It is also not necessary in this case to set a partition bootable +see. It is also not necessary in this case to set a slice bootable or install an MBR boot manager as both things are then irrelevant. The FreeBSD slice will start at absolute sector 0 of the disk (so that @@ -42,18 +42,18 @@ FreeBSD server or workstation, not a typical `home PC'. The flags field has the following legend: - '=' -- This partition is properly aligned. - '>' -- This partition doesn't end before cylinder 1024 - 'R' -- This partition contains the root (/) filesystem - 'B' -- Partition employs BAD144 bad-spot handling - 'C' -- This is the FreeBSD 2.0-compatibility partition (default) - 'A' -- This partition is marked active. + '=' -- This slice is properly aligned. + '>' -- This slice doesn't end before cylinder 1024 + 'R' -- This slice contains the root (/) filesystem + 'B' -- Slice employs BAD144 bad-spot handling + 'C' -- This is the FreeBSD 2.0-compatibility slice (default) + 'A' -- This slice is marked active. -If you select a partition for Bad144 handling, it will be scanned +If you select a slice for Bad144 handling, it will be scanned for bad blocks before any new filesystems are made on it. -If no partition is marked Active, you will need to either install +If no slice is marked Active, you will need to either install a Boot Manager (the option for which will be presented later in the installation) or set one Active before leaving this screen. -To leave the partition editor, type `Q'. +To leave the slice editor, type `Q'. diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index 682d814..c42b084 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -230,8 +230,6 @@ installInitial(void) msgConfirm("Unable to chroot to /mnt - this is bad!"); return DITEM_FAILURE; } - else - Chrooted = TRUE; chdir("/"); variable_set2(RUNNING_ON_ROOT, "yes"); @@ -443,6 +441,21 @@ installExpress(dialogMenuItem *self) if (DITEM_STATUS((i = diskLabelEditor(self))) == DITEM_FAILURE) return i; + if (!Dists) { + dialog_clear_norefresh(); + if (!dmenuOpenSimple(&MenuDistributions, FALSE) || !Dists) + return DITEM_FAILURE | DITEM_RESTORE; + } + + if (!mediaDevice) { + dialog_clear_norefresh(); + if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) + return DITEM_FAILURE | DITEM_RESTORE; + } + + if (!mediaDevice->init(mediaDevice)) + return DITEM_FAILURE | DITEM_REDRAW; + if (DITEM_STATUS((i = installCommit(self))) == DITEM_SUCCESS) { i |= DITEM_LEAVE_MENU; /* Give user the option of one last configuration spree */ @@ -482,6 +495,24 @@ installNovice(dialogMenuItem *self) if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) return DITEM_FAILURE; + while (1) { + dialog_clear_norefresh(); + if (!dmenuOpenSimple(&MenuDistributions, FALSE)) + return DITEM_FAILURE | DITEM_RESTORE; + + if (Dists) + break; + + if (msgYesNo("No distributions selected. Revisit the distributions menu?")) + return DITEM_FAILURE | DITEM_RESTORE; + } + + if (!mediaDevice && (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice)) + return DITEM_FAILURE | DITEM_RESTORE; + + if (!mediaDevice->init(mediaDevice)) + return DITEM_FAILURE | DITEM_RESTORE; + if (DITEM_STATUS((i = installCommit(self))) == DITEM_FAILURE) { dialog_clear_norefresh(); msgConfirm("Installation completed with some errors. You may wish to\n" @@ -638,29 +669,43 @@ int installCommit(dialogMenuItem *self) { int i; + char *str; Boolean need_bin; if (!Dists) { - if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists) + if (!msgYesNo("No distributions are selected for installation! Do you\n" + "want to do this now?")) { + if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists) + return DITEM_FAILURE | DITEM_RESTORE; + } + else return DITEM_FAILURE | DITEM_RESTORE; } -media: if (!mediaDevice) { - if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RESTORE; + if (!msgYesNo("You need to select a media type first. Do you want\n" + "to do this now?")) { + if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) + return DITEM_FAILURE | DITEM_RESTORE; + } + else + return DITEM_FAILURE | DITEM_RESTORE; } if (!mediaDevice->init(mediaDevice)) { if (!msgYesNo("Unable to initialize selected media. Would you like to\n" - "adjust your media configuration and try again?")) { - mediaDevice = NULL; - goto media; + "adjust your media configuration?")) { + if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) + return DITEM_FAILURE | DITEM_RESTORE; } else return DITEM_FAILURE | DITEM_RESTORE; } + str = variable_get(SYSTEM_STATE); + if (isDebug()) + msgDebug("installCommit: System state is `%s'\n", str); + if (RunningAsInit) { /* Do things we wouldn't do to a multi-user system */ if (DITEM_STATUS((i = installInitial())) == DITEM_FAILURE) diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c index 30bf9d5..063f4f6 100644 --- a/usr.sbin/sade/label.c +++ b/usr.sbin/sade/label.c @@ -460,7 +460,7 @@ static void print_command_summary(void) { mvprintw(17, 0, "The following commands are valid here (upper or lower case):"); - mvprintw(18, 0, "C = Create D = Delete M = Mount"); + mvprintw(18, 0, "C = Create D = Delete M = Mount pt."); if (!RunningAsInit) mvprintw(18, 47, "W = Write"); mvprintw(19, 0, "N = Newfs Opts T = Newfs Toggle U = Undo Q = Finish"); diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index 3de34c9..59a81a8 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -313,7 +313,7 @@ extern int DebugFD; /* Where diagnostic output goes */ extern Boolean Fake; /* Don't actually modify anything - testing */ extern Boolean SystemWasInstalled; /* Did we install it? */ extern Boolean RunningAsInit; /* Are we running stand-alone? */ -extern Boolean Chrooted; /* Yow, are we chrooted yet? */ +extern Boolean Chrooted; /* Are we chroot()ed? */ extern Boolean DialogActive; /* Is the dialog() stuff up? */ extern Boolean ColorDisplay; /* Are we on a color display? */ extern Boolean OnVTY; /* On a syscons VTY? */ |