Skip to content

Commit 00463eb

Browse files
committed
SWPROT-8953: build: Update rootfs script for custom UnifySDK
Repo can be overloaded from env ie: UNIFYSDK_GIT_REPOSITORY="https://${token}@github.com/SiliconLabs/UnifySDK_test" \ UNIFYSDK_GIT_TAG="z-wave/main" \ ./scripts/build-rootfs.sh Forwarded: #10 Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
1 parent adbfd47 commit 00463eb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

scripts/build-rootfs.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,28 @@ if [ ! -d "${rootfs_dir}" ] ; then
7575
${sudo} chmod -v u+rX "${rootfs_dir}"
7676
fi
7777

78+
### Environement to pass
79+
80+
[ "" = "$UNIFYSDK_GIT_REPOSITORY" ] \
81+
|| env_vars="$env_vars UNIFYSDK_GIT_REPOSITORY=${UNIFYSDK_GIT_REPOSITORY}"
82+
[ "" = "$UNIFYSDK_GIT_TAG" ] \
83+
|| env_vars="$env_vars UNIFYSDK_GIT_TAG=${UNIFYSDK_GIT_TAG}"
84+
export UNIFYSDK_GIT_TAG
85+
86+
7887
# TODO: https://github.com/rust-lang/cargo/issues/8719#issuecomment-1516492970
7988
env_vars="$env_vars CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse"
8089

8190
# TODO: https://github.com/rust-lang/cargo/issues/10583
8291
env_vars="$env_vars CARGO_NET_GIT_FETCH_WITH_CLI=true"
8392

93+
env_vars_options=""
94+
for i in $env_vars; do
95+
env_vars_options="$env_vars_options --setenv=$i"
96+
done
97+
98+
### Workarounds/Optimizations
99+
84100
cargo_dir="/tmp/$USER/${machine}/${HOME}/.cargo"
85101
${sudo} mkdir -pv "${cargo_dir}"
86102

@@ -91,6 +107,7 @@ case ${chroot} in
91107
--machine="${machine}" \
92108
--bind="${CURDIR}:${CURDIR}" \
93109
--bind="${cargo_dir}:/root/.cargo" \
110+
$env_vars_options
94111
"
95112
if [ -e "${qemu_file}" ] ; then
96113
rootfs_shell="$rootfs_shell --bind ${qemu_file}"

0 commit comments

Comments
 (0)