Move grml2ram tip after rsync
[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
9 --- a/scripts/live
10 +++ b/scripts/live
11 @@ -640,7 +640,7 @@ copy_live_to ()
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 @@ -653,10 +653,22 @@ copy_live_to ()
21         else
22                 if [ -n "${MODULETORAMFILE}" ]
23                 then
24 -                       cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
25 -               else
26 -                       cp -a ${copyfrom}/* ${copyto}   # "cp -a" from busybox also copies hidden files
27 -               fi
28 +                   if [ -x /bin/rsync ] ; then
29 +                   echo " * Copying $MODULETORAMFILE to RAM" 1>/dev/console
30 +                      rsync -a --progress ${MODULETORAMFILE} ${copyto} 1>/dev/console # copy only the filesystem module
31 +                   else
32 +                      cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
33 +                   fi
34 +                else
35 +                   if [ -x /bin/rsync ] ; then
36 +                      echo " * Copying whole medium to RAM" 1>/dev/console
37 +                      rsync -a --progress ${copyfrom}/* ${copyto} 1>/dev/console  # "cp -a" from busybox also copies hidden files
38 +                      echo "   -> Tip: boot using 'grml2ram' or use 'grml toram=...'" 1>/dev/console
39 +                      echo "           to copy the image only instead of the whole medium" 1>/dev/console
40 +                   else
41 +                      cp -a ${copyfrom}/* ${copyto}   # "cp -a" from busybox also copies hidden files
42 +                   fi
43 +                fi
44  
45                 livefs_root
46                 umount ${copyfrom}