log_warning_msg is broken for quiet as well, use /dev/console instead for toram
[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      Wed Feb 20 16:00:41 2008 +0100
10 +++ b/scripts/live      Wed Feb 20 17:57:04 2008 +0100
11 @@ -593,8 +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 -               return 1
17 +               echo " * Warning: Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}." >/dev/console
18         fi
19  
20         # begin copying (or uncompressing)
21 @@ -612,9 +611,19 @@ copy_live_to ()
22         else
23                 if [ -n "${MODULETORAMFILE}" ]
24                 then
25 -                       cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
26 -               else
27 -                       cp -a ${copyfrom}/* ${copyto}   # "cp -a" from busybox also copies hidden files
28 +                       if [ -x /usr/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 /usr/bin/rsync ] ; then
36 +                       echo " * Copying medium to RAM" 1>/dev/console
37 +                          rsync -a --progress ${copyfrom}/* ${copyto} 1>/dev/console  # "cp -a" from busybox also copies hidden files
38 +                       else
39 +                          cp -a ${copyfrom}/* ${copyto}   # "cp -a" from busybox also copies hidden files
40 +                       fi
41                 fi
42  
43                 livefs_root