mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-27 03:03:02 +02:00
Calling `load_cfg BR2_EXTERNAL_INFIX_PATH` from post-image.sh caused warnings due to multiple hits in the .config file: post-image.sh: 12: /tmp/tmp.5a3xhQQVc8: BR2_EXTERNAL_INFIX_PATH: not found post-image.sh: 13: /tmp/tmp.5a3xhQQVc8: BR2_EXTERNAL_INFIX_PATH: not found Let's grep for a "key.*=" instead of "key" to drop those warnings, while still acting as a catch-all for partial matches. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
29 lines
417 B
Bash
29 lines
417 B
Bash
ixmsg()
|
|
{
|
|
printf "\e[37;44m#!: $@\e[0m\n"
|
|
}
|
|
|
|
die()
|
|
{
|
|
echo "$@" >&2
|
|
exit 1
|
|
}
|
|
|
|
# Find all matching key=value assignments in output/.config
|
|
# E.g., load_cfg DISK_IMAGE sets the following variables:
|
|
#
|
|
# DISK_IMAGE=y
|
|
# DISK_IMAGE_SIZE="512"
|
|
# etc.
|
|
#
|
|
# shellcheck disable=SC1090
|
|
load_cfg()
|
|
{
|
|
tmp=$(mktemp -p /tmp)
|
|
|
|
grep -E "${1}.*=" "$BR2_CONFIG" >"$tmp"
|
|
. "$tmp"
|
|
|
|
rm "$tmp"
|
|
}
|