diff options
author | 2014-06-05 01:04:30 +0200 | |
---|---|---|
committer | 2015-04-29 13:31:45 -0400 | |
commit | 98da3645c1cd72895af0c9131db6024388f63af2 (patch) | |
tree | 404caa868c5f4e09dce4286eff953db8b8df52bb | |
parent | Better implementation which was originally done in 946918e & 7a38d63. (diff) | |
download | genkernel-98da3645c1cd72895af0c9131db6024388f63af2.tar.gz genkernel-98da3645c1cd72895af0c9131db6024388f63af2.tar.bz2 genkernel-98da3645c1cd72895af0c9131db6024388f63af2.zip |
This introduces changes to former commits d8e2d4d & 720a60f in
which there are fstab changes and tmpfs mounts which are combined
into one /etc/fstab instead.
-rw-r--r-- | defaults/linuxrc | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/defaults/linuxrc b/defaults/linuxrc index a6c4806c..8b3ff875 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -794,9 +794,19 @@ then # Function to handle the RC_NO_UMOUNTS variable in ${CHROOT}/etc/rc.conf conf_rc_no_umounts - # Fstab change for aufs - test ! $(grep -o ^aufs "${CHROOT}"/etc/fstab) && - echo "aufs / aufs defaults 0 0" > "${CHROOT}"/etc/fstab + # Fstab changes for aufs + if ! grep -q '^aufs' "${CHROOT}"/etc/fstab 2>/dev/null; then + for i in /var/tmp /tmp /usr/portage/distfiles; do + [ ! -d "${CHROOT}${i}" ] && mkdir -p "${CHROOT}${i}" + done + + cat > "${CHROOT}"/etc/fstab << FSTAB +aufs / aufs defaults 0 0 +vartmp /var/tmp tmpfs defaults 0 0 +tmp /tmp tmpfs defaults 0 0 +distfiles /usr/portage/distfiles tmpfs defaults 0 0 +FSTAB + fi if ${AUFS_MODULES}; then warn_msg "Adding all modules in $MODULESD/modules/" @@ -990,22 +1000,6 @@ then chmod 755 "${CHROOT}${i}" done - # This will prevent from putting junk on the CHANGESDEV - str="" - for i in /tmp /var/tmp /usr/portage/distfiles - do - mkdir -p "${CHROOT}${i}" - chmod 755 "${CHROOT}${i}" - - mount -t tmpfs tmpfs "${CHROOT}${i}" - str="${i} ${str}" - done - - warn_msg "${str}are mounted in ram" - warn_msg "consider saving important files elsewhere" - - sleep 2 - for i in ${CDROOT_PATH} ${overlay} ${static}; do mount --move ${NEW_ROOT}${i} ${CHROOT}${i} done |