Use tmpfs for chroot /run and /tmp

This commit is contained in:
Serge Schneider 2023-03-29 07:55:37 +01:00
parent b8437a77ba
commit 4e92753982

View File

@ -86,6 +86,14 @@ on_chroot() {
mount --bind /sys "${ROOTFS_DIR}/sys" mount --bind /sys "${ROOTFS_DIR}/sys"
fi fi
if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/run)"; then
mount -t tmpfs tmpfs "${ROOTFS_DIR}/run"
fi
if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/tmp)"; then
mount -t tmpfs tmpfs "${ROOTFS_DIR}/tmp"
fi
setarch linux32 capsh $CAPSH_ARG "--chroot=${ROOTFS_DIR}/" -- -e "$@" setarch linux32 capsh $CAPSH_ARG "--chroot=${ROOTFS_DIR}/" -- -e "$@"
} }
export -f on_chroot export -f on_chroot