summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2011-10-19 19:17:21 +0200
committerTails developers <amnesia@boum.org>2011-10-19 19:45:28 +0200
commit707f2e202a55c1af6d4f69fcfe6fd215dab9a449 (patch)
treeeb5d303031b1cf83b633fd0d226e1bcadb346c8e
parentb05bb37511155b71d94dacfe72e1e9f929883adc (diff)
Make kexec find out what kernel was booted, and load this one.
We'll soon ship several kernels for PAE / NX bit support: 486, 686-pae, amd64. Therefore, if the system was booted on a 64-bit kernel, plenty of memory may have been used, that need to be wiped on shutdown; in such a situation, the memory wipe kexec'd kernel must be 64-bit too: a 32-bit kernel may be unable to access all memory that may have been used during the runtime of Tails.
-rw-r--r--config/chroot_local-includes/etc/default/kexec15
1 files changed, 13 insertions, 2 deletions
diff --git a/config/chroot_local-includes/etc/default/kexec b/config/chroot_local-includes/etc/default/kexec
index 02fc4c0..13cab1b 100644
--- a/config/chroot_local-includes/etc/default/kexec
+++ b/config/chroot_local-includes/etc/default/kexec
@@ -5,8 +5,19 @@
LOAD_KEXEC=true
# Kernel and initrd image
-KERNEL_IMAGE="/vmlinuz"
-INITRD="/initrd.img"
+LIVE_IMAGE_MOUNTPOINT=/live/image
+for arg in $(cat /proc/cmdline) ; do
+ case "$arg" in
+ BOOT_IMAGE=*)
+ kernel="${arg#BOOT_IMAGE=}"
+ ;;
+ initrd=*)
+ initrd="${arg#initrd=}"
+ ;;
+ esac
+done
+KERNEL_IMAGE="${LIVE_IMAGE_MOUNTPOINT}${kernel}"
+INITRD="${LIVE_IMAGE_MOUNTPOINT}${initrd}"
# If empty, use current /proc/cmdline
APPEND="quiet"