Package: kexec-tools
Version: 1:2.0.4-1
Severity: wishlist
Tags: patch
User: tails-...@boum.org
Usertags: erase-memory

Hi,

tl;dr: please consider applying the attached patch.

We, folks from two Debian derivatives (Tails and Freepto), are working
together to package a Tails feature for Debian: erasing memory at
shutdown/reboot. The current implementation relies on kexec.

Doing so requires to make the kexec-tools stuff a bit more flexible
wrt. being reconfigured by other packages. To start with, we have to
dynamically patch /etc/default/kexec, and the best way we've found of
doing it is to add support for a /etc/default/kexec.d/ directory,
sourced (after /etc/default/kexec) by the two initscripts shipped by
kexec-tools.

If you don't mind adding complexity to the kexec-tools package in
order to support this usecase, more patches of the same kind
will follow.

Thanks for maintaining kexec-tools in Debian!

Cheers,
--
intrigeri

diff -Naur kexec-tools-2.0.4.orig/debian/kexec.init.d kexec-tools-2.0.4/debian/kexec.init.d
--- kexec-tools-2.0.4.orig/debian/kexec.init.d	2013-07-25 22:04:56.000000000 +0200
+++ kexec-tools-2.0.4/debian/kexec.init.d	2014-06-26 13:03:58.960450573 +0200
@@ -15,6 +15,11 @@
 . /lib/lsb/init-functions
 
 test -r /etc/default/kexec && . /etc/default/kexec
+if [ -d /etc/default/kexec.d ] ; then
+	for snippet in $(run-parts --list /etc/default/kexec.d) ; do
+		. "$snippet"
+	done
+fi
 
 do_stop () {
 	test "x`cat /sys/kernel/kexec_loaded`y" = "x1y" || exit 0
diff -Naur kexec-tools-2.0.4.orig/debian/kexec-load.init.d kexec-tools-2.0.4/debian/kexec-load.init.d
--- kexec-tools-2.0.4.orig/debian/kexec-load.init.d	2013-11-08 18:22:49.000000000 +0100
+++ kexec-tools-2.0.4/debian/kexec-load.init.d	2014-06-26 13:04:08.836375294 +0200
@@ -16,6 +16,11 @@
 . /lib/lsb/init-functions
 
 test -r /etc/default/kexec && . /etc/default/kexec
+if [ -d /etc/default/kexec.d ] ; then
+	for snippet in $(run-parts --list /etc/default/kexec.d) ; do
+		. "$snippet"
+	done
+fi
 
 process_grub_entry() {
 	initrd_image=
diff -Naur kexec-tools-2.0.4.orig/debian/kexec-tools.dirs kexec-tools-2.0.4/debian/kexec-tools.dirs
--- kexec-tools-2.0.4.orig/debian/kexec-tools.dirs	2012-01-19 19:59:26.000000000 +0100
+++ kexec-tools-2.0.4/debian/kexec-tools.dirs	2014-06-26 13:07:23.874881252 +0200
@@ -1 +1,2 @@
 sbin
+etc/default/kexec.d

Reply via email to