summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2011-10-20 16:28:46 +0200
committerTails developers <amnesia@boum.org>2011-10-20 17:01:25 +0200
commit8e391ae9d18aab4cbcfaa86bda7016c9b7f056a2 (patch)
tree5c50fb6974e1961961facf4e9036c410b84b118a
parent51b27d5fac5b24a4ec1c25bde1d3001c434d5ca6 (diff)
Have memlockd cache the running kernel and initrd.
Since we don't ship those in /boot anymore, the symlinks in / are broken. Moreover, once we ship several pairs of kernel/initrd, the running pair must be cached (and is already used by our kexec configuration).
-rwxr-xr-xconfig/chroot_local-hooks/52-update-rc.d1
-rwxr-xr-xconfig/chroot_local-includes/etc/init.d/tails-reconfigure-memlockd25
2 files changed, 26 insertions, 0 deletions
diff --git a/config/chroot_local-hooks/52-update-rc.d b/config/chroot_local-hooks/52-update-rc.d
index 946ce11..d3322a0 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-memlockd defaults
# we run Tor ourselves after HTP via NetworkManager hooks
update-rc.d tor disable
diff --git a/config/chroot_local-includes/etc/init.d/tails-reconfigure-memlockd b/config/chroot_local-includes/etc/init.d/tails-reconfigure-memlockd
new file mode 100755
index 0000000..3937b1a
--- /dev/null
+++ b/config/chroot_local-includes/etc/init.d/tails-reconfigure-memlockd
@@ -0,0 +1,25 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: tails-reconfigure-memlockd
+# Required-Start: $local_fs
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop:
+# Short-Description: Reconfigure memlockd depending on running kernel
+# Description: Reconfigure memlockd depending on running kernel
+### END INIT INFO
+
+MEMLOCKD_CONF=/etc/memlockd.cfg
+
+case "$1" in
+ start)
+ /usr/local/bin/tails-get-bootinfo kernel >> "$MEMLOCKD_CONF"
+ /usr/local/bin/tails-get-bootinfo initrd >> "$MEMLOCKD_CONF"
+ service memlockd restart
+ ;;
+ *)
+ echo "Usage: $0 start" >&2
+ exit 3
+ ;;
+esac
+exit 0