summaryrefslogtreecommitdiff
path: root/helpers/lh_patchlinux
blob: 7193f2319aa1e3dad161295c13ff51bbc08e932c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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