use search_fs_uuid
This commit is contained in:
parent
d6cb87a635
commit
afba34eb21
1 changed files with 13 additions and 6 deletions
|
@ -271,6 +271,7 @@ modules="$modules $disk_module"
|
||||||
modules="$modules $fs_module $partmap_module $devabstraction_module"
|
modules="$modules $fs_module $partmap_module $devabstraction_module"
|
||||||
|
|
||||||
prefix_drive=
|
prefix_drive=
|
||||||
|
config=
|
||||||
if [ "x${devabstraction_module}" = "x" ] ; then
|
if [ "x${devabstraction_module}" = "x" ] ; then
|
||||||
if echo "${install_device}" | grep -qx "(.*)" ; then
|
if echo "${install_device}" | grep -qx "(.*)" ; then
|
||||||
install_drive="${install_device}"
|
install_drive="${install_device}"
|
||||||
|
@ -289,16 +290,16 @@ if [ "x${devabstraction_module}" = "x" ] ; then
|
||||||
echo "UUID needed with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
|
echo "UUID needed with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
prefix_drive="(UUID=${uuid})"
|
config="search_fs_uuid ${uuid} root"
|
||||||
modules="$modules fs_uuid"
|
modules="$modules search_fs_uuid"
|
||||||
elif [ "x${grub_drive}" != "x${install_drive}" ] ; then
|
elif [ "x${grub_drive}" != "x${install_drive}" ] ; then
|
||||||
uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`"
|
uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`"
|
||||||
if [ "x${uuid}" = "x" ] ; then
|
if [ "x${uuid}" = "x" ] ; then
|
||||||
echo "You attempted a cross-disk install, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
|
echo "You attempted a cross-disk install, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
prefix_drive="(UUID=${uuid})"
|
config="search_fs_uuid ${uuid} root"
|
||||||
modules="$modules fs_uuid"
|
modules="$modules search_fs_uuid"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
prefix_drive=`$grub_probe --target=drive --device ${grub_device}`
|
prefix_drive=`$grub_probe --target=drive --device ${grub_device}`
|
||||||
|
@ -309,14 +310,20 @@ if [ "x${relative_grubdir}" = "x" ] ; then
|
||||||
relative_grubdir=/
|
relative_grubdir=/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
config_opt=
|
||||||
|
echo $config > ${grubdir}/load.cfg
|
||||||
|
if [ x$config != x ]; then
|
||||||
|
config_opt="-c $config "
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
|
if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
|
||||||
$grub_mkimage --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
|
$grub_mkimage ${config_opt} --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
|
||||||
|
|
||||||
# Now perform the installation.
|
# Now perform the installation.
|
||||||
$grub_setup ${setup_verbose} ${setup_force} --directory=${grubdir} --device-map=${device_map} \
|
$grub_setup ${setup_verbose} ${setup_force} --directory=${grubdir} --device-map=${device_map} \
|
||||||
${install_device} || exit 1
|
${install_device} || exit 1
|
||||||
else
|
else
|
||||||
$grub_mkimage -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
|
$grub_mkimage ${config_opt} -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prompt the user to check if the device map is correct.
|
# Prompt the user to check if the device map is correct.
|
||||||
|
|
Loading…
Add table
Reference in a new issue