From owner-cvs-src@FreeBSD.ORG Mon May 19 14:49:33 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 317CA37B401; Mon, 19 May 2003 14:49:33 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3C2E43F3F; Mon, 19 May 2003 14:49:31 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.9/8.12.9) with ESMTP id h4JLnUVo075387 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 19 May 2003 17:49:30 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.9/8.12.9/Submit) id h4JLnUrt075384; Mon, 19 May 2003 17:49:30 -0400 (EDT) (envelope-from wollman) Date: Mon, 19 May 2003 17:49:30 -0400 (EDT) From: Garrett Wollman Message-Id: <200305192149.h4JLnUrt075384@khavrinen.lcs.mit.edu> To: Ruslan Ermilov In-Reply-To: <20030518005055.GG12759@sunbay.com> References: <200305171158.h4HBwSUP054361@repoman.freebsd.org> <20030517125948.GC52158@sunbay.com> <20030517140630.GA60602@sunbay.com> <20030518005055.GG12759@sunbay.com> X-Spam-Score: -19.8 () IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/release/alpha dokern.sh drivers.conf X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2003 21:49:33 -0000 < said: > It'd be even more advantageous to gzip(1) all the .ko files, > and have sysinstall(8) unpack them. Even better would be to simply link them all together. The overhead for symbol tables and dynamic linking information appears to be about 24%, and much of that can be shared. Here is a simple science experiment: Build a complete set of modules. $ ld -Bshareable -d -warn-common -o foo.ko `find modules -name '*.kld'` $ objcopy --strip-debug foo.ko foo-nodebug.ko $ ls -l foo-nodebug.ko -rw-r--r-- 1 wollman wheel 9005614 May 19 17:31 foo-nodebug.ko OK, so this still won't fit on a floppy. Let's try this instead: $ awk '/^#/ { next; } NF > 2 {print "modules/usr/src/sys/modules/"$2"/"$2".kld"}' /usr/src/release/i386/drivers.conf > kld-list $ ld -Bshareable -d -warn-common -o foo.ko `while read kld; do if [ -e $kld ]; then echo $kld; else echo $kld | sed -e 's,s/if_,s/,' -e 's,/miibus/,/mii/,' -e 's,/\(sysv...\)/,/sysvipc/\1/,' -e 's,/firewire/,/firewire/firewire/,' -e 's,/sbp/,/firewire/sbp/,' -e 's,/fwe/,/firewire/fwe/,'; fi; done < kld-list` $ objcopy --strip-debug foo.ko foo-nodebug.ko $ ls -l foo-nodebug.ko -rw-r--r-- 1 wollman wheel 1834728 May 19 17:44 foo-nodebug.ko Well, that right there is almost enough to fit all the drivers on a single floppy again. If we can gzip it, we're more than there: -rw-r--r-- 1 wollman wheel 677731 May 19 17:47 foo-nodebug.ko.gz Let's try just the stuff from floppy 2: -rw-r--r-- 1 wollman wheel 732717 May 19 17:47 foo-nodebug.ko ...which gzips down to: -rw-r--r-- 1 wollman wheel 257111 May 19 17:47 foo-nodebug.ko.gz -GAWollman