Skip to content

Commit 454fed8

Browse files
committed
fix(devcontainer): Update working folder to a writable one (/tmp)
1 parent 1718786 commit 454fed8

4 files changed

Lines changed: 16 additions & 14 deletions

File tree

.devcontainer/cortex-m-toolchain.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ echo -e "[cortex-m-toolchain.sh] starting install"
1111
# --- tooling --------------------------------------------------------------
1212

1313
echo -e "[cortex-m-toolchain.sh] downloading and installing gcc-arm-non-eabi toolchain"
14-
cd /workspaces
14+
cd /tmp
1515

1616
wget -qO gcc-arm-none-eabi.tar.xz \
1717
https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz
@@ -21,4 +21,4 @@ ln -s arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi gcc-arm-none-eabi
2121
rm -f gcc-arm-none-eabi.tar.xz
2222

2323
echo -e "[cortex-m-toolchain.sh] update PATH in environment"
24-
echo -e "\nexport PATH=/workspaces/gcc-arm-none-eabi/bin:$PATH" >> $HOME/.bashrc
24+
echo -e "\nexport PATH=/tmp/gcc-arm-none-eabi/bin:$PATH" >> $HOME/.bashrc

.devcontainer/fetch-port-submodules.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ cd "$REPO_ROOT"
1212
if [ -z "$CP_PORT" ]; then
1313
echo -e "[fetch-port-submodules.sh] CP_PORT not set. Cannot fetch submodules!"
1414
exit 3
15+
else
16+
echo -e "[fetch-port-submodules.sh] CP_PORT=$CP_PORT"
1517
fi
1618

1719
cd "ports/$CP_PORT"

.devcontainer/install_build_env.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ REPO_ROOT="/workspaces/circuitpython"
2323

2424
on_exit() {
2525
rc=$?
26-
if [ -f /workspaces/install_build_env.log.active ]; then
27-
mv /workspaces/install_build_env.log.active /workspaces/install_build_env.log
26+
if [ -f /tmp/install_build_env.log.active ]; then
27+
mv /tmp/install_build_env.log.active /tmp/install_build_env.log
2828
fi
2929
rm -rf /tmp/install_build_env
3030
exit $rc
3131
}
3232

3333
# --- test prerequisites for installation ------------------------------------
3434

35-
while ! test -f /workspaces/post_create.finished; do
36-
echo -e "[install_build_env.sh] waiting for /workspaces/post_create.finished ..."
35+
while ! test -f /tmp/post_create.finished; do
36+
echo -e "[install_build_env.sh] waiting for /tmp/post_create.finished ..."
3737
sleep 1
3838
done
3939

40-
if [ -f /workspaces/install_build_env.log ]; then
40+
if [ -f /tmp/install_build_env.log ]; then
4141
echo -e "[install_build_env.sh] installation already done"
4242
exit 0
4343
elif ! mkdir /tmp/install_build_env 2>/dev/null; then
@@ -58,7 +58,7 @@ echo -e "[install_build_env.sh] starting install"
5858
"$REPO_ROOT/.devcontainer/$CP_TOOLCHAIN-toolchain.sh" || exit 3
5959
"$REPO_ROOT/.devcontainer/make-mpy-cross.sh" || exit 3
6060
echo -e "Setup complete!\nStart a new terminal and build CircuitPython!\n"
61-
) |& tee /workspaces/install_build_env.log.active
61+
) |& tee /tmp/install_build_env.log.active
6262

6363
echo -e "[install_build_env.sh] Setup complete!"
6464
exit 0

.devcontainer/post_create.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ echo -e "[post_create.sh] PWD=$PWD\n"
1111

1212
cat >> $HOME/.bashrc << "EOF"
1313
14-
if [ -f /workspaces/install_build_env.log ]; then
14+
if [ -f /tmp/install_build_env.log ]; then
1515
# setup already done
1616
echo "CircuitPython build-environment ready for $CP_TOOLCHAIN/$CP_PORT"
1717
echo "To start a build run:"
1818
echo " cd ports/$CP_PORT"
1919
echo " time make -j $(nproc) BOARD=your_board_name TRANSLATION=de_DE"
20-
elif [ -f /workspaces/install_build_env.log.active ]; then
20+
elif [ -f /tmp/install_build_env.log.active ]; then
2121
echo "Initial setup of build environment in progress, please wait."
22-
echo "Use 'tail -f /workspaces/install_build_env.log.active' to monitor progress."
22+
echo "Use 'tail -f /tmp/install_build_env.log.active' to monitor progress."
2323
echo "After successful installation, start a new terminal to build CircuitPython."
2424
else
2525
echo "Starting initial setup of build environment, please wait"
26-
nohup /workspaces/circuitpython/.devcontainer/install_build_env.sh >> $HOME/nohup.out &
27-
echo "Use 'tail -f /workspaces/install_build_env.log.active' to monitor progress."
26+
nohup /tmp/install_build_env.sh >> $HOME/nohup.out &
27+
echo "Use 'tail -f /tmp/install_build_env.log.active' to monitor progress."
2828
echo "After successful installation, start a new terminal to build CircuitPython."
2929
fi
3030
3131
EOF
32-
touch /workspaces/post_create.finished
32+
touch /tmp/post_create.finished
3333

3434
# --- that's it! ------------------------------------------------------------
3535

0 commit comments

Comments
 (0)