Support probing on hurd-any
authorJames Clarke <jrtc27@jrtc27.com>
Thu, 24 Sep 2015 17:22:21 +0000 (18:22 +0100)
committerSamuel Thibault <sthibault@debian.org>
Mon, 28 Sep 2015 23:38:21 +0000 (01:38 +0200)
debian/changelog
os-prober

index d57d547..ed88bfd 100644 (file)
@@ -3,6 +3,7 @@ os-prober (1.67) UNRELEASED; urgency=medium
   [ James Clarke ]
   * rules: Use DEB_HOST_ARCH_CPU instead of DEB_HOST_ARCH, and thus treat
     *-{i386,amd64} as x86
+  * Support probing on hurd-any.
 
  -- Samuel Thibault <sthibault@debian.org>  Tue, 29 Sep 2015 01:31:03 +0200
 
index d67f0b3..0e51682 100755 (executable)
--- a/os-prober
+++ b/os-prober
@@ -25,6 +25,7 @@ on_sataraid () {
 }
 
 partitions () {
+       os_name="$(uname -s)"
        # Exclude partitions that have whole_disk sysfs attribute set.
        if [ -d /sys/block ]; then
                # Exclude partitions on physical disks that are part of a
@@ -48,12 +49,18 @@ partitions () {
                                done
                        done
                fi
-       elif [ "$(uname -s)" = Linux ]; then
+       elif [ "$os_name" = Linux ]; then
                echo "Cannot find list of partitions!  (Try mounting /sys.)" >&2
                exit 1
+       elif [ "$os_name" = GNU ]; then
+               for part in /dev/hd*s*[0-9] /dev/sd*s*[0-9]; do
+                       if [ -s "$part" ]; then
+                               echo "$part"
+                       fi
+               done
        else
-               # We don't know how to probe OSes on non-Linux kernels.  For
-               # now, just don't get in the way.
+               # We don't know how to probe OSes on non-Linux and non-GNU kernels.
+               # For now, just don't get in the way.
                exit 0
        fi