Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/utils/sysinst/arch struct mbr_bootsel et al were mov...



details:   https://anonhg.NetBSD.org/src/rev/0886a9ce2b14
branches:  trunk
changeset: 546649:0886a9ce2b14
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Sat May 03 17:04:09 2003 +0000

description:
struct mbr_bootsel et al were moved to sys/disklabel_mbr.h, adapt.

diffstat:

 distrib/utils/sysinst/arch/amd64/md.c        |  12 ++--
 distrib/utils/sysinst/arch/amd64/md.h        |  20 +--------
 distrib/utils/sysinst/arch/amd64/menus.md.en |  58 ++++++++++++++--------------
 distrib/utils/sysinst/arch/amd64/menus.md.fr |  58 ++++++++++++++--------------
 distrib/utils/sysinst/arch/amd64/menus.md.pl |  58 ++++++++++++++--------------
 distrib/utils/sysinst/arch/i386/md.c         |  12 ++--
 distrib/utils/sysinst/arch/i386/md.h         |  18 +--------
 distrib/utils/sysinst/arch/i386/menus.md.en  |  58 ++++++++++++++--------------
 distrib/utils/sysinst/arch/i386/menus.md.fr  |  58 ++++++++++++++--------------
 distrib/utils/sysinst/arch/i386/menus.md.pl  |  58 ++++++++++++++--------------
 10 files changed, 189 insertions(+), 221 deletions(-)

diffs (truncated from 917 to 300 lines):

diff -r 90e2a8a55a38 -r 0886a9ce2b14 distrib/utils/sysinst/arch/amd64/md.c
--- a/distrib/utils/sysinst/arch/amd64/md.c     Sat May 03 16:46:39 2003 +0000
+++ b/distrib/utils/sysinst/arch/amd64/md.c     Sat May 03 17:04:09 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.1 2003/04/26 19:02:51 fvdl Exp $ */
+/*     $NetBSD: md.c,v 1.2 2003/05/03 17:04:09 fvdl Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -606,14 +606,14 @@
 
 
        mbs = (struct mbr_bootsel *)&mbr[MBR_BOOTSELOFF];
-       mbs->flags = BFL_SELACTIVE;
+       mbs->mbrb_flags = BFL_SELACTIVE;
 
        /* Setup default labels for partitions, since if not done by user */
        /* they don't get set and and bootselector doesn't 'appear' when  */
        /* it's loaded.                                                   */
        for (i = 0; i < NMBRPART; i++) {
-               if (parts[i].mbrp_typ != 0 && mbs->nametab[i][0] == '\0')
-                       snprintf(mbs->nametab[i], sizeof(mbs->nametab[0]),
+               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);
        }
 
@@ -622,7 +622,7 @@
        for (i = 0; i < NMBRPART; i++) {
                if (parts[i].mbrp_typ != 0 &&
                   parts[i].mbrp_start >= (bcyl * bhead * bsec)) {
-                       mbs->flags |= BFL_EXTINT13;
+                       mbs->mbrb_flags |= BFL_EXTINT13;
                        break;
                }
        }
@@ -638,7 +638,7 @@
        msg_table_add(MSG_bootsel_header);
        for (i = 0; i < 4; i++) {
                msg_table_add(MSG_bootsel_row,
-                   i, get_partname(i), mbs->nametab[i]);
+                   i, get_partname(i), mbs->mbrb_nametab[i]);
        }
        msg_display_add(MSG_newline);
 }
diff -r 90e2a8a55a38 -r 0886a9ce2b14 distrib/utils/sysinst/arch/amd64/md.h
--- a/distrib/utils/sysinst/arch/amd64/md.h     Sat May 03 16:46:39 2003 +0000
+++ b/distrib/utils/sysinst/arch/amd64/md.h     Sat May 03 17:04:09 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.h,v 1.1 2003/04/26 19:02:51 fvdl Exp $      */
+/*     $NetBSD: md.h,v 1.2 2003/05/03 17:04:09 fvdl Exp $      */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -122,7 +122,7 @@
  * If not defined, we assume the port does not support disklabels and
  * hand-edited disklabel will NOT be written by MI code.
  *
- * On x86_64, do what the 1.2 install scripts did. 
+ * On amd64, do what the 1.2 install scripts did. 
  */
 #define DISKLABEL_CMD "disklabel -w -r"
 
@@ -140,27 +140,11 @@
 #define _PATH_MBR      "/usr/mdec/mbr"
 #define _PATH_BOOTSEL  "/usr/mdec/mbr_bootsel"
 
-struct mbr_bootsel {
-       u_int8_t defkey;
-       u_int8_t flags;
-       u_int16_t timeo;
-       char nametab[4][9];
-       u_int16_t magic;
-} __attribute__((packed));
- 
 extern struct mbr_bootsel *mbs;
  
-#define BFL_SELACTIVE   0x01
-#define BFL_EXTINT13    0x02
- 
-#define SCAN_ENTER      0x1c
-#define SCAN_F1         0x3b
-
 #define LIB_COUNT      0
 #define LIB_MOVE       1
  
