Tweeks to editing file system partitions, fix for PR4405, adding a method

to reselect the allocation multiplier while editing a disklabel.
This commit is contained in:
phil 1997-10-31 23:00:32 +00:00
parent ff7fbfe809
commit 2cb88494a3
9 changed files with 51 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.md.eng,v 1.5 1997/10/31 17:15:10 phil Exp $ */ /* $NetBSD: menus.md.eng,v 1.6 1997/10/31 23:00:57 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -159,6 +159,7 @@ menu editfsparts, y=15, exit;
option "Change f", action { editpart = F;}, sub menu edfspart; option "Change f", action { editpart = F;}, sub menu edfspart;
option "Change g", action { editpart = G;}, sub menu edfspart; option "Change g", action { editpart = G;}, sub menu edfspart;
option "Change h", action { editpart = H;}, sub menu edfspart; option "Change h", action { editpart = H;}, sub menu edfspart;
option "Set new allocation size", action { reask_sizemult(); };
menu md_distcustom, exit, title " Selection toggles inclusion"; menu md_distcustom, exit, title " Selection toggles inclusion";

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.md.eng,v 1.4 1997/10/31 17:15:18 phil Exp $ */ /* $NetBSD: menus.md.eng,v 1.5 1997/10/31 23:01:01 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -51,6 +51,7 @@ menu editfsparts, y=15, exit;
option "Change f", action { editpart = F;}, sub menu edfspart; option "Change f", action { editpart = F;}, sub menu edfspart;
option "Change g", action { editpart = G;}, sub menu edfspart; option "Change g", action { editpart = G;}, sub menu edfspart;
option "Change h", action { editpart = H;}, sub menu edfspart; option "Change h", action { editpart = H;}, sub menu edfspart;
option "Set new allocation size", action { reask_sizemult(); };
menu md_distcustom, exit, title " Selection toggles inclusion"; menu md_distcustom, exit, title " Selection toggles inclusion";
display action { show_cur_distsets (); }; display action { show_cur_distsets (); };

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.md.eng,v 1.3 1997/10/31 17:15:22 phil Exp $ */ /* $NetBSD: menus.md.eng,v 1.4 1997/10/31 23:01:06 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -51,11 +51,15 @@ menu editfsparts, y=15, exit;
option "Change f", action { editpart = F;}, sub menu edfspart; option "Change f", action { editpart = F;}, sub menu edfspart;
option "Change g", action { editpart = G;}, sub menu edfspart; option "Change g", action { editpart = G;}, sub menu edfspart;
option "Change h", action { editpart = H;}, sub menu edfspart; option "Change h", action { editpart = H;}, sub menu edfspart;
option "Set new allocation size", action { reask_sizemult(); };
menu md_distcustom, exit, title " Selection toggles inclusion"; menu md_distcustom, x=30, y=10, exit, title " Selection toggles inclusion";
display action { show_cur_distsets (); }; display action { show_cur_distsets (); };
option "Compiler Tools", action { toggle_getit (3); }; option "Compiler Tools", action { toggle_getit (3); };
option "Games", action { toggle_getit (4); }; option "Games", action { toggle_getit (4); };
option "Online Manual Pages", action { toggle_getit (5); }; option "Online Manual Pages", action { toggle_getit (5); };
option "Miscellaneous", action { toggle_getit (6); }; option "Miscellaneous", action { toggle_getit (6); };
option "Text Processing Tools", action { toggle_getit (7); }; option "Text Processing Tools", action { toggle_getit (7); };
option "X11 clients", action { toggle_getit (8); };
option "X11 servers", action { toggle_getit (9); };
option "X programming", action { toggle_getit (10); };

View File

@ -1,4 +1,4 @@
/* $NetBSD: defs.h,v 1.9 1997/10/29 01:06:42 phil Exp $ */ /* $NetBSD: defs.h,v 1.10 1997/10/31 23:00:32 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -64,7 +64,7 @@
/* Round up to the next full cylinder size */ /* Round up to the next full cylinder size */
#define NUMSEC(size,sizemult,cylsize) \ #define NUMSEC(size,sizemult,cylsize) \
((sizemult == 1) ? (size) : \ ((size == -1) ? -1 : (sizemult == 1) ? (size) : \
(((size)*(sizemult)+(cylsize)-1)/(cylsize))*(cylsize)) (((size)*(sizemult)+(cylsize)-1)/(cylsize))*(cylsize))
/* Types */ /* Types */
@ -110,9 +110,14 @@ EXTERN char *disktype; /* ST506, SCSI, ... */
/* Used in editing partitions ... BSD disklabel and others */ /* Used in editing partitions ... BSD disklabel and others */
EXTERN int editpart; EXTERN int editpart;
/* Final known sizes for the NetBSD partition, NetBSD disk sizes. */ /* Partition start and size in disk sectors. */
EXTERN int ptstart, ptsize; EXTERN int ptstart, ptsize;
EXTERN int fsdsize, fsptsize;
/* File system disk size. File system partition size. May not include
full disk size. */
EXTERN int fsdsize, fsptsize;
EXTERN int fsdmb; EXTERN int fsdmb;
EXTERN int minfsdmb; EXTERN int minfsdmb;
EXTERN int partstart; EXTERN int partstart;
@ -224,6 +229,7 @@ void do_upgrade __P((void));
/* from util.c */ /* from util.c */
void get_ramsize __P((void)); void get_ramsize __P((void));
void ask_sizemult __P((void)); void ask_sizemult __P((void));
void reask_sizemult __P((void));
int ask_ynquestion __P((char *quest, char def, ...)); int ask_ynquestion __P((char *quest, char def, ...));
void extract_dist __P((void)); void extract_dist __P((void));
void run_makedev __P((void)); void run_makedev __P((void));

