Hi,
I am using the attached patch now. The patch assumes that it is run in
a chroot when the running kernel is not installed.
--
Benjamin Drung
System Developer
Debian & Ubuntu Developer
ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin
Email: benjamin.dr...@profitbricks.com
URL: http://www.profitbricks.com
Sitz der Gesellschaft: Berlin.
Registergericht: Amtsgericht Charlottenburg, HRB 125506B.
Geschäftsführer: Andreas Gauger, Achim Weiss.
From 7e6c0d5b0c7299154f75f281c02cf02cf85fb80e Mon Sep 17 00:00:00 2001
From: Benjamin Drung <benjamin.dr...@profitbricks.com>
Date: Thu, 2 Mar 2017 19:52:23 +0100
Subject: [PATCH] Generate initramfs for installed kernels in chroot
The postinst script from kdump-tools creates an initramfs for the
running kernel. When running inside a chroot, the running kernel (from
the host) might differ from the kernels that are available in the
chroot.
Thus generate the initramfs only when the running kernel is installed in
the system. Otherwise generate the initramfs for all installed kernels.
Bug-Debian: #856594
---
debian/kdump-tools.postinst | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/debian/kdump-tools.postinst b/debian/kdump-tools.postinst
index 4b6c6be..f604c8e 100755
--- a/debian/kdump-tools.postinst
+++ b/debian/kdump-tools.postinst
@@ -33,7 +33,15 @@ update_param() {
case "$1" in
configure)
# create smaller initrd.img files for kdump use
- /etc/kernel/postinst.d/kdump-tools $(uname -r) > /dev/null 2>&1
+ if test -d /lib/modules/$(uname -r); then
+ /etc/kernel/postinst.d/kdump-tools $(uname -r) > /dev/null 2>&1
+ else
+ # Running kernel not installed. Running in chroot?
+ for kernel_release in $(ls /lib/modules/); do
+ /etc/kernel/postinst.d/kdump-tools $kernel_release > /dev/null 2>&1
+ kdump-config symlinks $kernel_release
+ done
+ fi
# Customize crashkernel= value according to architecture
ARCH="$(arch)"
--
2.9.3