rc: prevent /var MFS transition on install media after import

This commit is contained in:
Franco Fichtner 2018-01-15 17:25:35 +01:00
parent 56517b529a
commit eaffc0edc4
2 changed files with 12 additions and 2 deletions

View File

@ -135,7 +135,7 @@ fi
/etc/rc.d/dmesg onestart
# XXX pre-17.1 compat: avoid matching use_mfs_tmpvar
USE_MFS_TMP=`/usr/bin/grep -c 'use_mfs_tmp[^_]' /conf/config.xml`
USE_MFS_TMP=$(/usr/bin/grep -c 'use_mfs_tmp[^_]' /conf/config.xml)
if [ ${USE_MFS_TMP} -ne 0 ]; then
mount -t tmpfs -o mode=01777 tmpfs /tmp

View File

@ -111,7 +111,17 @@ for RC_FILE in ${RC_FILES}; do
done
# XXX pre-17.1 compat: use_mfs_tmpvar matches both patterns
USE_MFS_VAR=`/usr/bin/grep -c 'use_mfs_.*var[^_]' /conf/config.xml`
USE_MFS_VAR=$(/usr/bin/grep -c 'use_mfs_.*var[^_]' /conf/config.xml)
# see if / is writable (aka. non-LiveCD boot)
if _tmpdir=$(mktemp -d -q /.diskless.XXXXXX); then
# only remove the directory
rmdir ${_tmpdir}
else
# config restore for install media does not support
# this as neither /var nor /root are persistent
USE_MFS_VAR=0
fi
if [ ${USE_MFS_VAR} -ne 0 ]; then
echo -n "Setting up memory disks..."