update: ensure older systems can upgrade

/efi mounting would fall over and block the update, so make a better
effort finding it and mounting it
This commit is contained in:
Harald Sitter
2025-01-26 16:43:49 +01:00
parent 8f93783339
commit aaa81980ff

View File

@@ -10,9 +10,24 @@ fi
set -e
# Trigger mount of ESP by accessing it.
# TODO file bug that sysupdate doesn't do that.
stat /efi/EFI 2>&1 > /dev/null
# Older installations may need ESP mounted in /efi to upgrade properly
if [ -d /efi ]; then
# Trigger mount of ESP by accessing it.
# TODO file bug that sysupdate doesn't do that.
stat /efi/EFI 2>&1 > /dev/null || true
if [ ! -d /efi/EFI ]; then
rootdisk=/dev/disk/by-partlabel/KDELinux
if [ -b /dev/gpt-auto-root ]; then
# When the partition was auto detected we can just use the auto-root device
rootdisk=/dev/gpt-auto-root
elif [ -b /dev/disk/by-partlabel/KDEOS ]; then
rootdisk=/dev/disk/by-partlabel/KDEOS # Fallback for older images
fi
espdev=$(_kde-linux-find-esp "$rootdisk")
mount "$espdev" "$ROOT/efi"
fi
fi
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
export TAR_OPTIONS="--zstd"