Created
October 16, 2023 16:29
-
-
Save a3f/b1bd0a6258b186a20a51fe5f72f40a08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment