Chroot: Set the default system mount
This commit is contained in:
parent
fc69b8633f
commit
85275feeea
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue