From 3c476fffb63e4b7b615bb2ae8189cb1e8782a4cd Mon Sep 17 00:00:00 2001 From: dsl Date: Wed, 7 May 2003 19:02:52 +0000 Subject: [PATCH] Pull some code fragments from machine and language dependant files into mbr.c Resynchronise amd64 with i386 --- distrib/utils/sysinst/arch/amd64/md.c | 85 ++++---- distrib/utils/sysinst/arch/amd64/md.h | 8 +- distrib/utils/sysinst/arch/amd64/menus.md.en | 179 +++++------------ distrib/utils/sysinst/arch/amd64/menus.md.fr | 153 +++++---------- distrib/utils/sysinst/arch/amd64/menus.md.pl | 182 +++++------------- distrib/utils/sysinst/arch/amiga/menus.md.fr | 22 +-- distrib/utils/sysinst/arch/arc/menus.md.en | 51 +---- distrib/utils/sysinst/arch/arc/menus.md.fr | 22 +-- distrib/utils/sysinst/arch/arc/menus.md.pl | 51 +---- distrib/utils/sysinst/arch/bebox/menus.md.en | 22 +-- distrib/utils/sysinst/arch/bebox/menus.md.fr | 22 +-- distrib/utils/sysinst/arch/bebox/menus.md.pl | 22 +-- distrib/utils/sysinst/arch/evbppc/menus.md.en | 22 +-- distrib/utils/sysinst/arch/evbppc/menus.md.fr | 22 +-- distrib/utils/sysinst/arch/evbppc/menus.md.pl | 22 +-- distrib/utils/sysinst/arch/hp300/menus.md.fr | 22 +-- .../utils/sysinst/arch/hpcmips/menus.md.en | 51 +---- .../utils/sysinst/arch/hpcmips/menus.md.fr | 22 +-- .../utils/sysinst/arch/hpcmips/menus.md.pl | 51 +---- distrib/utils/sysinst/arch/i386/md.c | 20 +- distrib/utils/sysinst/arch/i386/md.h | 4 +- distrib/utils/sysinst/arch/i386/menus.md.en | 167 ++++------------ distrib/utils/sysinst/arch/i386/menus.md.fr | 141 ++++---------- distrib/utils/sysinst/arch/i386/menus.md.pl | 170 ++++------------ .../utils/sysinst/arch/mvme68k/menus.md.fr | 22 +-- .../sysinst/arch/playstation2/menus.md.en | 22 +-- .../sysinst/arch/playstation2/menus.md.fr | 22 +-- .../sysinst/arch/playstation2/menus.md.pl | 22 +-- distrib/utils/sysinst/arch/prep/menus.md.en | 22 +-- distrib/utils/sysinst/arch/prep/menus.md.pl | 22 +-- .../utils/sysinst/arch/sandpoint/menus.md.en | 22 +-- .../utils/sysinst/arch/sandpoint/menus.md.fr | 22 +-- .../utils/sysinst/arch/sandpoint/menus.md.pl | 22 +-- distrib/utils/sysinst/mbr.c | 132 ++++++++++++- distrib/utils/sysinst/mbr.h | 12 +- 35 files changed, 463 insertions(+), 1412 deletions(-) diff --git a/distrib/utils/sysinst/arch/amd64/md.c b/distrib/utils/sysinst/arch/amd64/md.c index 24051a475b9c..b8f6f40deb25 100644 --- a/distrib/utils/sysinst/arch/amd64/md.c +++ b/distrib/utils/sysinst/arch/amd64/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.3 2003/05/07 10:20:19 dsl Exp $ */ +/* $NetBSD: md.c,v 1.4 2003/05/07 19:02:53 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -36,7 +36,7 @@ * */ -/* md.c -- Machine specific code for x86_64 */ +/* md.c -- Machine specific code for amd64 */ #include #include @@ -57,8 +57,7 @@ mbr_sector_t mbr; -char kernstr[STRSIZE]; -int mbr_present, mbr_len; +int mbr_len; int c1024_resp; struct disklist *disklist = NULL; struct nativedisk_info *nativedisk; @@ -66,26 +65,25 @@ struct biosdisk_info *biosdisk = NULL; int netbsd_mbr_installed = 0; int netbsd_bootsel_installed = 0; -static int md_read_bootcode (const char *, mbr_sector_t *); -static int count_mbr_parts (struct mbr_partition *); -static int mbr_part_above_chs (struct mbr_partition *); -static int mbr_partstart_above_chs (struct mbr_partition *); -static void configure_bootsel (void); -static void md_upgrade_mbrtype (void); - struct mbr_bootsel *mbs; int defbootselpart, defbootseldisk; - /* prototypes */ +static int md_read_bootcode(const char *, mbr_sector_t *); +static int count_mbr_parts(struct mbr_partition *); +static int mbr_part_above_chs(struct mbr_partition *); +static int mbr_partstart_above_chs(struct mbr_partition *); +static void configure_bootsel(void); +static void md_upgrade_mbrtype(void); + int -md_get_info() +md_get_info(void) { read_mbr(diskdev, &mbr, sizeof mbr); if (!valid_mbr(&mbr)) { - memset(&mbr.mbr_parts, 0, sizeof mbr.mbr_parts); + memset(&mbr, 0, sizeof mbr); /* XXX check result and give up if < 0 */ mbr_len = md_read_bootcode(_PATH_MBR, &mbr); netbsd_mbr_installed = 1; @@ -141,9 +139,7 @@ edit: * The existing partition table and bootselect configuration is kept. */ static int -md_read_bootcode(path, mbr) - const char *path; - mbr_sector_t *mbr; +md_read_bootcode(const char *path, mbr_sector_t *mbr) { int fd, cc; struct stat st; @@ -175,7 +171,7 @@ md_read_bootcode(path, mbr) } int -md_pre_disklabel() +md_pre_disklabel(void) { msg_display(MSG_dofdisk); @@ -194,6 +190,7 @@ md_post_disklabel(void) { if (rammb <= 32) set_swap(diskdev, bsdlabel, 1); + return 0; } @@ -204,16 +201,16 @@ md_post_newfs(void) int ret; /* boot blocks ... */ - ret = stat("/usr/mdec/biosboot_com0.sym", &sb); + ret = stat("/usr/mdec/biosboot_com0_9600.sym", &sb); if ((ret != -1) && (sb.st_mode & S_IFREG)) { msg_display(MSG_getboottype); process_menu(MENU_getboottype); } msg_display(MSG_dobootblks, diskdev); - if (!strcmp(boottype, "serial")) + if (!strncmp(boottype, "serial", 6)) return run_prog(RUN_DISPLAY, NULL, - "/usr/mdec/installboot -v /usr/mdec/biosboot_com0.sym /dev/r%sa", - diskdev); + "/usr/mdec/installboot -v /usr/mdec/biosboot_com0_%s.sym /dev/r%sa", + boottype + 6, diskdev); else return run_prog(RUN_DISPLAY, NULL, "/usr/mdec/installboot -v /usr/mdec/biosboot.sym /dev/r%sa", @@ -445,7 +442,7 @@ md_update(void) } void -md_upgrade_mbrtype() +md_upgrade_mbrtype(void) { struct mbr_partition *mbrp; int i, netbsdpart = -1, oldbsdpart = -1, oldbsdcount = 0; @@ -495,7 +492,7 @@ md_cleanup_install(void) sprintf(cmd, "sed " "-e '/^ttyE[1-9]/s/off/on/'" " < %s > %s", realfrom, realto); - + scripting_fprintf(logfp, "%s\n", cmd); do_system(cmd); run_prog(RUN_FATAL, NULL, "mv -f %s %s", realto, realfrom); @@ -520,7 +517,11 @@ md_bios_info(dev) mib[1] = CPU_DISKINFO; if (sysctl(mib, 2, NULL, &len, NULL, 0) < 0) goto nogeom; - disklist = (struct disklist *)malloc(len); + disklist = malloc(len); + if (disklist == NULL) { + fprintf(stderr, "Out of memory\n"); + return -1; + } sysctl(mib, 2, disklist, &len, NULL, 0); } @@ -583,27 +584,24 @@ count_mbr_parts(pt) } static int -mbr_part_above_chs(pt) - struct mbr_partition *pt; +mbr_part_above_chs(mbr_partition_t *pt) { return ((pt[bsdpart].mbrp_start + pt[bsdpart].mbrp_size) >= bcyl * bhead * bsec); } static int -mbr_partstart_above_chs(pt) - struct mbr_partition *pt; +mbr_partstart_above_chs(mbr_partition_t *pt) { return (pt[bsdpart].mbrp_start >= bcyl * bhead * bsec); } static void -configure_bootsel() +configure_bootsel(void) { struct mbr_partition *parts = &mbr.mbr_parts[0]; int i; - mbs = &mbr.mbr_bootsel; mbs->mbrb_flags = BFL_SELACTIVE; @@ -613,7 +611,7 @@ configure_bootsel() for (i = 0; i < NMBRPART; i++) { if (parts[i].mbrp_typ != 0 && mbs->mbrb_nametab[i][0] == '\0') snprintf(mbs->mbrb_nametab[i], sizeof(mbs->mbrb_nametab[0]), - "entry %d", i+1); + "entry %d", i); } process_menu(MENU_configbootsel); @@ -628,34 +626,21 @@ configure_bootsel() } void -disp_bootsel(part, mbsp) - struct mbr_partition *part; - struct mbr_bootsel *mbsp; -{ - int i; - - msg_table_add(MSG_bootsel_header); - for (i = 0; i < 4; i++) { - msg_table_add(MSG_bootsel_row, - i, get_partname(i), mbs->mbrb_nametab[i]); - } - msg_display_add(MSG_newline); -} - -void -md_init() +md_init(void) { } +#ifdef notdef void -md_set_sizemultname() +md_set_sizemultname(void) { set_sizemultname_meg(); } +#endif void -md_set_no_x() +md_set_no_x(void) { toggle_getit (8); diff --git a/distrib/utils/sysinst/arch/amd64/md.h b/distrib/utils/sysinst/arch/amd64/md.h index 05a027b8e3cd..8c3bcb180be7 100644 --- a/distrib/utils/sysinst/arch/amd64/md.h +++ b/distrib/utils/sysinst/arch/amd64/md.h @@ -1,4 +1,4 @@ -/* $NetBSD: md.h,v 1.2 2003/05/03 17:04:09 fvdl Exp $ */ +/* $NetBSD: md.h,v 1.3 2003/05/07 19:02:54 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -137,8 +137,8 @@ extern struct disklist *disklist; extern struct nativedisk_info *nativedisk; extern struct biosdisk_info *biosdisk; -#define _PATH_MBR "/usr/mdec/mbr" -#define _PATH_BOOTSEL "/usr/mdec/mbr_bootsel" +#define _PATH_MBR DEFAULT_BOOTDIR "/" DEFAULT_BOOTCODE +#define _PATH_BOOTSEL DEFAULT_BOOTDIR "/" DEFAULT_BOOTSELCODE extern struct mbr_bootsel *mbs; @@ -147,8 +147,6 @@ extern struct mbr_bootsel *mbs; extern int defbootselpart, defbootseldisk; -void disp_bootsel (struct mbr_partition *, struct mbr_bootsel *); - /* * prototypes for MD code. */ diff --git a/distrib/utils/sysinst/arch/amd64/menus.md.en b/distrib/utils/sysinst/arch/amd64/menus.md.en index af75ed907c75..52bf217d5072 100644 --- a/distrib/utils/sysinst/arch/amd64/menus.md.en +++ b/distrib/utils/sysinst/arch/amd64/menus.md.en @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.en,v 1.3 2003/05/07 10:20:19 dsl Exp $ */ +/* $NetBSD: menus.md.en,v 1.4 2003/05/07 19:02:54 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -39,8 +39,16 @@ /* Menu definitions for sysinst. i386 version, machine dependent. */ menu getboottype, title "Bootblocks selection"; - option "Use normal bootblocks", exit, action {boottype = "normal";}; - option "Use serial bootblocks", exit, action {boottype = "serial";}; + option "Use normal bootblocks", exit, action + {boottype = "normal";}; + option "Use serial (9600) bootblocks", exit, action + {boottype = "serial9600";}; + option "Use serial (38400) bootblocks", exit, action + {boottype = "serial38400";}; + option "Use serial (57600) bootblocks", exit, action + {boottype = "serial57600";}; + option "Use serial (115200) bootblocks", exit, action + {boottype = "serial115200";}; menu fullpart, title "Select your choice"; option "Use only part of the disk", exit, action {usefull = 0;}; @@ -81,7 +89,7 @@ menu dlgeom, title "Choose an option"; menu editparttable, title "Choose your partition", exit; display action { msg_display (MSG_editparttable); - disp_cur_part(&mbr.mbr_parts[0], activepart,-1); + disp_cur_part(&mbr.mbr_parts[0], activepart, -1); }; option "Edit partition 0", sub menu editpart, action { editpart = 0; }; @@ -96,73 +104,26 @@ menu editparttable, title "Choose your partition", exit; menu editpart, title "Select to change"; display action { msg_display (MSG_editpart, editpart); - disp_cur_part(&mbr.mbr_parts[0], editpart,-1); + disp_cur_part(&mbr.mbr_parts[0], editpart, -1); msg_display_add(MSG_newline); }; option "Kind", sub menu chooseid; - option "Start and size", action - { char buf[40]; int start, size, inp, partn; - - msg_table_add(MSG_mbrpart_start_special); - msg_prompt_add (MSG_start, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: start at end of part # given - * 0: start of disk. - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - start = part[partn].mbrp_start + - part[partn].mbrp_size; - } else if (inp == 0) - start = bsec; - else - start = NUMSEC(inp,sizemult,dlcylsize); - - if (sizemult > 1 && start < bsec) - start = bsec; - msg_table_add(MSG_mbrpart_size_special); - msg_prompt_add (MSG_size, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: until start of part # given - * 0: end of disk - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - size = part[partn].mbrp_start - start; - } else if (inp == 0) - size = dlsize - start; - else - size = NUMSEC(inp,sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Start and size", action { edit_ptn_bounds(); }; option "Set active", action { activepart = editpart; }; option "Partition OK", exit; menu chooseid, title "Partition Kind?"; option "NetBSD", exit, action { - part[editpart].mbrp_typ = 169; + part[editpart].mbrp_typ = MBR_PTYPE_NETBSD; }; option "DOS < 32 Meg", exit, action { - part[editpart].mbrp_typ = 4; + part[editpart].mbrp_typ = MBR_PTYPE_FAT16S; }; option "DOS > 32 Meg", exit, action { - part[editpart].mbrp_typ = 6; + part[editpart].mbrp_typ = MBR_PTYPE_FAT16B; }; option "unused", exit, action { @@ -283,92 +244,40 @@ menu biosmultmatch; biosdisk = NULL; }; -menu configbootsel, y=16, title "Change a bootmenu item", exit; - display action { msg_display(MSG_configbootsel); - disp_bootsel(&mbr.mbr_parts[0], mbs); - msg_display_add(MSG_bootseltimeout, (1000 * mbs->mbrb_timeo) / 18200); - msg_display_add(MSG_defbootselopt); - if (mbs->mbrb_defkey == SCAN_ENTER) - msg_display_add(MSG_defbootseloptactive); - else if (mbs->mbrb_defkey < (SCAN_F1 + 4)) - msg_display_add(MSG_defbootseloptpart, - defbootselpart); - else - msg_display_add(MSG_defbootseloptdisk, - defbootseldisk); - }; +menu configbootsel, y=16, title "Change a bootmenu item", exit + display action { disp_bootsel(); }; option "Edit menu entry 0", - action { - if (part[0].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[0], - mbs->mbrb_nametab[0], 8); - }; + action { edit_bootsel_entry(0); }; option "Edit menu entry 1", - action { - if (part[1].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[1], - mbs->mbrb_nametab[1], 8); - }; + action { edit_bootsel_entry(1); }; option "Edit menu entry 2", - action { - if (part[2].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[2], - mbs->mbrb_nametab[2], 8); - }; + action { edit_bootsel_entry(2); }; option "Edit menu entry 3", - action { - if (part[3].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[3], - mbs->mbrb_nametab[3], 8); - }; + action { edit_bootsel_entry(3); }; option "Set timeout value", - action { - char tstr[8]; - unsigned timo; - - do { - snprintf(tstr, 8, "%u", - (1000 * mbs->mbrb_timeo) / 18200); - msg_prompt(MSG_bootseltimeoutval, tstr, tstr, - 8); - timo = (unsigned)atoi(tstr); - } while (timo > 3600); - mbs->mbrb_timeo = (u_int16_t)((timo * 18200) / 1000); - }; + action { edit_bootsel_timeout(); }; option "Set default option", sub menu defaultbootsel; menu defaultbootsel, title "Pick a default partition/disk to boot"; - option "Partition 0", exit, - action { - if (mbs->mbrb_nametab[0][0] != 0 && part[0].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1; defbootselpart = 0; - }; - option "Partition 1", exit, - action { - if (mbs->mbrb_nametab[1][0] != 0 && part[1].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 1; defbootselpart = 1; - }; - option "Partition 2", exit, - action { - if (mbs->mbrb_nametab[2][0] != 0 && part[2].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 2; defbootselpart = 2; - }; - option "Partition 3", exit, - action { - if (mbs->mbrb_nametab[3][0] != 0 && part[3].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 3; defbootselpart = 3; - }; - option "Harddisk 0", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 4; defbootseldisk = 0; }; - option "Harddisk 1", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 5; defbootseldisk = 1; }; - option "Harddisk 2", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 6; defbootseldisk = 2; }; - option "Harddisk 3", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 7; defbootseldisk = 3; }; - option "Harddisk 4", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 8; defbootseldisk = 4; }; - option "Harddisk 5", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 9; defbootseldisk = 5; }; option "First active partition", exit, action { mbs->mbrb_defkey = SCAN_ENTER; }; + option "Partition 0", exit, + action { edit_bootsel_default_ptn(0); }; + option "Partition 1", exit, + action { edit_bootsel_default_ptn(1); }; + option "Partition 2", exit, + action { edit_bootsel_default_ptn(2); }; + option "Partition 3", exit, + action { edit_bootsel_default_ptn(3); }; + option "Harddisk 0", exit, + action { edit_bootsel_default_disk(0); }; + option "Harddisk 1", exit, + action { edit_bootsel_default_disk(1); }; + option "Harddisk 2", exit, + action { edit_bootsel_default_disk(2); }; + option "Harddisk 3", exit, + action { edit_bootsel_default_disk(3); }; + option "Harddisk 4", exit, + action { edit_bootsel_default_disk(4); }; + option "Harddisk 5", exit, + action { edit_bootsel_default_disk(5); }; diff --git a/distrib/utils/sysinst/arch/amd64/menus.md.fr b/distrib/utils/sysinst/arch/amd64/menus.md.fr index 8b0829b7c7e4..33c8a5402fc8 100644 --- a/distrib/utils/sysinst/arch/amd64/menus.md.fr +++ b/distrib/utils/sysinst/arch/amd64/menus.md.fr @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.fr,v 1.3 2003/05/07 10:20:19 dsl Exp $ */ +/* $NetBSD: menus.md.fr,v 1.4 2003/05/07 19:02:54 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -39,12 +39,20 @@ /* Menu definitions for sysinst. i386 version, machine dependent. */ menu getboottype, title "Sélection de Bootblocks"; - option "Utilisez normal le bootblocks", exit, action {boottype = "normal";}; - option "Utilisez serial le bootblocks", exit, action {boottype = "serial";}; + option "Utilisez normal le bootblocks", exit, action + {boottype = "normal";}; + option "Utilisez serial (9600) le bootblocks", exit, action + {boottype = "serial9600";}; + option "Utilisez serial (38400) le bootblocks", exit, action + {boottype = "serial38400";}; + option "Utilisez serial (57600) le bootblocks", exit, action + {boottype = "serial57600";}; + option "Utilisez serial (115200) le bootblocks", exit, action + {boottype = "serial115200";}; menu fullpart, y=15, title "Faite votre choix"; option "Utilisation d'une partie du disque", exit, action {usefull = 0;}; - option "Utilisation de tout le disque", exit, action {usefull = 1;}; + option "Utilisation de tout le disque", exit, action {usefull = 1;}; menu wdtype, title "Choix du type de disque"; display action { msg_display (MSG_wdtype, diskdev); }; @@ -79,10 +87,9 @@ menu dlgeom, title "Choisissez une option"; disk->dd_sec = dlsec; }; - menu editparttable, title "Choisissez votre partition", exit; display action { msg_display (MSG_editparttable); - disp_cur_part(&mbr.mbr_parts[0], activepart,-1); + disp_cur_part(&mbr.mbr_parts[0], activepart, -1); }; option "Edition de la partition 0", sub menu editpart, action { editpart = 0; }; @@ -97,44 +104,26 @@ menu editparttable, title "Choisissez votre partition", exit; menu editpart, title "Changement"; display action { msg_display (MSG_editpart, editpart); - disp_cur_part(&mbr.mbr_parts[0], activepart,editpart); + disp_cur_part(&mbr.mbr_parts[0], editpart, -1); msg_display_add(MSG_newline); }; option "du type de FS", sub menu chooseid; - option "du Début et de la taille", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "du Début et de la taille", action { edit_ptn_bounds(); }; option "Rendre la partition active", action { activepart = editpart; }; option "Partition OK", exit; menu chooseid, title "Type de Partition?"; option "NetBSD", exit, action { - part[editpart].mbrp_typ = 169; + part[editpart].mbrp_typ = MBR_PTYPE_NETBSD; }; option "DOS < 32 Meg", exit, action { - part[editpart].mbrp_typ = 4; + part[editpart].mbrp_typ = MBR_PTYPE_FAT16S; }; option "DOS > 32 Meg", exit, action { - part[editpart].mbrp_typ = 6; + part[editpart].mbrp_typ = MBR_PTYPE_FAT16B; }; option "inutilis'e", exit, action { @@ -153,7 +142,7 @@ menu cyl1024; c1024_resp = 1; }; - option "Rééditer le label", exit, action + option "Rééditer le label", exit, action { extern int c1024_resp; @@ -256,91 +245,39 @@ menu biosmultmatch; }; menu configbootsel, title "Changer une entree du menu", exit; - display action { msg_display(MSG_configbootsel); - disp_bootsel(&mbr.mbr_parts[0], mbs); - msg_display_add(MSG_bootseltimeout, (1000 * mbs->mbrb_timeo) / 18200); - msg_display_add(MSG_defbootselopt); - if (mbs->mbrb_defkey == SCAN_ENTER) - msg_display_add(MSG_defbootseloptactive); - else if (mbs->mbrb_defkey < (SCAN_F1 + 4)) - msg_display_add(MSG_defbootseloptpart, - defbootselpart); - else - msg_display_add(MSG_defbootseloptdisk, - defbootseldisk); - }; + display action { disp_bootsel(); }; option "Changer l'entrée 0 du menu", - action { - if (part[0].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[0], - mbs->mbrb_nametab[0], 8); - }; + action { edit_bootsel_entry(0); }; option "Changer l'entrée 1 du menu", - action { - if (part[1].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[1], - mbs->mbrb_nametab[1], 8); - }; + action { edit_bootsel_entry(1); }; option "Changer l'entrée 2 du menu", - action { - if (part[2].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[2], - mbs->mbrb_nametab[2], 8); - }; + action { edit_bootsel_entry(2); }; option "Changer l'entrée 3 du menu", - action { - if (part[3].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[3], - mbs->mbrb_nametab[3], 8); - }; + action { edit_bootsel_entry(3); }; option "Changer le temps d'attente", - action { - char tstr[8]; - unsigned timo; - - do { - snprintf(tstr, 8, "%u", - (1000 * mbs->mbrb_timeo) / 18200); - msg_prompt(MSG_bootseltimeoutval, tstr, tstr, - 8); - timo = (unsigned)atoi(tstr); - } while (timo > 3600); - mbs->mbrb_timeo = (u_int16_t)((timo * 18200) / 1000); - }; + action { edit_bootsel_timeout(); }; option "Changer le choix par defaut", sub menu defaultbootsel; menu defaultbootsel, title "Choisissez un disque ou partition"; - option "Partition 0", exit, - action { - if (mbs->mbrb_nametab[0][0] != 0 && part[0].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1; defbootselpart = 0; - }; - option "Partition 1", exit, - action { - if (mbs->mbrb_nametab[1][0] != 0 && part[1].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 1; defbootselpart = 1; - }; - option "Partition 2", exit, - action { - if (mbs->mbrb_nametab[2][0] != 0 && part[2].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 2; defbootselpart = 2; - }; - option "Partition 3", exit, - action { - if (mbs->mbrb_nametab[3][0] != 0 && part[3].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 3; defbootselpart = 3; - }; - option "Disque dur 0", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 4; defbootseldisk = 0; }; - option "Disque dur 1", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 5; defbootseldisk = 1; }; - option "Disque dur 2", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 6; defbootseldisk = 2; }; - option "Disque dur 3", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 7; defbootseldisk = 3; }; - option "Disque dur 4", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 8; defbootseldisk = 4; }; - option "Disque dur 5", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 9; defbootseldisk = 5; }; option "Première partition active", exit, action { mbs->mbrb_defkey = SCAN_ENTER; }; + option "Partition 0", exit, + action { edit_bootsel_default_ptn(0); }; + option "Partition 1", exit, + action { edit_bootsel_default_ptn(1); }; + option "Partition 2", exit, + action { edit_bootsel_default_ptn(2); }; + option "Partition 3", exit, + action { edit_bootsel_default_ptn(3); }; + option "Disque dur 0", exit, + action { edit_bootsel_default_disk(0); }; + option "Disque dur 1", exit, + action { edit_bootsel_default_disk(1); }; + option "Disque dur 2", exit, + action { edit_bootsel_default_disk(2); }; + option "Disque dur 3", exit, + action { edit_bootsel_default_disk(3); }; + option "Disque dur 4", exit, + action { edit_bootsel_default_disk(4); }; + option "Disque dur 5", exit, + action { edit_bootsel_default_disk(5); }; diff --git a/distrib/utils/sysinst/arch/amd64/menus.md.pl b/distrib/utils/sysinst/arch/amd64/menus.md.pl index a62d5a79f5fd..001a2bcc0d5d 100644 --- a/distrib/utils/sysinst/arch/amd64/menus.md.pl +++ b/distrib/utils/sysinst/arch/amd64/menus.md.pl @@ -1,6 +1,4 @@ -/* $NetBSD: menus.md.pl,v 1.3 2003/05/07 10:20:19 dsl Exp $ */ -/* Based on english version: */ -/* NetBSD: menus.md.en,v 1.36 2001/11/29 23:20:58 thorpej Exp */ +/* $NetBSD: menus.md.pl,v 1.4 2003/05/07 19:02:54 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -41,12 +39,20 @@ /* Menu definitions for sysinst. i386 version, machine dependent. */ menu getboottype, title "Wybor bootblokow"; - option "Uzyj normalnych bootblokow", exit, action {boottype = "normal";}; - option "Uzyj bootblokow na zewn. konsole", exit, action {boottype = "serial";}; + option "Uzyj normalnych bootblokow", exit, action + {boottype = "normal";}; + option "Uzyj bootblokow na zewn. konsole (9600)", exit, action + {boottype = "serial9600";}; + option "Uzyj bootblokow na zewn. konsole (38400)", exit, action + {boottype = "serial38400";}; + option "Uzyj bootblokow na zewn. konsole (57600)", exit, action + {boottype = "serial57600";}; + option "Uzyj bootblokow na zewn. konsole (115200)", exit, action + {boottype = "serial115200";}; menu fullpart, title "Wybierz"; option "Uzyj tylko czesci dysku", exit, action {usefull = 0;}; - option "Uzyj calego dysku", exit, action {usefull = 1;}; + option "Uzyj calego dysku", exit, action {usefull = 1;}; menu wdtype, title "Wybierz typ"; display action { msg_display (MSG_wdtype, diskdev); }; @@ -83,7 +89,7 @@ menu dlgeom, title "Wybierz opcje"; menu editparttable, title "Wybierz swoje partycje", exit; display action { msg_display (MSG_editparttable); - disp_cur_part(&mbr.mbr_parts[0], activepart,-1); + disp_cur_part(&mbr.mbr_parts[0], activepart, -1); }; option "Edytuj partycje 0", sub menu editpart, action { editpart = 0; }; @@ -98,78 +104,32 @@ menu editparttable, title "Wybierz swoje partycje", exit; menu editpart, title "Wybierz aby zmienic"; display action { msg_display (MSG_editpart, editpart); - disp_cur_part(&mbr.mbr_parts[0], editpart,-1); + disp_cur_part(&mbr.mbr_parts[0], editpart, -1); msg_display_add(MSG_newline); }; option "Rodzaj", sub menu chooseid; - option "Poczatek i rozmiar", action - { char buf[40]; int start, size, inp, partn; - - msg_table_add(MSG_mbrpart_start_special); - msg_prompt_add (MSG_start, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: start at end of part # given - * 0: start of disk. - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - start = part[partn].mbrp_start + - part[partn].mbrp_size; - } else if (inp == 0) - start = bsec; - else - start = NUMSEC(inp,sizemult,dlcylsize); - - if (sizemult > 1 && start < bsec) - start = bsec; - msg_table_add(MSG_mbrpart_size_special); - msg_prompt_add (MSG_size, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: until start of part # given - * 0: end of disk - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - size = part[partn].mbrp_start - start; - } else if (inp == 0) - size = dlsize - start; - else - size = NUMSEC(inp,sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Poczatek i rozmiar", action { edit_ptn_bounds(); }; option "Ustaw aktywna", action { activepart = editpart; }; option "Partycje OK", exit; menu chooseid, title "Rodzaj partycji?"; option "NetBSD", exit, action { - part[editpart].mbrp_typ = 169; + part[editpart].mbrp_typ = MBR_PTYPE_NETBSD; }; option "DOS < 32 Meg", exit, action { - part[editpart].mbrp_typ = 4; + part[editpart].mbrp_typ = MBR_PTYPE_FAT16S; }; option "DOS > 32 Meg", exit, action { - part[editpart].mbrp_typ = 6; + part[editpart].mbrp_typ = MBR_PTYPE_FAT16B; }; option "nie uzywana", exit, action { part[editpart].mbrp_typ = 0; }; + option "nie zmienia", exit; menu cyl1024; display action { @@ -285,91 +245,39 @@ menu biosmultmatch; }; menu configbootsel, y=16, title "Zmien bootmenu", exit; - display action { msg_display(MSG_configbootsel); - disp_bootsel(&mbr.mbr_parts[0], mbs); - msg_display_add(MSG_bootseltimeout, (1000 * mbs->mbrb_timeo) / 18200); - msg_display_add(MSG_defbootselopt); - if (mbs->mbrb_defkey == SCAN_ENTER) - msg_display_add(MSG_defbootseloptactive); - else if (mbs->mbrb_defkey < (SCAN_F1 + 4)) - msg_display_add(MSG_defbootseloptpart, - defbootselpart); - else - msg_display_add(MSG_defbootseloptdisk, - defbootseldisk); - }; + display action { disp_bootsel(); }; option "Edytuj wpis 0", - action { - if (part[0].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[0], - mbs->mbrb_nametab[0], 8); - }; + action { edit_bootsel_entry(0); }; option "Edytuj wpis 1", - action { - if (part[1].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[1], - mbs->mbrb_nametab[1], 8); - }; + action { edit_bootsel_entry(1); }; option "Edytuj wpis 2", - action { - if (part[2].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[2], - mbs->mbrb_nametab[2], 8); - }; + action { edit_bootsel_entry(2); }; option "Edytuj wpis 3", - action { - if (part[3].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[3], - mbs->mbrb_nametab[3], 8); - }; + action { edit_bootsel_entry(3); }; option "Ustaw opoznienie", - action { - char tstr[8]; - unsigned timo; - - do { - snprintf(tstr, 8, "%u", - (1000 * mbs->mbrb_timeo) / 18200); - msg_prompt(MSG_bootseltimeoutval, tstr, tstr, - 8); - timo = (unsigned)atoi(tstr); - } while (timo > 3600); - mbs->mbrb_timeo = (u_int16_t)((timo * 18200) / 1000); - }; + action { edit_bootsel_timeout(); }; option "Ustaw domyslna opcje", sub menu defaultbootsel; menu defaultbootsel, title "Wybierz domyslna partycje/dysk do uruchomiania"; - option "Partycja 0", exit, - action { - if (mbs->mbrb_nametab[0][0] != 0 && part[0].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1; defbootselpart = 0; - }; - option "Partycja 1", exit, - action { - if (mbs->mbrb_nametab[1][0] != 0 && part[1].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 1; defbootselpart = 1; - }; - option "Partycja 2", exit, - action { - if (mbs->mbrb_nametab[2][0] != 0 && part[2].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 2; defbootselpart = 2; - }; - option "Partycja 3", exit, - action { - if (mbs->mbrb_nametab[3][0] != 0 && part[3].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 3; defbootselpart = 3; - }; - option "Dysk twardy 0", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 4; defbootseldisk = 0; }; - option "Dysk twardy 1", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 5; defbootseldisk = 1; }; - option "Dysk twardy 2", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 6; defbootseldisk = 2; }; - option "Dysk twardy 3", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 7; defbootseldisk = 3; }; - option "Dysk twardy 4", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 8; defbootseldisk = 4; }; - option "Dysk twardy 5", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 9; defbootseldisk = 5; }; option "Pierwsza aktywna partycja", exit, action { mbs->mbrb_defkey = SCAN_ENTER; }; + option "Partycja 0", exit, + action { edit_bootsel_default_ptn(0); }; + option "Partycja 1", exit, + action { edit_bootsel_default_ptn(1); }; + option "Partycja 2", exit, + action { edit_bootsel_default_ptn(2); }; + option "Partycja 3", exit, + action { edit_bootsel_default_ptn(3); }; + option "Dysk twardy 0", exit, + action { edit_bootsel_default_disk(0); }; + option "Dysk twardy 1", exit, + action { edit_bootsel_default_disk(1); }; + option "Dysk twardy 2", exit, + action { edit_bootsel_default_disk(2); }; + option "Dysk twardy 3", exit, + action { edit_bootsel_default_disk(3); }; + option "Dysk twardy 4", exit, + action { edit_bootsel_default_disk(4); }; + option "Dysk twardy 5", exit, + action { edit_bootsel_default_disk(5); }; diff --git a/distrib/utils/sysinst/arch/amiga/menus.md.fr b/distrib/utils/sysinst/arch/amiga/menus.md.fr index fade09af318a..fcd7548cba93 100644 --- a/distrib/utils/sysinst/arch/amiga/menus.md.fr +++ b/distrib/utils/sysinst/arch/amiga/menus.md.fr @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.fr,v 1.7 2003/05/07 10:20:19 dsl Exp $ */ +/* $NetBSD: menus.md.fr,v 1.8 2003/05/07 19:02:54 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -97,25 +97,7 @@ menu editpart, title "Changement"; msg_printf_add ("\n"); }; option "du type de FS", sub menu chooseid; - option "du Début et de la taille", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "du Début et de la taille", action { edit_ptn_bounds(); }; option "Rendre la partition active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/arc/menus.md.en b/distrib/utils/sysinst/arch/arc/menus.md.en index 889a40c94fe4..0e75d0c93455 100644 --- a/distrib/utils/sysinst/arch/arc/menus.md.en +++ b/distrib/utils/sysinst/arch/arc/menus.md.en @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.en,v 1.4 2003/05/07 10:20:20 dsl Exp $ */ +/* $NetBSD: menus.md.en,v 1.5 2003/05/07 19:02:54 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -96,54 +96,7 @@ menu editpart, title "Select to change"; msg_display_add(MSG_newline); }; option "Kind", sub menu chooseid; - option "Start and size", action - { char buf[40]; int start, size, inp, partn; - - msg_table_add(MSG_mbrpart_start_special); - msg_prompt_add (MSG_start, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: start at end of part # given - * 0: start of disk. - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - start = part[partn].mbrp_start + - part[partn].mbrp_size; - } else if (inp == 0) - start = bsec; - else - start = NUMSEC(inp,sizemult,dlcylsize); - - if (sizemult > 1 && start < bsec) - start = bsec; - msg_table_add(MSG_mbrpart_size_special); - msg_prompt_add (MSG_size, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: until start of part # given - * 0: end of disk - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - size = part[partn].mbrp_start - start; - } else if (inp == 0) - size = dlsize - start; - else - size = NUMSEC(inp,sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Start and size", action { edit_ptn_bounds(); }; option "Set active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/arc/menus.md.fr b/distrib/utils/sysinst/arch/arc/menus.md.fr index c214af750628..78b3b34f6214 100644 --- a/distrib/utils/sysinst/arch/arc/menus.md.fr +++ b/distrib/utils/sysinst/arch/arc/menus.md.fr @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.fr,v 1.5 2003/05/07 10:20:20 dsl Exp $ */ +/* $NetBSD: menus.md.fr,v 1.6 2003/05/07 19:02:55 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -97,25 +97,7 @@ menu editpart, title "Changement"; msg_display_add(MSG_newline); }; option "du type de FS", sub menu chooseid; - option "du Début et de la taille", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "du Début et de la taille", action { edit_ptn_bounds(); }; option "Rendre la partition active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/arc/menus.md.pl b/distrib/utils/sysinst/arch/arc/menus.md.pl index 21cc8cc90b9c..8d16e23f7dcd 100644 --- a/distrib/utils/sysinst/arch/arc/menus.md.pl +++ b/distrib/utils/sysinst/arch/arc/menus.md.pl @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.pl,v 1.3 2003/05/07 10:20:20 dsl Exp $ */ +/* $NetBSD: menus.md.pl,v 1.4 2003/05/07 19:02:55 dsl Exp $ */ /* Based on english version: */ /* NetBSD: menus.md.en,v 1.2 2001/11/29 23:20:57 thorpej Exp */ @@ -98,54 +98,7 @@ menu editpart, title "Wybierz aby zmienic"; msg_display_add(MSG_newline); }; option "Rodzaj", sub menu chooseid; - option "Poczatek i rozmiar", action - { char buf[40]; int start, size, inp, partn; - - msg_table_add(MSG_mbrpart_start_special); - msg_prompt_add (MSG_start, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: start at end of part # given - * 0: start of disk. - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - start = part[partn].mbrp_start + - part[partn].mbrp_size; - } else if (inp == 0) - start = bsec; - else - start = NUMSEC(inp,sizemult,dlcylsize); - - if (sizemult > 1 && start < bsec) - start = bsec; - msg_table_add(MSG_mbrpart_size_special); - msg_prompt_add (MSG_size, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: until start of part # given - * 0: end of disk - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - size = part[partn].mbrp_start - start; - } else if (inp == 0) - size = dlsize - start; - else - size = NUMSEC(inp,sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Poczatek i rozmiar", action { edit_ptn_bounds(); }; option "Ustaw aktywna", action { activepart = editpart; }; option "Partycje OK", exit; diff --git a/distrib/utils/sysinst/arch/bebox/menus.md.en b/distrib/utils/sysinst/arch/bebox/menus.md.en index 0b72800dd1ac..b6d81ec3f01a 100644 --- a/distrib/utils/sysinst/arch/bebox/menus.md.en +++ b/distrib/utils/sysinst/arch/bebox/menus.md.en @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.en,v 1.16 2003/05/07 10:20:20 dsl Exp $ */ +/* $NetBSD: menus.md.en,v 1.17 2003/05/07 19:02:55 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -96,25 +96,7 @@ menu editpart, title "Select to change"; msg_display_add(MSG_newline); }; option "Kind", sub menu chooseid; - option "Start and size", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Start and size", action { edit_ptn_bounds(); }; option "Set active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/bebox/menus.md.fr b/distrib/utils/sysinst/arch/bebox/menus.md.fr index b143c2242b29..53fa7dd163f7 100644 --- a/distrib/utils/sysinst/arch/bebox/menus.md.fr +++ b/distrib/utils/sysinst/arch/bebox/menus.md.fr @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.fr,v 1.17 2003/05/07 10:20:20 dsl Exp $ */ +/* $NetBSD: menus.md.fr,v 1.18 2003/05/07 19:02:55 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -97,25 +97,7 @@ menu editpart, title "Changement"; msg_display_add(MSG_newline); }; option "du type de FS", sub menu chooseid; - option "du Début et de la taille", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "du Début et de la taille", action { edit_ptn_bounds(); }; option "Rendre la partition active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/bebox/menus.md.pl b/distrib/utils/sysinst/arch/bebox/menus.md.pl index c27b67ecd3e1..e9043c4c3507 100644 --- a/distrib/utils/sysinst/arch/bebox/menus.md.pl +++ b/distrib/utils/sysinst/arch/bebox/menus.md.pl @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.pl,v 1.3 2003/05/07 10:20:20 dsl Exp $ */ +/* $NetBSD: menus.md.pl,v 1.4 2003/05/07 19:02:55 dsl Exp $ */ /* Based on english version: */ /* NetBSD: menus.md.en,v 1.14 2001/11/29 23:20:57 thorpej Exp */ @@ -98,25 +98,7 @@ menu editpart, title "Wybierz aby zmienic"; msg_display_add(MSG_newline); }; option "Rodzaj", sub menu chooseid; - option "Poczatek i rozmiar", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Poczatek i rozmiar", action { edit_ptn_bounds(); }; option "Ustaw aktywna", action { activepart = editpart; }; option "Partycje OK", exit; diff --git a/distrib/utils/sysinst/arch/evbppc/menus.md.en b/distrib/utils/sysinst/arch/evbppc/menus.md.en index 27dc5add8cfd..d800baac5b0e 100644 --- a/distrib/utils/sysinst/arch/evbppc/menus.md.en +++ b/distrib/utils/sysinst/arch/evbppc/menus.md.en @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.en,v 1.2 2003/05/07 10:20:21 dsl Exp $ */ +/* $NetBSD: menus.md.en,v 1.3 2003/05/07 19:02:56 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -96,25 +96,7 @@ menu editpart, title "Select to change"; msg_display_add(MSG_newline); }; option "Kind", sub menu chooseid; - option "Start and size", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Start and size", action { edit_ptn_bounds(); }; option "Set active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/evbppc/menus.md.fr b/distrib/utils/sysinst/arch/evbppc/menus.md.fr index 85dee53e01db..a743a2bbe5e0 100644 --- a/distrib/utils/sysinst/arch/evbppc/menus.md.fr +++ b/distrib/utils/sysinst/arch/evbppc/menus.md.fr @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.fr,v 1.2 2003/05/07 10:20:21 dsl Exp $ */ +/* $NetBSD: menus.md.fr,v 1.3 2003/05/07 19:02:56 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -97,25 +97,7 @@ menu editpart, title "Changement"; msg_display_add(MSG_newline); }; option "du type de FS", sub menu chooseid; - option "du Début et de la taille", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "du Début et de la taille", action { edit_ptn_bounds(); }; option "Rendre la partition active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/evbppc/menus.md.pl b/distrib/utils/sysinst/arch/evbppc/menus.md.pl index fa075ed4ec08..3319f40adffb 100644 --- a/distrib/utils/sysinst/arch/evbppc/menus.md.pl +++ b/distrib/utils/sysinst/arch/evbppc/menus.md.pl @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.pl,v 1.2 2003/05/07 10:20:21 dsl Exp $ */ +/* $NetBSD: menus.md.pl,v 1.3 2003/05/07 19:02:56 dsl Exp $ */ /* Based on english version: */ /* NetBSD: menus.md.en,v 1.2 2001/11/29 23:21:01 thorpej Exp */ @@ -98,25 +98,7 @@ menu editpart, title "Wybierz aby zmienic"; msg_display_add(MSG_newline); }; option "Rodzaj", sub menu chooseid; - option "Poczatek i rozmiar", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Poczatek i rozmiar", action { edit_ptn_bounds(); }; option "Ustaw aktywna", action { activepart = editpart; }; option "Partycje OK", exit; diff --git a/distrib/utils/sysinst/arch/hp300/menus.md.fr b/distrib/utils/sysinst/arch/hp300/menus.md.fr index f16cb5439931..4fa0b2feaa4f 100644 --- a/distrib/utils/sysinst/arch/hp300/menus.md.fr +++ b/distrib/utils/sysinst/arch/hp300/menus.md.fr @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.fr,v 1.2 2003/05/07 10:20:21 dsl Exp $ */ +/* $NetBSD: menus.md.fr,v 1.3 2003/05/07 19:02:56 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -97,25 +97,7 @@ menu editpart, title "Changement"; msg_printf_add ("\n"); }; option "du type de FS", sub menu chooseid; - option "du Début et de la taille", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "du Début et de la taille", action { edit_ptn_bounds(); }; option "Rendre la partition active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/hpcmips/menus.md.en b/distrib/utils/sysinst/arch/hpcmips/menus.md.en index 573011a21fdb..9ac54d717b13 100644 --- a/distrib/utils/sysinst/arch/hpcmips/menus.md.en +++ b/distrib/utils/sysinst/arch/hpcmips/menus.md.en @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.en,v 1.11 2003/05/07 10:20:21 dsl Exp $ */ +/* $NetBSD: menus.md.en,v 1.12 2003/05/07 19:02:57 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -96,54 +96,7 @@ menu editpart, title "Select to change"; msg_display_add(MSG_newline); }; option "Kind", sub menu chooseid; - option "Start and size", action - { char buf[40]; int start, size, inp, partn; - - msg_table_add(MSG_mbrpart_start_special); - msg_prompt_add (MSG_start, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: start at end of part # given - * 0: start of disk. - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - start = part[partn].mbrp_start + - part[partn].mbrp_size; - } else if (inp == 0) - start = bsec; - else - start = NUMSEC(inp,sizemult,dlcylsize); - - if (sizemult > 1 && start < bsec) - start = bsec; - msg_table_add(MSG_mbrpart_size_special); - msg_prompt_add (MSG_size, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: until start of part # given - * 0: end of disk - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - size = part[partn].mbrp_start - start; - } else if (inp == 0) - size = dlsize - start; - else - size = NUMSEC(inp,sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Start and size", action { edit_ptn_bounds(); }; option "Set active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/hpcmips/menus.md.fr b/distrib/utils/sysinst/arch/hpcmips/menus.md.fr index 42911156281e..ff86c4d9a0aa 100644 --- a/distrib/utils/sysinst/arch/hpcmips/menus.md.fr +++ b/distrib/utils/sysinst/arch/hpcmips/menus.md.fr @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.fr,v 1.11 2003/05/07 10:20:22 dsl Exp $ */ +/* $NetBSD: menus.md.fr,v 1.12 2003/05/07 19:02:57 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -97,25 +97,7 @@ menu editpart, title "Changement"; msg_display_add(MSG_newline); }; option "du type de FS", sub menu chooseid; - option "du Début et de la taille", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "du Début et de la taille", action { edit_ptn_bounds(); }; option "Rendre la partition active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/hpcmips/menus.md.pl b/distrib/utils/sysinst/arch/hpcmips/menus.md.pl index 351149cabf73..d8a2cc0f0a46 100644 --- a/distrib/utils/sysinst/arch/hpcmips/menus.md.pl +++ b/distrib/utils/sysinst/arch/hpcmips/menus.md.pl @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.pl,v 1.4 2003/05/07 10:20:22 dsl Exp $ */ +/* $NetBSD: menus.md.pl,v 1.5 2003/05/07 19:02:57 dsl Exp $ */ /* Based on english version: */ /* NetBSD: menus.md.en,v 1.8 2002/03/23 03:24:34 shin Exp */ @@ -98,54 +98,7 @@ menu editpart, title "Wybierz aby zmienic"; msg_display_add(MSG_newline); }; option "Rodzaj", sub menu chooseid; - option "Poczatek i rozmiar", action - { char buf[40]; int start, size, inp, partn; - - msg_table_add(MSG_mbrpart_start_special); - msg_prompt_add (MSG_start, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: start at end of part # given - * 0: start of disk. - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - start = part[partn].mbrp_start + - part[partn].mbrp_size; - } else if (inp == 0) - start = bsec; - else - start = NUMSEC(inp,sizemult,dlcylsize); - - if (sizemult > 1 && start < bsec) - start = bsec; - msg_table_add(MSG_mbrpart_size_special); - msg_prompt_add (MSG_size, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: until start of part # given - * 0: end of disk - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - size = part[partn].mbrp_start - start; - } else if (inp == 0) - size = dlsize - start; - else - size = NUMSEC(inp,sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Poczatek i rozmiar", action { edit_ptn_bounds(); }; option "Ustaw aktywna", action { activepart = editpart; }; option "Partycje OK", exit; diff --git a/distrib/utils/sysinst/arch/i386/md.c b/distrib/utils/sysinst/arch/i386/md.c index 9697de4d0d90..e1aca5c34798 100644 --- a/distrib/utils/sysinst/arch/i386/md.c +++ b/distrib/utils/sysinst/arch/i386/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.74 2003/05/07 11:36:10 dsl Exp $ */ +/* $NetBSD: md.c,v 1.75 2003/05/07 19:02:57 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -85,7 +85,7 @@ md_get_info(void) { read_mbr(diskdev, &mbr, sizeof mbr); if (!valid_mbr(&mbr)) { - memset(&mbr.mbr_parts, 0, sizeof mbr.mbr_parts); + memset(&mbr, 0, sizeof mbr); /* XXX check result and give up if < 0 */ mbr_len = md_read_bootcode(_PATH_MBR, &mbr); netbsd_mbr_installed = 1; @@ -630,7 +630,7 @@ configure_bootsel(void) for (i = 0; i < NMBRPART; i++) { if (parts[i].mbrp_typ != 0 && mbs->mbrb_nametab[i][0] == '\0') snprintf(mbs->mbrb_nametab[i], sizeof(mbs->mbrb_nametab[0]), - "entry %d", i+1); + "entry %d", i); } process_menu(MENU_configbootsel); @@ -644,20 +644,6 @@ configure_bootsel(void) } } -void -/*ARGSUSED*/ -disp_bootsel(mbr_partition_t *part, mbr_bootsel_t *mbsp) -{ - int i; - - msg_table_add(MSG_bootsel_header); - for (i = 0; i < 4; i++) { - msg_table_add(MSG_bootsel_row, - i, get_partname(i), mbs->mbrb_nametab[i]); - } - msg_display_add(MSG_newline); -} - char * get_bootmodel(void) { diff --git a/distrib/utils/sysinst/arch/i386/md.h b/distrib/utils/sysinst/arch/i386/md.h index 4b3c920e46b1..ecaa9dc690c4 100644 --- a/distrib/utils/sysinst/arch/i386/md.h +++ b/distrib/utils/sysinst/arch/i386/md.h @@ -1,4 +1,4 @@ -/* $NetBSD: md.h,v 1.36 2003/05/07 10:20:22 dsl Exp $ */ +/* $NetBSD: md.h,v 1.37 2003/05/07 19:02:58 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -152,8 +152,6 @@ extern struct mbr_bootsel *mbs; extern int defbootselpart, defbootseldisk; -void disp_bootsel (struct mbr_partition *, struct mbr_bootsel *); - /* * prototypes for MD code. */ diff --git a/distrib/utils/sysinst/arch/i386/menus.md.en b/distrib/utils/sysinst/arch/i386/menus.md.en index 7b76b0bb4914..53a2bc557a81 100644 --- a/distrib/utils/sysinst/arch/i386/menus.md.en +++ b/distrib/utils/sysinst/arch/i386/menus.md.en @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.en,v 1.42 2003/05/07 10:20:22 dsl Exp $ */ +/* $NetBSD: menus.md.en,v 1.43 2003/05/07 19:02:58 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -89,7 +89,7 @@ menu dlgeom, title "Choose an option"; menu editparttable, title "Choose your partition", exit; display action { msg_display (MSG_editparttable); - disp_cur_part(&mbr.mbr_parts[0], activepart,-1); + disp_cur_part(&mbr.mbr_parts[0], activepart, -1); }; option "Edit partition 0", sub menu editpart, action { editpart = 0; }; @@ -104,73 +104,26 @@ menu editparttable, title "Choose your partition", exit; menu editpart, title "Select to change"; display action { msg_display (MSG_editpart, editpart); - disp_cur_part(&mbr.mbr_parts[0], editpart,-1); + disp_cur_part(&mbr.mbr_parts[0], editpart, -1); msg_display_add(MSG_newline); }; option "Kind", sub menu chooseid; - option "Start and size", action - { char buf[40]; int start, size, inp, partn; - - msg_table_add(MSG_mbrpart_start_special); - msg_prompt_add (MSG_start, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: start at end of part # given - * 0: start of disk. - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - start = part[partn].mbrp_start + - part[partn].mbrp_size; - } else if (inp == 0) - start = bsec; - else - start = NUMSEC(inp,sizemult,dlcylsize); - - if (sizemult > 1 && start < bsec) - start = bsec; - msg_table_add(MSG_mbrpart_size_special); - msg_prompt_add (MSG_size, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: until start of part # given - * 0: end of disk - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - size = part[partn].mbrp_start - start; - } else if (inp == 0) - size = dlsize - start; - else - size = NUMSEC(inp,sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Start and size", action { edit_ptn_bounds(); }; option "Set active", action { activepart = editpart; }; option "Partition OK", exit; menu chooseid, title "Partition Kind?"; option "NetBSD", exit, action { - part[editpart].mbrp_typ = 169; + part[editpart].mbrp_typ = MBR_PTYPE_NETBSD; }; option "DOS < 32 Meg", exit, action { - part[editpart].mbrp_typ = 4; + part[editpart].mbrp_typ = MBR_PTYPE_FAT16S; }; option "DOS > 32 Meg", exit, action { - part[editpart].mbrp_typ = 6; + part[editpart].mbrp_typ = MBR_PTYPE_FAT16B; }; option "unused", exit, action { @@ -291,92 +244,40 @@ menu biosmultmatch; biosdisk = NULL; }; -menu configbootsel, y=16, title "Change a bootmenu item", exit; - display action { msg_display(MSG_configbootsel); - disp_bootsel(&mbr.mbr_parts[0], mbs); - msg_display_add(MSG_bootseltimeout, (10 * mbs->mbrb_timeo + 9) / 182); - msg_display_add(MSG_defbootselopt); - if (mbs->mbrb_defkey == SCAN_ENTER) - msg_display_add(MSG_defbootseloptactive); - else if (mbs->mbrb_defkey < (SCAN_F1 + 4)) - msg_display_add(MSG_defbootseloptpart, - defbootselpart); - else - msg_display_add(MSG_defbootseloptdisk, - defbootseldisk); - }; +menu configbootsel, y=16, title "Change a bootmenu item", exit + display action { disp_bootsel(); }; option "Edit menu entry 0", - action { - if (part[0].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[0], - mbs->mbrb_nametab[0], 8); - }; + action { edit_bootsel_entry(0); }; option "Edit menu entry 1", - action { - if (part[1].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[1], - mbs->mbrb_nametab[1], 8); - }; + action { edit_bootsel_entry(1); }; option "Edit menu entry 2", - action { - if (part[2].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[2], - mbs->mbrb_nametab[2], 8); - }; + action { edit_bootsel_entry(2); }; option "Edit menu entry 3", - action { - if (part[3].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[3], - mbs->mbrb_nametab[3], 8); - }; + action { edit_bootsel_entry(3); }; option "Set timeout value", - action { - char tstr[8]; - unsigned timo; - - do { - snprintf(tstr, 8, "%u", - (10 * mbs->mbrb_timeo + 9) / 182); - msg_prompt(MSG_bootseltimeoutval, tstr, tstr, - 8); - timo = (unsigned)atoi(tstr); - } while (timo > 3600); - mbs->mbrb_timeo = (u_int16_t)((timo * 182) / 10); - }; + action { edit_bootsel_timeout(); }; option "Set default option", sub menu defaultbootsel; menu defaultbootsel, title "Pick a default partition/disk to boot"; - option "Partition 0", exit, - action { - if (mbs->mbrb_nametab[0][0] != 0 && part[0].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1; defbootselpart = 0; - }; - option "Partition 1", exit, - action { - if (mbs->mbrb_nametab[1][0] != 0 && part[1].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 1; defbootselpart = 1; - }; - option "Partition 2", exit, - action { - if (mbs->mbrb_nametab[2][0] != 0 && part[2].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 2; defbootselpart = 2; - }; - option "Partition 3", exit, - action { - if (mbs->mbrb_nametab[3][0] != 0 && part[3].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 3; defbootselpart = 3; - }; - option "Harddisk 0", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 4; defbootseldisk = 0; }; - option "Harddisk 1", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 5; defbootseldisk = 1; }; - option "Harddisk 2", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 6; defbootseldisk = 2; }; - option "Harddisk 3", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 7; defbootseldisk = 3; }; - option "Harddisk 4", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 8; defbootseldisk = 4; }; - option "Harddisk 5", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 9; defbootseldisk = 5; }; option "First active partition", exit, action { mbs->mbrb_defkey = SCAN_ENTER; }; + option "Partition 0", exit, + action { edit_bootsel_default_ptn(0); }; + option "Partition 1", exit, + action { edit_bootsel_default_ptn(1); }; + option "Partition 2", exit, + action { edit_bootsel_default_ptn(2); }; + option "Partition 3", exit, + action { edit_bootsel_default_ptn(3); }; + option "Harddisk 0", exit, + action { edit_bootsel_default_disk(0); }; + option "Harddisk 1", exit, + action { edit_bootsel_default_disk(1); }; + option "Harddisk 2", exit, + action { edit_bootsel_default_disk(2); }; + option "Harddisk 3", exit, + action { edit_bootsel_default_disk(3); }; + option "Harddisk 4", exit, + action { edit_bootsel_default_disk(4); }; + option "Harddisk 5", exit, + action { edit_bootsel_default_disk(5); }; diff --git a/distrib/utils/sysinst/arch/i386/menus.md.fr b/distrib/utils/sysinst/arch/i386/menus.md.fr index c238e0df1eac..74114f4d6410 100644 --- a/distrib/utils/sysinst/arch/i386/menus.md.fr +++ b/distrib/utils/sysinst/arch/i386/menus.md.fr @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.fr,v 1.36 2003/05/07 10:20:22 dsl Exp $ */ +/* $NetBSD: menus.md.fr,v 1.37 2003/05/07 19:02:58 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -52,7 +52,7 @@ menu getboottype, title "S menu fullpart, y=15, title "Faite votre choix"; option "Utilisation d'une partie du disque", exit, action {usefull = 0;}; - option "Utilisation de tout le disque", exit, action {usefull = 1;}; + option "Utilisation de tout le disque", exit, action {usefull = 1;}; menu wdtype, title "Choix du type de disque"; display action { msg_display (MSG_wdtype, diskdev); }; @@ -87,10 +87,9 @@ menu dlgeom, title "Choisissez une option"; disk->dd_sec = dlsec; }; - menu editparttable, title "Choisissez votre partition", exit; display action { msg_display (MSG_editparttable); - disp_cur_part(&mbr.mbr_parts[0], activepart,-1); + disp_cur_part(&mbr.mbr_parts[0], activepart, -1); }; option "Edition de la partition 0", sub menu editpart, action { editpart = 0; }; @@ -105,44 +104,26 @@ menu editparttable, title "Choisissez votre partition", exit; menu editpart, title "Changement"; display action { msg_display (MSG_editpart, editpart); - disp_cur_part(&mbr.mbr_parts[0], activepart,editpart); + disp_cur_part(&mbr.mbr_parts[0], editpart, -1); msg_display_add(MSG_newline); }; option "du type de FS", sub menu chooseid; - option "du Début et de la taille", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "du Début et de la taille", action { edit_ptn_bounds(); }; option "Rendre la partition active", action { activepart = editpart; }; option "Partition OK", exit; menu chooseid, title "Type de Partition?"; option "NetBSD", exit, action { - part[editpart].mbrp_typ = 169; + part[editpart].mbrp_typ = MBR_PTYPE_NETBSD; }; option "DOS < 32 Meg", exit, action { - part[editpart].mbrp_typ = 4; + part[editpart].mbrp_typ = MBR_PTYPE_FAT16S; }; option "DOS > 32 Meg", exit, action { - part[editpart].mbrp_typ = 6; + part[editpart].mbrp_typ = MBR_PTYPE_FAT16B; }; option "inutilis'e", exit, action { @@ -161,7 +142,7 @@ menu cyl1024; c1024_resp = 1; }; - option "Rééditer le label", exit, action + option "Rééditer le label", exit, action { extern int c1024_resp; @@ -264,91 +245,39 @@ menu biosmultmatch; }; menu configbootsel, title "Changer une entree du menu", exit; - display action { msg_display(MSG_configbootsel); - disp_bootsel(&mbr.mbr_parts[0], mbs); - msg_display_add(MSG_bootseltimeout, (10 * mbs->mbrb_timeo + 9) / 182); - msg_display_add(MSG_defbootselopt); - if (mbs->mbrb_defkey == SCAN_ENTER) - msg_display_add(MSG_defbootseloptactive); - else if (mbs->mbrb_defkey < (SCAN_F1 + 4)) - msg_display_add(MSG_defbootseloptpart, - defbootselpart); - else - msg_display_add(MSG_defbootseloptdisk, - defbootseldisk); - }; + display action { disp_bootsel(); }; option "Changer l'entrée 0 du menu", - action { - if (part[0].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[0], - mbs->mbrb_nametab[0], 8); - }; + action { edit_bootsel_entry(0); }; option "Changer l'entrée 1 du menu", - action { - if (part[1].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[1], - mbs->mbrb_nametab[1], 8); - }; + action { edit_bootsel_entry(1); }; option "Changer l'entrée 2 du menu", - action { - if (part[2].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[2], - mbs->mbrb_nametab[2], 8); - }; + action { edit_bootsel_entry(2); }; option "Changer l'entrée 3 du menu", - action { - if (part[3].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[3], - mbs->mbrb_nametab[3], 8); - }; + action { edit_bootsel_entry(3); }; option "Changer le temps d'attente", - action { - char tstr[8]; - unsigned timo; - - do { - snprintf(tstr, 8, "%u", - (10 * mbs->mbrb_timeo + 9) / 182); - msg_prompt(MSG_bootseltimeoutval, tstr, tstr, - 8); - timo = (unsigned)atoi(tstr); - } while (timo > 3600); - mbs->mbrb_timeo = (u_int16_t)((timo * 182) / 10); - }; + action { edit_bootsel_timeout(); }; option "Changer le choix par defaut", sub menu defaultbootsel; menu defaultbootsel, title "Choisissez un disque ou partition"; - option "Partition 0", exit, - action { - if (mbs->mbrb_nametab[0][0] != 0 && part[0].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1; defbootselpart = 0; - }; - option "Partition 1", exit, - action { - if (mbs->mbrb_nametab[1][0] != 0 && part[1].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 1; defbootselpart = 1; - }; - option "Partition 2", exit, - action { - if (mbs->mbrb_nametab[2][0] != 0 && part[2].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 2; defbootselpart = 2; - }; - option "Partition 3", exit, - action { - if (mbs->mbrb_nametab[3][0] != 0 && part[3].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 3; defbootselpart = 3; - }; - option "Disque dur 0", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 4; defbootseldisk = 0; }; - option "Disque dur 1", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 5; defbootseldisk = 1; }; - option "Disque dur 2", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 6; defbootseldisk = 2; }; - option "Disque dur 3", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 7; defbootseldisk = 3; }; - option "Disque dur 4", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 8; defbootseldisk = 4; }; - option "Disque dur 5", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 9; defbootseldisk = 5; }; option "Première partition active", exit, action { mbs->mbrb_defkey = SCAN_ENTER; }; + option "Partition 0", exit, + action { edit_bootsel_default_ptn(0); }; + option "Partition 1", exit, + action { edit_bootsel_default_ptn(1); }; + option "Partition 2", exit, + action { edit_bootsel_default_ptn(2); }; + option "Partition 3", exit, + action { edit_bootsel_default_ptn(3); }; + option "Disque dur 0", exit, + action { edit_bootsel_default_disk(0); }; + option "Disque dur 1", exit, + action { edit_bootsel_default_disk(1); }; + option "Disque dur 2", exit, + action { edit_bootsel_default_disk(2); }; + option "Disque dur 3", exit, + action { edit_bootsel_default_disk(3); }; + option "Disque dur 4", exit, + action { edit_bootsel_default_disk(4); }; + option "Disque dur 5", exit, + action { edit_bootsel_default_disk(5); }; diff --git a/distrib/utils/sysinst/arch/i386/menus.md.pl b/distrib/utils/sysinst/arch/i386/menus.md.pl index 214846f9b5e1..31fa549df42f 100644 --- a/distrib/utils/sysinst/arch/i386/menus.md.pl +++ b/distrib/utils/sysinst/arch/i386/menus.md.pl @@ -1,6 +1,4 @@ -/* $NetBSD: menus.md.pl,v 1.7 2003/05/07 10:20:23 dsl Exp $ */ -/* Based on english version: */ -/* NetBSD: menus.md.en,v 1.36 2001/11/29 23:20:58 thorpej Exp */ +/* $NetBSD: menus.md.pl,v 1.8 2003/05/07 19:02:58 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -54,7 +52,7 @@ menu getboottype, title "Wybor bootblokow"; menu fullpart, title "Wybierz"; option "Uzyj tylko czesci dysku", exit, action {usefull = 0;}; - option "Uzyj calego dysku", exit, action {usefull = 1;}; + option "Uzyj calego dysku", exit, action {usefull = 1;}; menu wdtype, title "Wybierz typ"; display action { msg_display (MSG_wdtype, diskdev); }; @@ -91,7 +89,7 @@ menu dlgeom, title "Wybierz opcje"; menu editparttable, title "Wybierz swoje partycje", exit; display action { msg_display (MSG_editparttable); - disp_cur_part(&mbr.mbr_parts[0], activepart,-1); + disp_cur_part(&mbr.mbr_parts[0], activepart, -1); }; option "Edytuj partycje 0", sub menu editpart, action { editpart = 0; }; @@ -106,78 +104,32 @@ menu editparttable, title "Wybierz swoje partycje", exit; menu editpart, title "Wybierz aby zmienic"; display action { msg_display (MSG_editpart, editpart); - disp_cur_part(&mbr.mbr_parts[0], editpart,-1); + disp_cur_part(&mbr.mbr_parts[0], editpart, -1); msg_display_add(MSG_newline); }; option "Rodzaj", sub menu chooseid; - option "Poczatek i rozmiar", action - { char buf[40]; int start, size, inp, partn; - - msg_table_add(MSG_mbrpart_start_special); - msg_prompt_add (MSG_start, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: start at end of part # given - * 0: start of disk. - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - start = part[partn].mbrp_start + - part[partn].mbrp_size; - } else if (inp == 0) - start = bsec; - else - start = NUMSEC(inp,sizemult,dlcylsize); - - if (sizemult > 1 && start < bsec) - start = bsec; - msg_table_add(MSG_mbrpart_size_special); - msg_prompt_add (MSG_size, NULL, buf, 40); - inp = atoi(buf); - /* - * -0, -1, -2, -3: until start of part # given - * 0: end of disk - */ - if ((inp == 0 && buf[0] == '-') || - (inp < 0 && inp >= -3)) { - partn = -inp; - size = part[partn].mbrp_start - start; - } else if (inp == 0) - size = dlsize - start; - else - size = NUMSEC(inp,sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Poczatek i rozmiar", action { edit_ptn_bounds(); }; option "Ustaw aktywna", action { activepart = editpart; }; option "Partycje OK", exit; menu chooseid, title "Rodzaj partycji?"; option "NetBSD", exit, action { - part[editpart].mbrp_typ = 169; + part[editpart].mbrp_typ = MBR_PTYPE_NETBSD; }; option "DOS < 32 Meg", exit, action { - part[editpart].mbrp_typ = 4; + part[editpart].mbrp_typ = MBR_PTYPE_FAT16S; }; option "DOS > 32 Meg", exit, action { - part[editpart].mbrp_typ = 6; + part[editpart].mbrp_typ = MBR_PTYPE_FAT16B; }; option "nie uzywana", exit, action { part[editpart].mbrp_typ = 0; }; + option "nie zmienia", exit; menu cyl1024; display action { @@ -293,91 +245,39 @@ menu biosmultmatch; }; menu configbootsel, y=16, title "Zmien bootmenu", exit; - display action { msg_display(MSG_configbootsel); - disp_bootsel(&mbr.mbr_parts[0], mbs); - msg_display_add(MSG_bootseltimeout, (10 * mbs->mbrb_timeo + 9) / 182); - msg_display_add(MSG_defbootselopt); - if (mbs->mbrb_defkey == SCAN_ENTER) - msg_display_add(MSG_defbootseloptactive); - else if (mbs->mbrb_defkey < (SCAN_F1 + 4)) - msg_display_add(MSG_defbootseloptpart, - defbootselpart); - else - msg_display_add(MSG_defbootseloptdisk, - defbootseldisk); - }; + display action { disp_bootsel(); }; option "Edytuj wpis 0", - action { - if (part[0].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[0], - mbs->mbrb_nametab[0], 8); - }; + action { edit_bootsel_entry(0); }; option "Edytuj wpis 1", - action { - if (part[1].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[1], - mbs->mbrb_nametab[1], 8); - }; + action { edit_bootsel_entry(1); }; option "Edytuj wpis 2", - action { - if (part[2].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[2], - mbs->mbrb_nametab[2], 8); - }; + action { edit_bootsel_entry(2); }; option "Edytuj wpis 3", - action { - if (part[3].mbrp_typ != 0) - msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[3], - mbs->mbrb_nametab[3], 8); - }; + action { edit_bootsel_entry(3); }; option "Ustaw opoznienie", - action { - char tstr[8]; - unsigned timo; - - do { - snprintf(tstr, 8, "%u", - (10 * mbs->mbrb_timeo + 9) / 182); - msg_prompt(MSG_bootseltimeoutval, tstr, tstr, - 8); - timo = (unsigned)atoi(tstr); - } while (timo > 3600); - mbs->mbrb_timeo = (u_int16_t)((timo * 182) / 10); - }; + action { edit_bootsel_timeout(); }; option "Ustaw domyslna opcje", sub menu defaultbootsel; menu defaultbootsel, title "Wybierz domyslna partycje/dysk do uruchomiania"; - option "Partycja 0", exit, - action { - if (mbs->mbrb_nametab[0][0] != 0 && part[0].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1; defbootselpart = 0; - }; - option "Partycja 1", exit, - action { - if (mbs->mbrb_nametab[1][0] != 0 && part[1].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 1; defbootselpart = 1; - }; - option "Partycja 2", exit, - action { - if (mbs->mbrb_nametab[2][0] != 0 && part[2].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 2; defbootselpart = 2; - }; - option "Partycja 3", exit, - action { - if (mbs->mbrb_nametab[3][0] != 0 && part[3].mbrp_typ != 0) - mbs->mbrb_defkey = SCAN_F1 + 3; defbootselpart = 3; - }; - option "Dysk twardy 0", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 4; defbootseldisk = 0; }; - option "Dysk twardy 1", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 5; defbootseldisk = 1; }; - option "Dysk twardy 2", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 6; defbootseldisk = 2; }; - option "Dysk twardy 3", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 7; defbootseldisk = 3; }; - option "Dysk twardy 4", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 8; defbootseldisk = 4; }; - option "Dysk twardy 5", exit, - action { mbs->mbrb_defkey = SCAN_F1 + 9; defbootseldisk = 5; }; option "Pierwsza aktywna partycja", exit, action { mbs->mbrb_defkey = SCAN_ENTER; }; + option "Partycja 0", exit, + action { edit_bootsel_default_ptn(0); }; + option "Partycja 1", exit, + action { edit_bootsel_default_ptn(1); }; + option "Partycja 2", exit, + action { edit_bootsel_default_ptn(2); }; + option "Partycja 3", exit, + action { edit_bootsel_default_ptn(3); }; + option "Dysk twardy 0", exit, + action { edit_bootsel_default_disk(0); }; + option "Dysk twardy 1", exit, + action { edit_bootsel_default_disk(1); }; + option "Dysk twardy 2", exit, + action { edit_bootsel_default_disk(2); }; + option "Dysk twardy 3", exit, + action { edit_bootsel_default_disk(3); }; + option "Dysk twardy 4", exit, + action { edit_bootsel_default_disk(4); }; + option "Dysk twardy 5", exit, + action { edit_bootsel_default_disk(5); }; diff --git a/distrib/utils/sysinst/arch/mvme68k/menus.md.fr b/distrib/utils/sysinst/arch/mvme68k/menus.md.fr index 0f9b3908b1a9..91845d697c2e 100644 --- a/distrib/utils/sysinst/arch/mvme68k/menus.md.fr +++ b/distrib/utils/sysinst/arch/mvme68k/menus.md.fr @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.fr,v 1.2 2003/05/07 10:20:23 dsl Exp $ */ +/* $NetBSD: menus.md.fr,v 1.3 2003/05/07 19:02:59 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -97,25 +97,7 @@ menu editpart, title "Changement"; msg_printf_add ("\n"); }; option "du type de FS", sub menu chooseid; - option "du Début et de la taille", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "du Début et de la taille", action { edit_ptn_bounds(); }; option "Rendre la partition active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/playstation2/menus.md.en b/distrib/utils/sysinst/arch/playstation2/menus.md.en index 376d8c0208ee..032172f6a862 100644 --- a/distrib/utils/sysinst/arch/playstation2/menus.md.en +++ b/distrib/utils/sysinst/arch/playstation2/menus.md.en @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.en,v 1.6 2003/05/07 10:20:23 dsl Exp $ */ +/* $NetBSD: menus.md.en,v 1.7 2003/05/07 19:02:59 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -96,25 +96,7 @@ menu editpart, title "Select to change"; msg_display_add(MSG_newline); }; option "Kind", sub menu chooseid; - option "Start and size", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Start and size", action { edit_ptn_bounds(); }; option "Set active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/playstation2/menus.md.fr b/distrib/utils/sysinst/arch/playstation2/menus.md.fr index e8664fec6a85..3009a9e6a5b8 100644 --- a/distrib/utils/sysinst/arch/playstation2/menus.md.fr +++ b/distrib/utils/sysinst/arch/playstation2/menus.md.fr @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.fr,v 1.7 2003/05/07 10:20:24 dsl Exp $ */ +/* $NetBSD: menus.md.fr,v 1.8 2003/05/07 19:02:59 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -97,25 +97,7 @@ menu editpart, title "Changement"; msg_display_add(MSG_newline); }; option "du type de FS", sub menu chooseid; - option "du Début et de la taille", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "du Début et de la taille", action { edit_ptn_bounds(); }; option "Rendre la partition active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/playstation2/menus.md.pl b/distrib/utils/sysinst/arch/playstation2/menus.md.pl index 287a150848d3..0f318879c789 100644 --- a/distrib/utils/sysinst/arch/playstation2/menus.md.pl +++ b/distrib/utils/sysinst/arch/playstation2/menus.md.pl @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.pl,v 1.5 2003/05/07 10:20:24 dsl Exp $ */ +/* $NetBSD: menus.md.pl,v 1.6 2003/05/07 19:02:59 dsl Exp $ */ /* Based on english version: */ /* NetBSD: menus.md.en,v 1.2 2001/11/29 23:21:00 thorpej Exp */ @@ -98,25 +98,7 @@ menu editpart, title "Wybierz aby zmienic"; msg_display_add(MSG_newline); }; option "Rodzaj", sub menu chooseid; - option "Poczatek i rozmiar", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Poczatek i rozmiar", action { edit_ptn_bounds(); }; option "Ustaw aktywna", action { activepart = editpart; }; option "Partycje OK", exit; diff --git a/distrib/utils/sysinst/arch/prep/menus.md.en b/distrib/utils/sysinst/arch/prep/menus.md.en index d493a1d231f6..6a7911d0d1c3 100644 --- a/distrib/utils/sysinst/arch/prep/menus.md.en +++ b/distrib/utils/sysinst/arch/prep/menus.md.en @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.en,v 1.4 2003/05/07 10:20:24 dsl Exp $ */ +/* $NetBSD: menus.md.en,v 1.5 2003/05/07 19:02:59 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -80,25 +80,7 @@ menu editpart, title "Select to change"; msg_display_add(MSG_newline); }; option "Kind", sub menu chooseid; - option "Start and size", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Start and size", action { edit_ptn_bounds(); }; option "Set active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/prep/menus.md.pl b/distrib/utils/sysinst/arch/prep/menus.md.pl index 78ca0f290375..e5840ed06256 100644 --- a/distrib/utils/sysinst/arch/prep/menus.md.pl +++ b/distrib/utils/sysinst/arch/prep/menus.md.pl @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.pl,v 1.3 2003/05/07 10:20:24 dsl Exp $ */ +/* $NetBSD: menus.md.pl,v 1.4 2003/05/07 19:03:00 dsl Exp $ */ /* Based on english version: */ /* NetBSD: menus.md.en,v 1.2 2001/11/29 23:21:01 thorpej Exp */ @@ -81,25 +81,7 @@ menu editpart, title "Wybierz aby zmienic"; msg_display_add(MSG_newline); }; option "Rodzaj", sub menu chooseid; - option "Poczatek i rozmiar", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Poczatek i rozmiar", action { edit_ptn_bounds(); }; option "Ustaw aktywna", action { activepart = editpart; }; option "Partycje OK", exit; diff --git a/distrib/utils/sysinst/arch/sandpoint/menus.md.en b/distrib/utils/sysinst/arch/sandpoint/menus.md.en index 34e49e331687..17d4dc568f2a 100644 --- a/distrib/utils/sysinst/arch/sandpoint/menus.md.en +++ b/distrib/utils/sysinst/arch/sandpoint/menus.md.en @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.en,v 1.4 2003/05/07 10:20:25 dsl Exp $ */ +/* $NetBSD: menus.md.en,v 1.5 2003/05/07 19:03:00 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -96,25 +96,7 @@ menu editpart, title "Select to change"; msg_display_add(MSG_newline); }; option "Kind", sub menu chooseid; - option "Start and size", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Start and size", action { edit_ptn_bounds(); }; option "Set active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/sandpoint/menus.md.fr b/distrib/utils/sysinst/arch/sandpoint/menus.md.fr index 37d681bc5ca1..15c29e0291dd 100644 --- a/distrib/utils/sysinst/arch/sandpoint/menus.md.fr +++ b/distrib/utils/sysinst/arch/sandpoint/menus.md.fr @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.fr,v 1.5 2003/05/07 10:20:25 dsl Exp $ */ +/* $NetBSD: menus.md.fr,v 1.6 2003/05/07 19:03:00 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -97,25 +97,7 @@ menu editpart, title "Changement"; msg_display_add(MSG_newline); }; option "du type de FS", sub menu chooseid; - option "du Début et de la taille", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "du Début et de la taille", action { edit_ptn_bounds(); }; option "Rendre la partition active", action { activepart = editpart; }; option "Partition OK", exit; diff --git a/distrib/utils/sysinst/arch/sandpoint/menus.md.pl b/distrib/utils/sysinst/arch/sandpoint/menus.md.pl index b5e1e645aa50..4aee379d666a 100644 --- a/distrib/utils/sysinst/arch/sandpoint/menus.md.pl +++ b/distrib/utils/sysinst/arch/sandpoint/menus.md.pl @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.pl,v 1.3 2003/05/07 10:20:25 dsl Exp $ */ +/* $NetBSD: menus.md.pl,v 1.4 2003/05/07 19:03:00 dsl Exp $ */ /* Based on english version: */ /* NetBSD: menus.md.en,v 1.2 2001/11/29 23:21:01 thorpej Exp */ @@ -98,25 +98,7 @@ menu editpart, title "Wybierz aby zmienic"; msg_display_add(MSG_newline); }; option "Rodzaj", sub menu chooseid; - option "Poczatek i rozmiar", action - { char buf[40]; int start, size; - msg_prompt_add (MSG_start, NULL, buf, 40); - start = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start < bsec) - start = bsec; - msg_prompt_add (MSG_size, NULL, buf, 40); - size = NUMSEC(atoi(buf),sizemult,dlcylsize); - if (sizemult > 1 && start == bsec) - size -= bsec; - if (start + size > bsize) - size = bsize - start; - if (size < 0) { - size = 0; - start = 0; - } - part[editpart].mbrp_start = start; - part[editpart].mbrp_size = size; - }; + option "Poczatek i rozmiar", action { edit_ptn_bounds(); }; option "Ustaw aktywna", action { activepart = editpart; }; option "Partycje OK", exit; diff --git a/distrib/utils/sysinst/mbr.c b/distrib/utils/sysinst/mbr.c index 6822a265c4d0..7f5b8e38bafd 100644 --- a/distrib/utils/sysinst/mbr.c +++ b/distrib/utils/sysinst/mbr.c @@ -1,4 +1,4 @@ -/* $NetBSD: mbr.c,v 1.32 2003/05/07 10:20:18 dsl Exp $ */ +/* $NetBSD: mbr.c,v 1.33 2003/05/07 19:02:52 dsl Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -242,7 +242,7 @@ edit_mbr(mbr) ask_sizemult(bcylsize); bsdpart = freebsdpart = -1; activepart = -1; - for (i = 0; i<4; i++) + for (i = 0; i < NMBRPART; i++) if (part[i].mbrp_flag != 0) { activepart = i; part[i].mbrp_flag = 0; @@ -255,7 +255,7 @@ edit_mbr(mbr) numfreebsd = 0; overlap = 0; yesno = 0; - for (i=0; i<4; i++) { + for (i=0; i < NMBRPART; i++) { /* Count 386bsd/FreeBSD/NetBSD(old) partitions */ if (part[i].mbrp_typ == MBR_PTYPE_386BSD) { freebsdpart = i; @@ -263,11 +263,12 @@ edit_mbr(mbr) } /* Count NetBSD-only partitions */ if (part[i].mbrp_typ == MBR_PTYPE_NETBSD) { - bsdpart = i; + if (bsdpart == -1) + bsdpart = i; numbsd++; } - for (j = i+1; j<4; j++) - if (partsoverlap(part, i,j)) + for (j = i + 1; j < NMBRPART; j++) + if (partsoverlap(part, i, j)) overlap = 1; } @@ -330,6 +331,54 @@ edit_mbr(mbr) return 1; } +void +edit_ptn_bounds(void) +{ + char buf[40]; int start, size, inp, partn; + + msg_table_add(MSG_mbrpart_start_special); + msg_prompt_add(MSG_start, NULL, buf, sizeof buf); + inp = atoi(buf); + /* + * -0, -1, -2, -3: start at end of part # given + * 0: start of disk. + */ + if ((inp == 0 && buf[0] == '-') || (inp < 0 && inp >= -3)) { + partn = -inp; + start = part[partn].mbrp_start + part[partn].mbrp_size; + } else if (inp == 0) + start = bsec; + else + start = NUMSEC(inp, sizemult, dlcylsize); + + if (sizemult > 1 && start < bsec) + start = bsec; + msg_table_add(MSG_mbrpart_size_special); + msg_prompt_add (MSG_size, NULL, buf, 40); + inp = atoi(buf); + /* + * -0, -1, -2, -3: until start of part # given + * 0: end of disk + */ + if ((inp == 0 && buf[0] == '-') || (inp < 0 && inp >= -3)) { + partn = -inp; + size = part[partn].mbrp_start - start; + } else if (inp == 0) + size = dlsize - start; + else + size = NUMSEC(inp, sizemult, dlcylsize); + if (sizemult > 1 && start == bsec) + size -= bsec; + if (start + size > bsize) + size = bsize - start; + if (size < 0) { + size = 0; + start = 0; + } + part[editpart].mbrp_start = start; + part[editpart].mbrp_size = size; +} + int partsoverlap(part, i, j) struct mbr_partition *part; @@ -642,3 +691,74 @@ get_mapping(parts, i, cylinder, head, sector, absolute) } return 0; } + +#ifdef BOOTSEL + +void +disp_bootsel(void) +{ + int i; + + msg_display(MSG_configbootsel); + msg_table_add(MSG_bootsel_header); + for (i = 0; i < 4; i++) { + msg_table_add(MSG_bootsel_row, i, get_partname(i), + mbs->mbrb_nametab[i]); + } + msg_display_add(MSG_newline); + + msg_display_add(MSG_bootseltimeout, (10 * mbs->mbrb_timeo + 9) / 182); + msg_display_add(MSG_defbootselopt); + if (mbs->mbrb_defkey == SCAN_ENTER) + msg_display_add(MSG_defbootseloptactive); + else if (mbs->mbrb_defkey < (SCAN_F1 + 4)) + msg_display_add(MSG_defbootseloptpart, defbootselpart); + else + msg_display_add(MSG_defbootseloptdisk, defbootseldisk); +} + +void +edit_bootsel_entry(int ptn) +{ + if (part[ptn].mbrp_typ != 0) + msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[ptn], + mbs->mbrb_nametab[ptn], 8); +} + +void +edit_bootsel_timeout(void) +{ + char tstr[8]; + unsigned timo; + + do { + snprintf(tstr, 8, "%u", (10 * mbs->mbrb_timeo + 9) / 182); + msg_prompt(MSG_bootseltimeoutval, tstr, tstr, 8); + timo = (unsigned)atoi(tstr); + } while (timo > 3600); + mbs->mbrb_timeo = (u_int16_t)((timo * 182) / 10); +} + +void +edit_bootsel_default_ptn(int ptn) +{ + int i; + int key = SCAN_1; + + if (mbs->mbrb_nametab[ptn][0] == 0 || part[ptn].mbrp_typ == 0) + return; + for (i = 0; i < ptn; i++) + if (mbs->mbrb_nametab[i][0] != 0 && part[i].mbrp_typ != 0) + key++; + mbs->mbrb_defkey = key; + defbootselpart = ptn; +} + +void +edit_bootsel_default_disk(int disk) +{ + + mbs->mbrb_defkey = SCAN_F1 + disk; + defbootseldisk = disk; +} +#endif diff --git a/distrib/utils/sysinst/mbr.h b/distrib/utils/sysinst/mbr.h index 5a230e5a06fe..0469fcef35e0 100644 --- a/distrib/utils/sysinst/mbr.h +++ b/distrib/utils/sysinst/mbr.h @@ -1,4 +1,4 @@ -/* $NetBSD: mbr.h,v 1.11 2003/05/07 10:20:18 dsl Exp $ */ +/* $NetBSD: mbr.h,v 1.12 2003/05/07 19:02:53 dsl Exp $ */ /* * Copyright 1997, 1988 Piermont Information Systems Inc. @@ -86,3 +86,13 @@ void set_bios_geom (int, int, int); int otherpart (int); int ourpart (int); char *get_partname (int); +void edit_ptn_bounds(void); +#if defined(__i386__) || defined(__x86_64__) +#define BOOTSEL +void disp_bootsel(void); +void edit_bootsel_entry(int); +void edit_bootsel_timeout(void); +void edit_bootsel_default_ptn(int); +void edit_bootsel_default_disk(int); +#endif +