From 85275feeea687873311773021d9eff4a13a8d5bc Mon Sep 17 00:00:00 2001 From: Gardouille Date: Fri, 5 Apr 2019 17:40:33 +0200 Subject: [PATCH] Chroot: Set the default system mount --- debian/chroot.install | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/chroot.install b/debian/chroot.install index 2d6e292..0f9ddb8 100755 --- a/debian/chroot.install +++ b/debian/chroot.install @@ -188,12 +188,16 @@ rm -f -- "${tmp_list_lv}" ## }}} ## Fstab {{{ ### Use the current mtab content as default fstab file for the target system -grep target /etc/mtab > /target/etc/fstab +grep target /etc/mtab | grep -vE '(tmpfs|pts|proc|sysfs)' > /target/etc/fstab ### Ensure to enable swap grep swap /target/etc/fstab || echo "/dev/mapper/${vgname}-swap swap swap sw,pri=0 0 0" >> /target/etc/fstab ### Add extra tmpfs mount point +grep "^proc" /target/etc/fstab || echo "proc /proc proc rw,nodev,size=100M 0 0" >> /target/etc/fstab +grep "^sysfs" /target/etc/fstab || echo "sysfs /sys sysfs rw,nodev,size=100M 0 0" >> /target/etc/fstab +grep "/dev/shm" /target/etc/fstab || echo "tmpfs /dev/shm tmpfs rw,nodev,size=100M 0 0" >> /target/etc/fstab +grep "^devpts" /target/etc/fstab || echo "devpts /dev/pts devpts rw,relatime,size=10240k,nr_inodes=2051120,mode=755 0 0" >> /target/etc/fstab grep "/var/tmp" /target/etc/fstab || echo "/tmp /var/tmp none rw,bind,size=1M,mode=1777 0 0" >> /target/etc/fstab ### Remove all occurrences to target and avoid double slashs