summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade/disks.c
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2002-11-03 10:06:22 +0000
committernyan <nyan@FreeBSD.org>2002-11-03 10:06:22 +0000
commit28a2b9046b83430df64a3cf504879f318b725eb9 (patch)
tree5259b287635df95c219b55bc8b9f3ddf5a3d7ec7 /usr.sbin/sade/disks.c
parent7479c2d936862c1fd87f63df9dc908b2c0044a6b (diff)
downloadFreeBSD-src-28a2b9046b83430df64a3cf504879f318b725eb9.zip
FreeBSD-src-28a2b9046b83430df64a3cf504879f318b725eb9.tar.gz
- Added the MenuIPLType menu for selecting pc98 boot IPL.
- Disabled 'Syscons, Font', 'Syscons, Screenmap' and 'Syscons, Ttys' menus on pc98. - Fixed the MenuMouseType and MenuMousePort menus for pc98. - Fixed some comments for pc98.
Diffstat (limited to 'usr.sbin/sade/disks.c')
-rw-r--r--usr.sbin/sade/disks.c58
1 files changed, 43 insertions, 15 deletions
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c
index cabee8b..14bb77d 100644
--- a/usr.sbin/sade/disks.c
+++ b/usr.sbin/sade/disks.c
@@ -182,15 +182,15 @@ getBootMgr(char *dname, u_char **bootipl, size_t *bootipl_size,
cp = variable_get(VAR_BOOTMGR);
if (!cp) {
- /* Figure out what kind of MBR the user wants */
+ /* Figure out what kind of IPL the user wants */
sprintf(str, "Install Boot Manager for drive %s?", dname);
- MenuMBRType.title = str;
- i = dmenuOpenSimple(&MenuMBRType, FALSE);
+ MenuIPLType.title = str;
+ i = dmenuOpenSimple(&MenuIPLType, FALSE);
} else {
if (!strncmp(cp, "boot", 4))
BootMgr = 0;
else
- BootMgr = 2;
+ BootMgr = 1;
}
if (cp || i) {
switch (BootMgr) {
@@ -202,7 +202,7 @@ getBootMgr(char *dname, u_char **bootipl, size_t *bootipl_size,
*bootmenu = boot05;
*bootmenu_size = boot05_size;
return;
- case 2:
+ case 1:
default:
break;
}
@@ -565,19 +565,19 @@ diskPartition(Device *dev)
"Are you absolutely sure you want to do this now?")) {
variable_set2(DISK_PARTITIONED, "yes", 0);
+#ifdef PC98
/*
- * Don't trash the MBR if the first (and therefore only) chunk
+ * Don't trash the IPL if the first (and therefore only) chunk
* is marked for a truly dedicated disk (i.e., the disklabel
* starts at sector 0), even in cases where the user has
- * requested booteasy or a "standard" MBR -- both would be
- * fatal in this case.
+ * requested a FreeBSD Boot Manager -- both would be fatal in
+ * this case.
*/
/*
- * Don't offer to update the MBR on this disk if the first
+ * Don't offer to update the IPL on this disk if the first
* "real" chunk looks like a FreeBSD "all disk" partition,
* or the disk is entirely FreeBSD.
*/
-#ifdef PC98
if ((d->chunks->part->type != freebsd) ||
(d->chunks->part->offset > 1))
getBootMgr(d->name, &bootipl, &bootipl_size,
@@ -590,6 +590,18 @@ diskPartition(Device *dev)
}
Set_Boot_Mgr(d, bootipl, bootipl_size, bootmenu, bootmenu_size);
#else
+ /*
+ * Don't trash the MBR if the first (and therefore only) chunk
+ * is marked for a truly dedicated disk (i.e., the disklabel
+ * starts at sector 0), even in cases where the user has
+ * requested booteasy or a "standard" MBR -- both would be
+ * fatal in this case.
+ */
+ /*
+ * Don't offer to update the MBR on this disk if the first
+ * "real" chunk looks like a FreeBSD "all disk" partition,
+ * or the disk is entirely FreeBSD.
+ */
if ((d->chunks->part->type != freebsd) ||
(d->chunks->part->offset > 1))
getBootMgr(d->name, &mbrContents, &mbrSize);
@@ -625,33 +637,49 @@ diskPartition(Device *dev)
case '\033': /* ESC */
case 'Q':
chunking = FALSE;
+#ifdef PC98
/*
- * Don't trash the MBR if the first (and therefore only) chunk
+ * Don't trash the IPL if the first (and therefore only) chunk
* is marked for a truly dedicated disk (i.e., the disklabel
* starts at sector 0), even in cases where the user has requested
- * booteasy or a "standard" MBR -- both would be fatal in this case.
+ * a FreeBSD Boot Manager -- both would be fatal in this case.
*/
/*
- * Don't offer to update the MBR on this disk if the first "real"
+ * Don't offer to update the IPL on this disk if the first "real"
* chunk looks like a FreeBSD "all disk" partition, or the disk is
* entirely FreeBSD.
*/
if ((d->chunks->part->type != freebsd) ||
(d->chunks->part->offset > 1)) {
if (variable_cmp(DISK_PARTITIONED, "written")) {
-#ifdef PC98
getBootMgr(d->name, &bootipl, &bootipl_size,
&bootmenu, &bootmenu_size);
if (bootipl != NULL && bootmenu != NULL)
Set_Boot_Mgr(d, bootipl, bootipl_size,
bootmenu, bootmenu_size);
+ }
+ }
#else
+ /*
+ * Don't trash the MBR if the first (and therefore only) chunk
+ * is marked for a truly dedicated disk (i.e., the disklabel
+ * starts at sector 0), even in cases where the user has requested
+ * booteasy or a "standard" MBR -- both would be fatal in this case.
+ */
+ /*
+ * Don't offer to update the MBR on this disk if the first "real"
+ * chunk looks like a FreeBSD "all disk" partition, or the disk is
+ * entirely FreeBSD.
+ */
+ if ((d->chunks->part->type != freebsd) ||
+ (d->chunks->part->offset > 1)) {
+ if (variable_cmp(DISK_PARTITIONED, "written")) {
getBootMgr(d->name, &mbrContents, &mbrSize);
if (mbrContents != NULL)
Set_Boot_Mgr(d, mbrContents, mbrSize);
-#endif
}
}
+#endif
break;
case 'Z':
OpenPOWER on IntegriCloud