Fix patch offsets for quilt patches
[live-boot-grml.git] / debian / patches / 14_no_blkid_on_lenny.patch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 14_no_blkid_on_lenny.dpatch by Michael Prokop <mika@grml.org>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: util-linux of lenny doesn't ship the initramfs-tools file
6 ## DP: /usr/share/initramfs-tools/hooks/utillinux yet which ensures
7 ## DP: that blkid is available, so therefore fall back to
8 ## DP: /lib/udev/vol_id in /scripts/live as well
9
10 @DPATCH@
11 --- a/scripts/live
12 +++ b/scripts/live
13 @@ -1680,7 +1680,12 @@
14  
15         if is_supported_fs ${fstype}
16         then
17 -               devuid=$(blkid -o value -s UUID "$devname")
18 +               # lenny
19 +               if command -v blkid >/dev/null 2>&1 ; then
20 +                       devuid=$(blkid -o value -s UUID "${devname}")
21 +               elif [ -x /lib/udev/vol_id ]; then
22 +                       devuid=$(/lib/udev/vol_id --uuid "${devname}" 2>/dev/null)
23 +               fi
24                 [ -n "$devuid" ] && grep -qs "\<$devuid\>" $tried && continue
25                 mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue
26                 [ -n "$devuid" ] && echo "$devuid" >> $tried