Hello community, here is the log from the commit of package os-prober for openSUSE:Factory checked in at 2017-02-22 13:51:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/os-prober (Old) and /work/SRC/openSUSE:Factory/.os-prober.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "os-prober" Changes: -------- --- /work/SRC/openSUSE:Factory/os-prober/os-prober.changes 2016-11-16 13:46:49.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.os-prober.new/os-prober.changes 2017-02-22 13:51:03.669436948 +0100 @@ -1,0 +2,33 @@ +Fri Feb 10 08:45:28 UTC 2017 - mch...@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 + +------------------------------------------------------------------- Old: ---- os-prober-1.49-skip-LVM2_member.patch os-prober-call-dmraid-once.patch os-prober_1.70.tar.xz New: ---- os-prober_1.74.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ os-prober.spec ++++++ --- /var/tmp/diff_new_pack.4Xokpd/_old 2017-02-22 13:51:04.541312851 +0100 +++ /var/tmp/diff_new_pack.4Xokpd/_new 2017-02-22 13:51:04.541312851 +0100 @@ -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 @@ 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 @@ 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: util-linux Recommends: dmraid Recommends: lvm2 +Recommends: dmsetup %if 0%{?suse_version} >= 1315 # For logger utility Requires: util-linux-systemd @@ -88,12 +85,11 @@ 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 @@ %patch12 -p1 %patch13 -p1 %patch14 -p1 -%patch15 -p1 %patch17 -p1 %patch18 -p1 %patch19 -p1 ++++++ os-prober-1.49-grub2-mount.patch ++++++ --- /var/tmp/diff_new_pack.4Xokpd/_old 2017-02-22 13:51:04.593305450 +0100 +++ /var/tmp/diff_new_pack.4Xokpd/_new 2017-02-22 13:51:04.597304881 +0100 @@ -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 @@ + 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 @@ - 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 @@ 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 ++++++ os-prober-EFI-openSUSEfy.patch ++++++ --- /var/tmp/diff_new_pack.4Xokpd/_old 2017-02-22 13:51:04.609303173 +0100 +++ /var/tmp/diff_new_pack.4Xokpd/_new 2017-02-22 13:51:04.613302604 +0100 @@ -7,24 +7,24 @@ - 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. ++++++ os-prober-btrfs-always-detect-default.patch ++++++ --- /var/tmp/diff_new_pack.4Xokpd/_old 2017-02-22 13:51:04.629300327 +0100 +++ /var/tmp/diff_new_pack.4Xokpd/_new 2017-02-22 13:51:04.633299758 +0100 @@ -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 @@ 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 @@ + 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 @@ + found=1 fi done - if [ "$found" ]; then + rmdir "$tmpmnt" || true ++++++ os-prober-btrfsfix.patch ++++++ --- /var/tmp/diff_new_pack.4Xokpd/_old 2017-02-22 13:51:04.645298049 +0100 +++ /var/tmp/diff_new_pack.4Xokpd/_new 2017-02-22 13:51:04.649297481 +0100 @@ -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 @@ 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 @@ 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 @@ 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 @@ 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 @@ } 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 @@ 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 @@ 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" - - . /usr/share/os-prober/common.sh +--- os-prober.orig/os-probes/common/50mounted-tests ++++ os-prober/os-probes/common/50mounted-tests +@@ -19,7 +19,19 @@ do_unmount() { + rmdir "$tmpmnt" || true + } --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 @@ + 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 @@ 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 @@ # 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 @@ 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: ++++++ os-prober-dont-load-all-fs-module-and-dont-test-mount.patch ++++++ --- /var/tmp/diff_new_pack.4Xokpd/_old 2017-02-22 13:51:04.657296342 +0100 +++ /var/tmp/diff_new_pack.4Xokpd/_new 2017-02-22 13:51:04.661295773 +0100 @@ -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 @@ 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. ++++++ os-prober-fix-btrfs-subvol-mounted-tests.patch ++++++ --- /var/tmp/diff_new_pack.4Xokpd/_old 2017-02-22 13:51:04.669294635 +0100 +++ /var/tmp/diff_new_pack.4Xokpd/_new 2017-02-22 13:51:04.673294065 +0100 @@ -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 @@ + 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 @@ + 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 @@ - 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 @@ - 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 ++++++ os-prober-linux-distro-avoid-expensive-ld-file-test.patch ++++++ --- /var/tmp/diff_new_pack.4Xokpd/_old 2017-02-22 13:51:04.681292927 +0100 +++ /var/tmp/diff_new_pack.4Xokpd/_new 2017-02-22 13:51:04.685292357 +0100 @@ -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 @@ -# 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 @@ - 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 @@ - 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 @@ - 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 @@ +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 @@ +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 @@ + 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 ++++++ os-prober-linux-distro-parse-os-release.patch ++++++ --- /var/tmp/diff_new_pack.4Xokpd/_old 2017-02-22 13:51:04.693291219 +0100 +++ /var/tmp/diff_new_pack.4Xokpd/_new 2017-02-22 13:51:04.697290650 +0100 @@ -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 ++++++ os-prober_1.70.tar.xz -> os-prober_1.74.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-prober-1.70/README new/os-prober/README --- old/os-prober-1.70/README 2011-01-20 08:59:35.000000000 +0100 +++ new/os-prober/README 2017-01-27 22:49:14.000000000 +0100 @@ -3,7 +3,7 @@ them, and work out how to boot other linux installs. os-prober --------- +--------- All one has to do is Depend on os-prober, and then run the os-prober command. This command takes no arguments: it will scan all disks available @@ -19,7 +19,7 @@ with their own boot sectors. Tests are executable programs in the directory /usr/lib/os-probes/. Each -test is called once per partition, with the partiton to check as its +test is called once per partition, with the partition to check as its parameter, and may output a string as described above, or nothing if it does not recognise an OS on that partition. Tests return an exit code of 0 if they successfully found an OS, and no further tests will be run on that @@ -41,7 +41,7 @@ linux-boot-prober ----------------- -the linux-boot-prober command should be run with a single argument +The linux-boot-prober command should be run with a single argument consisting of a partition that is known to have a linux root filesystem on it, as returned by the os-prober command. It will try to work out how to boot that linux installation, and if it is successful, will output one or @@ -56,7 +56,7 @@ is made that any partitions referred to in the kernel parameters will still be in the same place after Debian is installed, or that the /etc/fstab of the system will be right, or that the system will even boot. The initrd field may -be empty if there is no initrd. The label is whatever label was used in the +be empty if there is no initrd. The label is whatever label was used in the boot loader for this linux installation, and it may be quite long or very short (or nonexistent), and may be inaccurate, confusing, or non-unique. See TODO for other limitations. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-prober-1.70/common.sh new/os-prober/common.sh --- old/os-prober-1.70/common.sh 2015-10-08 05:05:33.000000000 +0200 +++ new/os-prober/common.sh 2017-01-27 22:49:14.000000000 +0100 @@ -3,12 +3,7 @@ } cleanup_tmpdir=false -cleanup_ro_partitions= cleanup () { - local partition - for partition in $cleanup_ro_partitions; do - blockdev --setrw "$partition" - done if $cleanup_tmpdir; then rm -rf "$OS_PROBER_TMP" fi @@ -57,7 +52,7 @@ cache_progname() { case $progname in '') - progname="$(basename "$0")" + progname="${0##*/}" ;; esac } @@ -76,7 +71,9 @@ } debug() { - log "debug: $@" + if [ -z "$OS_PROBER_DISABLE_DEBUG" ]; then + log "debug: $@" + fi } result () { @@ -106,14 +103,24 @@ # We can't always tell the filesystem type up front, but if we have the # information then we should use it. Note that we can't use block-attr here # as it's only available in udebs. +# If not detected after different attempts then "NOT-DETECTED" will be printed +# because function is not supposed to exit error codes. fs_type () { + local fstype="" if (export PATH="/lib/udev:$PATH"; type vol_id) >/dev/null 2>&1; then - PATH="/lib/udev:$PATH" vol_id --type "$1" 2>/dev/null - elif type blkid >/dev/null 2>&1; then - blkid -o value -s TYPE "$1" 2>/dev/null - else - return 0 + PATH="/lib/udev:$PATH" \ + fstype=$(vol_id --type "$1" 2>/dev/null || true) + [ -z "$fstype" ] || { echo "$fstype"; return; } fi + if type lsblk >/dev/null 2>&1 ; then + fstype=$(lsblk --nodeps --noheading --output FSTYPE -- "$1" || true) + [ -z "$fstype" ] || { echo "$fstype"; return; } + fi + if type blkid >/dev/null 2>&1; then + fstype=$(blkid -o value -s TYPE "$1" 2>/dev/null || true) + [ -z "$fstype" ] || { echo "$fstype"; return; } + fi + echo "NOT-DETECTED" } is_dos_extended_partition() { @@ -169,15 +176,6 @@ sed 's/\\011/ /g; s/\\012/\n/g; s/\\040/ /g; s/\\134/\\/g' } -ro_partition () { - if type blockdev >/dev/null 2>&1 && \ - [ "$(blockdev --getro "$1")" = 0 ] && \ - blockdev --setro "$1"; then - cleanup_ro_partitions="${cleanup_ro_partitions:+$cleanup_ro_partitions }$1" - trap cleanup EXIT HUP INT QUIT TERM - fi -} - find_label () { local output if type blkid >/dev/null 2>&1; then @@ -206,15 +204,37 @@ fi } -# Sets $mountboot as output variable. (We do this rather than requiring a -# subshell so that we can run ro_partition without the cleanup trap firing -# when the subshell exits.) +do_dmsetup () { + local prefix partition dm_device partition_name size_p + prefix="$1" + partition="$2" + dm_device= + + if type dmsetup >/dev/null 2>&1 && \ + type blockdev >/dev/null 2>&1; then + partition_name="osprober-linux-${partition##*/}" + dm_device="/dev/mapper/$partition_name" + size_p=$(blockdev --getsize $partition ) + if [ -e "$dm_device" ]; then + error "$dm_device already exists" + dm_device= + else + debug "creating device mapper device $dm_device" + echo "0 $size_p linear $partition 0" | dmsetup create -r $partition_name + fi + fi + echo "$dm_device" +} + +# Sets $mountboot and $dm_device as output variables. This is very messy, +# but POSIX shell isn't really up to the task of doing it more cleanly. linux_mount_boot () { partition="$1" tmpmnt="$2" bootpart="" mounted="" + dm_device="" if [ -e "$tmpmnt/etc/fstab" ]; then # Try to mount any /boot partition. bootmnt=$(parsefstab < "$tmpmnt/etc/fstab" | grep " /boot ") || true @@ -285,12 +305,12 @@ if type grub-mount >/dev/null 2>&1 && \ grub-mount "$boottomnt" "$tmpmnt/boot" 2>/dev/null; then mounted=1 - else - ro_partition "$boottomnt" - if mount -o ro "$boottomnt" "$tmpmnt/boot" -t "$3"; then + elif dm_device="$(do_dmsetup osprober-linux "$boottomnt")" && [ "$dm_device" ]; then + if mountinfo=`mount -o ro "$dm_device" "$tmpmnt/boot" -t "$3"`; then + debug "mounted as $3 filesystem" mounted=1 else - error "failed to mount $boottomnt on $tmpmnt/boot" + error "failed to mount $dm_device on $tmpmnt/boot: $mountinfo" fi fi fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-prober-1.70/debian/changelog new/os-prober/debian/changelog --- old/os-prober-1.70/debian/changelog 2015-10-27 06:45:58.000000000 +0100 +++ new/os-prober/debian/changelog 2017-02-01 00:01:21.000000000 +0100 @@ -1,3 +1,67 @@ +os-prober (1.74) unstable; urgency=high + + [ Ivo De Decker ] + * os-probes/common/50mounted-tests: Skip partition when FS type is + LVM2_member, since one isn't supposed to touch physical volumes + directly. This avoids hanging during “dmcreate setup” with + unencrypted LVM setups (Closes: #853277). + + -- Cyril Brulebois <k...@debian.org> Wed, 01 Feb 2017 00:01:17 +0100 + +os-prober (1.73) unstable; urgency=medium + + [ Cyril Brulebois ] + * Add support for Mageia, thanks to Neal Gompa (Closes: #851983). + + -- Christian Perrier <bubu...@debian.org> Sat, 21 Jan 2017 08:44:01 +0100 + +os-prober (1.72) unstable; urgency=medium + + * Improve logging of mounting and setting partitions to ro/rw (thanks, Ivo + De Decker). + * Use a read-only device-mapper entry if possible rather than setting the + underlying device to read-only (thanks, Ivo De Decker; closes: #701814). + 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 (closes: + #648208). + * Make os-prober-udeb depend on grub-mount-udeb on all Linux and kFreeBSD + architectures, now that it's available on them all (thanks, James + Cowgill; closes: #776275). + * Make os-prober depend on grub-common on Linux and kFreeBSD, in order + that grub-mount is consistently available. + * Fix detection of /usr/ partition as a GNU/Linux root partition when + /lib* directories are moved to /usr/ completely (thanks, Hedayat + Vatankhah; closes: #698733). + * Make the yaboot parser more tolerant about the syntax of "append" + options (thanks, Hedayat Vatankhah; closes: #674561). + * Disable debugging if OS_PROBER_DISABLE_DEBUG is set (thanks, Hedayat + Vatankhah; closes: #698598). + * Replace basename/dirname with shell string processing (thanks, Hedayat + Vatankhah; part of #694668). + * Call dmraid only once (thanks, Jeff Mahoney). + * Fix typos in README (thanks, Nyav; closes: #803155). + * Add os-release support (based loosely on a patch by Török Edwin; closes: + #794409). + * Add Devuan detection (thanks, David Hare; closes: #801631). + * Work harder to avoid trying to mount extended partitions (thanks, + Philippe Coval; closes: #784709). + * Drop " (loader)" suffixes on Microsoft operating systems (thanks, Chris + Lamb; closes: #787418). + + -- Colin Watson <cjwat...@debian.org> Fri, 20 Jan 2017 12:44:34 +0000 + +os-prober (1.71) unstable; urgency=medium + + [ Cyril Brulebois ] + * Add support for 4MLinux, thanks to Zbigniew Konojacki. + + [ Colin Watson ] + * Use HTTPS for Vcs-* URLs, and link to cgit rather than gitweb. + + -- Christian Perrier <bubu...@debian.org> Sat, 30 Jan 2016 07:38:56 +0100 + os-prober (1.70) unstable; urgency=medium [ Justus Winter ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-prober-1.70/debian/control new/os-prober/debian/control --- old/os-prober-1.70/debian/control 2014-11-08 05:01:43.000000000 +0100 +++ new/os-prober/debian/control 2017-01-27 22:49:14.000000000 +0100 @@ -5,13 +5,13 @@ Uploaders: Colin Watson <cjwat...@debian.org>, Christian Perrier <bubu...@debian.org>, Steve McIntyre <93...@debian.org> Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.15.7) Standards-Version: 3.9.4 -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=d-i/os-prober.git -Vcs-Git: git://anonscm.debian.org/d-i/os-prober.git +Vcs-Browser: https://anonscm.debian.org/cgit/d-i/os-prober.git +Vcs-Git: https://anonscm.debian.org/git/d-i/os-prober.git Package: os-prober-udeb Package-Type: udeb Architecture: any -Depends: ${misc:Depends}, ${shlibs:Depends}, di-utils-mapdevfs, anna (>= 1.16), grub-mount-udeb [i386 amd64 powerpc ppc64 ppc64el sparc mipsel kfreebsd-i386 kfreebsd-amd64] +Depends: ${misc:Depends}, ${shlibs:Depends}, di-utils-mapdevfs, anna (>= 1.16), grub-mount-udeb [linux-any kfreebsd-any], dmsetup-udeb [linux-any] Provides: os-prober Description: utility to detect other OSes on a set of drives This package is to be used by boot loader installers to detect other OSes @@ -22,7 +22,7 @@ Architecture: any Section: utils Priority: extra -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common [linux-any kfreebsd-any], dmsetup [linux-any] Description: utility to detect other OSes on a set of drives This package detects other OSes available on a system and outputs the results in a generic machine-readable format. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-prober-1.70/linux-boot-probes/common/50mounted-tests new/os-prober/linux-boot-probes/common/50mounted-tests --- old/os-prober-1.70/linux-boot-probes/common/50mounted-tests 2015-10-08 05:05:33.000000000 +0200 +++ new/os-prober/linux-boot-probes/common/50mounted-tests 2017-01-27 22:49:14.000000000 +0100 @@ -3,9 +3,25 @@ . /usr/share/os-prober/common.sh set -e +do_unmount() { + if [ "$mounted" ]; then + umount "$tmpmnt/boot" 2>/dev/null || true + if ! umount "$tmpmnt"; then + warn "failed to umount $tmpmnt" + fi + fi + for dm_device in $dm_devices; do + if [ -e "$dm_device" ]; then + debug "remove device mapper device $dm_device" + dmsetup remove $dm_device + fi + done + rmdir "$tmpmnt" || true +} + partition="$1" -types="$(fs_type "$partition")" || types=NOT-DETECTED +types="$(fs_type "$partition")" if [ "$types" = NOT-DETECTED ]; then debug "$1 type not recognised; skipping" exit 0 @@ -38,18 +54,23 @@ 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 mounted=1 type="$(grub-probe -d "$partition" -t fs)" [ "$type" ] || type=fuseblk -else - ro_partition "$partition" +elif dm_device="$(do_dmsetup osprober-linux "$partition")" && \ + [ "$dm_device" ]; then + dm_devices="$dm_device" 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 @@ -58,29 +79,22 @@ linux_mount_boot "$partition" "$tmpmnt" bootpart="${mountboot%% *}" mounted="${mountboot#* }" + if [ "$dm_device" ]; then + dm_devices="$dm_device $dm_devices" + fi for test in /usr/lib/linux-boot-probes/mounted/*; do if [ -f "$test" ] && [ -x "$test" ]; then debug "running $test $partition $bootpart $tmpmnt $type" if $test "$partition" "$bootpart" "$tmpmnt" "$type"; then debug "$test succeeded" - umount "$tmpmnt/boot" 2>/dev/null || true - if ! umount "$tmpmnt"; then - warn "failed to umount $tmpmnt" - fi - rmdir "$tmpmnt" || true + do_unmount exit 0 fi fi done - - umount "$tmpmnt/boot" 2>/dev/null || true - if ! umount "$tmpmnt"; then - warn "failed to umount $tmpmnt" - fi fi - -rmdir "$tmpmnt" || true +do_unmount # No tests found anything. exit 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-prober-1.70/linux-boot-probes/mounted/powerpc/40yaboot new/os-prober/linux-boot-probes/mounted/powerpc/40yaboot --- old/os-prober-1.70/linux-boot-probes/mounted/powerpc/40yaboot 2011-05-02 03:00:46.000000000 +0200 +++ new/os-prober/linux-boot-probes/mounted/powerpc/40yaboot 2017-01-27 22:49:14.000000000 +0100 @@ -27,7 +27,7 @@ fi if [ -z "$title" ]; then - title="$(basename "$kernel")" + title="${kernel##*/}" fi if [ "$read_only" ]; then parameters="ro $parameters" @@ -74,8 +74,8 @@ kernel="$(dequote "$2")" ;; append) - shift 1 - parameters="$(dequote "${line#append=}")" + cleanappend=`printf %s "$line" | sed 's/append\([[:space:]]\)*=\([[:space:]]\)*//'` + parameters="$(dequote "$cleanappend")" ;; initrd) initrd="$(dequote "$2")" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-prober-1.70/os-prober new/os-prober/os-prober --- old/os-prober-1.70/os-prober 2015-09-29 05:02:53.000000000 +0200 +++ new/os-prober/os-prober 2017-01-27 22:49:14.000000000 +0100 @@ -14,11 +14,16 @@ fi } +: >"$OS_PROBER_TMP/dmraid-map" +DMRAID=$(type dmraid >/dev/null 2>&1 || true) +if [ "$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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-prober-1.70/os-probes/common/50mounted-tests new/os-prober/os-probes/common/50mounted-tests --- old/os-prober-1.70/os-probes/common/50mounted-tests 2012-11-04 03:01:55.000000000 +0100 +++ new/os-prober/os-probes/common/50mounted-tests 2017-01-31 23:03:40.000000000 +0100 @@ -5,7 +5,21 @@ . /usr/share/os-prober/common.sh -types="$(fs_type "$partition")" || types=NOT-DETECTED +do_unmount() { + if [ "$mounted" ]; then + if ! umount "$tmpmnt"; then + warn "failed to umount $tmpmnt" + fi + fi + if [ -e "$dm_device" ] + then + debug "remove device mapper device $dm_device" + dmsetup remove $dm_device + fi + rmdir "$tmpmnt" || true +} + +types="$(fs_type "$partition")" if [ "$types" = NOT-DETECTED ]; then debug "$1 type not recognised; skipping" exit 0 @@ -15,6 +29,9 @@ elif [ "$types" = crypto_LUKS ]; then debug "$1 is a LUKS partition; skipping" exit 0 +elif [ "$types" = LVM2_member ]; then + debug "$1 is an LVM member; skipping" + exit 0 elif [ "$types" = ntfs ]; then if type ntfs-3g >/dev/null 2>&1; then types='ntfs-3g ntfs' @@ -57,13 +74,15 @@ 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 $delaytypes; 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 @@ -74,20 +93,13 @@ 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 - -rmdir "$tmpmnt" || true +do_unmount # No tests found anything. exit 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-prober-1.70/os-probes/mounted/common/90linux-distro new/os-prober/os-probes/mounted/common/90linux-distro --- old/os-prober-1.70/os-probes/mounted/common/90linux-distro 2012-11-27 03:02:01.000000000 +0100 +++ new/os-prober/os-probes/mounted/common/90linux-distro 2017-01-27 22:49:14.000000000 +0100 @@ -17,8 +17,11 @@ # 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 @@ -71,6 +74,9 @@ 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")" @@ -125,6 +131,12 @@ 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" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-prober-1.70/os-probes/mounted/powerpc/20macosx new/os-prober/os-probes/mounted/powerpc/20macosx --- old/os-prober-1.70/os-probes/mounted/powerpc/20macosx 2012-03-16 03:01:54.000000000 +0100 +++ new/os-prober/os-probes/mounted/powerpc/20macosx 2017-01-27 22:49:14.000000000 +0100 @@ -7,7 +7,9 @@ type="$3" debug() { - logger -t macosx-prober "debug: $@" + if [ -z "$OS_PROBER_DISABLE_DEBUG" ]; then + logger -t macosx-prober "debug: $@" + fi } # Weed out stuff that doesn't apply to us diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-prober-1.70/os-probes/mounted/x86/20microsoft new/os-prober/os-probes/mounted/x86/20microsoft --- old/os-prober-1.70/os-probes/mounted/x86/20microsoft 2015-10-09 05:02:57.000000000 +0200 +++ new/os-prober/os-probes/mounted/x86/20microsoft 2017-01-27 22:49:14.000000000 +0100 @@ -32,23 +32,23 @@ bcd=$(item_in_dir bcd "$2/$boot") if [ -n "$bcd" ]; then if grep -aqs "W.i.n.d.o.w.s. .1.0" "$2/$boot/$bcd"; then - long="Windows 10 (loader)" + long="Windows 10" elif grep -aqs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then - long="Windows 8 (loader)" + long="Windows 8" elif grep -aqs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then - long="Windows 7 (loader)" + long="Windows 7" elif grep -aqs "W.i.n.d.o.w.s. .V.i.s.t.a" "$2/$boot/$bcd"; then - long="Windows Vista (loader)" + long="Windows Vista" elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8. .R.2." "$2/$boot/$bcd"; then - long="Windows Server 2008 R2 (loader)" + long="Windows Server 2008 R2" elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8." "$2/$boot/$bcd"; then - long="Windows Server 2008 (loader)" + long="Windows Server 2008" elif grep -aqs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$2/$boot/$bcd"; then - long="Windows Recovery Environment (loader)" + long="Windows Recovery Environment" elif grep -aqs "W.i.n.d.o.w.s. .S.e.t.u.p" "$2/$boot/$bcd"; then - long="Windows Recovery Environment (loader)" + long="Windows Recovery Environment" else - long="Windows Vista (loader)" + long="Windows Vista" fi short=Windows @@ -84,7 +84,7 @@ long="Windows NT/2000/XP" fi else - long="Windows NT/2000/XP (loader)" + long="Windows NT/2000/XP" fi found=true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-prober-1.70/os-probes/mounted/x86/efi/10elilo new/os-prober/os-probes/mounted/x86/efi/10elilo --- old/os-prober-1.70/os-probes/mounted/x86/efi/10elilo 2013-05-15 17:36:10.000000000 +0200 +++ new/os-prober/os-probes/mounted/x86/efi/10elilo 2017-01-27 22:49:14.000000000 +0100 @@ -9,8 +9,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" short="ELILO" path=${bdir}/elilo.efi