[debian-non-standard] [OpenWrt-Users] building a kernel to boot debian - build process strips out lots of kernel module options

Martin Steigerwald Martin at lichtvoll.de
Sat Jun 16 11:07:00 CEST 2012


Am Samstag, 16. Juni 2012 schrieb Martin Steigerwald:
> Am Samstag, 16. Juni 2012 schrieb Martin Steigerwald:
> > Hi!
> > 
> > I am just trying to use OpenWrt to build a kernel for my Debian
> > Squeeze on ASUS WL-500 gP installation which still uses 2.6.30 from
> > 
> > http://wpkg.org/files/debian-asus/2.6.30/
> > 
> > 
> > This is with
> > 
> > URL: svn://svn.openwrt.org/openwrt/trunk
> > Revision: 32384
> 
> […]
> 
> > Thus I went for the official make kernel_menuconfig approach. The
> > kernel is now build.
> > 
> > But OpenWrt build process still doesn´t take all modules for the
> > effective kernel configuration in
> > trunk/build_dir/linux-brcm47xx/linux-3.3.8/.config. I have
> > configured:
> > 
> > martin at merkaba:~/Computer/Gayatri/OpenWRT/trunk/target/linux/brcm47xx
> > > grep "=m" config-3.3
> > CONFIG_BLK_DEV_CRYPTOLOOP=m
> > CONFIG_BLK_DEV_LOOP=m
> > CONFIG_BLK_DEV_NBD=m
> 
> [ … lots of options enabled as modules …]
> 
> > But I still get:
> > 
> > martin at merkaba:~/Computer/Gayatri/OpenWRT/trunk/build_dir/linux-
> > brcm47xx/linux-3.3.8> grep "=m" .config
> > CONFIG_IOSCHED_CFQ=m
> > CONFIG_NET_SCH_CBQ=m
> > CONFIG_NET_SCH_MULTIQ=m
> 
> [… way less options enabled as modules as in original configuration …]
> 
> I think this has to do with the magic in include/kernel-defaults.mk:
> 
> define Kernel/Configure/Default
>         $(LINUX_CONF_CMD) > $(LINUX_DIR)/.config.target
> # copy CONFIG_KERNEL_* settings over to .config.target
>         awk
> '/^(#[[:space:]]+)?CONFIG_KERNEL/{sub("CONFIG_KERNEL_","CONFIG_");print
> }' $(TOPDIR)/.config >>
> $(LINUX_DIR)/.config.target
>         echo "# CONFIG_KALLSYMS_EXTRA_PASS is not set" >>
> $(LINUX_DIR)/.config.target
>         echo "# CONFIG_KALLSYMS_ALL is not set" >>
> $(LINUX_DIR)/.config.target
>         echo "# CONFIG_KPROBES is not set" >>
> $(LINUX_DIR)/.config.target $(SCRIPT_DIR)/metadata.pl kconfig
> $(TMP_DIR)/.packageinfo $(TOPDIR)/.config >
> $(LINUX_DIR)/.config.override
>         $(SCRIPT_DIR)/kconfig.pl 'm+' '+' $(LINUX_DIR)/.config.target
> /dev/null $(LINUX_DIR)/.config.override >
> $(LINUX_DIR)/.config
>         $(call Kernel/SetInitramfs)
>         -$(_SINGLE)$(MAKE) $(KERNEL_MAKEOPTS) oldconfig prepare scripts
>         rm -rf $(KERNEL_BUILD_DIR)/modules
>         $(MAKE) $(KERNEL_MAKEOPTS)
> INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
>         $(SH_FUNC) grep '=[ym]' $(LINUX_DIR)/.config | LC_ALL=C sort |
> md5s
> 
> > $(LINUX_DIR)/.vermagic
> 
> endef
> 
> martin at merkaba:~/Computer/Gayatri/OpenWRT/trunk/target/linux/brcm47xx>
> grep =m config-3.3 | wc -l
> 211
> 
> martin at merkaba:~/Computer/Gayatri/OpenWRT/trunk/build_dir/linux-
> brcm47xx/linux-3.3.8> grep =m .config.target | wc -l
> 212
> martin at merkaba:~/Computer/Gayatri/OpenWRT/trunk/build_dir/linux-
> brcm47xx/linux-3.3.8> grep =m .config.old | wc -l
> 71
> martin at merkaba:~/Computer/Gayatri/OpenWRT/trunk/build_dir/linux-
> brcm47xx/linux-3.3.8> grep =m .config | wc -l
> 48
> martin at merkaba:~/Computer/Gayatri/OpenWRT/trunk/build_dir/linux-
> brcm47xx/linux-3.3.8>

I think I cracked it - the other approach didn´t work - no it compiled
those modules - I just clear .config.override prior to kconfig.pl ;):

martin at merkaba:~/Computer/Gayatri/OpenWRT/trunk> diff -u include/kernel-defaults.mk.orig include/kernel-defaults.mk
--- include/kernel-defaults.mk.orig     2012-06-15 21:34:22.858217640 +0200
+++ include/kernel-defaults.mk  2012-06-16 10:59:39.347091053 +0200
@@ -102,6 +102,7 @@
        echo "# CONFIG_KALLSYMS_ALL is not set" >> $(LINUX_DIR)/.config.target
        echo "# CONFIG_KPROBES is not set" >> $(LINUX_DIR)/.config.target
        $(SCRIPT_DIR)/metadata.pl kconfig $(TMP_DIR)/.packageinfo $(TOPDIR)/.config > $(LINUX_DIR)/.config.override
+       echo > $(LINUX_DIR)/.config.override
        $(SCRIPT_DIR)/kconfig.pl 'm+' '+' $(LINUX_DIR)/.config.target /dev/null $(LINUX_DIR)/.config.override > 
$(LINUX_DIR)/.config
        $(call Kernel/SetInitramfs)
        -$(_SINGLE)$(MAKE) $(KERNEL_MAKEOPTS) oldconfig prepare scripts
@@ -112,7 +113,10 @@
 
 define Kernel/CompileModules/Default
        rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map
+       rm -rf /tmp/openwrt-modules
+       mkdir -p /tmp/openwrt-modules
        +$(MAKE) $(KERNEL_MAKEOPTS) modules
+       +$(MAKE) $(KERNEL_MAKEOPTS) INSTALL_MOD_PATH=/tmp/openwrt-modules modules_install
 endef
 
 OBJCOPY_STRIP = -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id


Lets see whether this thing actually will boot after I copied the modules
to the USB stick and flashed the kernel.

(sorry for post without Cc to debian-non-standard)

-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7



More information about the debian-non-standard mailing list