diff --git a/os-prober-1.49-grub2-mount.patch b/os-prober-1.49-grub2-mount.patch index b9472f9..20e027b 100644 --- a/os-prober-1.49-grub2-mount.patch +++ b/os-prober-1.49-grub2-mount.patch @@ -1,7 +1,8 @@ -diff -urN os-prober.old/common.sh os-prober/common.sh ---- os-prober.old/common.sh 2014-12-14 19:04:07.711368751 +0100 -+++ os-prober/common.sh 2014-12-14 19:04:29.792443896 +0100 -@@ -259,8 +259,8 @@ +Index: os-prober/common.sh +=================================================================== +--- os-prober.orig/common.sh ++++ os-prober/common.sh +@@ -302,8 +302,8 @@ linux_mount_boot () { debug "found boot partition $1 for linux system on $partition, but cannot map to existing device" else debug "found boot partition $bootpart for linux system on $partition" @@ -10,15 +11,16 @@ diff -urN os-prober.old/common.sh os-prober/common.sh + if type grub2-mount >/dev/null 2>&1 && \ + grub2-mount "$boottomnt" "$tmpmnt/boot" 2>/dev/null; then mounted=1 - else - ro_partition "$boottomnt" -diff -urN os-prober.old/linux-boot-probes/common/50mounted-tests os-prober/linux-boot-probes/common/50mounted-tests ---- os-prober.old/linux-boot-probes/common/50mounted-tests 2014-12-14 19:04:07.711368751 +0100 -+++ os-prober/linux-boot-probes/common/50mounted-tests 2014-12-14 19:04:29.792443896 +0100 -@@ -34,11 +34,11 @@ - fi + elif dm_device="$(do_dmsetup osprober-linux "$boottomnt")" && [ "$dm_device" ]; then + if mountinfo=`mount -o ro "$dm_device" "$tmpmnt/boot" -t "$3"`; then +Index: os-prober/linux-boot-probes/common/50mounted-tests +=================================================================== +--- os-prober.orig/linux-boot-probes/common/50mounted-tests ++++ os-prober/linux-boot-probes/common/50mounted-tests +@@ -55,11 +55,11 @@ fi mounted= + dm_devices= -if type grub-mount >/dev/null 2>&1 && \ - type grub-probe >/dev/null 2>&1 && \ - grub-mount "$partition" "$tmpmnt" 2>/dev/null; then @@ -29,12 +31,13 @@ diff -urN os-prober.old/linux-boot-probes/common/50mounted-tests os-prober/linux - type="$(grub-probe -d "$partition" -t fs)" + type="$(grub2-probe -d "$partition" -t fs)" [ "$type" ] || type=fuseblk - else - ro_partition "$partition" -diff -urN os-prober.old/os-probes/common/50mounted-tests os-prober/os-probes/common/50mounted-tests ---- os-prober.old/os-probes/common/50mounted-tests 2014-12-14 19:04:07.712368755 +0100 -+++ os-prober/os-probes/common/50mounted-tests 2014-12-14 19:04:29.793443899 +0100 -@@ -46,11 +46,11 @@ + elif dm_device="$(do_dmsetup osprober-linux "$partition")" && \ + [ "$dm_device" ]; then +Index: os-prober/os-probes/common/50mounted-tests +=================================================================== +--- os-prober.orig/os-probes/common/50mounted-tests ++++ os-prober/os-probes/common/50mounted-tests +@@ -66,11 +66,11 @@ if [ ! -d "$tmpmnt" ]; then fi mounted= @@ -50,9 +53,10 @@ diff -urN os-prober.old/os-probes/common/50mounted-tests os-prober/os-probes/com if [ "$type" ]; then debug "mounted using GRUB $type filesystem driver" else -diff -urN os-prober.old/os-probes/init/common/10filesystems os-prober/os-probes/init/common/10filesystems ---- os-prober.old/os-probes/init/common/10filesystems 2014-12-14 19:04:07.713368758 +0100 -+++ os-prober/os-probes/init/common/10filesystems 2014-12-14 19:04:54.182526874 +0100 +Index: os-prober/os-probes/init/common/10filesystems +=================================================================== +--- os-prober.orig/os-probes/init/common/10filesystems ++++ os-prober/os-probes/init/common/10filesystems @@ -3,7 +3,7 @@ set +e # ignore errors from modprobe diff --git a/os-prober-1.49-skip-LVM2_member.patch b/os-prober-1.49-skip-LVM2_member.patch deleted file mode 100644 index e945f5c..0000000 --- a/os-prober-1.49-skip-LVM2_member.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: os-prober/os-probes/common/50mounted-tests -=================================================================== ---- os-prober.orig/os-probes/common/50mounted-tests -+++ os-prober/os-probes/common/50mounted-tests -@@ -15,6 +15,9 @@ elif [ "$types" = swap ]; then - elif [ "$types" = crypto_LUKS ]; then - debug "$1 is a LUKS partition; skipping" - exit 0 -+elif [ "$types" = LVM2_member ]; then -+ debug "$1 is a LVM2 partition; skipping" -+ exit 0 - elif [ "$types" = ntfs ]; then - if type ntfs-3g >/dev/null 2>&1; then - types='ntfs-3g ntfs' diff --git a/os-prober-EFI-openSUSEfy.patch b/os-prober-EFI-openSUSEfy.patch index 9c8271a..1ada700 100644 --- a/os-prober-EFI-openSUSEfy.patch +++ b/os-prober-EFI-openSUSEfy.patch @@ -7,24 +7,24 @@ after upstream merged (slightly outdated) version of them. - retain ELILO vendor prefix in case someone is really using it - comment in 05efi is obviously wrong -Index: os-prober-1.61/os-probes/mounted/x86/efi/10elilo +Index: os-prober/os-probes/mounted/x86/efi/10elilo =================================================================== ---- os-prober-1.61.orig/os-probes/mounted/x86/efi/10elilo -+++ os-prober-1.61/os-probes/mounted/x86/efi/10elilo +--- os-prober.orig/os-probes/mounted/x86/efi/10elilo ++++ os-prober/os-probes/mounted/x86/efi/10elilo @@ -11,7 +11,8 @@ elilo=`find $1 -name "elilo.efi"` if [ -n "$elilo" ]; then - bdir=`dirname $elilo` - bdir=`basename $bdir` + bdir="${elilo%/*}" + bdir="${elilo##*/}" - long="ELILO Boot Manager" + vendor=$(echo $bdir | sed 's|SuSE|SUSE|') + long="${vendor} ELILO Boot Manager" short="ELILO" path=${bdir}/elilo.efi found=true -Index: os-prober-1.61/os-probes/mounted/x86/05efi +Index: os-prober/os-probes/mounted/x86/05efi =================================================================== ---- os-prober-1.61.orig/os-probes/mounted/x86/05efi -+++ os-prober-1.61/os-probes/mounted/x86/05efi +--- os-prober.orig/os-probes/mounted/x86/05efi ++++ os-prober/os-probes/mounted/x86/05efi @@ -1,5 +1,5 @@ #!/bin/sh -# Detects all Microsoft OSes on a collection of partitions. diff --git a/os-prober-btrfs-always-detect-default.patch b/os-prober-btrfs-always-detect-default.patch index 8930e95..d67b327 100644 --- a/os-prober-btrfs-always-detect-default.patch +++ b/os-prober-btrfs-always-detect-default.patch @@ -1,7 +1,7 @@ -Index: os-prober-1.61/linux-boot-prober +Index: os-prober/linux-boot-prober =================================================================== ---- os-prober-1.61.orig/linux-boot-prober -+++ os-prober-1.61/linux-boot-prober +--- os-prober.orig/linux-boot-prober ++++ os-prober/linux-boot-prober @@ -67,7 +67,12 @@ if [ "$type" = btrfs ]; then fi if [ -z "$mpoint" ]; then @@ -16,15 +16,14 @@ Index: os-prober-1.61/linux-boot-prober warn "error mounting btrfs subvol=$subvol UUID=$UUID" umount "$tmpmnt/boot" 2>/dev/null umount "$tmpmnt" 2>/dev/null -Index: os-prober-1.61/os-probes/common/50mounted-tests +Index: os-prober/os-probes/common/50mounted-tests =================================================================== ---- os-prober-1.61.orig/os-probes/common/50mounted-tests -+++ os-prober-1.61/os-probes/common/50mounted-tests -@@ -99,6 +99,48 @@ if [ "$mounted" ]; then - fi +--- os-prober.orig/os-probes/common/50mounted-tests ++++ os-prober/os-probes/common/50mounted-tests +@@ -113,6 +113,47 @@ if [ "$mounted" ]; then fi + do_unmount -+ +probe_subvol () +{ + local subvol=$1 @@ -66,10 +65,10 @@ Index: os-prober-1.61/os-probes/common/50mounted-tests + return $ret +} + - # all btrfs subvol processing here. Handle both unmounted and + # all btrfs processing here. Handle both unmounted and # mounted subvolumes. if [ "$types" = btrfs ]; then -@@ -121,45 +163,23 @@ if [ "$types" = btrfs ]; then +@@ -135,45 +176,23 @@ if [ "$types" = btrfs ]; then rmdir "$tmpmnt" || true exit 1 fi @@ -129,4 +128,4 @@ Index: os-prober-1.61/os-probes/common/50mounted-tests + found=1 fi done - if [ "$found" ]; then + rmdir "$tmpmnt" || true diff --git a/os-prober-btrfsfix.patch b/os-prober-btrfsfix.patch index 1fd639a..6ba831a 100644 --- a/os-prober-btrfsfix.patch +++ b/os-prober-btrfsfix.patch @@ -1,8 +1,8 @@ -Index: os-prober-1.57/common.sh +Index: os-prober/common.sh =================================================================== ---- os-prober-1.57.orig/common.sh -+++ os-prober-1.57/common.sh -@@ -125,6 +125,7 @@ parse_proc_mounts () { +--- os-prober.orig/common.sh ++++ os-prober/common.sh +@@ -155,6 +155,7 @@ parse_proc_mounts () { done } @@ -10,7 +10,7 @@ Index: os-prober-1.57/common.sh parsefstab () { while read -r line; do case "$line" in -@@ -135,12 +136,22 @@ parsefstab () { +@@ -165,12 +166,22 @@ parsefstab () { set -f set -- $line set +f @@ -34,10 +34,10 @@ Index: os-prober-1.57/common.sh unescape_mount () { printf %s "$1" | \ sed 's/\\011/ /g; s/\\012/\n/g; s/\\040/ /g; s/\\134/\\/g' -Index: os-prober-1.57/linux-boot-prober +Index: os-prober/linux-boot-prober =================================================================== ---- os-prober-1.57.orig/linux-boot-prober -+++ os-prober-1.57/linux-boot-prober +--- os-prober.orig/linux-boot-prober ++++ os-prober/linux-boot-prober @@ -5,16 +5,143 @@ set -e newns "$@" @@ -184,10 +184,10 @@ Index: os-prober-1.57/linux-boot-prober if ! mapped="$(mapdevfs "$partition")"; then log "Device '$partition' does not exist; skipping" continue -Index: os-prober-1.57/linux-boot-probes/mounted/common/40grub2 +Index: os-prober/linux-boot-probes/mounted/common/40grub2 =================================================================== ---- os-prober-1.57.orig/linux-boot-probes/mounted/common/40grub2 -+++ os-prober-1.57/linux-boot-probes/mounted/common/40grub2 +--- os-prober.orig/linux-boot-probes/mounted/common/40grub2 ++++ os-prober/linux-boot-probes/mounted/common/40grub2 @@ -2,17 +2,27 @@ . /usr/share/os-prober/common.sh set -e @@ -217,11 +217,11 @@ Index: os-prober-1.57/linux-boot-probes/mounted/common/40grub2 result "$rootpart:$bootpart:$title:$kernel:$initrd:$parameters" found_item=1 fi -Index: os-prober-1.57/os-prober +Index: os-prober/os-prober =================================================================== ---- os-prober-1.57.orig/os-prober -+++ os-prober-1.57/os-prober -@@ -67,6 +67,9 @@ partitions () { +--- os-prober.orig/os-prober ++++ os-prober/os-prober +@@ -79,6 +79,9 @@ partitions () { echo "$(LVM_SUPPRESS_FD_WARNINGS=1 log_output lvs --noheadings --separator : -o vg_name,lv_name | sed "s|-|--|g;s|^[[:space:]]*\(.*\):\(.*\)$|/dev/mapper/\1-\2|")" fi @@ -231,7 +231,7 @@ Index: os-prober-1.57/os-prober } parse_proc_swaps () { -@@ -125,6 +128,8 @@ if [ -f /proc/mdstat ] ; then +@@ -137,6 +140,8 @@ if [ -f /proc/mdstat ] ; then grep "^md" /proc/mdstat | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true fi @@ -240,7 +240,7 @@ Index: os-prober-1.57/os-prober for partition in $(partitions); do if ! mapped="$(mapdevfs "$partition")"; then log "Device '$partition' does not exist; skipping" -@@ -143,7 +148,26 @@ for partition in $(partitions); do +@@ -155,7 +160,26 @@ for partition in $(partitions); do continue fi @@ -268,15 +268,15 @@ Index: os-prober-1.57/os-prober for test in /usr/lib/os-probes/*; do if [ -f "$test" ] && [ -x "$test" ]; then debug "running $test on $partition" -Index: os-prober-1.57/os-probes/common/50mounted-tests +Index: os-prober/os-probes/common/50mounted-tests =================================================================== ---- os-prober-1.57.orig/os-probes/common/50mounted-tests -+++ os-prober-1.57/os-probes/common/50mounted-tests -@@ -5,7 +5,19 @@ partition="$1" +--- os-prober.orig/os-probes/common/50mounted-tests ++++ os-prober/os-probes/common/50mounted-tests +@@ -19,7 +19,19 @@ do_unmount() { + rmdir "$tmpmnt" || true + } - . /usr/share/os-prober/common.sh - --types="$(fs_type "$partition")" || types=NOT-DETECTED +-types="$(fs_type "$partition")" +if [ "x$1" = xbtrfs ]; then + types=btrfs + if [ -z "$2" -o -z "$3" ]; then @@ -287,13 +287,13 @@ Index: os-prober-1.57/os-probes/common/50mounted-tests + BTRFSDEV="$3" +else + partition="$1" -+ types="$(fs_type "$partition")" || types=NOT-DETECTED ++ types="$(fs_type "$partition")" +fi + if [ "$types" = NOT-DETECTED ]; then debug "$1 type not recognised; skipping" exit 0 -@@ -49,6 +61,76 @@ if [ ! -d "$tmpmnt" ]; then +@@ -66,6 +78,76 @@ if [ ! -d "$tmpmnt" ]; then fi mounted= @@ -370,10 +370,10 @@ Index: os-prober-1.57/os-probes/common/50mounted-tests if type grub2-mount >/dev/null 2>&1 && \ type grub2-probe >/dev/null 2>&1 && \ grub2-mount "$partition" "$tmpmnt" 2>/dev/null; then -Index: os-prober-1.57/os-probes/mounted/common/90linux-distro +Index: os-prober/os-probes/mounted/common/90linux-distro =================================================================== ---- os-prober-1.57.orig/os-probes/mounted/common/90linux-distro -+++ os-prober-1.57/os-probes/mounted/common/90linux-distro +--- os-prober.orig/os-probes/mounted/common/90linux-distro ++++ os-prober/os-probes/mounted/common/90linux-distro @@ -7,6 +7,8 @@ set -e partition="$1" dir="$2" @@ -383,7 +383,7 @@ Index: os-prober-1.57/os-probes/mounted/common/90linux-distro # This test is inaccurate, but given separate / and /boot partitions and the # fact that only some architectures have ld-linux.so, I can't see anything -@@ -131,7 +133,11 @@ if (ls "$dir"/lib*/ld*.so* || ls "$dir"/ +@@ -143,7 +145,11 @@ if (ls "$dir"/lib*/ld*.so* && [ -d "$dir fi label="$(count_next_label "$short")" @@ -396,10 +396,10 @@ Index: os-prober-1.57/os-probes/mounted/common/90linux-distro exit 0 else exit 1 -Index: os-prober-1.57/README.btrfs +Index: os-prober/README.btrfs =================================================================== --- /dev/null -+++ os-prober-1.57/README.btrfs ++++ os-prober/README.btrfs @@ -0,0 +1,15 @@ +BTRFS is a new filesystem which combines the filesystem with logical volume +management (subvolumes). For further information, see: diff --git a/os-prober-call-dmraid-once.patch b/os-prober-call-dmraid-once.patch deleted file mode 100644 index a33bb1e..0000000 --- a/os-prober-call-dmraid-once.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: Jeff Mahoney -Subject: os-prober: call dmraid -r *once* -References: bnc#883453 - -os-prober calls dmraid -r -c unqualifed for every partition and then greps -the result. dmraid -r -c without a device list will scan every device -on the system. Every time. The results will not differ between runs. - -This patch saves the results and performs the grep afterward. - -Signed-off-by: Jeff Mahoney ---- - os-prober | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -Index: os-prober/os-prober -=================================================================== ---- os-prober.orig/os-prober -+++ os-prober/os-prober -@@ -14,11 +14,17 @@ log_output () { - fi - } - -+: >"$OS_PROBER_TMP/dmraid-map" -+DMRAID=$(type dmraid >/dev/null 2>&1 || true) -+if [ -n "$DMRAID" ]; then -+ dmraid -r -c >"$OS_PROBER_TMP/dmraid-map" -+fi -+ - on_sataraid () { - type dmraid >/dev/null 2>&1 || return 1 - local parent="${1%/*}" - local device="/dev/${parent##*/}" -- if dmraid -r -c | grep -q "$device"; then -+ if grep -q "$device" "$OS_PROBER_TMP/dmraid-map"; then - return 0 - fi - return 1 diff --git a/os-prober-dont-load-all-fs-module-and-dont-test-mount.patch b/os-prober-dont-load-all-fs-module-and-dont-test-mount.patch index 4adb2af..859dffd 100644 --- a/os-prober-dont-load-all-fs-module-and-dont-test-mount.patch +++ b/os-prober-dont-load-all-fs-module-and-dont-test-mount.patch @@ -1,7 +1,8 @@ -diff -urN os-prober.old/os-probes/common/50mounted-tests os-prober/os-probes/common/50mounted-tests ---- os-prober.old/os-probes/common/50mounted-tests 2014-12-14 19:04:07.712368755 +0100 -+++ os-prober/os-probes/common/50mounted-tests 2014-12-14 19:08:15.674211934 +0100 -@@ -25,19 +25,13 @@ +Index: os-prober/os-probes/common/50mounted-tests +=================================================================== +--- os-prober.orig/os-probes/common/50mounted-tests ++++ os-prober/os-probes/common/50mounted-tests +@@ -57,19 +57,13 @@ elif [ -z "$types" ]; then debug "$1 is a LUKS partition; skipping" exit 0 fi @@ -28,18 +29,19 @@ diff -urN os-prober.old/os-probes/common/50mounted-tests os-prober/os-probes/com fi tmpmnt=/var/lib/os-prober/mount -@@ -59,7 +53,7 @@ +@@ -161,7 +155,7 @@ if type grub2-mount >/dev/null 2>&1 && \ fi - else - ro_partition "$partition" + elif dm_device="$(do_dmsetup osprober "$partition")" && \ + [ "$dm_device" ]; then - for type in $types $delaytypes; do + for type in $types; do - if mount -o ro -t "$type" "$partition" "$tmpmnt" 2>/dev/null; then + if mountinfo=`mount -o ro -t "$type" "$dm_device" "$tmpmnt" 2>&1`; then debug "mounted as $type filesystem" mounted=1 -diff -urN os-prober.old/os-probes/init/common/10filesystems os-prober/os-probes/init/common/10filesystems ---- os-prober.old/os-probes/init/common/10filesystems 2014-12-14 19:04:07.713368758 +0100 -+++ os-prober/os-probes/init/common/10filesystems 2014-12-14 19:09:51.939538946 +0100 +Index: os-prober/os-probes/init/common/10filesystems +=================================================================== +--- os-prober.orig/os-probes/init/common/10filesystems ++++ os-prober/os-probes/init/common/10filesystems @@ -1,39 +1,19 @@ #!/bin/sh # Make sure filesystems are available. diff --git a/os-prober-fix-btrfs-subvol-mounted-tests.patch b/os-prober-fix-btrfs-subvol-mounted-tests.patch index b7711e5..7964c5e 100644 --- a/os-prober-fix-btrfs-subvol-mounted-tests.patch +++ b/os-prober-fix-btrfs-subvol-mounted-tests.patch @@ -1,15 +1,13 @@ -Index: os-prober-1.61/os-probes/common/50mounted-tests +Index: os-prober/os-probes/common/50mounted-tests =================================================================== ---- os-prober-1.61.orig/os-probes/common/50mounted-tests -+++ os-prober-1.61/os-probes/common/50mounted-tests -@@ -56,10 +56,54 @@ fi +--- os-prober.orig/os-probes/common/50mounted-tests ++++ os-prober/os-probes/common/50mounted-tests +@@ -73,10 +73,51 @@ fi mounted= --# all btrfs processing here. Handle both unmounted and --# mounted subvolumes. - if [ "$types" = btrfs ]; then - partition="$BTRFSDEV" ++if [ "$types" = btrfs ]; then ++ partition="$BTRFSDEV" +fi + +if type grub2-mount >/dev/null 2>&1 && \ @@ -23,13 +21,15 @@ Index: os-prober-1.61/os-probes/common/50mounted-tests + debug "mounted using GRUB, but unknown filesystem?" + type=fuseblk + fi -+else -+ ro_partition "$partition" ++elif dm_device="$(do_dmsetup osprober "$partition")" && \ ++ [ "$dm_device" ]; then + for type in $types; do -+ if mount -o ro -t "$type" "$partition" "$tmpmnt" 2>/dev/null; then ++ if mountinfo=`mount -o ro -t "$type" "$dm_device" "$tmpmnt" 2>&1`; then + debug "mounted as $type filesystem" + mounted=1 + break ++ else ++ debug "mounting $dm_device ($partition) as $type failed: $mountinfo" + fi + done +fi @@ -40,38 +40,30 @@ Index: os-prober-1.61/os-probes/common/50mounted-tests + if [ -f "$test" ] && [ -x "$test" ]; then + if "$test" "$partition" "$tmpmnt" "$type"; then + debug "os found by subtest $test" -+ if ! umount "$tmpmnt"; then -+ warn "failed to umount $tmpmnt" -+ fi -+ rmdir "$tmpmnt" || true ++ do_unmount + exit 0 + fi + fi + done -+ if ! umount "$tmpmnt"; then -+ warn "failed to umount $tmpmnt" -+ fi +fi ++do_unmount + -+# all btrfs subvol processing here. Handle both unmounted and -+# mounted subvolumes. -+if [ "$types" = btrfs ]; then + # all btrfs processing here. Handle both unmounted and + # mounted subvolumes. + if [ "$types" = btrfs ]; then +- partition="$BTRFSDEV" debug "begin btrfs processing for $UUID" # note that the btrfs volume must not be mounted ro if mount -t btrfs -U "$UUID" "$tmpmnt" 2>/dev/null; then -@@ -117,52 +161,9 @@ if [ "$types" = btrfs ]; then - fi - fi - done -- rmdir "$tmpmnt" || true +@@ -137,48 +178,8 @@ if [ "$types" = btrfs ]; then + rmdir "$tmpmnt" || true if [ "$found" ]; then -+ rmdir "$tmpmnt" || true exit 0 - else - exit 1 -- fi --fi -- + fi + fi + -if type grub2-mount >/dev/null 2>&1 && \ - type grub2-probe >/dev/null 2>&1 && \ - grub2-mount "$partition" "$tmpmnt" 2>/dev/null; then @@ -83,13 +75,15 @@ Index: os-prober-1.61/os-probes/common/50mounted-tests - debug "mounted using GRUB, but unknown filesystem?" - type=fuseblk - fi --else -- ro_partition "$partition" +-elif dm_device="$(do_dmsetup osprober "$partition")" && \ +- [ "$dm_device" ]; then - for type in $types; do -- if mount -o ro -t "$type" "$partition" "$tmpmnt" 2>/dev/null; then +- if mountinfo=`mount -o ro -t "$type" "$dm_device" "$tmpmnt" 2>&1`; then - debug "mounted as $type filesystem" - mounted=1 - break +- else +- debug "mounting $dm_device ($partition) as $type failed: $mountinfo" - fi - done -fi @@ -100,16 +94,13 @@ Index: os-prober-1.61/os-probes/common/50mounted-tests - if [ -f "$test" ] && [ -x "$test" ]; then - if "$test" "$partition" "$tmpmnt" "$type"; then - debug "os found by subtest $test" -- if ! umount "$tmpmnt"; then -- warn "failed to umount $tmpmnt" -- fi -- rmdir "$tmpmnt" || true +- do_unmount - exit 0 - fi - fi - done -- if ! umount "$tmpmnt"; then -- warn "failed to umount $tmpmnt" - fi - fi - +-fi +-do_unmount +- + # No tests found anything. + exit 1 diff --git a/os-prober-linux-distro-avoid-expensive-ld-file-test.patch b/os-prober-linux-distro-avoid-expensive-ld-file-test.patch index 639acb7..0ff7176 100644 --- a/os-prober-linux-distro-avoid-expensive-ld-file-test.patch +++ b/os-prober-linux-distro-avoid-expensive-ld-file-test.patch @@ -1,8 +1,8 @@ -Index: os-prober-1.70/os-probes/mounted/common/90linux-distro +Index: os-prober/os-probes/mounted/common/90linux-distro =================================================================== ---- os-prober-1.70.orig/os-probes/mounted/common/90linux-distro -+++ os-prober-1.70/os-probes/mounted/common/90linux-distro -@@ -10,135 +10,121 @@ type="$3" +--- os-prober.orig/os-probes/mounted/common/90linux-distro ++++ os-prober/os-probes/mounted/common/90linux-distro +@@ -10,147 +10,133 @@ type="$3" uuid="$4" subvol="$5" @@ -15,8 +15,11 @@ Index: os-prober-1.70/os-probes/mounted/common/90linux-distro -# symlinks we need to also check in $dir/usr/lib* for distributions that -# moved /lib* to /usr and only left symlinks behind. -# TODO: look for ld-linux.so on arches that have it --if (ls "$dir"/lib*/ld*.so* || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then -- if [ -e "$dir/etc/debian_version" ]; then +-if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then +- if [ -e "$dir/etc/os-release" ]; then +- short="$(grep ^NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')" +- long="$(grep ^PRETTY_NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')" +- elif [ -e "$dir/etc/debian_version" ]; then - short="Debian" - long="$(printf "Debian GNU/Linux (%s)\n" "$(cat "$dir/etc/debian_version")")" - # RPM derived distributions may also have a redhat-release or @@ -69,6 +72,9 @@ Index: os-prober-1.70/os-probes/mounted/common/90linux-distro - elif [ -e "$dir/etc/openna-release" ]; then - short="OpenNA" - long="$(cat "$dir/etc/openna-release")" +- elif [ -e "$dir/etc/mageia-release" ]; then +- short="Mageia" +- long="$(cat "$dir/etc/mageia-release")" - elif [ -e "$dir/etc/conectiva-release" ]; then - short="Conectiva" - long="$(cat "$dir/etc/conectiva-release")" @@ -123,6 +129,12 @@ Index: os-prober-1.70/os-probes/mounted/common/90linux-distro - elif [ -e "$dir/etc/meego-release" ]; then - short="MeeGo" - long="$(head -1 "$dir/etc/meego-release")" +- elif [ -e "$dir/etc/4MLinux-version" ]; then +- short="4MLinux" +- long="4MLinux $(head -1 "$dir/etc/4MLinux-version")" +- elif [ -e "$dir/etc/devuan_version" ]; then +- short="Devuan" +- long="$(printf "Devuan GNU/Linux (%s)\n" "$(cat "$dir/etc/devuan_version")")" - else - short="Linux" - long="unknown Linux distribution" @@ -135,7 +147,10 @@ Index: os-prober-1.70/os-probes/mounted/common/90linux-distro - result "$partition:$long:$label:linux" - fi - exit 0 -+if [ -e "$dir/etc/debian_version" ]; then ++if [ -e "$dir/etc/os-release" ]; then ++ short="$(grep ^NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')" ++ long="$(grep ^PRETTY_NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')" ++elif [ -e "$dir/etc/debian_version" ]; then + short="Debian" + long="$(printf "Debian GNU/Linux (%s)\n" "$(cat "$dir/etc/debian_version")")" +# RPM derived distributions may also have a redhat-release or @@ -188,6 +203,9 @@ Index: os-prober-1.70/os-probes/mounted/common/90linux-distro +elif [ -e "$dir/etc/openna-release" ]; then + short="OpenNA" + long="$(cat "$dir/etc/openna-release")" ++elif [ -e "$dir/etc/mageia-release" ]; then ++ short="Mageia" ++ long="$(cat "$dir/etc/mageia-release")" +elif [ -e "$dir/etc/conectiva-release" ]; then + short="Conectiva" + long="$(cat "$dir/etc/conectiva-release")" @@ -242,6 +260,12 @@ Index: os-prober-1.70/os-probes/mounted/common/90linux-distro +elif [ -e "$dir/etc/meego-release" ]; then + short="MeeGo" + long="$(head -1 "$dir/etc/meego-release")" ++elif [ -e "$dir/etc/4MLinux-version" ]; then ++ short="4MLinux" ++ long="4MLinux $(head -1 "$dir/etc/4MLinux-version")" ++elif [ -e "$dir/etc/devuan_version" ]; then ++ short="Devuan" ++ long="$(printf "Devuan GNU/Linux (%s)\n" "$(cat "$dir/etc/devuan_version")")" else exit 1 fi @@ -253,11 +277,11 @@ Index: os-prober-1.70/os-probes/mounted/common/90linux-distro + result "$partition:$long:$label:linux" +fi +exit 0 -Index: os-prober-1.70/os-prober +Index: os-prober/os-prober =================================================================== ---- os-prober-1.70.orig/os-prober -+++ os-prober-1.70/os-prober -@@ -187,6 +187,11 @@ for partition in $(partitions); do +--- os-prober.orig/os-prober ++++ os-prober/os-prober +@@ -186,6 +186,11 @@ for partition in $(partitions); do # be handled by 50mounted-tests so we can do a subvol only once. type=$(blkid -o value -s TYPE $mapped || true) if [ "$type" = btrfs ]; then diff --git a/os-prober-linux-distro-parse-os-release.patch b/os-prober-linux-distro-parse-os-release.patch index b0e426f..d8d7791 100644 --- a/os-prober-linux-distro-parse-os-release.patch +++ b/os-prober-linux-distro-parse-os-release.patch @@ -1,25 +1,24 @@ -Index: os-prober-1.70/os-probes/mounted/common/90linux-distro +Index: os-prober/os-probes/mounted/common/90linux-distro =================================================================== ---- os-prober-1.70.orig/os-probes/mounted/common/90linux-distro -+++ os-prober-1.70/os-probes/mounted/common/90linux-distro -@@ -117,6 +117,20 @@ elif [ -e "$dir/etc/lfs-release" ]; then - elif [ -e "$dir/etc/meego-release" ]; then - short="MeeGo" - long="$(head -1 "$dir/etc/meego-release")" -+elif [ -L "$dir/etc/os-release" ]; then +--- os-prober.orig/os-probes/mounted/common/90linux-distro ++++ os-prober/os-probes/mounted/common/90linux-distro +@@ -10,7 +10,18 @@ type="$3" + uuid="$4" + subvol="$5" + +-if [ -e "$dir/etc/os-release" ]; then ++if [ -L "$dir/etc/os-release" ]; then + RELPATH=$(readlink -f "$dir/etc/os-release") + if readlink "$dir/etc/os-release" | grep -q '^/'; then + RELPATH="$dir$RELPATH" + fi + if [ -f "$RELPATH" ]; then -+ short=$(sed -n "/^NAME=/{s@\"\(.*\)\"@\1@;t 1;s@'\(.*\)'@\1@;: 1;s@^[^=]\+=@@;p;b}" "$RELPATH") -+ long="$short $(sed -n "/^VERSION=/{s@\"\(.*\)\"@\1@;t 1;s@'\(.*\)'@\1@;: 1;s@^[^=]\+=@@;p;b}" "$RELPATH")" ++ short="$(grep ^NAME= "$RELPATH" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')" ++ long="$(grep ^PRETTY_NAME= "$RELPATH" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')" + else + exit 1 + fi +elif [ -e "$dir/etc/os-release" ]; then -+ short=$(sed -n "/^NAME=/{s@\"\(.*\)\"@\1@;t 1;s@'\(.*\)'@\1@;: 1;s@^[^=]\+=@@;p;b}" $dir/etc/os-release) -+ long="$short $(sed -n "/^VERSION=/{s@\"\(.*\)\"@\1@;t 1;s@'\(.*\)'@\1@;: 1;s@^[^=]\+=@@;p;b}" $dir/etc/os-release)" - else - exit 1 - fi + short="$(grep ^NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')" + long="$(grep ^PRETTY_NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')" + elif [ -e "$dir/etc/debian_version" ]; then diff --git a/os-prober.changes b/os-prober.changes index 16f75a7..6197772 100644 --- a/os-prober.changes +++ b/os-prober.changes @@ -1,3 +1,36 @@ +------------------------------------------------------------------- +Fri Feb 10 08:45:28 UTC 2017 - mchang@suse.com + +- Version bump to 1.74: + * Add support for Mageia + * Improve logging of mounting and setting partitions to ro/rw + * Use a read-only device-mapper entry if possible rather than setting the + underlying device to read-only. + Note that this introduces a dependency on dmsetup on Linux architectures. + * Remove the "blockdev --setro" code path entirely, since the read-only + device-mapper arrangement supersedes it and should be safer + * Make the yaboot parser more tolerant about the syntax of "append" options + * Disable debugging if OS_PROBER_DISABLE_DEBUG is set + * Replace basename/dirname with shell string processing + * Fix typos in README + * Add Devuan detection + * Work harder to avoid trying to mount extended partitions + * Drop " (loader)" suffixes on Microsoft operating systems + * Add support for 4MLinux + * Use HTTPS for Vcs-* URLs, and link to cgit rather than gitweb. +- Rediff + * os-prober-1.49-grub2-mount.patch + * os-prober-EFI-openSUSEfy.patch + * os-prober-btrfs-always-detect-default.patch + * os-prober-btrfsfix.patch + * os-prober-dont-load-all-fs-module-and-dont-test-mount.patch + * os-prober-fix-btrfs-subvol-mounted-tests.patch + * os-prober-linux-distro-avoid-expensive-ld-file-test.patch + * os-prober-linux-distro-parse-os-release.patch +- Remove patches; fixed on upstream release + * os-prober-call-dmraid-once.patch + * os-prober-1.49-skip-LVM2_member.patch + ------------------------------------------------------------------- Tue Nov 15 09:03:26 UTC 2016 - mchang@suse.com diff --git a/os-prober.spec b/os-prober.spec index 7938965..44e2d96 100644 --- a/os-prober.spec +++ b/os-prober.spec @@ -1,7 +1,7 @@ # # spec file for package os-prober # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: os-prober -Version: 1.70 +Version: 1.74 Release: 0 Summary: Probes disks on the system for installed operating systems License: GPL-2.0+ @@ -32,8 +32,6 @@ Patch0: os-prober-newnsdirfix.patch Patch1: os-prober-SUSE.patch # PATCH-FIX-OPENSUSE: Fix parsing of grub.cfg [bnc#796919] Patch3: os-prober-1.49-fix-grub2.cfg-parsing.patch -# PATCH-FIX-OPENSUSE: Do not try to mount LVM2 PV [bnc#798604] -Patch4: os-prober-1.49-skip-LVM2_member.patch # PATCH-FIX-OPENSUSE: Use correct name for grub2-mount Patch5: os-prober-1.49-grub2-mount.patch # PATCH-FIX-OPENSUSE: Probe also unpartitioned Linux MD devices (bnc#811006) @@ -52,8 +50,6 @@ Patch12: os-prober-dont-load-all-fs-module-and-dont-test-mount.patch Patch13: os-prober-fix-btrfs-subvol-mounted-tests.patch # PATCH-FIX-SLE: fix os-prober creates many unusuable entries on multipath disk (bnc#875327) Patch14: os-prober-skip-part-on-multipath.patch -# PATCH-FIX-SLE: fix os-prober: dmraid is called without a device list for every partition (bnc#883453) -Patch15: os-prober-call-dmraid-once.patch # PATCH-FIX-SLE: fix os-prober fails to detect other SLES12 installation (bsc#892364) Patch17: Improve-btrfs-handling-on-os-probing-for-grub2.patch # PATCH-FIX-SLE: fix os-prober mount error, no such file or directory (bsc#931955) @@ -77,6 +73,7 @@ Requires: udev Requires: util-linux Recommends: dmraid Recommends: lvm2 +Recommends: dmsetup %if 0%{?suse_version} >= 1315 # For logger utility Requires: util-linux-systemd @@ -88,12 +85,11 @@ in a generic machine-readable format. Support for new OSes and Linux distributions can be added easily. %prep -%setup -q +%setup -q -n os-prober cp %{SOURCE1} . %patch0 -p1 %patch1 -p1 %patch3 -p1 -%patch4 -p1 %patch5 -p1 %patch7 -p1 %patch8 -p1 @@ -103,7 +99,6 @@ cp %{SOURCE1} . %patch12 -p1 %patch13 -p1 %patch14 -p1 -%patch15 -p1 %patch17 -p1 %patch18 -p1 %patch19 -p1 diff --git a/os-prober_1.70.tar.xz b/os-prober_1.70.tar.xz deleted file mode 100644 index 741a4df..0000000 --- a/os-prober_1.70.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f95a8998e106578edf105c42c84809c71e413a01370be9bd0b6d238d5b63bf1d -size 25468 diff --git a/os-prober_1.74.tar.xz b/os-prober_1.74.tar.xz new file mode 100644 index 0000000..d9e75b8 --- /dev/null +++ b/os-prober_1.74.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8e97ae193783eb8b5f5aba6b6d447b2e3e60696bb71f86ad029c33e14c5a7be +size 26692