Fix misdetection of /usr/ as root partition
authorHedayat Vatankhah <hedayatv@gmail.com>
Wed, 18 Jan 2017 16:46:26 +0000 (16:46 +0000)
committerColin Watson <cjwatson@debian.org>
Thu, 19 Jan 2017 21:01:50 +0000 (21:01 +0000)
... when /lib* directories are moved to /usr/ completely.
Closes: #698733

debian/changelog
os-probes/mounted/common/90linux-distro

index 411d09d..3e908af 100644 (file)
@@ -14,6 +14,9 @@ os-prober (1.72) UNRELEASED; urgency=medium
     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).
 
  -- Colin Watson <cjwatson@debian.org>  Sat, 31 Dec 2016 17:11:49 +0000
 
index 9544531..54be364 100755 (executable)
@@ -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* || 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")")"