Fixed various script issues. Thanks fezie for testing.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2009-11-25 22:34:35 +01:00
parent 4996893238
commit 20f1afd41a

View file

@ -32,7 +32,7 @@ platform=@platform@
pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
grub_setup=${sbindir}/`echo grub-setup | sed ${transform}` grub_setup=${sbindir}/`echo grub-setup | sed ${transform}`
if [ "${target_cpu}-${platform}" = "i386-pc" || "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then if [ "${target_cpu}-${platform}" = "i386-pc" ] || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then
grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
else else
grub_mkimage=${bindir}/`echo grub-mkelfimage | sed ${transform}` grub_mkimage=${bindir}/`echo grub-mkelfimage | sed ${transform}`
@ -179,7 +179,7 @@ device_map=${grubdir}/device.map
grub_probe="${grub_probe} --device-map=${device_map}" grub_probe="${grub_probe} --device-map=${device_map}"
# Check if GRUB is installed. # Check if GRUB is installed.
if [ "${target_cpu}-${platform}" = "i386-pc" || "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then if [ "${target_cpu}-${platform}" = "i386-pc" ] || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then
set $grub_setup dummy set $grub_setup dummy
if test -f "$1"; then if test -f "$1"; then
: :
@ -241,7 +241,7 @@ done
for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst; do for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst; do
cp -f $file ${grubdir} || exit 1 cp -f $file ${grubdir} || exit 1
done done
if [ "${target_cpu}-${platform}" = "i386-pc" || "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then if [ "${target_cpu}-${platform}" = "i386-pc" ] || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then
for file in ${pkglibdir}/*.img ${pkglibdir}/efiemu??.o; do for file in ${pkglibdir}/*.img ${pkglibdir}/efiemu??.o; do
if test -f $file; then if test -f $file; then
cp -f $file ${grubdir} || exit 1 cp -f $file ${grubdir} || exit 1
@ -272,8 +272,14 @@ devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}`
modules="$modules $disk_module" modules="$modules $disk_module"
modules="$modules $fs_module $partmap_module $devabstraction_module" modules="$modules $fs_module $partmap_module $devabstraction_module"
relative_grubdir=`make_system_path_relative_to_its_root ${grubdir}` || exit 1
if [ "x${relative_grubdir}" = "x" ] ; then
relative_grubdir=/
fi
prefix_drive= prefix_drive=
config= config_opt=
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}"
@ -292,7 +298,9 @@ 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
config="search_fs_uuid ${uuid} root" echo "search.fs_uuid ${uuid} root " > ${grubdir}/load.cfg
echo 'set prefix=($root)'"${relative_grubdir}" >> ${grubdir}/load.cfg
config_opt="-c ${grubdir}/load.cfg "
modules="$modules search_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}`"
@ -300,25 +308,16 @@ if [ "x${devabstraction_module}" = "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
config="search_fs_uuid ${uuid} root" echo "search.fs_uuid ${uuid} root " > ${grubdir}/load.cfg
echo 'set prefix=($root)'"${relative_grubdir}" >> ${grubdir}/load.cfg
config_opt="-c ${grubdir}/load.cfg "
modules="$modules search_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}`
fi fi
relative_grubdir=`make_system_path_relative_to_its_root ${grubdir}` || exit 1 if [ "${target_cpu}-${platform}" = "i386-pc" ] || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then
if [ "x${relative_grubdir}" = "x" ] ; then
relative_grubdir=/
fi
config_opt=
echo $config > ${grubdir}/load.cfg
if [ x$config != x ]; then
config_opt="-c $config "
fi
if [ "${target_cpu}-${platform}" = "i386-pc" || "${target_cpu}-${platform}" = "sparc64-ieee1275" ] ; then
$grub_mkimage ${config_opt} --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.