Skip to content

Commit 0c1df22

Browse files
committed
unify chroot commands
1 parent cd5142b commit 0c1df22

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

mount_rubikpi3.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,17 @@ sudo mount --bind "$(pwd)" rootfs/tmp/build/
156156
# Check if sudo is installed in the chroot environment, install if missing
157157
echo "=== Checking for sudo in chroot ==="
158158
sudo chroot rootfs /usr/bin/qemu-aarch64-static /bin/bash -c "
159+
set -exv
160+
export DEBIAN_FRONTEND=noninteractive
159161
if ! command -v sudo &> /dev/null; then
160162
echo 'sudo not found, installing...'
161-
set -exv && DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y sudo
163+
apt-get update && apt-get install -y sudo
162164
else
163165
echo 'sudo is already installed'
164166
fi
165-
"
166167
167-
# Run the installation scripts in chroot with verbose output
168-
echo "=== Running installation scripts in chroot ==="
169-
sudo chroot rootfs /usr/bin/qemu-aarch64-static /bin/bash -c "
170-
set -exv
171-
export DEBIAN_FRONTEND=noninteractive
168+
echo "=== Running installation scripts in chroot ==="
169+
172170
echo '=== Making script executable ==='
173171
chmod +x ${script}
174172
echo '=== Running ${script} with arguments: ${@:3} ==='

0 commit comments

Comments
 (0)