Date: Sun, 20 Jul 2003 13:07:36 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: current@freebsd.org Subject: compressed modules Message-ID: <20030720.130736.73689720.imp@bsdimp.com>
next in thread | raw e-mail | index | archive | help
----Next_Part(Sun_Jul_20_13:07:36_2003_620)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Please try the enclosed patch. It adds support to sysinstall for
compressed modules. I think this will save some space on the drivers
disk since it isn't currently compressed (unless I'm smoking the good
stuff).
Warner
----Next_Part(Sun_Jul_20_13:07:36_2003_620)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="sysinstall.diff"
Index: modules.c
===================================================================
RCS file: /cache/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:52:55 -0000
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD$
+ * $FreeBSD: src/usr.sbin/sysinstall/modules.c,v 1.6 2003/01/15 21:47:36 jhb Exp $
*/
#include "sysinstall.h"
@@ -91,6 +91,20 @@
else
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) {
+ if (desc_str[0])
+ msgConfirm("Loading module %s failed\n%s", dp->d_name, desc_str);
+ else
+ msgConfirm("Loading module %s failed", dp->d_name);
+ }
+ unlink(module);
}
}
closedir(dirp);
----Next_Part(Sun_Jul_20_13:07:36_2003_620)----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030720.130736.73689720.imp>
