Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173925448
D11765.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1001 B
Referenced Files
None
Subscribers
None
D11765.diff
View Options
Index: etc/rc.initdiskless
===================================================================
--- etc/rc.initdiskless
+++ etc/rc.initdiskless
@@ -195,10 +195,27 @@
to_umount="$b ${to_umount}"
}
-# Create a generic memory disk (using tmpfs)
+# Attempt to load tmpfs, if it is not already available
+# tmpfs_status is empty if load_tmpfs has not been called,
+# 0 if tmpfs is available, and some other status code otherwise
+#
+tmpfs_status=""
+load_tmpfs() {
+ kldstat -q -m tmpfs || kldload -q tmpfs >/dev/null 2>&1
+ tmpfs_status=$?
+}
+
+# Create a generic memory disk
+# Use tmpfs, if available, otherwise fall back to using mfs
#
mount_md() {
- mount -t tmpfs -o size=$(($1 * 512)) tmpfs $2
+ # Only try to load tmpfs once
+ ${tmpfs_status:+:} load_tmpfs
+ if [ $tmpfs_status -eq 0 ]; then
+ mount -t tmpfs -o size=$(($1 * 512)) tmpfs $2
+ else
+ /sbin/mdmfs -S -i 4096 -s $1 -M md $2
+ fi
}
# Create the memory filesystem if it has not already been created
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 30, 9:57 AM (17 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39938558
Default Alt Text
D11765.diff (1001 B)
Attached To
Mode
D11765: Fall back to md(4) in rc.initdiskless if tmpfs(5) is not available
Attached
Detach File
Event Timeline
Log In to Comment