-#define MBR_BOOTSELOFF  (MBR_PARTOFF - sizeof (struct mbr_bootsel))
-
 extern int defbootselpart, defbootseldisk;
 
 void disp_bootsel (struct mbr_partition *, struct mbr_bootsel *);
diff -r 90e2a8a55a38 -r 0886a9ce2b14 distrib/utils/sysinst/arch/amd64/menus.md.en
--- a/distrib/utils/sysinst/arch/amd64/menus.md.en      Sat May 03 16:46:39 2003 +0000
+++ b/distrib/utils/sysinst/arch/amd64/menus.md.en      Sat May 03 17:04:09 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menus.md.en,v 1.1 2003/04/26 19:02:51 fvdl Exp $       */
+/*     $NetBSD: menus.md.en,v 1.2 2003/05/03 17:04:09 fvdl Exp $       */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -288,11 +288,11 @@
 menu configbootsel, y=16, title  "Change a bootmenu item", exit;
         display action  { msg_display(MSG_configbootsel);
                           disp_bootsel((struct mbr_partition *)&mbr[MBR_PARTOFF], mbs);
-                         msg_display_add(MSG_bootseltimeout, (1000 * mbs->timeo) / 18200);
+                         msg_display_add(MSG_bootseltimeout, (1000 * mbs->mbrb_timeo) / 18200);
                          msg_display_add(MSG_defbootselopt);
-                         if (mbs->defkey == SCAN_ENTER)
+                         if (mbs->mbrb_defkey == SCAN_ENTER)
                                msg_display_add(MSG_defbootseloptactive);
-                         else if (mbs->defkey < (SCAN_F1 + 4))
+                         else if (mbs->mbrb_defkey < (SCAN_F1 + 4))
                                msg_display_add(MSG_defbootseloptpart,
                                    defbootselpart);
                          else
@@ -302,26 +302,26 @@
         option "Edit menu entry 0",
                action {
                        if (part[0].mbrp_typ != 0)
-                               msg_prompt(MSG_bootselitemname, mbs->nametab[0],
-                                   mbs->nametab[0], 8);
+                               msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[0],
+                                   mbs->mbrb_nametab[0], 8);
                };
         option "Edit menu entry 1",
                action {
                        if (part[1].mbrp_typ != 0)
-                               msg_prompt(MSG_bootselitemname, mbs->nametab[1],
-                                   mbs->nametab[1], 8);
+                               msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[1],
+                                   mbs->mbrb_nametab[1], 8);
                };
         option "Edit menu entry 2",
                action {
                        if (part[2].mbrp_typ != 0)
-                               msg_prompt(MSG_bootselitemname, mbs->nametab[2],
-                                   mbs->nametab[2], 8);
+                               msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[2],
+                                   mbs->mbrb_nametab[2], 8);
                };
         option "Edit menu entry 3",
                action {
                        if (part[3].mbrp_typ != 0)
-                               msg_prompt(MSG_bootselitemname, mbs->nametab[3],
-                                   mbs->nametab[3], 8);
+                               msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[3],
+                                   mbs->mbrb_nametab[3], 8);
                };
        option "Set timeout value",
                action {
@@ -330,47 +330,47 @@
 
                        do {
                                snprintf(tstr, 8, "%u",
-                                   (1000 * mbs->timeo) / 18200);
+                                   (1000 * mbs->mbrb_timeo) / 18200);
                                msg_prompt(MSG_bootseltimeoutval, tstr, tstr,
                                    8);
                                timo = (unsigned)atoi(tstr);
                        } while (timo > 3600);
-                       mbs->timeo = (u_int16_t)((timo * 18200) / 1000);
+                       mbs->mbrb_timeo = (u_int16_t)((timo * 18200) / 1000);
                };
        option "Set default option", sub menu defaultbootsel;
 
 menu defaultbootsel, title "Pick a default partition/disk to boot";
        option "Partition 0", exit,
                action {
-                       if (mbs->nametab[0][0] != 0 && part[0].mbrp_typ != 0)
-                               mbs->defkey = SCAN_F1; defbootselpart = 0;
+                       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->nametab[1][0] != 0 && part[1].mbrp_typ != 0)
-                               mbs->defkey = SCAN_F1 + 1; defbootselpart = 1;
+                       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->nametab[2][0] != 0 && part[2].mbrp_typ != 0)
-                               mbs->defkey = SCAN_F1 + 2; defbootselpart = 2;
+                       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->nametab[3][0] != 0 && part[3].mbrp_typ != 0)
-                               mbs->defkey = SCAN_F1 + 3; defbootselpart = 3;
+                       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->defkey = SCAN_F1 + 4; defbootseldisk = 0; };
+               action { mbs->mbrb_defkey = SCAN_F1 + 4; defbootseldisk = 0; };
        option "Harddisk 1", exit,
-               action { mbs->defkey = SCAN_F1 + 5; defbootseldisk = 1; };
+               action { mbs->mbrb_defkey = SCAN_F1 + 5; defbootseldisk = 1; };
        option "Harddisk 2", exit,
