diff options
author | Maksym Sloyko <maxims@google.com> | 2020-12-09 01:11:38 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2021-01-28 01:00:40 +0300 |
commit | f197793a823fd9ddbb31a21a465933734e626e24 (patch) | |
tree | 3a2247f9f1ca0f4eefe720caf151b902b3a88cb7 | |
parent | 49054bcb324c0bdd5916ad360bf500db9d9be508 (diff) | |
download | openbmc-f197793a823fd9ddbb31a21a465933734e626e24.tar.xz |
setup: support any level of machine conf depth
Modify setup script to support any level of machine conf depth.
Internally Google uses machines that sit yet another layer deep
in the repository. Instead of adding yet another level of depth
to the expansion, look for all configs using `find`, if it's
available. If it's not, ball back to the old wildcard expansion.
Signed-off-by: Maksym Sloyko <maxims@google.com>
Change-Id: I1066fe5f6ece4454e3555ca97f75bd91d6da1dba
-rwxr-xr-x | setup | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -31,7 +31,19 @@ machine() { local target=$1 local build_dir=$2 local cfg name tmpl - for cfg in meta-*/meta-*/conf/machine/*.conf meta-*/conf/machine/*.conf; do + local configs + + # zsh requires wordsplit so that variable expansion behaves like bash + if [ -n "$ZSH_NAME" ]; then + setopt local_options shwordsplit + fi + if which find > /dev/null 2>&1; then + configs=$(find meta-* -path "*/conf/machine/*.conf") + else + configs=$(ls -1 meta-*/meta-*/conf/machine/*.conf meta-*/conf/machine/*.conf) + fi + + for cfg in $configs; do name=${cfg##*/} name=${name%.conf} tmpl=${cfg%/machine/*.conf} |