changeset 443:eddcdc561685

Autoconfig /tmp depend on files: tmpfs.ko - mount tmpfs to /tmp else md + ufs else md + msdos.
author Aleksandr Rybalko <ray@ddteam.net>
date Thu, 20 Sep 2012 15:34:37 +0300
parents 127789042ff9
children a0f75c3d2ca5
files profiles/SMALL_/files/etc/rc.d/mountcritlocal
diffstat 1 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/profiles/SMALL_/files/etc/rc.d/mountcritlocal	Thu Sep 20 15:32:53 2012 +0300
+++ b/profiles/SMALL_/files/etc/rc.d/mountcritlocal	Thu Sep 20 15:34:37 2012 +0300
@@ -12,9 +12,26 @@
 {
 	# XXX: check TMPFS again
 	# XXX: get useful size: small for /etc or big for upgrade
-	md=`/sbin/mdconfig -a -t malloc -s 1m`
-	newfs -b 4096 -f 512 -n -o space /dev/${md} > /dev/null
-	mount /dev/${md} /tmp
+	_IS_ETC_MOUNTED=0
+	if [ -f /boot/kernel/tmpfs.ko -a "x${TMPFS_ETC_ENABLED}" != "xno" ]; then
+		mount -t tmpfs tmpfs /tmp
+		_IS_ETC_MOUNTED=1
+	else
+		md=$(mdconfig -a -t malloc -s 1m)
+		if [ -f /boot/kernel/ufs.ko ]; then
+			newfs -b 4096 -f 512 -n -o space /dev/${md} > /dev/null
+			mount -t ufs /dev/${md} /tmp
+			_IS_ETC_MOUNTED=1
+		else
+			if [ -f /boot/kernel/msdosfs.ko ]; then
+				newfs_msdos -n 1 /dev/${md} > /dev/null
+				mount -t msdosfs /dev/${md} /tmp
+				_IS_ETC_MOUNTED=1
+			else
+				mdconfig -d ${md}
+			fi
+		fi
+	fi
 
 	mkdir -p /tmp/etc
 	for dir in account at audit cache db empty lib log mail msgs preserve \