@@ -193,6 +193,20 @@ function prepare_and_build_rootfs {
193
193
build_initramfs
194
194
}
195
195
196
+ function vmlinux_split_debuginfo {
197
+ VMLINUX=" $1 "
198
+ DEBUGINFO=" $VMLINUX .debug"
199
+ VMLINUX_ORIG=" $VMLINUX "
200
+ if [ $ARCH = " aarch64" ]; then
201
+ # in aarch64, the debug info is in vmlinux
202
+ VMLINUX_ORIG=linux/vmlinux
203
+ fi
204
+ objcopy --only-keep-debug $VMLINUX_ORIG $DEBUGINFO
205
+ objcopy --preserve-dates --strip-debug --add-gnu-debuglink=$DEBUGINFO $VMLINUX
206
+ # gdb does not support compressed files, but compress them because they are huge
207
+ gzip -v $DEBUGINFO
208
+ }
209
+
196
210
function build_al_kernels {
197
211
if [[ $# = 0 ]]; then
198
212
local KERNEL_VERSION=" all"
@@ -208,7 +222,6 @@ function build_al_kernels {
208
222
clone_amazon_linux_repo
209
223
210
224
CI_CONFIG=" $PWD /guest_configs/ci.config"
211
- FTRACE_CONFIG=" $PWD /guest_configs/ftrace.config"
212
225
213
226
if [[ " $KERNEL_VERSION " == @ (all| 5.10) ]]; then
214
227
build_al_kernel $PWD /guest_configs/microvm-kernel-ci-$ARCH -5.10.config " $CI_CONFIG "
@@ -221,10 +234,18 @@ function build_al_kernels {
221
234
fi
222
235
223
236
# Build debug kernels
237
+ FTRACE_CONFIG=" $PWD /guest_configs/ftrace.config"
238
+ DEBUG_CONFIG=" $PWD /guest_configs/debug.config"
224
239
OUTPUT_DIR=$OUTPUT_DIR /debug
225
240
mkdir -pv $OUTPUT_DIR
226
- build_al_kernel " $PWD /guest_configs/microvm-kernel-ci-$ARCH -5.10.config" " $CI_CONFIG " " $FTRACE_CONFIG "
227
- build_al_kernel " $PWD /guest_configs/microvm-kernel-ci-$ARCH -6.1.config" " $CI_CONFIG " " $FTRACE_CONFIG "
241
+ if [[ " $KERNEL_VERSION " == @ (all| 5.10) ]]; then
242
+ build_al_kernel " $PWD /guest_configs/microvm-kernel-ci-$ARCH -5.10.config" " $CI_CONFIG " " $FTRACE_CONFIG " " $DEBUG_CONFIG "
243
+ vmlinux_split_debuginfo $OUTPUT_DIR /vmlinux-5.10.*
244
+ fi
245
+ if [[ " $KERNEL_VERSION " == @ (all| 6.1) ]]; then
246
+ build_al_kernel " $PWD /guest_configs/microvm-kernel-ci-$ARCH -6.1.config" " $CI_CONFIG " " $FTRACE_CONFIG " " $DEBUG_CONFIG "
247
+ vmlinux_split_debuginfo $OUTPUT_DIR /vmlinux-6.1.*
248
+ fi
228
249
}
229
250
230
251
function print_help {
0 commit comments