diff options
Diffstat (limited to 'remote/includes')
| -rw-r--r-- | remote/includes/chroot.inc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/remote/includes/chroot.inc b/remote/includes/chroot.inc index f0940bba..fc9738ec 100644 --- a/remote/includes/chroot.inc +++ b/remote/includes/chroot.inc @@ -50,8 +50,8 @@ chroot_prepare_dirs() { chroot_prepare_mounts() { # first mount / on CHROOT_BINDDIR and remount read-only - mount -o bind "${CHROOT_LOWERDIR}" "${CHROOT_BINDDIR}" || perror "Could not bind-mount '$CHROOT_LOWERDIR' to '$CHROOT_BINDDIR'." - mount -o remount,ro "${CHROOT_BINDDIR}" || perror "Could not remount '$CHROOT_BINDDIR' read-only." + mount -o bind "${CHROOT_LOWERDIR}" "${CHROOT_BINDDIR}" || perror "Could not bind-mount '$CHROOT_LOWERDIR' to '$CHROOT_BINDDIR'." + mount -o remount,ro,bind "${CHROOT_BINDDIR}" || perror "Could not remount '$CHROOT_BINDDIR' read-only." # check that it really is read-only [ "x$(mount | grep -E "^/ on ${CHROOT_BINDDIR}" | grep -v '\(.*ro.*\)')" != "x" ] && perror "'${CHROOT_BINDDIR}' is not read-only! Aborting..." @@ -72,7 +72,7 @@ chroot_gen_autoexec() { # create the script to be automatically executed. cat >"${CHROOT_MOUNTDIR}/autoexec.bat"<<-EOF #!/bin/bash - echo "chroot success." + echo "chroot started successfully." EOF # dump the piped input to it @@ -128,6 +128,7 @@ chroot_run() { chroot_gen_autoexec || perror "'chroot_gen_autoexec' failed with $?." # do the chroot + exec 0>&8 chroot --userspec root:root "${CHROOT_MOUNTDIR}" /autoexec.bat local RET=$? if [ "$RET" -eq 0 ]; then |
