]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
add apply-live-updates.sh to pre-pivot hook 012
authorWill Woods <wwoods@redhat.com>
Mon, 1 Aug 2011 20:21:09 +0000 (16:21 -0400)
committerHarald Hoyer <harald@redhat.com>
Fri, 12 Aug 2011 06:03:55 +0000 (08:03 +0200)
If we're about to start a Live image (i.e. if /dev/mapper/live-rw
exists) this script will take any files found in /updates (inside the
initramfs!) and and copy them into $NEWROOT.

This allows for hotfixes to be applied to existing Live images without
rebuilding the entire image.

Signed-off-by: Will Woods <wwoods@redhat.com>
modules.d/90dmsquash-live/apply-live-updates.sh [new file with mode: 0755]
modules.d/90dmsquash-live/module-setup.sh

diff --git a/modules.d/90dmsquash-live/apply-live-updates.sh b/modules.d/90dmsquash-live/apply-live-updates.sh
new file mode 100755 (executable)
index 0000000..dfdb404
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+if [ -b /dev/mapper/live-rw ]; then
+    if [ "`echo /updates/*`" != "/updates/*" ]; then
+        echo "Applying updates to live image..."
+        /bin/cp -a /updates/* $NEWROOT
+    fi
+fi
index 8ed633f0811befd8e8b60505252fca225cf2f25d..684655f547a6b467ecbd20a4e698c6f0dc160e4c 100755 (executable)
@@ -34,6 +34,7 @@ install() {
     inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh"
     inst_hook pre-udev 30 "$moddir/dmsquash-live-genrules.sh"
     inst_hook pre-udev 30 "$moddir/dmsquash-liveiso-genrules.sh"
+    inst_hook pre-pivot 20 "$moddir/apply-live-updates.sh"
     inst "$moddir/dmsquash-live-root" "/sbin/dmsquash-live-root"
     # should probably just be generally included
     inst_rules 60-cdrom_id.rules