diff options
author | dillon <dillon@FreeBSD.org> | 2001-12-09 09:47:09 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2001-12-09 09:47:09 +0000 |
commit | 3824d202d7975b7fa60b86b36924f7a0d3617da8 (patch) | |
tree | fdc035e8ee538d31ed15cd57e1153a54edd35b31 /usr.sbin/sade/install.c | |
parent | be4cbfd0296b742e019aae13b2d1be2267760cef (diff) | |
download | FreeBSD-src-3824d202d7975b7fa60b86b36924f7a0d3617da8.zip FreeBSD-src-3824d202d7975b7fa60b86b36924f7a0d3617da8.tar.gz |
Cleanup sysinstall's 'A'uto partitioning mode to provide more reasonable
defaults both in regards to the size of the partitions that are created
and in regards to safety and functional separation.
Still TODO: extend the previous partition to cover a deleted partition
if the previous partiton was auto-created, and supply some sort of
solution for /tmp.
Reviewed by: Just about everyone
Approved by: Nobody except maybe my pet mouse fred
Obtained from: God, so complain to HIM
MFC after: 1 week
Diffstat (limited to 'usr.sbin/sade/install.c')
-rw-r--r-- | usr.sbin/sade/install.c | 62 |
1 files changed, 53 insertions, 9 deletions
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index 6b5a6b1..468b202 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -66,12 +66,12 @@ static void fixit_common(void); static void installConfigure(void); Boolean -checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev) +checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev, Chunk **vtdev, Chunk **hdev) { Device **devs; Boolean status; Disk *disk; - Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev; + Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev, *vartmpdev, *homedev; int i; /* Don't allow whinging if noWarn is set */ @@ -79,7 +79,19 @@ checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vd whinge = FALSE; status = TRUE; - *rdev = *sdev = *udev = *vdev = rootdev = swapdev = usrdev = vardev = NULL; + if (rdev) + *rdev = NULL; + if (sdev) + *sdev = NULL; + if (udev) + *udev = NULL; + if (vdev) + *vdev = NULL; + if (vtdev) + *vtdev = NULL; + if (hdev) + *hdev = NULL; + rootdev = swapdev = usrdev = vardev = vartmpdev = homedev = NULL; /* We don't need to worry about root/usr/swap if we're already multiuser */ if (!RunningAsInit) @@ -136,6 +148,30 @@ checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vd if (isDebug()) msgDebug("Found vardev at %s!\n", vardev->name); } + } else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/var/tmp")) { + if (vartmpdev) { + if (whinge) + msgConfirm("WARNING: You have more than one /var/tmp filesystem.\n" + "Using the first one found."); + continue; + } + else { + vartmpdev = c2; + if (isDebug()) + msgDebug("Found vartmpdev at %s!\n", vartmpdev->name); + } + } else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/home")) { + if (homedev) { + if (whinge) + msgConfirm("WARNING: You have more than one /home filesystem.\n" + "Using the first one found."); + continue; + } + else { + homedev = c2; + if (isDebug()) + msgDebug("Found homedev at %s!\n", homedev->name); + } } } } @@ -166,10 +202,18 @@ checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vd } /* Copy our values over */ - *rdev = rootdev; - *sdev = swapdev; - *udev = usrdev; - *vdev = vardev; + if (rdev) + *rdev = rootdev; + if (sdev) + *sdev = swapdev; + if (udev) + *udev = usrdev; + if (vdev) + *vdev = vardev; + if (vtdev) + *vtdev = vartmpdev; + if (hdev) + *hdev = homedev; if (!rootdev && whinge) { msgConfirm("No root device found - you must label a partition as /\n" @@ -851,7 +895,7 @@ installFilesystems(dialogMenuItem *self) { int i, mountfailed; Disk *disk; - Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev; + Chunk *c1, *c2, *rootdev, *swapdev; Device **devs; PartInfo *root; char dname[80]; @@ -863,7 +907,7 @@ installFilesystems(dialogMenuItem *self) return DITEM_SUCCESS; upgrade = !variable_cmp(SYSTEM_STATE, "upgrade"); - if (!checkLabels(TRUE, &rootdev, &swapdev, &usrdev, &vardev)) + if (!checkLabels(TRUE, &rootdev, &swapdev, NULL, NULL, NULL, NULL)) return DITEM_FAILURE; if (rootdev) |