efi-image: Fix <platform>/grub.cfg, variables must NOT be expanded
The test 'if [ x$grub_platform == xefi -a x$lockdown != xy ]' is meant
to be done by GRUB at runtime, so this line should appear verbatim in
the grub.cfg file.
However the variables are expanded at build-time by the script, because
the dollar symbol is not escaped.
Here's the result on a 12.1.0 live image:
$ cat <<debian-live-12.1.0>>/boot/grub/x86_64-efi/grub.cfg
if [ x == xefi -a x != xy ] ; then
insmod part_acorn
insmod part_amiga
insmod part_apple
insmod part_bsd
insmod part_dfly
insmod part_dvh
insmod part_gpt
insmod part_msdos
insmod part_plan
insmod part_sun
insmod part_sunpc
fi
source /boot/grub/grub.cfg
Note that this mistake would have been caught if only the nounset option
had been used (ie. 'set -u').
Fixes commit: 7b36f5b0ad
This commit is contained in:
parent
a3f7a33f95
commit
6dbb8d2598
|
@ -64,7 +64,7 @@ for i in /usr/lib/grub/$platform/part_*.mod; do
|
||||||
done
|
done
|
||||||
mkdir -p "$outdir/boot/grub/$platform"
|
mkdir -p "$outdir/boot/grub/$platform"
|
||||||
cat >"$outdir/boot/grub/$platform/grub.cfg" <<EOF
|
cat >"$outdir/boot/grub/$platform/grub.cfg" <<EOF
|
||||||
if [ x$grub_platform == xefi -a x$lockdown != xy ] ; then
|
if [ x\$grub_platform == xefi -a x\$lockdown != xy ] ; then
|
||||||
$(printf " insmod %s\n" $PARTITIONLIST)
|
$(printf " insmod %s\n" $PARTITIONLIST)
|
||||||
fi
|
fi
|
||||||
source /boot/grub/grub.cfg
|
source /boot/grub/grub.cfg
|
||||||
|
|
Loading…
Reference in New Issue