From owner-cvs-all Tue Feb 20 13:43:19 2001 Delivered-To: cvs-all@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 7552137B491; Tue, 20 Feb 2001 13:43:13 -0800 (PST) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id WAA36174; Tue, 20 Feb 2001 22:43:11 +0100 (CET) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Luigi Rizzo Cc: Greg Lehey , Luigi Rizzo , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/release/picobsd/build Makefile.mfs References: <200102200128.CAA37354@info.iet.unipi.it> From: Dag-Erling Smorgrav Date: 20 Feb 2001 22:43:10 +0100 In-Reply-To: Dag-Erling Smorgrav's message of "20 Feb 2001 14:15:04 +0100" Message-ID: Lines: 34 User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dag-Erling Smorgrav writes: > You could write a short Perl script (or C program) that scans a > directory and generates C code (using only mkdir(2), mknod(2), > symlink(2) and chown(2)) that recreates the device nodes. I suspect > the resulting code, when crunched, would consume less space than the > device nodes themselves. Populate a directory with the desired device nodes, then generate the C source code as follows: $ ./makedev.pl -o makedev.c /path/to/populated/dev Starting from an empty directory, the resulting binary weighs in at 5432 bytes; 34360 bytes when starting from /dev on my laptop (1092 nodes including directories). You can further reduce the size of the binary if you realize that device nodes are invariably owned by system users and groups, which have UIDs and GIDs low enough to fit in a char. If you don't care about ownership, you can drop the UID and GID (and the associated code). In that case you can probably drop the mode as well. Note that the current implementation doesn't support symlinks, but this shouldn't be hard to add if necessary. I don't know if this actually saves you anything; it'll probably reduce the size of a compressed fs image, but I don't know by how much. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message