And nother toram fix
authorMichael Prokop <devnull@localhost>
Wed, 20 Feb 2008 17:05:53 +0000 (18:05 +0100)
committerMichael Prokop <devnull@localhost>
Wed, 20 Feb 2008 17:05:53 +0000 (18:05 +0100)
debian/patches/02_more_verbose_toram.diff
scripts/live

index 44460fb..4b01918 100755 (executable)
@@ -6,19 +6,27 @@
 
 @DPATCH@
 
---- a/scripts/live     Wed Feb 20 16:00:41 2008 +0100
-+++ b/scripts/live     Wed Feb 20 17:57:04 2008 +0100
-@@ -593,8 +593,7 @@ copy_live_to ()
+--- a/scripts/live     Wed Feb 20 17:57:40 2008 +0100
++++ b/scripts/live     Wed Feb 20 18:05:36 2008 +0100
+@@ -564,7 +564,7 @@ copy_live_to ()
+               then
+                       size=$( expr $(ls -la ${MODULETORAMFILE} | awk '{print $5}') / 1024 + 5000 )
+               else
+-                      log_warning_msg "Error: toram-module ${MODULETORAM} (${MODULETORAMFILE}) could not be read."
++                      echo " * Error: toram-module ${MODULETORAM} (${MODULETORAMFILE}) could not be read." >/dev/console
+                       return 1
+               fi
+       fi
+@@ -593,7 +593,7 @@ copy_live_to ()
  
        if [ "${freespace}" -lt "${size}" ]
        then
 -              [ "${quiet}" != "y" ] && log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
--              return 1
-+              echo " * Warning: Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}." >/dev/console
++              echo " * Error: Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}." >/dev/console
+               return 1
        fi
  
-       # begin copying (or uncompressing)
-@@ -612,9 +611,19 @@ copy_live_to ()
+@@ -612,9 +612,19 @@ copy_live_to ()
        else
                if [ -n "${MODULETORAMFILE}" ]
                then
index 80f77e9..dad1a2b 100755 (executable)
@@ -564,7 +564,7 @@ copy_live_to ()
                then
                        size=$( expr $(ls -la ${MODULETORAMFILE} | awk '{print $5}') / 1024 + 5000 )
                else
-                       log_warning_msg "Error: toram-module ${MODULETORAM} (${MODULETORAMFILE}) could not be read."
+                       echo " * Error: toram-module ${MODULETORAM} (${MODULETORAMFILE}) could not be read." >/dev/console
                        return 1
                fi
        fi
@@ -593,7 +593,7 @@ copy_live_to ()
 
        if [ "${freespace}" -lt "${size}" ]
        then
-               [ "${quiet}" != "y" ] && log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
+               echo " * Error: Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}." >/dev/console
                return 1
        fi
 
@@ -612,9 +612,19 @@ copy_live_to ()
        else
                if [ -n "${MODULETORAMFILE}" ]
                then
-                       cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
-               else
-                       cp -a ${copyfrom}/* ${copyto}   # "cp -a" from busybox also copies hidden files
+                       if [ -x /usr/bin/rsync ] ; then
+                       echo " * Copying $MODULETORAMFILE to RAM" 1>/dev/console
+                          rsync -a --progress ${MODULETORAMFILE} ${copyto} 1>/dev/console # copy only the filesystem module
+                       else
+                          cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
+                       fi
+               else
+                       if [ -x /usr/bin/rsync ] ; then
+                       echo " * Copying medium to RAM" 1>/dev/console
+                          rsync -a --progress ${copyfrom}/* ${copyto} 1>/dev/console  # "cp -a" from busybox also copies hidden files
+                       else
+                          cp -a ${copyfrom}/* ${copyto}   # "cp -a" from busybox also copies hidden files
+                       fi
                fi
 
                livefs_root