Add debian/patches/14_no_blkid_on_lenny.dpatch.
authorMichael Prokop <mika@grml.org>
Thu, 27 May 2010 21:42:00 +0000 (23:42 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 27 May 2010 21:42:00 +0000 (23:42 +0200)
debian/patches/00list
debian/patches/14_no_blkid_on_lenny.dpatch [new file with mode: 0644]

index 3c1b0f8..460ec94 100644 (file)
@@ -5,3 +5,4 @@
 11_dhcphostname.patch
 12_uuid_support.dpatch
 13_always_display_warnings_and_failures.dpatch
+14_no_blkid_on_lenny.dpatch
diff --git a/debian/patches/14_no_blkid_on_lenny.dpatch b/debian/patches/14_no_blkid_on_lenny.dpatch
new file mode 100644 (file)
index 0000000..e5cfb76
--- /dev/null
@@ -0,0 +1,26 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 14_no_blkid_on_lenny.dpatch by Michael Prokop <mika@grml.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: util-linux of lenny doesn't ship the initramfs-tools file
+## DP: /usr/share/initramfs-tools/hooks/utillinux yet which ensures
+## DP: that blkid is available, so therefore fall back to
+## DP: /lib/udev/vol_id in /scripts/live as well
+
+@DPATCH@
+--- a/scripts/live
++++ b/scripts/live
+@@ -1588,7 +1588,12 @@ check_dev ()
+       if is_supported_fs ${fstype}
+       then
+-              devuid=$(blkid -o value -s UUID "$devname")
++              # lenny
++              if command -v blkid >/dev/null 2>&1 ; then
++                      devuid=$(blkid -o value -s UUID "${devname}")
++              elif [ -x /lib/udev/vol_id ]; then
++                      devuid=$(/lib/udev/vol_id --uuid "${devname}" 2>/dev/null)
++              fi
+               [ -n "$devuid" ] && grep -qs "\<$devuid\>" $tried && continue
+               mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue
+               [ -n "$devuid" ] && echo "$devuid" >> $tried