debian/patches/04_drop_usage_of_fstype.dpatch: address vol_id -> blkid issue v1.157.4-1grml.00
authorMichael Prokop <mika@grml.org>
Fri, 13 Nov 2009 22:30:26 +0000 (23:30 +0100)
committerMichael Prokop <mika@grml.org>
Fri, 13 Nov 2009 22:59:45 +0000 (23:59 +0100)
debian/changelog
debian/patches/04_drop_usage_of_fstype.dpatch

index 4c7bab2..3d4f60a 100644 (file)
@@ -1,8 +1,10 @@
 live-initramfs (1.157.4-1grml.00) unstable; urgency=low
 
   * Synchronise with Debian's version 1.157.4-1.
+  * Update debian/patches/04_drop_usage_of_fstype.dpatch to address
+    vol_id -> blkid issue (see #555529).
 
- -- Michael Prokop <mika@grml.org>  Fri, 13 Nov 2009 21:00:07 +0100
+ -- Michael Prokop <mika@grml.org>  Fri, 13 Nov 2009 23:29:39 +0100
 
 live-initramfs (1.157.3-1grml.01) unstable; urgency=low
 
index aac30c9..9c2314f 100755 (executable)
@@ -4,13 +4,14 @@
 ## All lines beginning with `## DP:' are a description of the patch.
 ## DP: Avoid the use of fstype in a running live system, as it's
 ## DP: a executable and not a shell function and causes problems
-## DP: for example within live-snapshot
+## DP: for example within live-snapshot.
+## DP: Further switch from vol_id to blkid if using udev >=146-1.
 
 @DPATCH@
-
---- a/scripts/live-helpers
-+++ b/scripts/live-helpers
-@@ -76,24 +76,6 @@ is_supported_fs ()
+diff -urNad live-initramfs-grml~/scripts/live-helpers live-initramfs-grml/scripts/live-helpers
+--- live-initramfs-grml~/scripts/live-helpers  2009-11-13 23:45:28.000000000 +0100
++++ live-initramfs-grml/scripts/live-helpers   2009-11-13 23:59:36.524643320 +0100
+@@ -76,25 +76,17 @@
  
  get_fstype ()
  {
 -      eval $(fstype ${1} 2>/dev/null)
 -
 -      if [ "${FSTYPE}" != "unknown" ]
--      then
++      # udev >=146-1 no longer provides vol_id:
++      if [ -x /lib/udev/vol_id ]
+       then
 -              echo ${FSTYPE}
 -              return 0
--      fi
++              /lib/udev/vol_id -t ${1} 2>/dev/null
++      else
++              eval $(blkid -o udev "${1}")
++              if [ -n "$ID_FS_TYPE" ]
++              then
++                      echo "${ID_FS_TYPE}"
++              fi
+       fi
 -
-       /lib/udev/vol_id -t ${1} 2>/dev/null
+-      /lib/udev/vol_id -t ${1} 2>/dev/null
  }
  
+ where_is_mounted ()
+@@ -357,10 +349,21 @@
+                               done
+                       fi
+-                      if [ "$(/lib/udev/vol_id -l ${devname} 2>/dev/null)" = "${pers_label}" ]
++                      # udev >=146-1 no longer provides vol_id:
++                      if [ -x /lib/udev/vol_id ]
+                       then
+-                              echo "${devname}"
+-                              return 0
++                              if [ "$(/lib/udev/vol_id -l ${devname} 2>/dev/null)" = "${pers_label}" ]
++                              then
++                                      echo "${devname}"
++                                      return 0
++                              fi
++                      else
++                              eval $(blkid -o udev "${devname}")
++                              if [ "$ID_FS_LABEL" = "${pers_label}" ]
++                              then
++                                      echo "${devname}"
++                                      return 0
++                              fi
+                       fi
+                       if [ "${PERSISTENT}" = "nofiles" ]