summaryrefslogtreecommitdiff
path: root/modules.d/90dmsquash-live
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2011-08-01 16:21:09 -0400
committerHarald Hoyer <harald@redhat.com>2011-08-12 08:03:55 +0200
commitf116ca115c9684ce8586edf692ffd88a436682df (patch)
tree42fa0d79df5b24b4270817abb14b004b22711a6b /modules.d/90dmsquash-live
parenta12db35efa6a9e8d718188dff48fb3e5db163290 (diff)
downloaddracut-f116ca115c9684ce8586edf692ffd88a436682df.tar.gz
dracut-f116ca115c9684ce8586edf692ffd88a436682df.tar.bz2
dracut-f116ca115c9684ce8586edf692ffd88a436682df.zip
add apply-live-updates.sh to pre-pivot hook012
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>
Diffstat (limited to 'modules.d/90dmsquash-live')
-rwxr-xr-xmodules.d/90dmsquash-live/apply-live-updates.sh7
-rwxr-xr-xmodules.d/90dmsquash-live/module-setup.sh1
2 files changed, 8 insertions, 0 deletions
diff --git a/modules.d/90dmsquash-live/apply-live-updates.sh b/modules.d/90dmsquash-live/apply-live-updates.sh
new file mode 100755
index 00000000..dfdb4046
--- /dev/null
+++ b/modules.d/90dmsquash-live/apply-live-updates.sh
@@ -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
diff --git a/modules.d/90dmsquash-live/module-setup.sh b/modules.d/90dmsquash-live/module-setup.sh
index 8ed633f0..684655f5 100755
--- a/modules.d/90dmsquash-live/module-setup.sh
+++ b/modules.d/90dmsquash-live/module-setup.sh
@@ -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