-               action { mbs->defkey = SCAN_F1 + 6; defbootseldisk = 2; };
+               action { mbs->mbrb_defkey = SCAN_F1 + 6; defbootseldisk = 2; };
        option "Harddisk 3", exit,
-               action { mbs->defkey = SCAN_F1 + 7; defbootseldisk = 3; };
+               action { mbs->mbrb_defkey = SCAN_F1 + 7; defbootseldisk = 3; };
        option "Harddisk 4", exit,
-               action { mbs->defkey = SCAN_F1 + 8; defbootseldisk = 4; };
+               action { mbs->mbrb_defkey = SCAN_F1 + 8; defbootseldisk = 4; };
        option "Harddisk 5", exit,
-               action { mbs->defkey = SCAN_F1 + 9; defbootseldisk = 5; };
+               action { mbs->mbrb_defkey = SCAN_F1 + 9; defbootseldisk = 5; };
        option "First active partition", exit,
-               action { mbs->defkey = SCAN_ENTER; };
+               action { mbs->mbrb_defkey = SCAN_ENTER; };
diff -r 90e2a8a55a38 -r 0886a9ce2b14 distrib/utils/sysinst/arch/amd64/menus.md.fr
--- a/distrib/utils/sysinst/arch/amd64/menus.md.fr      Sat May 03 16:46:39 2003 +0000
+++ b/distrib/utils/sysinst/arch/amd64/menus.md.fr      Sat May 03 17:04:09 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menus.md.fr,v 1.1 2003/04/26 19:02:51 fvdl Exp $       */
+/*     $NetBSD: menus.md.fr,v 1.2 2003/05/03 17:04:09 fvdl Exp $       */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -260,11 +260,11 @@
 menu configbootsel, title  "Changer une entree du menu", exit;
         display action  { msg_display(MSG_configbootsel);
                           disp_bootsel((struct mbr_partition *)&mbr[MBR_PARTOFF], mbs);
-                         msg_display_add(MSG_bootseltimeout, (1000 * mbs->timeo) / 18200);
+                         msg_display_add(MSG_bootseltimeout, (1000 * mbs->mbrb_timeo) / 18200);
                          msg_display_add(MSG_defbootselopt);
-                         if (mbs->defkey == SCAN_ENTER)
+                         if (mbs->mbrb_defkey == SCAN_ENTER)
                                msg_display_add(MSG_defbootseloptactive);
-                         else if (mbs->defkey < (SCAN_F1 + 4))
+                         else if (mbs->mbrb_defkey < (SCAN_F1 + 4))
                                msg_display_add(MSG_defbootseloptpart,
                                    defbootselpart);
                          else
@@ -274,26 +274,26 @@
         option "Changer l'entrée 0 du menu",
                action {
                        if (part[0].mbrp_typ != 0)
-                               msg_prompt(MSG_bootselitemname, mbs->nametab[0],
-                                   mbs->nametab[0], 8);
+                               msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[0],
+                                   mbs->mbrb_nametab[0], 8);
                };
         option "Changer l'entrée 1 du menu",
                action {
                        if (part[1].mbrp_typ != 0)
-                               msg_prompt(MSG_bootselitemname, mbs->nametab[1],
-                                   mbs->nametab[1], 8);
+                               msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[1],
+                                   mbs->mbrb_nametab[1], 8);
                };
         option "Changer l'entrée 2 du menu",
                action {
                        if (part[2].mbrp_typ != 0)
-                               msg_prompt(MSG_bootselitemname, mbs->nametab[2],
-                                   mbs->nametab[2], 8);
+                               msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[2],
+                                   mbs->mbrb_nametab[2], 8);
                };
         option "Changer l'entrée 3 du menu",
                action {
                        if (part[3].mbrp_typ != 0)
-                               msg_prompt(MSG_bootselitemname, mbs->nametab[3],
-                                   mbs->nametab[3], 8);
+                               msg_prompt(MSG_bootselitemname, mbs->mbrb_nametab[3],
+                                   mbs->mbrb_nametab[3], 8);
                };
        option "Changer le temps d'attente",
                action {
@@ -302,47 +302,47 @@
 
                        do {
                                snprintf(tstr, 8, "%u",
-                                   (1000 * mbs->timeo) / 18200);
+                                   (1000 * mbs->mbrb_timeo) / 18200);
                                msg_prompt(MSG_bootseltimeoutval, tstr, tstr,
                                    8);
                                timo = (unsigned)atoi(tstr);
                        } while (timo > 3600);
-                       mbs->timeo = (u_int16_t)((timo * 18200) / 1000);
+                       mbs->mbrb_timeo = (u_int16_t)((timo * 18200) / 1000);
                };
        option "Changer le choix par defaut", sub menu defaultbootsel;
 
 menu defaultbootsel, title "Choisissez un disque ou partition";
        option "Partition 0", exit,
                action {
-                       if (mbs->nametab[0][0] != 0 && part[0].mbrp_typ != 0)
-                               mbs->defkey = SCAN_F1; defbootselpart = 0;
+                       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->nametab[1][0] != 0 && part[1].mbrp_typ != 0)



Home | Main Index | Thread Index | Old Index