Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Oct 2010 21:43:36 -0700
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        bug-followup@FreeBSD.org, j.unger@jpru.de
Cc:        rc@freebsd.org
Subject:   Re: conf/122477: [patch] /etc/rc.d/mdconfig and mdconfig2 are ignoring additional parameter in some cases
Message-ID:  <AANLkTimpDN4j5QYwdWyPTDKXxtYUkwrFycCVYWui343A@mail.gmail.com>

index | next in thread | raw e-mail

[-- Attachment #1 --]
    IMO, the problem with this feature is lack of documentation when
it was converted from ramdisk_* to mdconfig_md*. How does this patch
work for you (you get the support you like via mdconfig_units)?
    This also removes all of the outdated documentation for ramdisk_*
because it's no longer used by rc(8).
Thanks,
-Garrett

[-- Attachment #2 --]
Index: etc/rc.d/mdconfig
===================================================================
--- etc/rc.d/mdconfig	(revision 213680)
+++ etc/rc.d/mdconfig	(working copy)
@@ -174,10 +174,11 @@
 }
 
 _mdconfig_cmd="$1"
+eval _mdconfig_list=\$mdconfig_units
 if [ $# -gt 0 ]; then
         shift
 fi
-[ -n "$*" ] && _mdconfig_list="$*"
+[ -n "$_mdconfig_list" -a -n "$*" ] && _mdconfig_list="$*"
 
 load_rc_config $name
 
Index: etc/rc.d/mdconfig2
===================================================================
--- etc/rc.d/mdconfig2	(revision 213680)
+++ etc/rc.d/mdconfig2	(working copy)
@@ -204,10 +204,11 @@
 }
 
 _mdconfig2_cmd="$1"
+eval _mdconfig2_list=\$mdconfig_units
 if [ $# -gt 0 ]; then
         shift
 fi
-[ -n "$*" ] && _mdconfig2_list="$*"
+[ -n "$_mdconfig2_list" -a -n "$*" ] && _mdconfig2_list="$*"
 
 load_rc_config $name
 
Index: share/man/man5/rc.conf.5
===================================================================
--- share/man/man5/rc.conf.5	(revision 213680)
+++ share/man/man5/rc.conf.5	(working copy)
@@ -3997,6 +3997,23 @@
 which causes log files flagged with a
 .Cm C
 to be created.
+.It Va mdconfig_units
+.Pq Vt str
+A list of one or more
+.Xr md 4
+units to configure with
+.Xr mdconfig 8
+and
+.Xr newfs 8
+in time to be mounted with
+.Xr fstab 5 .
+If unspecified, the
+.Va mdconfig_md Ns Aq Ar X
+variables are evaluated in consecutive order from md0, until one variable is
+unset or null.
+See the
+.Va mdconfig_md Ns Aq Ar X
+variable descriptions below for more details.
 .It Va mdconfig_md Ns Aq Ar X
 .Pq Vt str
 Arguments to
@@ -4015,10 +4032,12 @@
 .Fl f Ar file
 for vnode backed
 .Xr md 4
-devices.
-Note that
+devices. Each
 .Va mdconfig_md Ns Aq Ar X
-variables are evaluated until one variable is unset or null.
+entry listed in
+.Va mdconfig_units
+must be defined in
+.Xr fstab 5 .
 .It Va mdconfig_md Ns Ao Ar X Ac Ns Va _newfs
 .Pq Vt str
 Optional arguments passed to
@@ -4082,65 +4101,6 @@
 .Bd -literal
 mdconfig_md0_cmd="tar xfzC /var/file.tgz \e${_mp}"
 .Ed
-.It Va ramdisk_units
-.Pq Vt str
-A list of one or more ramdisk units to configure with
-.Xr mdconfig 8
-and
-.Xr newfs 8
-in time to be mounted from
-.Xr fstab 5 .
-Each listed unit
-.Ar X
-must specify at least a
-.Ar type
-in a
-.Va ramdisk_ Ns Ao Ar X Ac Ns Va _config
-variable.
-Note that this way to configure ramdisks has been deprecated
-in favor of new
-.Va mdconfig_md*
-variables (see above).
-.It Va ramdisk_ Ns Ao Ar X Ac Ns Va _config
-.Pq Vt str
-Arguments to
-.Xr mdconfig 8
-for ramdisk
-.Ar X .
-At minimum a
-.Fl t Ar type
-must be specified, where
-.Ar type
-must be one of
-.Cm malloc
-or
-.Cm swap .
-.It Va ramdisk_ Ns Ao Ar X Ac Ns Va _newfs
-.Pq Vt str
-Optional arguments passed to
-.Xr newfs 8
-to initialize ramdisk
-.Ar X .
-.It Va ramdisk_ Ns Ao Ar X Ac Ns Va _owner
-.Pq Vt str
-An ownership specification passed to
-.Xr chown 8
-after the specified ramdisk unit
-.Ar X
-has been mounted.
-Both the
-.Xr md 4
-device and the mount point will be changed.
-.It Va ramdisk_ Ns Ao Ar X Ac Ns Va _perms
-.Pq Vt str
-A mode string passed to
-.Xr chmod 1
-after the specified ramdisk unit
-.Ar X
-has been mounted.
-Both the
-.Xr md 4
-device and the mount point will be changed.
 .It Va autobridge_interfaces
 .Pq Vt str
 Set to the list of bridge interfaces that will have newly arriving interfaces
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimpDN4j5QYwdWyPTDKXxtYUkwrFycCVYWui343A>