Merge upstream version 1.173.2-1.
[live-initramfs-grml.git] / debian / patches / 02_more_verbose_toram.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 02_more_verbose_toram.dpatch by <mika@grml.org>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Support more verbose version of toram via rsync
6
7 @DPATCH@
8 diff -urNad live-initramfs-grml~/scripts/live live-initramfs-grml/scripts/live
9 --- live-initramfs-grml~/scripts/live   2009-11-13 18:51:34.000000000 +0100
10 +++ live-initramfs-grml/scripts/live    2009-11-13 18:55:37.366466532 +0100
11 @@ -673,7 +673,7 @@
12  
13         # begin copying (or uncompressing)
14         mkdir "${copyto}"
15 -       echo "mount -t ${fstype} ${mount_options} ${dev} ${copyto}"
16 +       log_begin_msg "mount -t ${fstype} ${mount_options} ${dev} ${copyto}"
17         mount -t "${fstype}" ${mount_options} "${dev}" "${copyto}"
18  
19         if [ "${extension}" = "tgz" ]
20 @@ -686,11 +686,23 @@
21         else
22                 if [ -n "${MODULETORAMFILE}" ]
23                 then
24 -                       cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
25 -               else
26 -                       mkdir -p ${copyto}/${LIVE_MEDIA_PATH}
27 -                       cp -a ${copyfrom}/${LIVE_MEDIA_PATH}/* ${copyto}/${LIVE_MEDIA_PATH}   # "cp -a" from busybox also copies hidden files
28 -               fi
29 +                    if [ -x /bin/rsync ] ; then
30 +                    echo " * Copying $MODULETORAMFILE to RAM" 1>/dev/console
31 +                       rsync -a --progress ${MODULETORAMFILE} ${copyto} 1>/dev/console # copy only the filesystem module
32 +                    else
33 +                       cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
34 +                    fi
35 +                 else
36 +                    if [ -x /bin/rsync ] ; then
37 +                       echo " * Copying whole medium to RAM" 1>/dev/console
38 +                       rsync -a --progress ${copyfrom}/* ${copyto} 1>/dev/console  # "cp -a" from busybox also copies hidden files
39 +                       echo "   -> Tip: boot using 'grml2ram' or use 'grml toram=...'" 1>/dev/console
40 +                       echo "           to copy the image only instead of the whole medium" 1>/dev/console
41 +                    else
42 +                       mkdir -p ${copyto}/${LIVE_MEDIA_PATH}
43 +                       cp -a ${copyfrom}/${LIVE_MEDIA_PATH}/* ${copyto}/${LIVE_MEDIA_PATH}   # "cp -a" from busybox also copies hidden files
44 +                    fi
45 +                 fi
46  
47                 umount ${copyfrom}
48                 mount -r -o move ${copyto} ${copyfrom}