[os-prober] Update to 1.57 (#890409)
Hedayat Vatankhah
hedayat at fedoraproject.org
Thu Jan 31 20:29:40 UTC 2013
commit ac292e1ea1196fd2ec397cc6b4e6d176a3eaf864
Author: Hedayat Vatankhah <hedayat.fwd at gmail.com>
Date: Thu Jan 31 23:58:53 2013 +0330
Update to 1.57 (#890409)
- Use shell string processing rather than 'basename' (#875356)
- Make it possible to disable logging debug messages by assigning a value to
OS_PROBER_DISABLE_DEBUG environment variable (#893997).
- Detect multi btrfs pools/volumes (#888341)
os-prober-btrfsfix.patch | 448 ++++++++++++++++++++
os-prober-disable-debug-test.patch | 14 +
os-prober-grub2-fedorafix.patch | 13 -
...l.patch => os-prober-no-dummy-mach-kernel.patch | 0
os-prober-remove-basename.patch | 24 +
os-prober-usrmovefix.patch | 17 +-
os-prober.spec | 18 +-
7 files changed, 510 insertions(+), 24 deletions(-)
---
diff --git a/os-prober-btrfsfix.patch b/os-prober-btrfsfix.patch
new file mode 100644
index 0000000..c14b8e6
--- /dev/null
+++ b/os-prober-btrfsfix.patch
@@ -0,0 +1,448 @@
+--- os-prober-1.56-orig-1/common.sh 2013-01-10 08:33:45.200766262 -0500
++++ os-prober-1.56-orig-1/common.sh 2013-01-10 08:34:43.644058934 -0500
+@@ -127,6 +127,7 @@
+ done
+ }
+
++# add forth parameter to pickup btrfs subvol info
+ parsefstab () {
+ while read -r line; do
+ case "$line" in
+@@ -137,12 +138,22 @@
+ set -f
+ set -- $line
+ set +f
+- printf '%s %s %s\n' "$1" "$2" "$3"
++ printf '%s %s %s %s\n' "$1" "$2" "$3" "$4"
+ ;;
+ esac
+ done
+ }
+
++#check_btrfs_mounted $bootsv $bootuuid)
++check_btrfs_mounted () {
++ bootsv="$1"
++ bootuuid="$2"
++ bootdev=$(blkid | grep "$bootuuid" | cut -d ':' -f 1)
++ bindfrom=$(grep " btrfs " /proc/self/mountinfo |
++ grep " $bootdev " | grep " /$bootsv " | cut -d ' ' -f 5)
++ printf "%s" "$bindfrom"
++}
++
+ unescape_mount () {
+ printf %s "$1" | \
+ sed 's/\\011/ /g; s/\\012/\n/g; s/\\040/ /g; s/\\134/\\/g'
+--- os-prober-1.56-orig-1/linux-boot-prober 2012-03-27 10:39:42.000000000 -0400
++++ os-prober-1.56-orig-1/linux-boot-prober 2013-01-10 08:34:43.644058934 -0500
+@@ -5,16 +5,143 @@
+
+ newns "$@"
+ require_tmpdir
++ERR="n"
++
++tmpmnt=/var/lib/os-prober/mount
++if [ ! -d "$tmpmnt" ]; then
++ mkdir "$tmpmnt"
++fi
++
++mounted=
++bootmnt=
++bootsv=
++bootuuid=
+
+ grep "^/dev/" /proc/mounts | parse_proc_mounts >"$OS_PROBER_TMP/mounted-map" || true
+
+-partition="$1"
++if [ -z "$1" ]; then
++ ERR=y
++elif [ "$1" = btrfs -a -z "$2" ]; then
++ ERR=y
++elif [ "$1" = btrfs -a -z "$3" ]; then
++ ERR=y
++elif [ "$1" = btrfs ]; then
++ type=btrfs
++ echo "$2" | grep -q "^UUID=" || ERR=y
++ echo "$3" | grep -q "^subvol=" || ERR=y
++ export "$2"
++ export "$3"
++ partition=$(blkid | grep "$UUID" | cut -d ':' -f 1 | tr '\n' ' ' | cut -d ' ' -f 1)
++ debug "btrfs: partition=$partition, UUID=$UUID, subvol=$subvol"
++else
++ partition="$1"
++ type=other
++fi
+
+-if [ -z "$partition" ]; then
++if [ "x$ERR" != xn ]; then
+ echo "usage: linux-boot-prober partition" >&2
++ echo " linux-boot-prober btrfs UUID=<> subvol=<>" >&2
+ exit 1
+ fi
+
++if [ "$type" = btrfs ]; then
++ # handle all of the btrfs stuff here
++ if [ ! -e "/proc/self/mountinfo" ]; then
++ warn "/proc/self/mountinfo does not exist, exiting"
++ umount "$tmpmnt" 2>/dev/null
++ rmdir "$tmpmnt" 2>/dev/null
++ exit 1
++ fi
++ mpoint=$(grep "btrfs" /proc/self/mountinfo | grep " /$subvol " | grep " $partition " | cut -d ' ' -f 5)
++ if [ "$mpoint" = "/" ]; then
++ warn "specifying active root not valid, exiting"
++ umount "$tmpmnt" 2>/dev/null
++ rmdir "$tmpmnt" 2>/dev/null
++ exit 1
++ fi
++ if [ "$mpoint" = "$tmpmnt" ]; then
++ warn "btrfs subvol=$subvool, UUID=$UUID, already mounted on $tmpmnt **ERROR**"
++ umount "$tmpmnt" 2>/dev/null
++ rmdir "$tmpmnt" 2>/dev/null
++ exit 1
++ fi
++ if [ -z "$mpoint" ]; then
++ # mount the btrfs root
++ if ! mount -o subvol=$subvol -t btrfs -U $UUID "$tmpmnt" 2>/dev/null; then
++ warn "error mounting btrfs subvol=$subvol UUID=$UUID"
++ umount "$tmpmnt/boot" 2>/dev/null
++ umount "$tmpmnt" 2>/dev/null
++ rmdir "$tmpmnt" 2>/dev/null
++ exit 1
++ fi
++ else
++ # bind-mount
++ if ! mount -o bind "$mpoint" "$tmpmnt" 2>/dev/null; then
++ warn "error mounting btrfs bindfrom=$mpoint subvol=$subvol UUID=$UUID"
++ umount "$tmpmnt/boot" 2>/dev/null
++ umount "$tmpmnt" 2>/dev/null
++ rmdir "$tmpmnt" 2>/dev/null
++ exit 1
++ fi
++ fi
++ debug "mounted btrfs $partition, subvol=$subvol on $tmpmnt"
++ if [ ! -e "$tmpmnt/etc/fstab" ]; then
++ warn "btrfs subvol=$subvol not root"
++ umount "$tmpmnt" 2>/dev/null
++ rmdir "$tmpmnt" 2>/dev/null
++ exit 1
++ fi
++ bootmnt=$(parsefstab < "$tmpmnt/etc/fstab" | grep " /boot ") || true
++ if [ -z "$bootmnt" ]; then
++ # /boot is part of the root
++ bootpart="$partition"
++ bootsv="$subvol"
++ elif echo "$bootmnt" | cut -d ' ' -f 3 | grep -q "btrfs"; then
++ # separate btrfs /boot subvolume
++ bootsv=$(echo "$bootmnt" | cut -d ' ' -f 4 | grep "^subvol=" | sed "s/subvol=//" )
++ bootuuid=$(echo "$bootmnt" | cut -d ' ' -f 1 | grep "^UUID=" | sed "s/UUID=//" )
++ debug "mounting btrfs $tmpmnt/boot UUID=$bootuuid subvol=$bootsv"
++ bindfrom=$(check_btrfs_mounted $bootsv $bootuuid)
++ if [ -n "$bindfrom" ]; then
++ # already mounted some place
++ if ! mount -o bind $bindfrom "$tmpmnt/boot" 2>/dev/null; then
++ warn "error bind mounting btrfs boot subvol=$bootsv, from=$bindfrom"
++ umount "$tmpmnt/boot" 2>/dev/null
++ umount "$tmpmnt" 2>/dev/null
++ rmdir "$tmpmnt" 2>/dev/null
++ exit 1
++ fi
++ elif ! mount -o subvol=$bootsv -t btrfs -U $bootuuid "$tmpmnt/boot" 2>/dev/null; then
++ warn "error mounting btrfs boot partition subvol=$bootsv, UUID=$bootuuid"
++ umount "$tmpmnt/boot" 2>/dev/null
++ umount "$tmpmnt" 2>/dev/null
++ rmdir "$tmpmnt" 2>/dev/null
++ exit 1
++ fi
++ bootpart=$(grep " btrfs " /proc/self/mountinfo | grep " /$bootsv " | cut -d ' ' -f 10)
++ else
++ # non-btrfs partition or logical volume
++ linux_mount_boot $partition $tmpmnt
++ bootpart="${mountboot%% *}"
++ bootsv=
++ fi
++
++ test="/usr/lib/linux-boot-probes/mounted/40grub2"
++ if [ -f $test ] && [ -x $test ]; then
++ debug "running $test $partition $bootpart $tmpmnt $type $subvol $bootsv"
++ if $test "$partition" "$bootpart" "$tmpmnt" "$type" "$subvol" "$bootsv"; then
++ debug "$test succeeded"
++ fi
++ fi
++ umount "$tmpmnt/boot" 2>/dev/null || true
++ if ! umount "$tmpmnt" 2>/dev/null; then
++ warn "problem umount $tmpmnt"
++ fi
++ rmdir "$tmpmnt" 2>/dev/null || true
++
++ exit 0
++fi
++
+ if ! mapped="$(mapdevfs "$partition")"; then
+ log "Device '$partition' does not exist; skipping"
+ continue
+@@ -22,8 +149,8 @@
+
+ if ! grep -q "^$mapped " "$OS_PROBER_TMP/mounted-map"; then
+ for test in /usr/lib/linux-boot-probes/*; do
+- debug "running $test"
+ if [ -x $test ] && [ -f $test ]; then
++ debug "running $test"
+ if $test "$partition"; then
+ debug "linux detected by $test"
+ break
+--- os-prober-1.56-orig-1/linux-boot-probes/mounted/common/40grub2 2012-09-17 13:32:52.000000000 -0400
++++ os-prober-1.56-orig-1/linux-boot-probes/mounted/common/40grub2 2013-01-10 08:34:43.644058934 -0500
+@@ -2,17 +2,27 @@
+ . /usr/share/os-prober/common.sh
+ set -e
+
++# add support for btrfs with no separate /boot
++# that is, rootsv = bootsv
+ partition="$1"
+ bootpart="$2"
+ mpoint="$3"
+ type="$4"
++rootsv="$5"
++bootsv="$6"
+
+ found_item=0
+
+ entry_result () {
++ if [ "x$type" = "xbtrfs" -a "$rootsv" = "$bootsv" ]; then
++ # trim off the leading subvol
++ kernelfile=$(echo "$kernel" | cut -d '/' -f 2- | cut -d '/' -f 2-)
++ else
++ kernelfile=$kernel
++ fi
+ if [ "$ignore_item" = 0 ] && \
+ [ -n "$kernel" ] && \
+- [ -e "$mpoint/$kernel" ]; then
++ [ -e "$mpoint/$kernelfile" ]; then
+ result "$rootpart:$bootpart:$title:$kernel:$initrd:$parameters"
+ found_item=1
+ fi
+--- os-prober-1.56-orig-1/os-prober 2013-01-10 08:33:45.193766227 -0500
++++ os-prober-1.56-orig-1/os-prober 2013-01-10 08:34:43.645058939 -0500
+@@ -64,9 +64,12 @@
+
+ # Also detect OSes on LVM volumes (assumes LVM is active)
+ if type lvs >/dev/null 2>&1; then
+- echo "$(LVM_SUPPRESS_FD_WARNINGS=1 log_output lvs --noheadings --separator : -o vg_name,lv_name |
++ echo "$(LVM_SUPPRESS_FD_WARNINGS=1 log_output lvs --noheadings --separator : -o vg_name,lv_name 2>/dev/null |
+ sed "s|-|--|g;s|^[[:space:]]*\(.*\):\(.*\)$|/dev/mapper/\1-\2|")"
+ fi
++
++ # now lets make sure we got all of the btrfs partitions and disks
++ blkid | grep btrfs | cut -d ':' -f 1
+ }
+
+ parse_proc_swaps () {
+@@ -124,6 +127,8 @@
+ grep "^md" /proc/mdstat | cut -d: -f2- | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true
+ fi
+
++: >"$OS_PROBER_TMP/btrfs-vols"
++
+ for partition in $(partitions); do
+ if ! mapped="$(mapdevfs "$partition")"; then
+ log "Device '$partition' does not exist; skipping"
+@@ -142,7 +147,26 @@
+ continue
+ fi
+
+- if ! grep -q "^$mapped " "$OS_PROBER_TMP/mounted-map" ; then
++ # do btrfs processing here; both mounted and unmounted will
++ # be handled by 50mounted-tests so we can do a subvol only once.
++ type=$(blkid -o value -s TYPE $mapped)
++ if [ "$type" = btrfs ]; then
++ uuid=$(blkid -o value -s UUID $mapped)
++ if grep -q "^$uuid" "$OS_PROBER_TMP/btrfs-vols" ; then
++ continue
++ fi
++ debug "btrfs volume uuid=$uuid partition=$partition"
++ echo "$uuid" >>"$OS_PROBER_TMP/btrfs-vols"
++ test="/usr/lib/os-probes/50mounted-tests"
++ if [ -f "$test" ] && [ -x "$test" ]; then
++ debug "running $test on btrfs $partition"
++ if "$test" btrfs "$uuid" "$partition"; then
++ debug "os detected by $test"
++ continue
++ fi
++ fi
++
++ elif ! grep -q "^$mapped " "$OS_PROBER_TMP/mounted-map" ; then
+ for test in /usr/lib/os-probes/*; do
+ if [ -f "$test" ] && [ -x "$test" ]; then
+ debug "running $test on $partition"
+--- os-prober-1.56-orig-1/os-probes/common/50mounted-tests 2012-09-17 11:08:12.000000000 -0400
++++ os-prober-1.56-orig-1/os-probes/common/50mounted-tests 2013-01-10 08:34:43.645058939 -0500
+@@ -1,20 +1,36 @@
+ #!/bin/sh
+ # Sub-tests that require a mounted partition.
+ set -e
+-partition="$1"
+
+ . /usr/share/os-prober/common.sh
+
+-types="$(fs_type "$partition")" || types=NOT-DETECTED
++if [ "x$1" = xbtrfs ]; then
++ types=btrfs
++ if [ -z "$2" -o -z "$3" ]; then
++ debug "missing btrfs parameters, exiting"
++ exit 1
++ fi
++ UUID="$2"
++ BTRFSDEV="$3"
++else
++ partition="$1"
++ types="$(fs_type "$partition")" || types=NOT-DETECTED
++fi
++
+ if [ "$types" = NOT-DETECTED ]; then
+ debug "$1 type not recognised; skipping"
+- exit 0
++ exit 1
++elif [ "x$types" = "x" ]; then
++ exit 1
++elif [ "$types" = LVM2_member ]; then
++ debug "skipping LVM2 Volume Group on $partition"
++ exit 1
+ elif [ "$types" = swap ]; then
+ debug "$1 is a swap partition; skipping"
+- exit 0
++ exit 1
+ elif [ "$types" = crypto_LUKS ]; then
+ debug "$1 is a LUKS partition; skipping"
+- exit 0
++ exit 1
+ elif [ "$types" = ntfs ]; then
+ if type ntfs-3g >/dev/null 2>&1; then
+ types='ntfs-3g ntfs'
+@@ -23,7 +39,7 @@
+ if type cryptsetup >/dev/null 2>&1 && \
+ cryptsetup luksDump "$partition" >/dev/null 2>&1; then
+ debug "$1 is a LUKS partition; skipping"
+- exit 0
++ exit 1
+ fi
+ for type in $(grep -v nodev /proc/filesystems); do
+ # hfsplus filesystems are mountable as hfs. Try hfs last so
+@@ -46,6 +62,76 @@
+ fi
+
+ mounted=
++
++# 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
++ debug "btrfs volume $UUID mounted"
++ else
++ warn "cannot mount btrfs volume $UUID, exiting"
++ rmdir "$tmpmnt" || true
++ exit 1
++ fi
++ # besides regular subvols, get ro and snapshot so thet can be excluded
++ subvols=$(btrfs subvolume list "$tmpmnt" | cut -d ' ' -f 9)
++ rosubvols=$(btrfs subvolume list -r "$tmpmnt" | cut -d ' ' -f 9)
++ sssubvols=$(btrfs subvolume list -s "$tmpmnt" | cut -d ' ' -f 9)
++ if ! umount "$tmpmnt"; then
++ warn "failed to umount btrfs volume on $tmpmnt"
++ rmdir "$tmpmnt" || true
++ exit 1
++ fi
++ if [ -z "$subvols" ]; then
++ debug "no subvols found on btrfs volume $UUID"
++ exit 1
++ fi
++ found=
++ for subvol in $subvols; do
++ debug "begin btrfs processing for $UUID subvol=$subvol"
++ if echo "$rosubvols" | grep -q -x "$subvol"; then
++ continue
++ fi
++ if echo "$sssubvols" | grep -q -x "$subvol"; then
++ continue
++ fi
++ mounted=
++ mpoint="$(grep btrfs /proc/self/mountinfo | grep "$partition " | grep "/$subvol " | cut -d ' ' -f 5)"
++ if [ -n "$mpoint" ]; then
++ if [ "x$mpoint" = "x/" ]; then
++ continue # this is the root for the running system
++ fi
++ mounted=1
++ else
++ # again, do not mount btrfs ro
++ mount -t btrfs -o subvol="$subvol" -U "$UUID" "$tmpmnt"
++ mpoint="$tmpmnt"
++ fi
++ test="/usr/lib/os-probes/mounted/90linux-distro"
++ if [ -f "$test" ] && [ -x "$test" ]; then
++ debug "running subtest $test"
++ if "$test" "$partition" "$mpoint" btrfs "UUID=$UUID" "subvol=$subvol"; then
++ debug "os found by subtest $test on subvol $subvol"
++ found=1
++ fi
++ fi
++ if [ -z "$mounted" ]; then
++ if ! umount "$tmpmnt"; then
++ warn "failed to umount $tmpmnt"
++ fi
++ fi
++ done
++ rmdir "$tmpmnt" || true
++ if [ "$found" ]; then
++ exit 0
++ else
++ exit 1
++ fi
++fi
++
+ if type grub-mount >/dev/null 2>&1 && \
+ type grub-probe >/dev/null 2>&1 && \
+ grub-mount "$partition" "$tmpmnt" 2>/dev/null; then
+--- os-prober-1.56-orig-1/os-probes/mounted/common/90linux-distro 2013-01-10 08:33:45.197766247 -0500
++++ os-prober-1.56-orig-1/os-probes/mounted/common/90linux-distro 2013-01-10 08:34:43.645058939 -0500
+@@ -7,6 +7,8 @@
+ partition="$1"
+ dir="$2"
+ type="$3"
++uuid="$4"
++subvol="$5"
+
+ # 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 @@
+ fi
+
+ label="$(count_next_label "$short")"
+- result "$partition:$long:$label:linux"
++ if [ "x$type" = "xbtrfs" -a "x$uuid" != "x" -a "x$subvol" != "x" ]; then
++ result "$partition:$long:$label:linux:$type:$uuid:$subvol"
++ else
++ result "$partition:$long:$label:linux"
++ fi
+ exit 0
+ else
+ exit 1
+--- os-prober-1.56-orig-1/README.btrfs 1969-12-31 19:00:00.000000000 -0500
++++ os-prober-1.56-orig-1/README.btrfs 2013-01-10 08:34:43.645058939 -0500
+@@ -0,0 +1,15 @@
++BTRFS is a new filesystem which combines the filesystem with logical volume
++management (subvolumes). For further information, see:
++ https://btrfs.wiki.kernel.org/index.php/Main_Page
++ https://btrfs.wiki.kernel.org/index.php/FAQ
++
++In order to support BTRFS, a number of changes were necessary to os-prober,
++os-probes/common/50mounted-tests, os-probes/mounted/common/90linux-distro,
++linux-boot-prober, and linux-boot-probes/common/50mounted-tests.
++
++The biggest impact will be to grub2 where there is additional information
++output by os-prober and where, if a BTRFS subvolume is being used for root,
++the parameters for linux-boot-prober have changed.
++
++Sun 30 Dec 2012 11:49:52 AM EST Gene Czarcinski <gene at czarc.net>
++
diff --git a/os-prober-disable-debug-test.patch b/os-prober-disable-debug-test.patch
new file mode 100644
index 0000000..a823385
--- /dev/null
+++ b/os-prober-disable-debug-test.patch
@@ -0,0 +1,14 @@
+diff -ur os-prober-1.56-orig/common.sh os-prober-1.56/common.sh
+--- os-prober-1.56-orig/common.sh 2012-12-26 13:53:55.962187097 -0500
++++ os-prober-1.56/common.sh 2013-01-10 08:25:14.843206268 -0500
+@@ -76,7 +76,9 @@
+ }
+
+ debug() {
+- log "debug: $@"
++ if [ -z "$OS_PROBER_DISABLE_DEBUG" ]; then
++ log "debug: $@"
++ fi
+ }
+
+ result () {
diff --git a/os-porber-no-dummy-mach-kernel.patch b/os-prober-no-dummy-mach-kernel.patch
similarity index 100%
rename from os-porber-no-dummy-mach-kernel.patch
rename to os-prober-no-dummy-mach-kernel.patch
diff --git a/os-prober-remove-basename.patch b/os-prober-remove-basename.patch
new file mode 100644
index 0000000..51996c1
--- /dev/null
+++ b/os-prober-remove-basename.patch
@@ -0,0 +1,24 @@
+diff -up os-prober-1.57/common.sh.remove-basename os-prober-1.57/common.sh
+--- os-prober-1.57/common.sh.remove-basename 2013-01-23 01:06:50.023992389 +0330
++++ os-prober-1.57/common.sh 2013-01-23 02:01:09.435244141 +0330
+@@ -57,7 +57,7 @@ progname=
+ cache_progname() {
+ case $progname in
+ '')
+- progname="$(basename "$0")"
++ progname="${0##*/}"
+ ;;
+ esac
+ }
+diff -up os-prober-1.57/linux-boot-probes/mounted/powerpc/40yaboot.remove-basename os-prober-1.57/linux-boot-probes/mounted/powerpc/40yaboot
+--- os-prober-1.57/linux-boot-probes/mounted/powerpc/40yaboot.remove-basename 2013-01-23 02:04:03.855063593 +0330
++++ os-prober-1.57/linux-boot-probes/mounted/powerpc/40yaboot 2013-01-23 02:02:34.876175982 +0330
+@@ -27,7 +27,7 @@ recordstanza () {
+ fi
+
+ if [ -z "$title" ]; then
+- title="$(basename "$kernel")"
++ title="${kernel##*/}"
+ fi
+ if [ "$read_only" ]; then
+ parameters="ro $parameters"
diff --git a/os-prober-usrmovefix.patch b/os-prober-usrmovefix.patch
index 361a9e3..e03d536 100644
--- a/os-prober-usrmovefix.patch
+++ b/os-prober-usrmovefix.patch
@@ -1,13 +1,12 @@
-diff -up os-prober-1.53/os-probes/mounted/common/90linux-distro.usermovefix os-prober-1.53/os-probes/mounted/common/90linux-distro
---- os-prober-1.53/os-probes/mounted/common/90linux-distro.usermovefix 2012-06-02 20:07:39.878619263 +0430
-+++ os-prober-1.53/os-probes/mounted/common/90linux-distro 2012-06-02 20:14:40.341362757 +0430
-@@ -13,7 +13,8 @@ type="$3"
- # better. Make sure this test has a high number so that more accurate tests
- # can come first.
+diff -up os-prober-1.57/os-probes/mounted/common/90linux-distro.usrmovefix os-prober-1.57/os-probes/mounted/common/90linux-distro
+--- os-prober-1.57/os-probes/mounted/common/90linux-distro.usrmovefix 2013-01-23 00:39:20.333616357 +0330
++++ os-prober-1.57/os-probes/mounted/common/90linux-distro 2013-01-23 00:39:51.834222545 +0330
+@@ -17,7 +17,7 @@ type="$3"
+ # 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* >/dev/null 2>/dev/null; then
-+if ls "$dir"/lib*/ld*.so* >/dev/null 2>/dev/null && [ -d "$dir/boot" ] \
-+ || ls "$dir"/usr/lib*/ld*.so* >/dev/null 2>/dev/null; then
+-if (ls "$dir"/lib*/ld*.so* || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; 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/debian_version" ]; then
short="Debian"
long="$(printf "Debian GNU/Linux (%s)\n" "$(cat "$dir/etc/debian_version")")"
diff --git a/os-prober.spec b/os-prober.spec
index 8f52445..2f498d6 100644
--- a/os-prober.spec
+++ b/os-prober.spec
@@ -1,5 +1,5 @@
Name: os-prober
-Version: 1.56
+Version: 1.57
Release: 1%{?dist}
Summary: Probes disks on the system for installed operating systems
@@ -11,11 +11,15 @@ Source0: http://ftp.de.debian.org/debian/pool/main/o/os-prober/%{name}_%{
# move newns binary outside of os-prober subdirectory, so that debuginfo
# can be automatically generated for it
Patch0: os-prober-newnsdirfix.patch
-Patch1: os-porber-no-dummy-mach-kernel.patch
+Patch1: os-prober-no-dummy-mach-kernel.patch
# Sent upstream
Patch2: os-prober-mdraidfix.patch
Patch3: os-prober-yaboot-parsefix.patch
Patch4: os-prober-usrmovefix.patch
+Patch5: os-prober-remove-basename.patch
+Patch6: os-prober-disable-debug-test.patch
+# To be sent upstream
+Patch7: os-prober-btrfsfix.patch
Requires: udev coreutils util-linux
Requires: grep /bin/sed /sbin/modprobe
@@ -32,6 +36,9 @@ distributions can be added easily.
%patch2 -p1 -b .mdraidfix
%patch3 -p1 -b .yaboot-parsefix
%patch4 -p1
+%patch5 -p1 -b .remove-basename
+%patch6 -p1 -b .disable-debug-test
+%patch7 -p1 -b .btrfsfix
find -type f -exec sed -i -e 's|usr/lib|usr/libexec|g' {} \;
sed -i -e 's|grub-probe|grub2-probe|g' os-probes/common/50mounted-tests \
@@ -82,6 +89,13 @@ fi
%{_var}/lib/%{name}
%changelog
+* Tue Jan 22 2013 Hedayat Vatankhah <hedayat.fwd+rpmchlog at gmail.com> - 1.57-1
+- Update to 1.57 (#890409)
+- Use shell string processing rather than 'basename' (#875356)
+- Make it possible to disable logging debug messages by assigning a value to
+ OS_PROBER_DISABLE_DEBUG environment variable (#893997).
+- Detect multi btrfs pools/volumes (#888341)
+
* Thu Oct 11 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog at gmail.com> - 1.56-1
- Update to 1.56 with a bug fix and applied one of my patches
More information about the scm-commits
mailing list