From owner-freebsd-hackers Fri Feb 2 20:23: 5 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id 5774C37B491; Fri, 2 Feb 2001 20:22:42 -0800 (PST) Received: by bazooka.unixfreak.org (Postfix, from userid 1000) id 0A02C3E02; Fri, 2 Feb 2001 20:22:41 -0800 (PST) Received: from unixfreak.org (localhost [127.0.0.1]) by bazooka.unixfreak.org (Postfix) with ESMTP id 0011F3C10C; Fri, 2 Feb 2001 20:22:42 -0800 (PST) To: Matt Dillon Cc: mi@aldan.algebra.com, deischen@FreeBSD.ORG, hackers@freebsd.org Subject: Re: mount_md (was: mdconfig config file (was: cvs commit: src/sys/i386/conf GENERIC)) In-Reply-To: Message from Matt Dillon of "Fri, 02 Feb 2001 12:55:11 PST." <200102022055.f12KtBL98916@earth.backplane.com> Date: Fri, 02 Feb 2001 20:22:41 -0800 From: Dima Dorfman Message-Id: <20010203042241.0A02C3E02@bazooka.unixfreak.org> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [ cvs-(all|commiters) --> -hackers ] > : > :> > :> (this whole thing is predicated on someone writing a mount_md wrapper > :> for MD that mimics the options mount_mfs accepts, for compatibility). > : > :I'll do it. Would it be safe to assume that it's acceptable to write > :a C program to parse the arguments, build command lines to > :appropriately invoke disklabel, newfs, maybe tunefs, and mount, then > :call system(3) to execute them? > : > : Dima Dorfman > : dima@unixfreak.org > > Yes, though preferably I'd fork/exec the sub-programs (and use > absolute paths) rather then use system(), because the mount program > will be running during booting and its important to have it use as > few system resources as possible in case the system is screwed up. > We don't want it exec'ing /bin/sh. Point taken. I kind of figured system() was a little evil; that's why I asked. I've written the majority of the code. You can find it at: http://www.unixfreak.org/~dima/home/mount_md.c. It is mostly functional. It accepts just about all of the arguments that mount_mfs does, plus a few others. It has the ability to create vnode, swap, and malloc -backed disks. It's not terribly well-documented (I'll write up a man page if it's decided that this is acceptable), but most of the options are easily explained by looking at a few lines of code. Some thoughts: - If you want softupdates, you need to specify the -S flag. Should softupdates be the default? - To suppress the output of disklabel/newfs/etc., it closes fds 0-2. Is this evil? Should I devise another method of doing this (something like opening /dev/null and dup2'ing that fd to 0-2)? - Should there be an option to make use of md's autounit feature? I don't think it will be very hard to implement, but I don't know how useful it would be. I think that's it. Comments? Suggestions? Thanks in advance Dima Dorfman dima@unixfreak.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message