]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Revert "kernel-install: also try to find $BOOT by partition GUID"
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 16 Mar 2023 04:26:18 +0000 (13:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 17 Mar 2023 11:41:17 +0000 (20:41 +0900)
This reverts commit 41f39e2144c935868059e894c1a1e13803e3568f.

From the post merge comment in #26648:

> Hmm, this is highly problematic, no? if I boot from my ssd and then
> plug in a fedora live usb stick, then there will be two ESPs around,
> the one from my ssd and the one from the live usb one, and this code
> might find the wrong one and bad things will happen

src/kernel-install/kernel-install.in

index 2c59648afc144352f037ba7c753ae4ce275f1460..bbbd9c8e455ac73129cb4ac7069dfb122429b6cf 100755 (executable)
@@ -206,7 +206,6 @@ else
     BOOT_ROOT_SEARCH="/efi /boot /boot/efi"
 fi
 
-# First search for existing setups in any of the known directories.
 for pref in $BOOT_ROOT_SEARCH; do
     for suff in $ENTRY_TOKEN_SEARCH; do
         if [ -d "$pref/$suff" ]; then
@@ -229,24 +228,6 @@ for pref in $BOOT_ROOT_SEARCH; do
     done
 done
 
-# If we haven't found anything, and if we have lsblk, use the partition GUID to
-# search for XBOOTLDR (first) or ESP (as a fallback).
-if [ -z "$BOOT_ROOT" ] && command -v lsblk >/dev/null 2>&1; then
-    for guid in bc13c2ff-59e6-4262-a352-b275fd6f7172 c12a7328-f81f-11d2-ba4b-00a0c93ec93b; do
-        eval "$(lsblk --pairs --output MOUNTPOINT,PARTTYPE | grep "$guid")"
-        BOOT_ROOT="$MOUNTPOINT"
-        unset MOUNTPOINT
-        unset PARTTYPE
-
-        if [ -n "$BOOT_ROOT" ]; then
-            log_verbose "$BOOT_ROOT is a mount point for partition GUID $guid, using BOOT_ROOT=$BOOT_ROOT"
-            break
-        fi
-    done
-fi
-
-# Finally if we still haven't found anything, check if /efi or /boot/efi are mountpoints
-# and if so, assume they point to the ESP.
 [ -z "$BOOT_ROOT" ] && for pref in "/efi" "/boot/efi"; do
     if mountpoint -q "$pref"; then
         BOOT_ROOT="$pref"
@@ -257,7 +238,6 @@ fi
     fi
 done
 
-# If all else fails, install on /boot.
 if [ -z "$BOOT_ROOT" ]; then
     BOOT_ROOT="/boot"
     log_verbose "KERNEL_INSTALL_BOOT_ROOT autodetection yielded no candidates, using \"$BOOT_ROOT\""