]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2002-01-08 Yoshinori K. Okuji <okuji@gnu.org>
authorokuji <okuji@localhost>
Tue, 8 Jan 2002 03:19:23 +0000 (03:19 +0000)
committerokuji <okuji@localhost>
Tue, 8 Jan 2002 03:19:23 +0000 (03:19 +0000)
* grub/main.c (use_preset_menu): New variable.
(OPT_PRESET_MENU): New macro.
(longopts): Added an entry for "--preset-menu".
(usage): Added a description for "--preset-menu". Also, change
the first character of the description for "--device-map" to
lower case for consistency.
(main): Set USE_PRESET_MENU to 1 in the case of OPT_PRESET_MENU.
* stage2/shared.h (use_preset_menu): Declared.
* stage2/stage2.c [PRESET_MENU_STRING || SUPPORT_DISKLESS]
(open_preset_menu) [GRUB_UTIL]: If USE_PRESET_MENU is false,
return zero immediately.

ChangeLog
NEWS
docs/grub.8
grub/main.c
stage2/shared.h
stage2/stage2.c

index 703f840a075488bf2ff8225a3d889d14841b9cf7..20e1e781c75d0f41e48693b4a39ce251f47410d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2002-01-08  Yoshinori K. Okuji  <okuji@gnu.org>
+
+       * grub/main.c (use_preset_menu): New variable.
+       (OPT_PRESET_MENU): New macro.
+       (longopts): Added an entry for "--preset-menu".
+       (usage): Added a description for "--preset-menu". Also, change
+       the first character of the description for "--device-map" to
+       lower case for consistency.
+       (main): Set USE_PRESET_MENU to 1 in the case of OPT_PRESET_MENU.
+       * stage2/shared.h (use_preset_menu): Declared.
+       * stage2/stage2.c [PRESET_MENU_STRING || SUPPORT_DISKLESS]
+       (open_preset_menu) [GRUB_UTIL]: If USE_PRESET_MENU is false,
+       return zero immediately.
+
 2002-01-08  Yoshinori K. Okuji  <okuji@gnu.org>
 
        * stage2/common.c [SUPPORT_DISKLESS]
diff --git a/NEWS b/NEWS
index 26c076a17ab93f83e15a070dd62e873d310b35e5..6d20417ca1c78438dd0898f8694dae56dc74d01e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,22 @@ New in 0.91:
 * The commands "hide" and "unhide" support logical partitions.
 * The utility ``grub-install'' supports NetBSD.
 * The network support is updated to Etherboot-5.0.5.
-* Important bugfixes are made for ReiserFS, APM, TFTP, etc.
+* The manner of handling the preset menu changes. In the previous
+  implementation, the preset menu is used only when opening the
+  configuration file failed. Now try to use the preset menu first. And,
+  if the configuration file is available, it is read after readoing the
+  preset menu. In this case, menu entries in the preset menu (if any)
+  are overrided by the configuration file.
+* Diskless support is a bit changed. In the previous, GRUB set up a
+  network automatically via a special function. In the current, the
+  function is gone and the preset menu feature is used (i.e. just
+  execute the command "bootp" as if you specified it in the preset
+  menu). This has no impact against most users, but you should take care
+  if using the preset menu for your own purpose, because GRUB doesn't
+  call "bootp" implicitly when the preset menu is used explicitly. In
+  this case, you would probably need to insert commands to initialize a
+  network into your preset menu.
+* Important bugfixes are made for ReiserFS, APM, TFTP, LBA, etc.
 
 New in 0.90 - 2001-07-11:
 * The command "setkey" resets key mappings, when no argument is
index ccae129e0e9f10571d3685830a1bd88e0210e646..cb931540be0ff80206cf5aad1873ba476afe0ad3 100644 (file)
@@ -18,7 +18,7 @@ specify stage2 boot_drive [default=0x0]
 specify stage2 config_file [default=/boot/grub/menu.lst]
 .TP
 \fB\-\-device\-map\fR=\fIFILE\fR
-Use the device map file FILE
+use the device map file FILE
 .TP
 \fB\-\-help\fR
 display this message and exit
@@ -38,6 +38,9 @@ do not use curses
 \fB\-\-no\-floppy\fR
 do not probe any floppy drive
 .TP
+\fB\-\-preset\-menu\fR
+use the preset menu
+.TP
 \fB\-\-probe\-second\-floppy\fR
 probe the second floppy drive
 .TP
index eccf485a7239b6d9ccd9e60ca3b5f33a7b20c814..845cff73c3611c55a47e2ad4614586e88958e64c 100644 (file)
@@ -1,7 +1,7 @@
 /* main.c - experimental GRUB stage2 that runs under Unix */
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 1999, 2000  Free Software Foundation, Inc.
+ *  Copyright (C) 1999, 2000, 2001  Free Software Foundation, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -34,6 +34,7 @@ int grub_stage2 (void);
 
 char *program_name = 0;
 int use_config_file = 1;
