summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2011-10-21 10:51:47 +0200
committerTails developers <amnesia@boum.org>2011-10-21 11:15:23 +0200
commitbc93b95d09ad422128411dc84c174b7f383b5ca6 (patch)
treeea2c864c1adafa8ea4cc1521f921d9c1b557caba
parentf3c8602c5c77b5c96bffe0882d003115b936f60f (diff)
Reconfigure kexec at boot time.
Avoid breaking the build by adding too much scripting to /etc/default/kexec, that is sourced by the kexec-tools.config maintainer script.
-rwxr-xr-xconfig/chroot_local-hooks/52-update-rc.d1
-rw-r--r--config/chroot_local-includes/etc/default/kexec8
-rwxr-xr-xconfig/chroot_local-includes/etc/init.d/tails-reconfigure-kexec24
3 files changed, 30 insertions, 3 deletions
diff --git a/config/chroot_local-hooks/52-update-rc.d b/config/chroot_local-hooks/52-update-rc.d
index d3322a0..f31f0a2 100755
--- a/config/chroot_local-hooks/52-update-rc.d
+++ b/config/chroot_local-hooks/52-update-rc.d
@@ -8,6 +8,7 @@ update-rc.d tails-kexec stop 85 0 6 .
update-rc.d tails-wifi start 17 S .
update-rc.d memlockd start 22 2 3 4 5 .
update-rc.d tails-sdmem-on-media-removal start 23 2 3 4 5 . stop 01 0 6
+update-rc.d tails-reconfigure-kexec defaults
update-rc.d tails-reconfigure-memlockd defaults
# we run Tor ourselves after HTP via NetworkManager hooks
diff --git a/config/chroot_local-includes/etc/default/kexec b/config/chroot_local-includes/etc/default/kexec
index 107bbf0..504b21e 100644
--- a/config/chroot_local-includes/etc/default/kexec
+++ b/config/chroot_local-includes/etc/default/kexec
@@ -1,12 +1,14 @@
# Defaults for kexec initscript
-# sourced by /etc/init.d/kexec and /etc/init.d/kexec-load
+# sourced by kexec-tools.config, /etc/init.d/kexec and /etc/init.d/kexec-load
# Load a kexec kernel (true/false)
LOAD_KEXEC=true
# Kernel and initrd image
-KERNEL_IMAGE=$(/usr/local/bin/tails-get-bootinfo kernel)
-INITRD=$(/usr/local/bin/tails-get-bootinfo initrd)
+# Unused: tails-reconfigure-kexec appends the correct values to this file
+# at boot time.
+KERNEL_IMAGE=/vmlinux
+INITRD=/initrd.img
# If empty, use current /proc/cmdline
APPEND="quiet"
diff --git a/config/chroot_local-includes/etc/init.d/tails-reconfigure-kexec b/config/chroot_local-includes/etc/init.d/tails-reconfigure-kexec
new file mode 100755
index 0000000..7722655
--- /dev/null
+++ b/config/chroot_local-includes/etc/init.d/tails-reconfigure-kexec
@@ -0,0 +1,24 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: tails-reconfigure-kexec
+# Required-Start: $local_fs
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop:
+# Short-Description: Reconfigure kexec depending on running kernel
+# Description: Reconfigure kexec depending on running kernel
+### END INIT INFO
+
+KEXEC_CONF=/etc/default/kexec
+
+case "$1" in
+ start)
+ echo "KERNEL_IMAGE=\"$(/usr/local/bin/tails-get-bootinfo kernel)\"" >> "$KEXEC_CONF"
+ echo "INITRD=\"$(/usr/local/bin/tails-get-bootinfo initrd)\"" >> "$KEXEC_CONF"
+ ;;
+ *)
+ echo "Usage: $0 start" >&2
+ exit 3
+ ;;
+esac
+exit 0