d2bcab25ce35c0c1f4d5ad7ee4a72f27e541c187
[live-initramfs-grml.git] / debian / patches / 02_more_verbose_toram.diff
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      Mon Nov 26 00:11:21 2007 +0100
10 +++ b/scripts/live      Wed Feb 20 15:57:57 2008 +0100
11 @@ -593,7 +593,7 @@ copy_live_to ()
12  
13         if [ "${freespace}" -lt "${size}" ]
14         then
15 -               [ "${quiet}" != "y" ] && log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
16 +               log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
17                 return 1
18         fi
19  
20 @@ -612,9 +612,19 @@ 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 +                       if [ -x /usr/bin/rsync ] ; then
28 +                       echo " * Copying $MODULETORAMFILE to RAM" 1>/dev/console
29 +                          rsync -a --progress ${MODULETORAMFILE} ${copyto} 1>/dev/console # copy only the filesystem module
30 +                       else
31 +                          cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
32 +                       fi
33 +               else
34 +                       if [ -x /usr/bin/rsync ] ; then
35 +                       echo " * Copying medium to RAM" 1>/dev/console
36 +                          rsync -a --progress ${copyfrom}/* ${copyto} 1>/dev/console  # "cp -a" from busybox also copies hidden files
37 +                       else
38 +                          cp -a ${copyfrom}/* ${copyto}   # "cp -a" from busybox also copies hidden files
39 +                       fi
40                 fi
41  
42                 livefs_root