summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-05 21:05:45 +0100
committerLeah Rowe <leah@libreboot.org>2025-05-05 21:05:45 +0100
commit7585336b914d5d43ab85ba2f75fc5215be7782fb (patch)
treeb3a5babca01006e7b8d4091fd342f794c0870116 /include
parentef38333f8b0dae8f7f7b271128e2805de9669be3 (diff)
inject.sh: simplify kconfig scanning
Use fe_ with a new function, scankconfig, to do the same thing. Not only is this simpler, it now also operates on all coreboot configs for a given target, whereas it previously only operated on the first one. This is useful for cases where one config might use a file that the other one does not; in practise, we don't do this yet, but it's a theoretical possibility Also: don't use the function check_defconfig, which is now redundant and has been removed. That function also conflicted with another function by the same name in mk, but fortunately didn't cause an issue in practise, due to how sh works; when vendor.sh was used, it was without running the tree commands, except under a separate lbmk instance. So this is a simplification, a feature enhancement and even a bug fix, all wrapped into one! Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
-rw-r--r--include/inject.sh12
-rw-r--r--include/lib.sh8
2 files changed, 9 insertions, 11 deletions
diff --git a/include/inject.sh b/include/inject.sh
index 6caf8500..fa6ac095 100644
--- a/include/inject.sh
+++ b/include/inject.sh
@@ -49,9 +49,8 @@ download()
readkconfig()
{
x_ rm -f "$xbmktmp/cbcfg"
- cbcfg="`check_defconfig "$boarddir"`" || for cbc in $cv; do
- grep "$cbc" "$cbcfg" 1>>"$xbmktmp/cbcfg" 2>/dev/null || :
- done
+ fe_ scankconfig "$boarddir/config" -type f
+
eval "`setcfg "$xbmktmp/cbcfg" 1`"
for c in $cvchk; do
@@ -63,6 +62,13 @@ readkconfig()
return 1
}
+scankconfig()
+{
+ for cbc in $cv; do
+ grep "$cbc" "$1" 1>>"$xbmktmp/cbcfg" 2>/dev/null || :
+ done
+}
+
bootstrap()
{
x_ ./mk -f coreboot ${cbdir##*/}
diff --git a/include/lib.sh b/include/lib.sh
index e6fa7e75..530ea170 100644
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -105,14 +105,6 @@ mk()
done; :
}
-check_defconfig()
-{
- [ -d "$1" ] || err "Target '$1' not defined."
- for x in "$1"/config/*; do
- [ -f "$x" ] && printf "%s\n" "$x" && return 1
- done; :
-}
-
setvars()
{
_setvars=""