View File

@ -1,4 +1,4 @@
/* $NetBSD: disks.c,v 1.6 1997/10/29 01:06:48 phil Exp $ */ /* $NetBSD: disks.c,v 1.7 1997/10/31 23:00:37 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -168,10 +168,12 @@ void disp_cur_fspart (int disp, int showall)
msg_display_add (MSG_fspart_head); msg_display_add (MSG_fspart_head);
for (i=start; i<stop; i++) { for (i=start; i<stop; i++) {
if (showall || bsdlabel[i][D_SIZE] > 0) { if (showall || bsdlabel[i][D_SIZE] > 0) {
msg_printf_add (" %c:%10d%10d %6s", msg_printf_add (" %c: %9d %9d %9d %6s",
'a'+i, 'a'+i,
bsdlabel[i][D_SIZE]/sizemult , bsdlabel[i][D_SIZE]/sizemult ,
bsdlabel[i][D_OFFSET]/sizemult, bsdlabel[i][D_OFFSET]/sizemult,
(bsdlabel[i][D_OFFSET] +
bsdlabel[i][D_SIZE])/sizemult,
fstype[bsdlabel[i][D_FSTYPE]]); fstype[bsdlabel[i][D_FSTYPE]]);
if (bsdlabel[i][D_FSTYPE] == T_42BSD) if (bsdlabel[i][D_FSTYPE] == T_42BSD)
msg_printf_add ("%6d%6d %s", msg_printf_add ("%6d%6d %s",

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.1.1.1 1997/09/26 23:02:53 phil Exp $ */ /* $NetBSD: main.c,v 1.2 1997/10/31 23:00:40 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -47,12 +47,19 @@
#include "msg_defs.h" #include "msg_defs.h"
#include "menu_defs.h" #include "menu_defs.h"
int main(void); int main(int argc, char **argv);
int main(void) int main(int argc, char **argv)
{ {
WINDOW *win; WINDOW *win;
/* Check for TERM ... */
if (!getenv("TERM")) {
fprintf (stderr, "%s: TERM environment varible not set.\n",
argv[0]);
exit(1);
}
/* initialize message window */ /* initialize message window */
win = newwin(22,78,1,1); win = newwin(22,78,1,1);
msg_window(win); msg_window(win);

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.mi.eng,v 1.10 1997/10/30 00:03:32 phil Exp $ */ /* $NetBSD: menus.mi.eng,v 1.11 1997/10/31 23:00:45 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -66,12 +66,14 @@ menu netbsd, title " NetBSD-@@VERSION@@ Install System";
option "Reboot the computer", exit, option "Reboot the computer", exit,
action (endwin) { run_prog("/sbin/reboot"); }; action (endwin) { run_prog("/sbin/reboot"); };
option "Utility menu", sub menu utility; option "Utility menu", sub menu utility;
option "Exit Install System", exit, action (endwin) {};
menu utility, title " NetBSD-@@VERSION@@ Utility", exit; menu utility, title " NetBSD-@@VERSION@@ Utility", exit;
option "Run /bin/sh", option "Run /bin/sh",
action (endwin) { system("/bin/sh"); puts(CL); }; action (endwin) { system("/bin/sh"); puts(CL); };
option "Configure network", option "Configure network",
action { config_network(); }; action { config_network(); };
/* option "Partition a disk"; XXX add later. */
option "Halt the system", exit, option "Halt the system", exit,
action (endwin) { run_prog("/sbin/halt"); }; action (endwin) { run_prog("/sbin/halt"); };
@ -164,6 +166,8 @@ menu edfspart, title " Change what? ", exit, y=15;
start = NUMSEC(atoi(buf),sizemult,dlcylsize); start = NUMSEC(atoi(buf),sizemult,dlcylsize);
msg_prompt_add (MSG_size, NULL, buf, 40); msg_prompt_add (MSG_size, NULL, buf, 40);
size = NUMSEC(atoi(buf),sizemult,dlcylsize); size = NUMSEC(atoi(buf),sizemult,dlcylsize);
if (size == -1)
size = dlsize - start;
if (editpart == 1 && if (editpart == 1 &&
bsdlabel[editpart][D_FSTYPE] == T_SWAP) bsdlabel[editpart][D_FSTYPE] == T_SWAP)
size -= swapadj; size -= swapadj;

