Tweak the uuid search setup

Not all arches may have a grub.cfg, it seems. Don't fail there.
This commit is contained in:
Steve McIntyre 2022-11-28 10:24:00 +00:00
parent d99baf29c5
commit 2ef9e57ec0
2 changed files with 12 additions and 8 deletions

View File

@ -257,8 +257,10 @@ change_grub_cfg_uuid () {
# reliable - see #1024346 and #1024720 for examples where this
# fails. Instead, let's generate a UUID here and use that as a
# flag file.
UUID=$(uuidgen)
mkdir -p $CDDIR/.disk/id
touch $CDDIR/.disk/id/$UUID
sed -i "/search --file --set=root/s,.disk/info,.disk/id/$UUID," $CDDIR/EFI/debian/grub.cfg
if [ -f $CDDIR/EFI/debian/grub.cfg ]; then
UUID=$(uuidgen)
mkdir -p $CDDIR/.disk/id
touch $CDDIR/.disk/id/$UUID
sed -i "/search --file --set=root/s,.disk/info,.disk/id/$UUID," $CDDIR/EFI/debian/grub.cfg
fi
}

View File

@ -231,8 +231,10 @@ change_grub_cfg_uuid () {
# reliable - see #1024346 and #1024720 for examples where this
# fails. Instead, let's generate a UUID here and use that as a
# flag file.
UUID=$(uuidgen)
mkdir -p $CDDIR/.disk/id
touch $CDDIR/.disk/id/$UUID
sed -i "/search --file --set=root/s,.disk/info,.disk/id/$UUID," $CDDIR/EFI/debian/grub.cfg
if [ -f $CDDIR/EFI/debian/grub.cfg ]; then
UUID=$(uuidgen)
mkdir -p $CDDIR/.disk/id
touch $CDDIR/.disk/id/$UUID
sed -i "/search --file --set=root/s,.disk/info,.disk/id/$UUID," $CDDIR/EFI/debian/grub.cfg
fi
}