Apply grml patches on the fly via dpatch
authorMichael Prokop <devnull@localhost>
Thu, 1 Nov 2007 22:32:50 +0000 (23:32 +0100)
committerMichael Prokop <devnull@localhost>
Thu, 1 Nov 2007 22:32:50 +0000 (23:32 +0100)
debian/patches/00list [new file with mode: 0644]
debian/patches/01_add_rsync.dpatch [new file with mode: 0755]
debian/patches/02_more_verbose_toram.diff [new file with mode: 0755]
debian/rules

diff --git a/debian/patches/00list b/debian/patches/00list
new file mode 100644 (file)
index 0000000..6caeaf8
--- /dev/null
@@ -0,0 +1,2 @@
+01_add_rsync.dpatch
+02_more_verbose_toram.diff
diff --git a/debian/patches/01_add_rsync.dpatch b/debian/patches/01_add_rsync.dpatch
new file mode 100755 (executable)
index 0000000..9bad8e0
--- /dev/null
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_add_rsync.dpatch by  <mika@grml.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add support for rsync
+
+@DPATCH@
+
+--- a/hooks/live       2007-11-01 22:26:49.063100777 +0100
++++ b/hooks/live       2007-11-01 22:27:28.560386219 +0100
+@@ -74,6 +74,8 @@
+ # Filesystem: ext3
+ manual_add_modules ext3
++copy_exec /usr/bin/rsync
++
+ # Filesystem: squashfs
+ copy_exec /sbin/losetup /sbin
+ manual_add_modules loop
diff --git a/debian/patches/02_more_verbose_toram.diff b/debian/patches/02_more_verbose_toram.diff
new file mode 100755 (executable)
index 0000000..9ed4f4f
--- /dev/null
@@ -0,0 +1,33 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02_more_verbose_toram.dpatch by  <mika@grml.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Support more verbose version of toram via rsync
+
+@DPATCH@
+
+--- a/scripts/live     2007-11-01 22:25:41.567739580 +0100
++++ b/scripts/live     2007-11-01 23:03:02.413731337 +0100
+@@ -609,9 +609,19 @@
+       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
++                        log_begin_msg "Copying $MODULETORAMFILE to RAM" >/dev/console
++                      if [ -x /usr/bin/rsync ] ; then
++                         rsync -a --progress ${MODULETORAMFILE} ${copyto} 1>/dev/console # copy only the filesystem module
++                      else
++                         cp ${MODULETORAMFILE} ${copyto} # copy only the filesystem module
++                      fi
++              else
++                        log_begin_msg "Copying medium to RAM" >/dev/console
++                      if [ -x /usr/bin/rsync ] ; then
++                         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
index bf12dad..0e1bf0e 100755 (executable)
@@ -8,7 +8,7 @@ upstream:
        rm -rf ../live-initramfs/.git
 
 build: build-stamp
-build-stamp:
+build-stamp: patch
        dh_testdir
 
        # Building package
@@ -16,7 +16,7 @@ build-stamp:
 
        touch build-stamp
 
-clean:
+clean: unpatch
        dh_testdir
        dh_testroot
        rm -f build-stamp
@@ -26,6 +26,16 @@ clean:
 
        dh_clean
 
+patch: patch-stamp
+
+patch-stamp:
+       dpatch apply-all
+       dpatch cat-all >patch-stamp
+
+unpatch:
+       dpatch deapply-all
+       rm -rf patch-stamp debian/patched
+
 install: build
        dh_testdir
        dh_testroot