View File

@ -1,4 +1,4 @@
/* $NetBSD: msg.mi.eng,v 1.9 1997/10/29 01:06:55 phil Exp $ */ /* $NetBSD: msg.mi.eng,v 1.10 1997/10/31 23:00:48 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -194,8 +194,8 @@ message fspart
message fspart_head message fspart_head
{ {
id: Size Offset FStype Bsize Fsize Mount point id: Size Offset End FStype Bsize Fsize Mount point
--- ---- ------ ------ ----- ----- ----------- --- ---- ------ --- ------ ----- ----- -----------
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: util.c,v 1.8 1997/10/30 00:03:36 phil Exp $ */ /* $NetBSD: util.c,v 1.9 1997/10/31 23:00:50 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -65,7 +65,7 @@ void get_ramsize(void)
static int asked = 0; static int asked = 0;
void ask_sizemult () void ask_sizemult (void)
{ {
if (!asked) { if (!asked) {
msg_display (MSG_sizechoice, dlcylsize); msg_display (MSG_sizechoice, dlcylsize);
@ -74,6 +74,12 @@ void ask_sizemult ()
asked = 1; asked = 1;
} }
void reask_sizemult (void)
{
asked = 0;
ask_sizemult ();
}
/* Returns 1 for "y" or "Y" and "n" otherwise. CR => default. */ /* Returns 1 for "y" or "Y" and "n" otherwise. CR => default. */
int int
ask_ynquestion (char *quest, char def, ...) ask_ynquestion (char *quest, char def, ...)