compressed modules

From: M. Warner Losh <imp_at_bsdimp.com>
Date: Sun, 20 Jul 2003 13:07:36 -0600 (MDT)
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

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
_at__at_ -23,7 +23,7 _at__at_
  * 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"
_at__at_ -91,6 +91,20 _at__at_
 		    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);
Received on Sun Jul 20 2003 - 10:08:14 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:15 UTC