Date: Wed, 26 Apr 2006 08:48:06 +0200 From: Robert Millan <rmh@aybabtu.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/96346: [PATCH] disable build of modules that are already in kernel image Message-ID: <E1FYdok-000CiR-8U@io.debian.net> Resent-Message-ID: <200604260650.k3Q6oJwg025260@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 96346 >Category: kern >Synopsis: [PATCH] disable build of modules that are already in kernel image >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Apr 26 06:50:18 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Robert Millan >Release: GNU/kFreeBSD 5.4-1-586 i586 >Organization: >Environment: System: GNU/kFreeBSD io.debian.net 5.4-1-586 #0 Mon Dec 5 19:45:10 CET 2005 i586 i386 AMD-K6(tm) 3D processor GNU/kFreeBSD Architecture: i586 >Description: Unless explicitly overriden, in a kernel build all modules are also built; even those that are already part of the kernel image. These modules are useless since they can't be loaded. My patch disables them. >How-To-Repeat: >Fix: Index: usr.sbin/config/mkmakefile.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/config/mkmakefile.c,v retrieving revision 1.86 diff -u -r1.86 mkmakefile.c --- usr.sbin/config/mkmakefile.c 3 Feb 2006 06:12:10 -0000 1.86 +++ usr.sbin/config/mkmakefile.c 26 Apr 2006 06:39:05 -0000 @@ -70,6 +70,7 @@ static void do_rules(FILE *); static void do_xxfiles(char *, FILE *); static void do_objs(FILE *); +static void do_without_modules(FILE *); static void do_before_depend(FILE *); static int opteq(const char *, const char *); static void read_files(void); @@ -143,6 +144,8 @@ } if (eq(line, "%BEFORE_DEPEND\n")) do_before_depend(ofp); + else if (eq(line, "%WITHOUT_MODULES\n")) + do_without_modules(ofp); else if (eq(line, "%OBJS\n")) do_objs(ofp); else if (strncmp(line, "%FILES.", 7) == 0) @@ -613,6 +616,28 @@ } static void +do_without_modules(FILE *fp) +{ + struct device *dp; + int lpos, len; + char *cp, *sp; + + fprintf(fp, "MKMODULESENV+= WITHOUT_MODULES=\""); + lpos = 34; + STAILQ_FOREACH(dp, &dtab, d_next) { + sp = dp->d_name; + cp = sp + (len = strlen(sp)) - 1; + if (len + lpos > 72) { + lpos = 8; + fprintf(fp, "\\\n\t"); + } + fprintf(fp, "%s ", sp); + lpos += len + 1; + } + fprintf(fp, "\"\n"); +} + +static void do_xxfiles(char *tag, FILE *fp) { struct file_list *tp; Index: sys/conf/Makefile.alpha =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.alpha,v retrieving revision 1.140 diff -u -r1.140 Makefile.alpha --- sys/conf/Makefile.alpha 28 Nov 2005 17:51:30 -0000 1.140 +++ sys/conf/Makefile.alpha 26 Apr 2006 06:39:42 -0000 @@ -28,6 +28,8 @@ .endif .include "$S/conf/kern.pre.mk" +%WITHOUT_MODULES + %BEFORE_DEPEND %OBJS Index: sys/conf/Makefile.amd64 =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.amd64,v retrieving revision 1.22 diff -u -r1.22 Makefile.amd64 --- sys/conf/Makefile.amd64 28 Nov 2005 17:51:30 -0000 1.22 +++ sys/conf/Makefile.amd64 26 Apr 2006 06:39:42 -0000 @@ -38,6 +38,8 @@ MKMODULESENV+= MACHINE=amd64 +%WITHOUT_MODULES + %BEFORE_DEPEND %OBJS Index: sys/conf/Makefile.arm =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.arm,v retrieving revision 1.26 diff -u -r1.26 Makefile.arm --- sys/conf/Makefile.arm 27 Mar 2006 00:32:46 -0000 1.26 +++ sys/conf/Makefile.arm 26 Apr 2006 06:39:42 -0000 @@ -94,6 +94,8 @@ rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \ inflate-tramp.o +%WITHOUT_MODULES + %BEFORE_DEPEND %OBJS Index: sys/conf/Makefile.i386 =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.i386,v retrieving revision 1.271 diff -u -r1.271 Makefile.i386 --- sys/conf/Makefile.i386 29 Jan 2006 03:32:19 -0000 1.271 +++ sys/conf/Makefile.i386 26 Apr 2006 06:39:42 -0000 @@ -34,6 +34,8 @@ MKMODULESENV+= MACHINE=${MACHINE} +%WITHOUT_MODULES + %BEFORE_DEPEND %OBJS Index: sys/conf/Makefile.ia64 =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.ia64,v retrieving revision 1.67 diff -u -r1.67 Makefile.ia64 --- sys/conf/Makefile.ia64 28 Nov 2005 17:51:31 -0000 1.67 +++ sys/conf/Makefile.ia64 26 Apr 2006 06:39:42 -0000 @@ -38,6 +38,8 @@ ASM_CFLAGS= -x assembler-with-cpp -Wa,-x -DLOCORE ${CFLAGS} +%WITHOUT_MODULES + %BEFORE_DEPEND %OBJS Index: sys/conf/Makefile.pc98 =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.pc98,v retrieving revision 1.173 diff -u -r1.173 Makefile.pc98 --- sys/conf/Makefile.pc98 29 Jan 2006 03:32:19 -0000 1.173 +++ sys/conf/Makefile.pc98 26 Apr 2006 06:39:42 -0000 @@ -34,6 +34,8 @@ MKMODULESENV+= MACHINE=${MACHINE} +%WITHOUT_MODULES + %BEFORE_DEPEND %OBJS Index: sys/conf/Makefile.powerpc =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.powerpc,v retrieving revision 1.283 diff -u -r1.283 Makefile.powerpc --- sys/conf/Makefile.powerpc 28 Nov 2005 17:51:31 -0000 1.283 +++ sys/conf/Makefile.powerpc 26 Apr 2006 06:39:42 -0000 @@ -37,6 +37,8 @@ CFLAGS+= -fno-omit-frame-pointer .endif +%WITHOUT_MODULES + %BEFORE_DEPEND %OBJS Index: sys/conf/Makefile.sparc64 =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.sparc64,v retrieving revision 1.38 diff -u -r1.38 Makefile.sparc64 --- sys/conf/Makefile.sparc64 28 Nov 2005 17:51:31 -0000 1.38 +++ sys/conf/Makefile.sparc64 26 Apr 2006 06:39:42 -0000 @@ -32,6 +32,8 @@ MDOBJS= exception.o interrupt.o +%WITHOUT_MODULES + %BEFORE_DEPEND %OBJS >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1FYdok-000CiR-8U>