Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 May 2006 13:36:15 +0100
From:      Florent Thoumie <flz@FreeBSD.org>
To:        freebsd-rc@FreeBSD.org
Cc:        anders@FreeBSD.org, delphij@FreeBSD.org
Subject:   CFT: rc.d/mdconfig{,2} - ramdisk rc.d script extension to support all md(4) devices
Message-ID:  <4465D2BF.7080703@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig45C3C57F6395E85C76D4C783
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

These scripts are supposed to extend the existing ramdisk rc.d script to
vnode-backed md(4) devices. I added some features as well (mostly
proposed by Anders).

Malloc/Swap md(4) devices are created by mdconfig (as early as possible).=

Vnode md(4) devices created from files located on root partition are
created by mdconfig. The others md(4) devices are created by mdconfig2.

Assuming there's an fstab entry for the md(4) device, they'll be fsck'ed
 (if !swap/malloc) or newfs'ed and mounted.

Use as follows :

mdconfig_md0=3D"-t malloc -s 10m" -> created by mdconfig
mdconfig_md1=3D"-t swap -s 5m" -> created by mdconfig
mdconfig_md2=3D"-t vnode -f /boot/foo.img" -> created by mdconfig
mdconfig_md3=3D"-t vnode -f /boot/foo.uzip" -> created by mdconfig
mdconfig_md4=3D"-t vnode -f /usr/local/test.img" -> created by mdconfig2
mdconfig_md6=3D"this one won't work since there's no mdconfig_md5"

Additionally you can use the following options :

mdconfig_mdX_owner, mdconfig_mdX_perms -> perms and owner changed by
mdconfig2
mdconfig_mdX_newfs -> additional flags to pass to newfs for malloc/swap
backed md(4) device
mdconfig_mdX_files -> files to copy to the mounted mdX device by mdconfig=
2
mdconfig_mdX_cmd -> command run to populate the mounted mdX device by
mdconfig2 (note that it's passed to eval, so you can use \${_mp} and
\${_dev} to reference both the device and the mount point.

There's currently no doc, I'll do it while people (you readers) are
testing them. I might have forgotten to say something, so ask just in
case you need some other information.

Scripts are here:

http://people.freebsd.org/~flz/local/mdconfig
http://people.freebsd.org/~flz/local/mdconfig2

You'll need the additional patch to rc.subr as well:

http://people.freebsd.org/~flz/local/rcsubr-seq.diff

--=20
Florent Thoumie
flz@FreeBSD.org
FreeBSD Committer


--------------enig45C3C57F6395E85C76D4C783
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEZdLGMxEkbVFH3PQRAoVjAJ9vBnO74EmKD8hoD6LkY28YNbMbZACaAl18
NQzwxF0ZS9RWW5520Mj2rHE=
=kWUF
-----END PGP SIGNATURE-----

--------------enig45C3C57F6395E85C76D4C783--



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