diff --git a/ChangeLog b/ChangeLog index 0382a5113..6fa2838bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2008-06-06 Robert Millan + + * util/grub-emu.c (grub_machine_init): Move code in this function from + here ... + (main): ... to here (before grub_util_biosdisk_init() call, to prevent + segfault in case grub_printf() is called). + + * util/i386/pc/grub-install.in: Append `--device-map=${device_map}' to + grub_probe. Update all users not to explicitly add it again. + (grub_device): New variable; contains corresponding device for grubdir. + (fs_module, partmap_module, devabstraction_module): Pass + `--device ${grub_device}' to grub_probe to avoid traversing /dev + every time. + 2008-06-05 Robert Millan * normal/misc.c (grub_normal_print_device_info): When a filesystem UUID diff --git a/util/grub-emu.c b/util/grub-emu.c index 00a2c49c9..5431a92c8 100644 --- a/util/grub-emu.c +++ b/util/grub-emu.c @@ -71,8 +71,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) void grub_machine_init (void) { - signal (SIGINT, SIG_IGN); - grub_console_init (); } void @@ -183,6 +181,9 @@ main (int argc, char *argv[]) sleep (1); } + signal (SIGINT, SIG_IGN); + grub_console_init (); + /* XXX: This is a bit unportable. */ grub_util_biosdisk_init (dev_map); diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 60da57a76..87e5f84e2 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -148,6 +148,8 @@ esac grubdir=${bootdir}/`echo grub | sed ${transform}` device_map=${grubdir}/device.map +grub_probe="${grub_probe} --device-map=${device_map}" + # Check if GRUB is installed. set $grub_setup dummy if test -f "$1"; then @@ -210,8 +212,11 @@ for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst ${pkglibdir}/*.img; do cp -f $file ${grubdir} || exit 1 done +# Write device to a variable so we don't have to traverse /dev every time. +grub_device=`$grub_probe --target=device ${grubdir}` + # Create the core image. First, auto-detect the filesystem module. -fs_module=`$grub_probe --target=fs --device-map=${device_map} ${grubdir}` +fs_module=`$grub_probe --target=fs --device ${grub_device}` if test "x$fs_module" = x -a "x$modules" = x; then echo "Auto-detection of a filesystem module failed." 1>&2 echo "Please specify the module with the option \`--modules' explicitly." 1>&2 @@ -221,10 +226,10 @@ fi # Then the partition map module. In order to support partition-less media, # this command is allowed to fail (--target=fs already grants us that the # filesystem will be accessible). -partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` +partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/null` # Device abstraction module, if any (lvm, raid). -devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_map} ${grubdir}` +devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` # _chain is often useful modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module _chain"