summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1994-11-02 11:00:35 +0000
committerjkh <jkh@FreeBSD.org>1994-11-02 11:00:35 +0000
commitd8bef49c01693fa3aefeb98c384d6ddc127ee10c (patch)
tree6ae62542da5521d70089d33c98127b385e3e7c6a
parentdcd5ec0ca701a90b9fdac91cc6d477c401bed547 (diff)
downloadFreeBSD-src-d8bef49c01693fa3aefeb98c384d6ddc127ee10c.zip
FreeBSD-src-d8bef49c01693fa3aefeb98c384d6ddc127ee10c.tar.gz
Last changes before going to bed. Disk label editor should now work
a fair bit better.
-rw-r--r--sbin/sysinstall/label.c32
-rw-r--r--sbin/sysinstall/stage0.c2
-rw-r--r--sbin/sysinstall/stage2.c3
3 files changed, 27 insertions, 10 deletions
diff --git a/sbin/sysinstall/label.c b/sbin/sysinstall/label.c
index ddb3f33..4727b92 100644
--- a/sbin/sysinstall/label.c
+++ b/sbin/sysinstall/label.c
@@ -36,10 +36,18 @@ struct field {
struct field label_fields[MAXPARTITIONS][EDITABLES];
+int allocated_space;
+int ourpart_offset;
+int ourpart_size;
+
void
yelp(char *str)
{
- dialog_msgbox("Validation Error", str, 6, 75, 1);
+ standout();
+ mvprintw(24, 0, "Validation Error: %s. Press return to continue", str);
+ standend();
+ beep();
+ (void)getch();
}
void
@@ -419,8 +427,6 @@ CleanMount(int disk, int part)
MP[disk][part] = 0;
}
-int free_space;
-
void
DiskLabel()
{
@@ -443,12 +449,16 @@ DiskLabel()
hd = lbl->d_ntracks;
sec = lbl->d_nsectors;
tsec = lbl->d_secperunit;
- free_space = lbl->d_partitions[OURPART].p_size;
while(!done) {
clear(); standend();
j = 0;
mvprintw(j++, 0, "%s -- Diskspace editor -- DISKLABEL", TITLE);
j++;
+
+ allocated_space = 0;
+ ourpart_size = lbl->d_partitions[OURPART].p_size;
+ ourpart_offset = lbl->d_partitions[OURPART].p_offset;
+
mvprintw(j++, 0, "Part Start End Blocks MB Type Mountpoint");
for (i = 0; i < MAXPARTITIONS; i++) {
mvprintw(j++, 0, "%c ", 'a'+i);
@@ -474,10 +484,15 @@ DiskLabel()
else {
if (Fmount[MP[diskno][i]])
printw(Fmount[MP[diskno][i]]);
- free_space -= lbl->d_partitions[i].p_size;
+ if ((lbl->d_partitions[i].p_offset >= ourpart_offset) &&
+ ((lbl->d_partitions[i].p_offset +
+ lbl->d_partitions[i].p_size) <=
+ (ourpart_offset + ourpart_size)))
+ allocated_space += lbl->d_partitions[i].p_size;
}
}
- mvprintw(19, 0, "Free space: %d blocks.", free_space);
+ mvprintw(18, 0, "Total size: %d blocks", ourpart_size);
+ mvprintw(19, 0, "Space allocated: %d blocks", allocated_space);
mvprintw(21, 0, "Commands available:");
mvprintw(22, 0, "(S)ize (M)ountpoint (D)elete (R)eread (W)rite (Q)uit");
mvprintw(23, 0, "Enter Command> ");
@@ -627,8 +642,9 @@ DiskLabel()
if (ioctl(Dfd[diskno], DIOCWLABEL, &flag) < 0)
Fatal("Couldn't disable writing of labels");
- mvprintw(24, 0, "Label written successfully.");
- beep();
+ mvprintw(24, 0,
+ "Label written successfully. Press return to continue.");
+ (void)getch();
break;
case 'q': case 'Q':
diff --git a/sbin/sysinstall/stage0.c b/sbin/sysinstall/stage0.c
index e14c229..5b2a531 100644
--- a/sbin/sysinstall/stage0.c
+++ b/sbin/sysinstall/stage0.c
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-
+#include <sys/reboot.h>
#include <dialog.h>
#include "sysinstall.h"
diff --git a/sbin/sysinstall/stage2.c b/sbin/sysinstall/stage2.c
index 32a9632..52b8d6a 100644
--- a/sbin/sysinstall/stage2.c
+++ b/sbin/sysinstall/stage2.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: stage2.c,v 1.9 1994/11/01 10:10:39 phk Exp $
+ * $Id: stage2.c,v 1.10 1994/11/02 06:19:46 jkh Exp $
*
*/
@@ -131,4 +131,5 @@ stage2()
unmount(dbuf, 0);
}
dialog_msgbox(TITLE,"Remove the floppy from the drive and hit return to reboot from the hard disk",6, 75, 1);
+ dialog_clear();
}
OpenPOWER on IntegriCloud