Adjust path of rsync (use /bin)
[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      Thu Jul 17 14:17:15 2008 +0200
10 +++ b/scripts/live      Thu Jul 17 14:17:24 2008 +0200
11 @@ -582,7 +582,7 @@ copy_live_to ()
12                 then
13                         size=$( expr $(ls -la ${MODULETORAMFILE} | awk '{print $5}') / 1024 + 5000 )
14                 else
15 -                       log_warning_msg "Error: toram-module ${MODULETORAM} (${MODULETORAMFILE}) could not be read."
16 +                       echo " * Error: toram-module ${MODULETORAM} (${MODULETORAMFILE}) could not be read." >/dev/console
17                         return 1
18                 fi
19         fi
20 @@ -611,7 +611,7 @@ copy_live_to ()
21  
22         if [ "${freespace}" -lt "${size}" ]
23         then
24 -               [ "${quiet}" != "y" ] && log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
25 +               echo " * Error: Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}." >/dev/console
26                 return 1
27         fi
28  
29 @@ -630,9 +630,19 @@ copy_live_to ()
30         else
31                 if [ -n "${MODULETORAMFILE}" ]
32                 then
33 -                       cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
34 -               else
35 -                       cp -a ${copyfrom}/* ${copyto}   # "cp -a" from busybox also copies hidden files
36 +                       if [ -x /bin/rsync ] ; then
37 +                       echo " * Copying $MODULETORAMFILE to RAM" 1>/dev/console
38 +                          rsync -a --progress ${MODULETORAMFILE} ${copyto} 1>/dev/console # copy only the filesystem module
39 +                       else
40 +                          cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
41 +                       fi
42 +               else
43 +                       if [ -x /bin/rsync ] ; then
44 +                       echo " * Copying medium to RAM" 1>/dev/console
45 +                          rsync -a --progress ${copyfrom}/* ${copyto} 1>/dev/console  # "cp -a" from busybox also copies hidden files
46 +                       else
47 +                          cp -a ${copyfrom}/* ${copyto}   # "cp -a" from busybox also copies hidden files
48 +                       fi
49                 fi
50  
51                 livefs_root