tests/util/grub-shell: Use shell variable instead of autoconf

By using shell variable that are set once by the expansion of an autoconf
variable, the resulting shell script is more easily moved and modified
from the build/install directory it was generated for. The resulting
script is more readable as well.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Glenn Washburn authored and Daniel Kiper committed 2022-08-10 14:24:47 +02:00
1 parent 21a26dd572
commit 0c6c1aff2a
1 file changed
+8 -8
+8 -8
View File
@@ -384,10 +384,10 @@ if test -z "$debug"; then
fi fi
if [ x$boot != xnet ] && [ x$boot != xemu ]; then if [ x$boot != xnet ] && [ x$boot != xemu ]; then
pkgdatadir="@builddir@" "@builddir@/grub-mkrescue" "--output=${isofile}" "--override-directory=${builddir}/grub-core" \ pkgdatadir="${builddir}" "${builddir}/grub-mkrescue" "--output=${isofile}" "--override-directory=${builddir}/grub-core" \
--rom-directory="${rom_directory}" \ --rom-directory="${rom_directory}" \
--locale-directory="@srcdir@/po" \ --locale-directory="${srcdir}/po" \
--themes-directory="@srcdir@/themes" \ --themes-directory="${srcdir}/themes" \
$mkimage_extra_arg ${mkrescue_args} \ $mkimage_extra_arg ${mkrescue_args} \
"/boot/grub/grub.cfg=${cfgfile}" "/boot/grub/testcase.cfg=${source}" \ "/boot/grub/grub.cfg=${cfgfile}" "/boot/grub/testcase.cfg=${source}" \
${files} >/dev/null 2>&1 ${files} >/dev/null 2>&1
@@ -482,7 +482,7 @@ copy_extra_files() {
if [ x$boot = xnet ]; then if [ x$boot = xnet ]; then
netdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 netdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
pkgdatadir="@builddir@" "@builddir@/grub-mknetdir" "--grub-mkimage=${builddir}/grub-mkimage" "--directory=${builddir}/grub-core" "--net-directory=$netdir" ${mkrescue_args} > /dev/null pkgdatadir="${builddir}" "${builddir}/grub-mknetdir" "--grub-mkimage=${builddir}/grub-mkimage" "--directory=${builddir}/grub-core" "--net-directory=$netdir" ${mkrescue_args} > /dev/null
cp "${cfgfile}" "$netdir/boot/grub/grub.cfg" cp "${cfgfile}" "$netdir/boot/grub/grub.cfg"
cp "${source}" "$netdir/boot/grub/testcase.cfg" cp "${source}" "$netdir/boot/grub/testcase.cfg"
[ -z "$files" ] || copy_extra_files "$netdir" $files [ -z "$files" ] || copy_extra_files "$netdir" $files
@@ -493,9 +493,9 @@ elif [ x$boot = xemu ]; then
mkdir -p "$grubdir/fonts" mkdir -p "$grubdir/fonts"
mkdir -p "$grubdir/themes" mkdir -p "$grubdir/themes"
mkdir -p "$grubdir/locale" mkdir -p "$grubdir/locale"
test -f "@builddir@/"unicode.pf2 && cp "@builddir@/"unicode.pf2 "$grubdir/fonts/unicode.pf2" test -f "${builddir}/"unicode.pf2 && cp "${builddir}/"unicode.pf2 "$grubdir/fonts/unicode.pf2"
cp -R "@srcdir@/themes/starfield" "$grubdir/themes/starfield" cp -R "${srcdir}/themes/starfield" "$grubdir/themes/starfield"
for file in "@srcdir@/po/"*.gmo; do for file in "${srcdir}/po/"*.gmo; do
if [ -f "$file" ]; then if [ -f "$file" ]; then
cp "$file" "$grubdir/locale/" cp "$file" "$grubdir/locale/"
fi fi
@@ -505,7 +505,7 @@ elif [ x$boot = xemu ]; then
[ -z "$files" ] || copy_extra_files "$rootdir" $files [ -z "$files" ] || copy_extra_files "$rootdir" $files
roottar="$(mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")" roottar="$(mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")"
(cd "$rootdir"; tar cf "$roottar" .) (cd "$rootdir"; tar cf "$roottar" .)
@builddir@/grub-core/grub-emu -m "$device_map" --memdisk "$roottar" -r memdisk -d "/boot/grub" | tr -d "\r" | do_trim "${builddir}/grub-core/grub-emu" -m "$device_map" --memdisk "$roottar" -r memdisk -d "/boot/grub" | tr -d "\r" | do_trim
test -n "$debug" || rm -rf "$rootdir" test -n "$debug" || rm -rf "$rootdir"
test -n "$debug" || rm -f "$roottar" test -n "$debug" || rm -f "$roottar"
else else