Fix check for available /dev/md* devices
authorMichael Prokop <mika@grml.org>
Mon, 13 Oct 2014 19:14:52 +0000 (21:14 +0200)
committerMichael Prokop <mika@grml.org>
Mon, 13 Oct 2014 19:14:53 +0000 (21:14 +0200)
/dev/md* might also expand devices like /dev/md/0:

| # ls -la /dev/md*
| brw-rw---- 1 root disk 9, 0 Oct 13 19:01 /dev/md0
|
| /dev/md:
| total 0
| drwxr-xr-x  2 root root   60 Oct 13 19:01 ./
| drwxr-xr-x 15 root root 3860 Oct 13 19:02 ../
| lrwxrwxrwx  1 root root    6 Oct 13 19:01 0 -> ../md0

We're interested only in /dev/md[0-9]* devices though.

grml-debootstrap

index f589166..c029246 100755 (executable)
@@ -419,7 +419,7 @@ prompt_for_target()
   AVAILABLE_PARTITIONS=$(LANG=C fdisk -l 2>/dev/null | \
                sed 's/*//' | \
                grep -v 'Extended$' | \
   AVAILABLE_PARTITIONS=$(LANG=C fdisk -l 2>/dev/null | \
                sed 's/*//' | \
                grep -v 'Extended$' | \
-               gawk -v num=0 -v ORS=' ' '/^\/dev\// {print $1}'; ls /dev/md* 2>/dev/null || true);
+               gawk -v num=0 -v ORS=' ' '/^\/dev\// {print $1}'; ls /dev/md[0-9]* 2>/dev/null || true);
 
   if [ -z "$AVAILABLE_PARTITIONS" ] ; then
      dialog --title "$PN" --trim \
 
   if [ -z "$AVAILABLE_PARTITIONS" ] ; then
      dialog --title "$PN" --trim \