summaryrefslogtreecommitdiff
path: root/helpers/lh_patchlinux
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/lh_patchlinux')
-rwxr-xr-xhelpers/lh_patchlinux32
1 files changed, 32 insertions, 0 deletions
diff --git a/helpers/lh_patchlinux b/helpers/lh_patchlinux
new file mode 100755
index 000000000..7193f2319
--- /dev/null
+++ b/helpers/lh_patchlinux
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# lh_patchlinux.sh <action>
+
+# The linux-image package asks interactively for initial ramdisk
+# creation. Therefore, we preconfigure /etc/kernel-img.conf.
+# FIXME: preseeding?
+
+case "${1}" in
+ apply)
+ # Save kernel configuration
+ if [ -f "${LIVE_CHROOT}"/etc/kernel-img.conf ]
+ then
+ cp "${LIVE_CHROOT}"/etc/kernel-img.conf \
+ "${LIVE_CHROOT}"/etc/kernel-img.conf.old
+ fi
+
+ # Configure kernel-img.conf
+ echo "do_initrd = Yes" >> "${LIVE_CHROOT}"/etc/kernel-img.conf
+ ;;
+
+ deapply)
+ # Restore kernel configuration
+ if [ -f "${LIVE_CHROOT}"/etc/kernel-img.conf.old ]
+ then
+ mv "${LIVE_CHROOT}"/etc/kernel-img.conf.old \
+ "${LIVE_CHROOT}"/etc/kernel-img.conf
+ else
+ rm -f "${LIVE_CHROOT}"/etc/kernel-img.conf
+ fi
+ ;;
+esac