summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade/disks.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>2001-03-12 10:18:54 +0000
committerjkh <jkh@FreeBSD.org>2001-03-12 10:18:54 +0000
commit338f25906d3f2b09a1e95a3e879422d0965a8fbd (patch)
tree22f7e6506cd2209cc05602b1bddc4dc4541ba77d /usr.sbin/sade/disks.c
parent2833cfc211ddea931a242764fd58c92128d862a9 (diff)
downloadFreeBSD-src-338f25906d3f2b09a1e95a3e879422d0965a8fbd.zip
FreeBSD-src-338f25906d3f2b09a1e95a3e879422d0965a8fbd.tar.gz
Really finish softupdate setting from the label editor and fix
a few cosmetic problems: o Allow it to work with scripts (see man page or install.cfg file). o Preserve old softupdates flag across newfs toggles o Clean up partitioned/labelled flag handling o Don't ask for MBR choice again if you've already written it out. o Actually document the new features.
Diffstat (limited to 'usr.sbin/sade/disks.c')
-rw-r--r--usr.sbin/sade/disks.c49
1 files changed, 15 insertions, 34 deletions
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c
index 4932528..a033782 100644
--- a/usr.sbin/sade/disks.c
+++ b/usr.sbin/sade/disks.c
@@ -527,7 +527,7 @@ diskPartition(Device *dev)
break;
case 'U':
- if ((cp = variable_get(DISK_LABELLED)) && !strcmp(cp, "written")) {
+ if (!variable_cmp(DISK_LABELLED, "written")) {
msgConfirm("You've already written this information out - you\n"
"can't undo it.");
}
@@ -624,21 +624,6 @@ diskPartition(Device *dev)
* starts at sector 0), even in cases where the user has requested
* booteasy or a "standard" MBR -- both would be fatal in this case.
*/
-#if 0
- if ((d->chunks->part->flags & CHUNK_FORCE_ALL) != CHUNK_FORCE_ALL) {
-#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
- getBootMgr(d->name, &mbrContents, &mbrSize);
- if (mbrContents != NULL)
- Set_Boot_Mgr(d, mbrContents, mbrSize);
-#endif
- }
-#else
/*
* 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
@@ -646,19 +631,20 @@ diskPartition(Device *dev)
*/
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);
+ 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
- getBootMgr(d->name, &mbrContents, &mbrSize);
- if (mbrContents != NULL)
- Set_Boot_Mgr(d, mbrContents, mbrSize);
+ getBootMgr(d->name, &mbrContents, &mbrSize);
+ if (mbrContents != NULL)
+ Set_Boot_Mgr(d, mbrContents, mbrSize);
+ }
#endif
}
-#endif
break;
case 'Z':
@@ -807,7 +793,9 @@ diskPartitionWrite(dialogMenuItem *self)
{
Device **devs;
int i;
- char *cp;
+
+ if (!variable_cmp(DISK_PARTITIONED, "written"))
+ return DITEM_SUCCESS;
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
if (!devs) {
@@ -816,10 +804,6 @@ diskPartitionWrite(dialogMenuItem *self)
}
if (isDebug())
msgDebug("diskPartitionWrite: Examining %d devices\n", deviceCount(devs));
- cp = variable_get(DISK_PARTITIONED);
- if (cp && !strcmp(cp, "written"))
- return DITEM_SUCCESS;
-
for (i = 0; devs[i]; i++) {
Disk *d = (Disk *)devs[i]->private;
static u_char *boot1;
@@ -844,10 +828,6 @@ diskPartitionWrite(dialogMenuItem *self)
msgConfirm("ERROR: Unable to write data to disk %s!", d->name);
return DITEM_FAILURE;
}
-
- /* If we've been through here before, we don't need to do the rest */
- if (cp && !strcmp(cp, "written"))
- return DITEM_SUCCESS;
}
/* Now it's not "yes", but "written" */
variable_set2(DISK_PARTITIONED, "written", 0);
@@ -972,3 +952,4 @@ diskPartitionNonInteractive(Device *dev)
variable_set2(DISK_PARTITIONED, "yes", 0);
}
}
+
OpenPOWER on IntegriCloud