Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153205258
D13411.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D13411.diff
View Options
Index: head/share/man/man4/md.4
===================================================================
--- head/share/man/man4/md.4
+++ head/share/man/man4/md.4
@@ -7,7 +7,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 5, 2017
+.Dd December 7, 2017
.Dt MD 4
.Os
.Sh NAME
@@ -79,7 +79,8 @@
needs the following options:
.Bd -literal -offset indent
options MD_ROOT # MD is a potential root device
-options MD_ROOT_SIZE=8192 # 8MB ram disk
+options MD_ROOT_READONLY # disallow mounting root writeable
+options MD_ROOT_SIZE=8192 # 8MB ram disk
makeoptions MFS_IMAGE=/h/foo/ARM-MD
options ROOTDEVNAME=\\"ufs:md0\\"
.Ed
Index: head/sys/conf/NOTES
===================================================================
--- head/sys/conf/NOTES
+++ head/sys/conf/NOTES
@@ -1101,6 +1101,9 @@
# images of type mfs_root or md_root.
options MD_ROOT
+# Write-protect the md root device so that it may not be mounted writeable.
+options MD_ROOT_READONLY
+
# Disk quotas are supported when this option is enabled.
options QUOTA #enable disk quotas
Index: head/sys/conf/options
===================================================================
--- head/sys/conf/options
+++ head/sys/conf/options
@@ -165,6 +165,7 @@
MAC_TEST opt_dontuse.h
MD_ROOT opt_md.h
MD_ROOT_FSTYPE opt_md.h
+MD_ROOT_READONLY opt_md.h
MD_ROOT_SIZE opt_md.h
MFI_DEBUG opt_mfi.h
MFI_DECODE_LOG opt_mfi.h
Index: head/sys/dev/md/md.c
===================================================================
--- head/sys/dev/md/md.c
+++ head/sys/dev/md/md.c
@@ -1791,9 +1791,15 @@
sc->start = mdstart_preload;
if (name != NULL)
strlcpy(sc->file, name, sizeof(sc->file));
-#if defined(MD_ROOT) && !defined(ROOTDEVNAME)
- if (sc->unit == 0)
+#ifdef MD_ROOT
+ if (sc->unit == 0) {
+#ifndef ROOTDEVNAME
rootdevnames[0] = MD_ROOT_FSTYPE ":/dev/md0";
+#endif
+#ifdef MD_ROOT_READONLY
+ sc->flags |= MD_READONLY;
+#endif
+ }
#endif
mdinit(sc);
if (name != NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 20, 7:25 PM (13 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31799598
Default Alt Text
D13411.diff (1 KB)
Attached To
Mode
D13411: Add MD_ROOT_READONLY option to disallow writeable remount of root fs
Attached
Detach File
Event Timeline
Log In to Comment