Support comma delimited devices in live-media-path
[live-boot-grml.git] / debian / patches / 25_support_lvm_for_live-media.patch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 25_support_lvm_for_live-media.dpatch by  <mru@grml.org>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Support lvm and raid devices for live-media
6
7 @DPATCH@
8
9 --- a/scripts/live
10 +++ b/scripts/live
11 @@ -1669,6 +1669,29 @@
12                         umount $mountpoint
13                 fi
14         fi
15 +
16 +       IFS=","
17 +       for device in ${devname} ; do
18 +               case "$device" in
19 +                       *mapper*)  # add lvm support
20 +                       if [ -x /scripts/local-top/lvm2 ] ; then
21 +                               ROOT="$device" resume="" /scripts/local-top/lvm2
22 +                       fi
23 +                       ;;
24 +                       /dev/md*)
25 +                       if [ -x /scripts/local-top/mdadm ] ; then
26 +                               cp /conf/conf.d/md /conf/conf.d/md.orig
27 +                               echo "MD_DEVS=$device " >> /conf/conf.d/md
28 +                               /scripts/local-top/mdadm
29 +                               mv /conf/conf.d/md.orig /conf/conf.d/md
30 +                       fi
31 +                       ;;
32 +               esac
33 +       done
34 +       unset IFS
35 +
36 +       [ -n "$device" ] && devname="$device"
37 +
38         [ -e "$devname" ] || continue
39  
40         if [ -n "${LIVE_MEDIA_OFFSET}" ]