From f0b59b87b7e4786f13bff2939996cf15a71e0993 Mon Sep 17 00:00:00 2001
From: Serapheim Dimitropoulos <serapheim@delphix.com>
Date: Wed, 4 Oct 2023 08:40:22 -0700
Subject: [PATCH] WIP

PR URL: https://www.github.com/delphix/linux-pkg/pull/303
---
 default-package-config.sh |  3 ++-
 lib/common.sh             | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/default-package-config.sh b/default-package-config.sh
index 6b9de14..23b5b8b 100644
--- a/default-package-config.sh
+++ b/default-package-config.sh
@@ -37,8 +37,9 @@ function merge_with_upstream() {
 #
 function kernel_prepare() {
 	logmust install_pkgs \
-		equivs \
 		devscripts \
+		equivs \
+		gawk \
 		kernel-wedge
 }
 
diff --git a/lib/common.sh b/lib/common.sh
index 9d1d69c..29ae0ca 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -594,6 +594,20 @@ function install_kernel_headers() {
 	for kernel in $KERNEL_VERSIONS; do
 		logmust dpkg-query -l "linux-headers-$kernel" >/dev/null
 	done
+
+	#
+	# XXX: Refactor & explain
+	#
+	logmust echo "SERAPHEIM START2"
+	local pkg
+	for pkg in "${_RET_LIST[@]}"; do
+		logmust install_pkgs "$DEPDIR/$pkg/"linux-image-*-dbgsym.deb
+	done
+	local kernel
+	for kernel in $KERNEL_VERSIONS; do
+		logmust cp "/usr/lib/debug/boot/vmlinux-${kernel}" "/usr/src/linux-headers-$kernel/vmlinux"
+	done
+	logmust echo "SERAPHEIM END2"
 }
 
 function delphix_revision() {