diff --git a/docs/1_setup.md b/docs/1_setup.md index 5a2956f..cedc5f8 100644 --- a/docs/1_setup.md +++ b/docs/1_setup.md @@ -59,12 +59,10 @@ Execute the following instructions within the ARMHF guest system: echo 1 | sudo tee /proc/sys/kernel/randomize_va_spac ``` - Chroot into the root filesystem: - ``` - sudo mount -t proc /proc/ $ROOTFS/proc/ - sudo mount -t sysfs /sys/ $ROOTFS/sys/ - sudo mount -o bind /dev/ $ROOTFS/dev/ - sudo chroot $ROOTFS/ /bin/sh - export SHELL=/bin/sh + ```shell + # Mount proc, sys and dev (use flag -u to unmount) + ./mount.sh + sudo chroot $ROOTFS /usr/bin/env -i SHELL="/bin/ash" PS1="(r6700v3) # " /bin/ash ``` ---------------------------------------------------------------------------------------------------- diff --git a/mount.sh b/mount.sh new file mode 100755 index 0000000..4dea7f3 --- /dev/null +++ b/mount.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Parse command line arguments +unmount=false +while [[ "$#" -gt 0 ]]; do + case $1 in + -u) unmount=true; + esac + shift +done + +# (Un-) mounting +if [ "$unmount" = true ]; then + sudo umount --recursive $ROOTFS/proc/ + sudo umount --recursive $ROOTFS/sys/ + sudo umount --recursive $ROOTFS/dev/ +else + sudo mount -t proc /proc/ $ROOTFS/proc/ + sudo mount -t sysfs /sys/ $ROOTFS/sys/ + sudo mount -o bind /dev/ $ROOTFS/dev/ +fi \ No newline at end of file