0005-md_size-can-now-contain-more-flexible-definitions-of.patch

rumcic, 04/18/2010 04:21 PM

Download (2.33 KB)

View differences:

etc/rc.d/diskless
46 46
#   $1 = size
47 47
#   $2 = mount point
48 48
mount_md() {
49
	/sbin/mount_tmpfs -s `expr $1 '*' 512` tmpfs $2
49
	/sbin/mount_tmpfs -s $1 tmpfs $2
50 50
}
51 51

  
52 52
# If there is a global system configuration file, suck it in.
......
71 71
        rmdir /var/.diskless
72 72
else
73 73
	echo "+++ mount_md of /var"
74
	mount_md ${varsize:=32768} /var
74
	mount_md ${varsize:=16M} /var
75 75
fi
76 76

  
77 77
if [ ! -d /var/db ]; then
......
117 117
		echo "dropping into shell, ^D to continue anyway."
118 118
		/bin/sh
119 119
	else
120
		mount_md ${tmpsize:=20480} /tmp
120
		mount_md ${tmpsize:=10M} /tmp
121 121
		chmod 01777 /tmp
122 122
	fi
123 123
fi
etc/rc.d/initdiskless
105 105
# Create a generic memory disk
106 106
#
107 107
mount_md() {
108
	/sbin/mount_tmpfs -s `expr $1 '*' 512` tmpfs $2
108
	/sbin/mount_tmpfs -s $1 tmpfs $2
109 109
}
110 110

  
111 111
# Create the memory filesystem if it has not already been created
......
114 114
	if [ "x`eval echo \\$md_created_$1`" = "x" ]; then
115 115
		if [ "x`eval echo \\$md_size_$1`" = "x" ]; then
116 116
			if [ "$1" = "etc" ]; then
117
				md_size=20480
117
				md_size=12M
118 118
			else
119
				md_size=4096
119
				md_size=2M
120 120
			fi
121 121
		else
122 122
			md_size=`eval echo \\$md_size_$1`
123
			# for backwards compatibility ... if it's a number, then it's the number of desired sectors and not bytes!
124
			if [ "$md_size" = "${md_size%%[!0-9]*}" ]; then
125
				md_size=`expr $md_size '*' 512`
126
			fi
123 127
		fi
124 128
		mount_md $md_size /$1
125 129
		/bin/chmod 755 /$1
126
-