Chroot: Create the fstab file on the target system
This commit is contained in:
parent
c4ce689763
commit
28428ffb18
|
@ -181,6 +181,23 @@ do
|
||||||
done < "${tmp_list_lv}"
|
done < "${tmp_list_lv}"
|
||||||
rm -f -- "${tmp_list_lv}"
|
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
|
||||||
|
|
||||||
|
### 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 devtmpfs /target/etc/fstab || echo "udev /dev devtmpfs rw,relatime,size=10240k,nr_inodes=2051120,mode=755 0 0" >> /target/etc/fstab
|
||||||
|
grep "/run " /target/etc/fstab || echo "tmpfs /run tmpfs rw,size=15M,mode=755 0 0" >> /target/etc/fstab
|
||||||
|
grep "/run/lock" /target/etc/fstab || echo "tmpfs /run/lock tmpfs rw,size=5120k 0 0" >> /target/etc/fstab
|
||||||
|
grep "/run/shm" /target/etc/fstab || echo "tmpfs /run/shm tmpfs rw,nodev,size=100M 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
|
||||||
|
sed -i 's;/target;;g' /target/etc/fstab
|
||||||
## }}}
|
## }}}
|
||||||
# }}}
|
# }}}
|
||||||
# Finish {{{
|
# Finish {{{
|
||||||
|
|
Loading…
Reference in New Issue