diff --git a/os-prober-fix-btrfs-boot-without-subvol.patch b/os-prober-fix-btrfs-boot-without-subvol.patch new file mode 100644 index 0000000..f269e24 --- /dev/null +++ b/os-prober-fix-btrfs-boot-without-subvol.patch @@ -0,0 +1,21 @@ +Index: os-prober/linux-boot-prober +=================================================================== +--- os-prober.orig/linux-boot-prober ++++ os-prober/linux-boot-prober +@@ -90,15 +90,9 @@ if [ "$type" = btrfs ]; then + # /boot is part of the root + bootpart="$partition" + bootsv="$subvol" +- elif echo "$bootmnt" | cut -d ' ' -f 3 | grep -q "btrfs"; then ++ elif echo "$bootmnt" | cut -d ' ' -f 3 | grep -q "btrfs" && echo "$bootmnt" | cut -d ' ' -f 4 | grep -q "subvol="; then + # separate btrfs /boot subvolume + bootsv=$(echo "$bootmnt" | cut -d ' ' -f 4 | sed -n 's!\(^subvol=\|.*,subvol=\)\([^,]\+\).*!\2!p') +- if [ -z "$bootsv" ]; then +- warn "no subvolume in entry: $bootmnt" +- umount "$tmpmnt" 2>/dev/null +- rmdir "$tmpmnt" 2>/dev/null +- exit 1 +- fi + bootuuid=$(echo "$bootmnt" | cut -d ' ' -f 1 | sed -n 's/UUID=\("\(.*\)"\|\(.*\)\)/\2\3/p') + debug "mounting btrfs $tmpmnt/boot UUID=$bootuuid subvol=$bootsv" + bindfrom=$(check_btrfs_mounted $bootsv $bootuuid) diff --git a/os-prober.changes b/os-prober.changes index 144a541..3d2f5ac 100644 --- a/os-prober.changes +++ b/os-prober.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 27 22:23:25 UTC 2023 - Lukas Müller + +- Properly handle /boot on btrfs without subvolumes (boo#1210467). + * os-prober-fix-btrfs-boot-without-subvol.patch + ------------------------------------------------------------------- Thu Dec 22 04:54:11 UTC 2022 - Michael Chang diff --git a/os-prober.spec b/os-prober.spec index 116a977..3f48352 100644 --- a/os-prober.spec +++ b/os-prober.spec @@ -1,7 +1,7 @@ # # spec file for package os-prober # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -75,6 +75,8 @@ Patch28: os-prober-use-tmp-over-var-lib-for-transient-files.patch Patch29: os-prober-btrfs-multiple-device.patch # PATCH-FIX-OPENSUSE: 40grub2: debug messages (bsc#1101735) Patch30: os-prober-disable-debug.patch +# PATCH-FIX-OPENSUSE: linux-boot-prober does not handle btrfs /boot without subvolumes well (boo#1210467) +Patch31: os-prober-fix-btrfs-boot-without-subvol.patch Requires: /bin/grep Requires: /bin/sed Requires: /sbin/modprobe