From c2e79d80b5a92e59f531607970ce0e7622034b5f Mon Sep 17 00:00:00 2001 From: Jiping Ma Date: Tue, 14 Jun 2022 02:48:59 +0000 Subject: [PATCH] Debian: add kdump-tools package. There is a need to modify the source code of the kdump-tools package to adapt it to Debian-based StarlingX. This commit replaces the binary package with a source package. The default kernel image is located at /boot/vmlinuz-${kernel_version} in Debian system. But it is /boot/1/vmlinuz-${kernel_version} in the current starlingx system. In addition, initrd.img is also different because we use ostree. So this commit creates two soft links for vmlinuz and initrd.img. Test Plan: PASS: Image builds successfully. PASS: kdump-tools installs successfully. PASS: Can generate vmcore files in /var/crash after kernel panic. Story: 2009964 Task: 45623 Depends-On: https://review.opendev.org/c/starlingx/tools/+/845886 Depends-On: https://review.opendev.org/c/starlingx/tools/+/845884 Signed-off-by: Jiping Ma Change-Id: Ifffbf0e436e79d9547a478f8b725e18f283d138e --- debian_iso_image.inc | 1 + debian_pkg_dirs | 1 + ...add-vmlinuz-and-initrd.img-soft-link.patch | 33 +++++++++++++++++++ tools/kdump-tools/debian/deb_patches/series | 1 + tools/kdump-tools/debian/meta_data.yaml | 11 +++++++ 5 files changed, 47 insertions(+) create mode 100644 tools/kdump-tools/debian/deb_patches/0001-kdump-tools-add-vmlinuz-and-initrd.img-soft-link.patch create mode 100644 tools/kdump-tools/debian/deb_patches/series create mode 100644 tools/kdump-tools/debian/meta_data.yaml diff --git a/debian_iso_image.inc b/debian_iso_image.inc index 88d73928d..02394f38e 100644 --- a/debian_iso_image.inc +++ b/debian_iso_image.inc @@ -1,6 +1,7 @@ # List of packages to be included/installed in ISO facter +kdump-tools puppet drbd-tools parted diff --git a/debian_pkg_dirs b/debian_pkg_dirs index c6eee4587..09ed60498 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -82,3 +82,4 @@ security/python-keyring security/shim-unsigned security/openscap storage-drivers/trident-installer +tools/kdump-tools diff --git a/tools/kdump-tools/debian/deb_patches/0001-kdump-tools-add-vmlinuz-and-initrd.img-soft-link.patch b/tools/kdump-tools/debian/deb_patches/0001-kdump-tools-add-vmlinuz-and-initrd.img-soft-link.patch new file mode 100644 index 000000000..12ceeb14a --- /dev/null +++ b/tools/kdump-tools/debian/deb_patches/0001-kdump-tools-add-vmlinuz-and-initrd.img-soft-link.patch @@ -0,0 +1,33 @@ +From bc657ad181e105e225849a78fd08ddcb630cb9e9 Mon Sep 17 00:00:00 2001 +From: Jiping Ma +Date: Sun, 12 Jun 2022 23:54:50 -0700 +Subject: [PATCH] kdump-tools: add vmlinuz and initrd.img soft link. + +Default vmlinuz is in the folder /boot, but our vmlinuz is in /boot/1. +so create the soft link for vmlinuz and initrd.img. + +Signed-off-by: Jiping Ma +--- + debian/kdump-config.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/debian/kdump-config.in b/debian/kdump-config.in +index 564ab94..eb23da1 100755 +--- a/debian/kdump-config.in ++++ b/debian/kdump-config.in +@@ -494,6 +494,12 @@ kernel_version=$1 + exit 1 + fi + ++ if [ ! -e "/boot/vmlinux-${kernel_version}" ] && [ ! -e "/boot/vmlinuz-${kernel_version}" ]; then ++ ln -s /boot/1/vmlinuz-${kernel_version} /boot/vmlinuz-${kernel_version} ++ fi ++ if [ ! -f "${KDUMP_DIR}/initrd.img-${kernel_version}" ]; then ++ ln -s /boot/1/initramfs /var/lib/kdump/initrd.img-${kernel_version} ++ fi + if [ -e "/boot/vmlinux-${kernel_version}" ] || [ -e "/boot/vmlinuz-${kernel_version}" ]; then + create_symlink vmlinuz "$kernel_version" + +-- +2.34.1 + diff --git a/tools/kdump-tools/debian/deb_patches/series b/tools/kdump-tools/debian/deb_patches/series new file mode 100644 index 000000000..ed99c1c21 --- /dev/null +++ b/tools/kdump-tools/debian/deb_patches/series @@ -0,0 +1 @@ +0001-kdump-tools-add-vmlinuz-and-initrd.img-soft-link.patch diff --git a/tools/kdump-tools/debian/meta_data.yaml b/tools/kdump-tools/debian/meta_data.yaml new file mode 100644 index 000000000..eb408e72d --- /dev/null +++ b/tools/kdump-tools/debian/meta_data.yaml @@ -0,0 +1,11 @@ +--- +debver: 1:1.6.8.4 +debname: kdump-tools +dl_path: + name: kdump-tools_1.6.8.4.tar.xz + url: "https://deb.debian.org/debian/pool/main/k/kdump-tools/kdump-tools_1.6.8.4.tar.xz" + md5sum: 26bcae7c27b729d614a4a85e2a01cb64 + sha256sum: 5d91fb4277e305e7d621d0205131ca69e1677a10645f74657e0e0eaaf2f73fe7 +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true