From 81ed99dcf6d14a3981e23e16a342b475b5b8f94d Mon Sep 17 00:00:00 2001 From: Martin Harriman Date: Tue, 13 Aug 2024 20:59:42 +0000 Subject: [PATCH] tools: add collect-kernel-config script Run tools/collect-kernel-config to extract the six as-build kernel configurations from build/rpms after building the core kit. Build both architectures if you will be comparing configurations for both architectures. --- tools/collect-kernel-config | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 tools/collect-kernel-config diff --git a/tools/collect-kernel-config b/tools/collect-kernel-config new file mode 100755 index 000000000..a5fd83e27 --- /dev/null +++ b/tools/collect-kernel-config @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +output_dir=/tmp/configs + +usage() { + cat <&2 usage + bail "$1" +} + + +# +# Parse arguments +# + +while [[ $# -gt 0 ]]; do + case $1 in + -o|--output-dir) + shift; output_dir=$1 ;; + -h|--help) + usage; exit 0 ;; + *) + usage_error "Invalid option '$1'" ;; + esac + shift +done + +readonly output_dir +mkdir -p ${output_dir} +echo "Created ${output_dir}" + +for kernel in 5.10 5.15 6.1; do + for arch in x86_64 aarch64; do + rpm2cpio ./build/rpms/kernel-${kernel}/bottlerocket-kernel-${kernel}-${kernel}*.${arch}.rpm | cpio --extract --to-stdout ./boot/config > ${output_dir}/config-${kernel}-${arch}.config + done +done