From owner-cvs-src@FreeBSD.ORG Sat May 17 23:07:52 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 7DE5E37B405; Sat, 17 May 2003 23:07:52 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BDE643F93; Sat, 17 May 2003 23:07:51 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h4I5x2kA081733; Sat, 17 May 2003 23:59:02 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 17 May 2003 23:57:30 -0600 (MDT) Message-Id: <20030517.235730.97368061.imp@bsdimp.com> To: scott_long@btc.adaptec.com From: "M. Warner Losh" In-Reply-To: <3EC71BA3.4020908@btc.adaptec.com> References: <20030518005055.GG12759@sunbay.com> <20030517.231551.107143172.imp@bsdimp.com> <3EC71BA3.4020908@btc.adaptec.com> X-Mailer: Mew version 2.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: src-committers@FreeBSD.org cc: ru@FreeBSD.org cc: wilko@FreeBSD.org cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org cc: des@ofug.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: Sun, 18 May 2003 06:07:53 -0000 In message: <3EC71BA3.4020908@btc.adaptec.com> Scott Long writes: : M. Warner Losh wrote: : > In message: <20030518005055.GG12759@sunbay.com> : > Ruslan Ermilov writes: : > : It'd be even more advantageous to gzip(1) all the .ko files, : > : and have sysinstall(8) unpack them. : > : > Timing Solutions has been running with gzip'd .ko files since about : > FreeBSD 4.1 or so without ill effect (module one bug that jdp fixed : > about the same time we noticed it in the 4.2ish time frame). kldload : > doesn't work with .gz'd files, but the boot loader does :-) : > : > Warner : : Does TSI have any patches to donate? What about sysinstall? TSC (not TSI :-) didn't need to patch anything to make it happen. We don't use sysinstall to build our embedded systems. It would be better to hack kldload(8) to deal with .gz files. However, since kldload(8) doesn't know what file it is loading (unless it starts with a '/' and has a . in it) it would be hard to patch it generically. It would be easy to patch it to to handle that one exception case. However, sysinstall goes directly to the iron using kldload(2). It might be interesting to add gzip support to the kernel loading process, but I'm not up for it for 5.1-RELEASE :-) Here's a gross patch to sysinstall that gunzips .ko.gz files to /tmp/blah.ko, kldloads it, then unlinks it. Likely needs to be cleaned up to use the same #defines (esp for /tmp), error checking on system, etc. I don't plan on committing it, but I did take the time to find where the code needed to go so I thought I'd post the patch (which i just hand edited, so you might need to apply it by hand). Maybe we should kill the desc file stuff too while we're in the neighborhood. Warner Index: modules.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/sysinstall/modules.c,v retrieving revision 1.6 diff -u -r1.6 modules.c --- modules.c 15 Jan 2003 21:47:36 -0000 1.6 +++ modules.c 18 May 2003 05:54:36 -0000 @@ -92,6 +92,16 @@ msgConfirm("Loading module %s failed", dp->d_name); } } + if (strcmp(dp->d_name + dp->d_namlen - (sizeof(".ko.gz") - 1), ".ko.gz") == 0) { + snprintf(module, sizeof(module), "/tmp/%s", dp->d_name); + module[strlen(module) - sizeof(".gz")] = '\0'; + snprintf(desc, sizeof(desc), "zcat < %s/%s > %s", MODULESDIR, + dp->d_name, module); + system(desc); + if (kldload(module) < 0 && errno != EEXIST) + msgConfirm("Loading module %s failed", dp->d_name); + unlink(module); + } } closedir(dirp); }