Fix some mount stuff

This commit is contained in:
Fierelier 2024-01-12 08:10:16 +01:00
parent 067e01f032
commit 5265e615be
2 changed files with 6 additions and 2 deletions

View File

@ -4,5 +4,9 @@ mkdir -p "$UNSHH_CHROOT/sys"
mount --rbind /sys "$UNSHH_CHROOT/sys"
mkdir -p "$UNSHH_CHROOT/dev"
mount --rbind /dev "$UNSHH_CHROOT/dev"
mkdir -p "$UNSHH_CHROOT/dev/pts"
mount --rbind /dev/pts "$UNSHH_CHROOT/dev/pts"
mkdir -p "$UNSHH_CHROOT/tmp"
mount --rbind /tmp "$UNSHH_CHROOT/tmp"
mkdir -p "$UNSHH_CHROOT/host"
mount --rbind / "$UNSHH_CHROOT/host"

View File

@ -4,8 +4,8 @@ if [ "$UNSHH_ROOT" = "0" ]; then
unshare --mount --map-root-user -R "$UNSHH_CHROOT" useradd -m --uid "$UNSHH_USER_ID" --gid "$UNSHH_GROUP_ID" "$UNSHH_USER_NAME"
set -e
mkdir -p "$UNSHH_CHROOT/home/$UNSHH_USER_NAME/host"
mount --bind "/home/$UNSHH_USER_NAME" "$UNSHH_CHROOT/home/$UNSHH_USER_NAME/host"
mount --rbind "/home/$UNSHH_USER_NAME" "$UNSHH_CHROOT/home/$UNSHH_USER_NAME/host"
else
mkdir -p "$UNSHH_CHROOT/root/host"
mount --bind "/home/$UNSHH_USER_NAME" "$UNSHH_CHROOT/root/host"
mount --rbind "/home/$UNSHH_USER_NAME" "$UNSHH_CHROOT/root/host"
fi