|
2 | 2 | # Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. |
3 | 3 | # SPDX-License-Identifier: MIT |
4 | 4 |
|
5 | | -TOPDIR=$(realpath $(dirname $(readlink -f $0))/..) |
| 5 | +if [ -z $1 ] || [ -z $2 ] ; then |
| 6 | + echo "The REPO_DIR or WORK_DIR is empty and it needs to point to the corresponding directories." |
| 7 | + echo "Please run it with:" |
| 8 | + echo " $0 REPO_DIR WORK_DIR" |
| 9 | + exit 1 |
| 10 | +fi |
6 | 11 |
|
7 | | -# Ensure KAS workspace is outside of the checked out repo |
8 | | -# Allows the caller to specify KAS_WORK_DIR, otherwise make temp one |
9 | | -export KAS_WORK_DIR=$(realpath ${KAS_WORK_DIR:-$(mktemp -d)}) |
| 12 | +REPO_DIR="$1" |
| 13 | +WORK_DIR="$2" |
| 14 | + |
| 15 | +_is_dir(){ |
| 16 | + test -d "$1" && return |
| 17 | + echo "The '$1' is not a directory." |
| 18 | + exit 1 |
| 19 | +} |
| 20 | + |
| 21 | +_is_dir "$REPO_DIR" |
| 22 | +_is_dir "$WORK_DIR" |
10 | 23 |
|
11 | 24 | # Yocto Project layer checking tool |
12 | 25 | CMD="yocto-check-layer-wrapper" |
13 | 26 | # Layer to check |
14 | | -CMD="$CMD $TOPDIR" |
| 27 | +CMD="$CMD $REPO_DIR" |
15 | 28 | # Disable auto layer discovery |
16 | 29 | CMD="$CMD --no-auto" |
17 | 30 | # Layers to process for dependencies |
18 | | -CMD="$CMD --dependency $KAS_WORK_DIR/oe-core/meta" |
| 31 | +CMD="$CMD --dependency $WORK_DIR/oe-core/meta" |
19 | 32 | # Disable automatic testing of dependencies |
20 | 33 | CMD="$CMD --no-auto-dependency" |
21 | 34 | # Set machines to all machines defined in this BSP layer |
22 | | -CMD="$CMD --machines $(echo $(find $TOPDIR/conf/machine/ -maxdepth 1 -name *.conf -exec basename {} .conf \; ))" |
| 35 | +CMD="$CMD --machines $(echo $(find $REPO_DIR/conf/machine/ -maxdepth 1 -name *.conf -exec basename {} .conf \; ))" |
23 | 36 |
|
24 | | -echo "Running kas in $KAS_WORK_DIR" |
25 | | -exec kas shell $TOPDIR/ci/base.yml --command "$CMD" |
| 37 | +exec $CMD |
0 commit comments