summaryrefslogtreecommitdiffstats
path: root/sbin/sysinstall/stage1.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1994-11-05 03:34:22 +0000
committerphk <phk@FreeBSD.org>1994-11-05 03:34:22 +0000
commit8e7b034f199d4114ec98aa8067abab66792667d2 (patch)
treeb264e58d121182f89312b424a1e067ce4398cbc6 /sbin/sysinstall/stage1.c
parent2f7789168ba42cde29e4929ef2d32cf181b0eb35 (diff)
downloadFreeBSD-src-8e7b034f199d4114ec98aa8067abab66792667d2.zip
FreeBSD-src-8e7b034f199d4114ec98aa8067abab66792667d2.tar.gz
Added a (H)elp function to the fdisk/disklabel code, much needed, now I only
have to write the text-file it will dump on you. Stopped using cleartoeol in AskEm(), just as a test to see if the screen looks more sane. Added a attempted auto-recognition of /, swap and /usr for the first disk where it looks sensible. Logic of this might need to be improved. Made a "ShowFile()" which will not bomb/ignore you if the file isn't there.
Diffstat (limited to 'sbin/sysinstall/stage1.c')
-rw-r--r--sbin/sysinstall/stage1.c41
1 files changed, 37 insertions, 4 deletions
diff --git a/sbin/sysinstall/stage1.c b/sbin/sysinstall/stage1.c
index 76fa8ca..e9b3dd9 100644
--- a/sbin/sysinstall/stage1.c
+++ b/sbin/sysinstall/stage1.c
@@ -259,8 +259,40 @@ stage1()
int i,j;
int ok = 0;
int ready = 0;
+ int foundroot=0,foundusr=0,foundswap=0;
query_disks();
+ /*
+ * Try to be intelligent about this and assign some mountpoints
+ */
+#define LEGAL(disk,part) ( \
+ Dlbl[disk]->d_partitions[part].p_size && \
+ (Dlbl[disk]->d_partitions[part].p_offset >= \
+ Dlbl[disk]->d_partitions[OURPART].p_offset) && \
+ ((Dlbl[disk]->d_partitions[part].p_size + \
+ Dlbl[disk]->d_partitions[part].p_offset) <= \
+ (Dlbl[disk]->d_partitions[OURPART].p_offset + \
+ Dlbl[disk]->d_partitions[OURPART].p_size)))
+
+ for(i = 0; i < MAX_NO_DISKS && Dname[i]; i++) {
+ if (Dlbl[i]->d_partitions[OURPART].p_size == 0)
+ break;
+ if (!foundroot && LEGAL(i,0) &&
+ Dlbl[i]->d_partitions[0].p_fstype == FS_BSDFFS) {
+ SetMount(i,0,"/");
+ foundroot++;
+ }
+ if (!foundswap && LEGAL(i,1) &&
+ Dlbl[i]->d_partitions[1].p_fstype == FS_SWAP) {
+ SetMount(i,1,"swap");
+ foundswap++;
+ }
+ if (!foundusr && LEGAL(i,4) &&
+ Dlbl[i]->d_partitions[4].p_fstype == FS_BSDFFS) {
+ SetMount(i,4,"/usr");
+ foundusr++;
+ }
+ }
while (!ready) {
clear(); standend();
j = 0;
@@ -268,9 +300,7 @@ stage1()
j++;
mvprintw(j++, 0, "Disks Total FreeBSD ");
j++;
- for(i = 0; i < MAX_NO_DISKS; i++) {
- if(!Dname[i])
- continue;
+ for(i = 0; i < MAX_NO_DISKS && Dname[i]; i++) {
mvprintw(j++, 0, "%2d: %-6s %5lu MB %5lu MB",
i,
Dname[i],
@@ -288,10 +318,13 @@ stage1()
}
mvprintw(21, 0, "Commands available:");
- mvprintw(22, 0, "(F)disk (D)isklabel (Q)uit");
+ mvprintw(22, 0, "(H)elp (F)disk (D)isklabel (Q)uit");
mvprintw(23, 0, "Enter Command> ");
i = getch();
switch(i) {
+ case 'h': case 'H':
+ ShowFile(HELPME_FILE,"Help file for disklayout");
+ break;
case 'q': case 'Q':
return;
case 'f': case 'F':
OpenPOWER on IntegriCloud