OpenWrt Forum Archive

Topic: Compiling ip_gre module into Kamikaze 7.09 image to load automatically

The content of this topic has been archived on 5 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello, I've compiled a 7.09 image to boot successfully on a Linksys WRT54G3G router and have also managed to compile in the ip_gre module without issue. However I would like the firmware to load this module during bootup without the need for an entry to be added to the /etc/modules.d directory after the firmware is loaded. ie allow the firmware to be deployed without this requirement.

I've tried creating an entry in the soure build_dir under the /etc/modules.d directory, but this was not compiled into the image.

Any ideas?

Many thanks, RM

Appling the patch below and recompile with 'make package/kernel-clean world' will add the ip_gre module in /etc/modules.d/30-gre and loads it automatically.

Index: package/kernel/modules/network.mk
===================================================================
--- package/kernel/modules/network.mk   (revision 9624)
+++ package/kernel/modules/network.mk   (working copy)
 -148,6 +148,7 @@
   KCONFIG=$(CONFIG_NET_IPGRE)
   FILES=$(LINUX_DIR)/net/ipv4/ip_gre.$(LINUX_KMOD_SUFFIX)
   SUBMENU:=$(NSMENU)
+  AUTOLOAD:=$(call AutoLoad,30,ip_gre)
 endef
 $(eval $(call KernelPackage,gre))

Many thanks and I'll try your suggestion when I get home.

Any idea how you can also change the default network configuration file in the image. I want to change the LAN ip range to a less commonly used one to avoid ip conflicts.

In menuconfig -> [*] Image configuration -> you can pre-configure the LAN Protocol, LAN IP Address, LAN Gateway and LAN DNS Server.

If you need to change more options you can create a custom network config file in kamikaze_7.09/files/etc/config/network and recompile.

Thanks to all. The patch worked fine and the ip_gre module now loads automatically after firmware is flashed.

The configuration change suggested also work without a hitch.

Many thanks.

RM

The discussion might have continued from here.