+int use_preset_menu = 0;
 int use_curses = 1;
 int verbose = 0;
 int read_only = 0;
@@ -43,20 +44,21 @@ static int default_boot_drive;
 static int default_install_partition;
 static char *default_config_file;
 
-#define OPT_HELP -2
-#define OPT_VERSION -3
-#define OPT_HOLD -4
-#define OPT_CONFIG_FILE -5
-#define OPT_INSTALL_PARTITION -6
-#define OPT_BOOT_DRIVE -7
-#define OPT_NO_CONFIG_FILE -8
-#define OPT_NO_CURSES -9
-#define OPT_BATCH -10
-#define OPT_VERBOSE -11
-#define OPT_READ_ONLY -12
-#define OPT_PROBE_SECOND_FLOPPY -13
-#define OPT_NO_FLOPPY -14
-#define OPT_DEVICE_MAP -15
+#define OPT_HELP               -2
+#define OPT_VERSION            -3
+#define OPT_HOLD               -4
+#define OPT_CONFIG_FILE                -5
+#define OPT_INSTALL_PARTITION  -6
+#define OPT_BOOT_DRIVE         -7
+#define OPT_NO_CONFIG_FILE     -8
+#define OPT_NO_CURSES          -9
+#define OPT_BATCH              -10
+#define OPT_VERBOSE            -11
+#define OPT_READ_ONLY          -12
+#define OPT_PROBE_SECOND_FLOPPY        -13
+#define OPT_NO_FLOPPY          -14
+#define OPT_DEVICE_MAP         -15
+#define OPT_PRESET_MENU                -16
 #define OPTSTRING ""
 
 static struct option longopts[] =
@@ -71,6 +73,7 @@ static struct option longopts[] =
   {"no-config-file", no_argument, 0, OPT_NO_CONFIG_FILE},
   {"no-curses", no_argument, 0, OPT_NO_CURSES},
   {"no-floppy", no_argument, 0, OPT_NO_FLOPPY},
+  {"preset-menu", no_argument, 0, OPT_PRESET_MENU},
   {"probe-second-floppy", no_argument, 0, OPT_PROBE_SECOND_FLOPPY},
   {"read-only", no_argument, 0, OPT_READ_ONLY},
   {"verbose", no_argument, 0, OPT_VERBOSE},
@@ -93,13 +96,14 @@ Enter the GRand Unified Bootloader command shell.\n\
     --batch                  turn on batch mode for non-interactive use\n\
     --boot-drive=DRIVE       specify stage2 boot_drive [default=0x%x]\n\
     --config-file=FILE       specify stage2 config_file [default=%s]\n\
-    --device-map=FILE        Use the device map file FILE\n\
+    --device-map=FILE        use the device map file FILE\n\
     --help                   display this message and exit\n\
     --hold                   wait until a debugger will attach\n\
     --install-partition=PAR  specify stage2 install_partition [default=0x%x]\n\
     --no-config-file         do not use the config file\n\
     --no-curses              do not use curses\n\
     --no-floppy              do not probe any floppy drive\n\
+    --preset-menu            use the preset menu\n\
     --probe-second-floppy    probe the second floppy drive\n\
     --read-only              do not write anything to devices\n\
     --verbose                print verbose messages\n\
@@ -215,6 +219,10 @@ main (int argc, char **argv)
        case OPT_DEVICE_MAP:
          device_map_file = strdup (optarg);
          break;
+
+       case OPT_PRESET_MENU:
+         use_preset_menu = 1;
+         break;
          
        default:
          usage (1);
index 8b050e3fe02c1aef0573151d9d37a85bf3294672..f5577efe19bb6950ce4c6c1be6edfdc2bc09d49e 100644 (file)
@@ -568,6 +568,9 @@ extern unsigned long linux_text_len;
 /* If not using config file, this variable is set to zero,
    otherwise non-zero.  */
 extern int use_config_file;
+/* If using the preset menu, this variable is set to non-zero,
+   otherwise zero.  */
+extern int use_preset_menu;
 /* If not using curses, this variable is set to zero, otherwise non-zero.  */
 extern int use_curses;
 /* The flag for verbose messages.  */
index e6f425923365965adaa186501311cfd53227ce72..ca73734d4b8d45fc78317f007fc3311d8d31ccc4 100644 (file)
@@ -35,6 +35,13 @@ static int preset_menu_offset;
 static int
 open_preset_menu (void)
 {
+#ifdef GRUB_UTIL
+  /* Unless the user explicitly requests to use the preset menu,
+     always opening the preset menu fails in the grub shell.  */
+  if (! use_preset_menu)
+    return 0;
+#endif /* GRUB_UTIL */
+  
   preset_menu_offset = 0;
   return preset_menu != 0;
 }