fix: make all rbound mountpoints also rslaves.

This commit is contained in:
oddlama 2022-07-01 19:54:26 +02:00
parent b3324498fb
commit b78dea2dc7
No known key found for this signature in database
GPG Key ID: 14EFE510775FE39A
1 changed files with 7 additions and 3 deletions

View File

@ -468,7 +468,7 @@ function format_zfs_standard() {
|| die "Could not create zfs pool on $devices_desc" || die "Could not create zfs pool on $devices_desc"
if [[ "$compress" != false ]]; then if [[ "$compress" != false ]]; then
zfs set "compression=$compress" rpool/ROOT \ zfs set "compression=$compress" rpool \
|| die "Could enable compression on dataset 'rpool'" || die "Could enable compression on dataset 'rpool'"
fi fi
zfs create rpool/ROOT \ zfs create rpool/ROOT \
@ -926,8 +926,12 @@ function gentoo_chroot() {
einfo "Mounting virtual filesystems" einfo "Mounting virtual filesystems"
( (
mountpoint -q -- "$chroot_dir/proc" || mount -t proc /proc "$chroot_dir/proc" || exit 1 mountpoint -q -- "$chroot_dir/proc" || mount -t proc /proc "$chroot_dir/proc" || exit 1
mountpoint -q -- "$chroot_dir/run" || mount --rbind /run "$chroot_dir/run" || exit 1 mountpoint -q -- "$chroot_dir/run" || {
mountpoint -q -- "$chroot_dir/tmp" || mount --rbind /tmp "$chroot_dir/tmp" || exit 1 mount --rbind /run "$chroot_dir/run" &&
mount --make-rslave "$chroot_dir/run"; } || exit 1
mountpoint -q -- "$chroot_dir/tmp" || {
mount --rbind /tmp "$chroot_dir/tmp" &&
mount --make-rslave "$chroot_dir/tmp"; } || exit 1
mountpoint -q -- "$chroot_dir/sys" || { mountpoint -q -- "$chroot_dir/sys" || {
mount --rbind /sys "$chroot_dir/sys" && mount --rbind /sys "$chroot_dir/sys" &&
mount --make-rslave "$chroot_dir/sys"; } || exit 1 mount --make-rslave "$chroot_dir/sys"; } || exit 1