#!/bin/bash set -e if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then echo "USAGE: $0 kernel-recipe [defconfig path]" exit 1 fi recipe=$1 dest=$(realpath $2) bbgetvar () { # NOTE: You may need to add SANITY_TESTED_DISTROS:append = " debian-12" # to conf/local.conf if the error messages makes it into the output bitbake-getvar -r "$1" --value "$2" } bitbake -c do_configure $recipe KCONFIG="$(bbgetvar $recipe B)/.config" if [ -z "$dest" ]; then echo "$KCONFIG" else cd "$(dirname $dest)" dest=$(basename $dest) if [ -n "$(git status --porcelain $dest)" ]; then echo "uncomitted changes: refusing to overwrite $dest" exit 2 fi cp "$KCONFIG" "$dest" fi