From aaa81980ffc9d9c45228f6891da3464aef950a48 Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Sun, 26 Jan 2025 16:43:49 +0100 Subject: [PATCH] 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 --- update.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/update.sh b/update.sh index b5a3159..58a3fd2 100755 --- a/update.sh +++ b/update.sh @@ -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"