index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | lxc_pacstrap.patch | 16 | ||||
-rw-r--r-- | src/arch-nspawn.in | 12 |
diff --git a/lxc_pacstrap.patch b/lxc_pacstrap.patch new file mode 100644 index 0000000..f289586 --- /dev/null +++ b/lxc_pacstrap.patch @@ -0,0 +1,16 @@ +--- /usr/sbin/pacstrap 2024-07-04 14:46:45.000000000 +0000 ++++ /usr/local/sbin/pacstrap 2024-08-25 01:01:36.829991269 +0000 +@@ -124,9 +124,10 @@ + chroot_add_mount sys "$1/sys" -t sysfs -o nosuid,noexec,nodev,ro && + ignore_error chroot_maybe_add_mount "[[ -d '$1/sys/firmware/efi/efivars' ]]" \ + efivarfs "$1/sys/firmware/efi/efivars" -t efivarfs -o nosuid,noexec,nodev && +- chroot_add_mount udev "$1/dev" -t devtmpfs -o mode=0755,nosuid && +- chroot_add_mount devpts "$1/dev/pts" -t devpts -o mode=0620,gid=5,nosuid,noexec && +- chroot_add_mount shm "$1/dev/shm" -t tmpfs -o mode=1777,nosuid,nodev && ++# chroot_add_mount udev "$1/dev" -t devtmpfs -o mode=0755,nosuid && ++ chroot_add_mount /dev "$1/dev" --bind --make-private -o mode=0755,nosuid && ++# chroot_add_mount devpts "$1/dev/pts" -t devpts -o mode=0620,gid=5,nosuid,noexec && ++# chroot_add_mount shm "$1/dev/shm" -t tmpfs -o mode=1777,nosuid,nodev && + chroot_add_mount run "$1/run" -t tmpfs -o nosuid,nodev,mode=0755 && + chroot_add_mount tmp "$1/tmp" -t tmpfs -o mode=1777,strictatime,nodev,nosuid + } diff --git a/src/arch-nspawn.in b/src/arch-nspawn.in index 54e474f..cb3c317 100644 --- a/src/arch-nspawn.in +++ b/src/arch-nspawn.in @@ -147,4 +147,14 @@ else set_arch="${CARCH}" fi -exec ${CARCH:+setarch "$set_arch"} systemd-nspawn "${nspawn_args[@]}" "$@" +mkdir -p "${working_dir}/proc" +mount proc "${working_dir}/proc" -t proc -o nosuid,noexec,nodev + +# Eeeeeeh +${CARCH:+setarch "$set_arch"} systemd-nspawn "${nspawn_args[@]}" "$@" + +RET=$? + +umount "${working_dir}/proc" + +exit $RET |