mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
2008-06-06 Robert Millan <rmh@aybabtu.com>
* 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.
This commit is contained in:
1 parent
9ece62fb9f
commit
25d6b3273b
3 files changed
+25
-5
No files matched your search
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user