Skip to content

Commit 346f0f8

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 e58a947 commit 346f0f8

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
@@ -108,12 +108,28 @@ if [ ! -d "${rootfs_dir}" ] ; then
108108
${sudo} chmod -v u+rX "${rootfs_dir}"
109109
fi
110110

111+
### Environement to pass
112+
113+
[ "" = "$UNIFYSDK_GIT_REPOSITORY" ] \
114+
|| env_vars="$env_vars UNIFYSDK_GIT_REPOSITORY=${UNIFYSDK_GIT_REPOSITORY}"
115+
[ "" = "$UNIFYSDK_GIT_TAG" ] \
116+
|| env_vars="$env_vars UNIFYSDK_GIT_TAG=${UNIFYSDK_GIT_TAG}"
117+
export UNIFYSDK_GIT_TAG
118+
119+
111120
# TODO: https://github.com/rust-lang/cargo/issues/8719#issuecomment-1516492970
112121
env_vars="$env_vars CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse"
113122

114123
# TODO: https://github.com/rust-lang/cargo/issues/10583
115124
env_vars="$env_vars CARGO_NET_GIT_FETCH_WITH_CLI=true"
116125

126+
env_vars_options=""
127+
for i in $env_vars; do
128+
env_vars_options="$env_vars_options --setenv=$i"
129+
done
130+
131+
### Workarounds/Optimizations
132+
117133
cargo_dir="/tmp/$USER/${machine}/${HOME}/.cargo"
118134
${sudo} mkdir -pv "${cargo_dir}"
119135

@@ -124,6 +140,7 @@ case ${chroot} in
124140
--machine="${machine}" \
125141
--bind="${CURDIR}:${CURDIR}" \
126142
--bind="${cargo_dir}:/root/.cargo" \
143+
$env_vars_options
127144
"
128145
if [ -e "${qemu_file}" ] ; then
129146
rootfs_shell="$rootfs_shell --bind ${qemu_file}"

0 commit comments

Comments
 (0)