mrrl-containers

MRRL version of container scripts
git clone https://ccx.te2000.cz/git/mrrl-containers
Log | Files | Refs

commit 3a44c547f0f1806f26b59b9871deefe848311be9
parent 58beb5e4ad093dbcf5ac63cc6c4031eb11dad9fe
Author: Jan Pobrislo <ccx@te2000.cz>
Date:   Wed,  5 Aug 2026 21:57:10 +0000

Mount /mnt/ns after prepare_chroot and remount read-only

Diffstat:
Msbin/ns_run_unshared | 18++++++++++--------
Mzsh-functions/confz_containers_init | 2+-
2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/sbin/ns_run_unshared b/sbin/ns_run_unshared @@ -75,11 +75,19 @@ cd $NS_ROOT if { ns_run_mounts . } +# container-specific setup +if { runblock 1 } + +# now we can make /dev immutable +if { mount -o remount,ro dev } + # mountpoint for privileged operations and pivot_root -if { s6-mount -nwt tmpfs -o nosuid,nodev,mode=711 mnt_ns $NS_TMPFS } +if { s6-mount -t tmpfs -o rw,nosuid,nodev,mode=711 mnt_ns $NS_TMPFS } if { mkdir ${NS_TMPFS}/oldroot ${NS_TMPFS}/bin } #if { s6-hiercopy $NS_BIN ${NS_TMPFS}/bin } -if { s6-mount -n -o bind,ro $NS_BIN ${NS_TMPFS}/bin } +if { s6-mount -o bind,ro,nosuid,nodev $NS_BIN ${NS_TMPFS}/bin } +if { s6-mount -o remount,bind,ro,nosuid,nodev _ ${NS_TMPFS}/bin } +if { s6-mount -o remount,ro,nosuid,nodev,mode=711 _ $NS_TMPFS } # optional fstab file for extra mounts if { @@ -89,12 +97,6 @@ if { } unexport NS_FSTAB -# container-specific setup -if { runblock 1 } - -# now we can make /dev immutable -if { mount -o remount,ro dev } - # exec into the script we generated above, it: # * does pivot_root to change rootdir # * umounts all undesired filesystems diff --git a/zsh-functions/confz_containers_init b/zsh-functions/confz_containers_init @@ -461,7 +461,7 @@ confz_container_mount_layout_check() { "if { s6-mount -o remount,bind,$rw,nodev,nosuid _ $dst_el }" ) done - unify mount_el $mount_el_lines + unify mount_el ${(F)mount_el_lines} } confz_container_service_ephemeral_check() {