mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 09:13:01 +02:00
board/common: fix load_cfg key=value extraction
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>
This commit is contained in:
+13
-4
@@ -9,11 +9,20 @@ die()
|
||||
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()
|
||||
{
|
||||
local tmp=$(mktemp -p /tmp)
|
||||
tmp=$(mktemp -p /tmp)
|
||||
|
||||
grep "$1" $BR2_CONFIG >$tmp
|
||||
. $tmp
|
||||
rm $tmp
|
||||
grep -E "${1}.*=" "$BR2_CONFIG" >"$tmp"
|
||||
. "$tmp"
|
||||
|
||||
rm "$tmp"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
common=$(dirname "$(readlink -f "$0")")
|
||||
. $common/lib.sh
|
||||
. "$common/lib.sh"
|
||||
|
||||
load_cfg BR2_ARCH
|
||||
load_cfg BR2_DEFCONFIG
|
||||
@@ -50,8 +50,6 @@ fi
|
||||
|
||||
load_cfg GNS3_APPLIANCE
|
||||
if [ "$GNS3_APPLIANCE" = "y" ]; then
|
||||
load_cfg GNS3_APPLIANCE_RAM
|
||||
load_cfg GNS3_APPLIANCE_IFNUM
|
||||
ixmsg "Creating GNS3 Appliance, $GNS3_APPLIANCE_RAM MiB with $GNS3_APPLIANCE_IFNUM ports"
|
||||
$common/mkgns3a.sh $NAME $GNS3_APPLIANCE_RAM $GNS3_APPLIANCE_IFNUM
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user