OpenWrt Forum Archive

Topic: How to recompile the kernel only?

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

Hi,

Is there a way to recompile only the kernel?  Each time I'm changing a kernel file, the whole make mechanism is dragging through all the packages, resulting in a lot of lost time.

Hope there's an efficient way to recompile the kernel only, just like you can recompile packages/kernel modules only.

Anyone any idea?

Best rgds,

-Geert

How about make target/linux/<platform>/compile or make target/linux/<platform>/compile V=99?

make target/linux/platform/{clean,install} V=99 && make V=99

bump oldd thread, is this still valid?
because:

make target/linux/mips_34kc/compile V=99
make[1]: Entering directory `/hdd/openwrt/dvb'
make[1]: *** No rule to make target `target/linux/mips_34kc/compile'.  Stop.
make[1]: Leaving directory `/hdd/openwrt/dvb'
make: *** [target/linux/mips_34kc/compile] Fehler 2

make target/linux/ar71xx_generic/compile V=99
make[1]: Entering directory `/hdd/openwrt/dvb'
make[1]: *** No rule to make target `target/linux/ar71xx_generic/compile'.  Stop.
make[1]: Leaving directory `/hdd/openwrt/dvb'
make: *** [target/linux/ar71xx_generic/compile] Fehler 2

make target/linux/ar71xx/compile V=99
make[1]: Entering directory `/hdd/openwrt/dvb'
make[1]: *** No rule to make target `target/linux/ar71xx/compile'.  Stop.
make[1]: Leaving directory `/hdd/openwrt/dvb'
make: *** [target/linux/ar71xx/compile] Fehler 2

the current command would be just: make target/linux/compile

So, the complete command is
make target/linux/{clean,compile} V=s

(Last edited by hnyman on 14 Nov 2014, 16:31)

Thank You That worked

Hi,

  And if I want to compile just a "kmod"?

  Is there any make target for that?

Which kmod package(s) do you want to compile?

[debian@debian:/opt/openwrt-git-trunk 840%] ~ scripts/feeds search kmod
Search results in feed 'packages':
kmod-gpiotoggling            Toggle GPIOs in kernel space
kmod-loop-aes                loopback module with built-in AES
kmod-madwifi                 Driver for Atheros wireless chipsets
kmod-openswan                Openswan (kernel module)
kmod-pcmcia-serial-sierra    Sierra AirCard PCMCIA support
kmod-siit                    Stateless IP ICMP Translation Algorithm
kmod-wprobe                  Wireless driver probe infrastructure
libmikmod                    Mikmod sound library
Search results in feed 'packages_github':
kmod                         Linux kernel module handling (tools)
kmod-cryptodev               Driver for cryptographic acceleration
kmod-lttng                   Linux Trace Toolkit: next generation (kernel modules)
kmod-openvswitch             Open vSwitch Kernel Package
kmod-usb-serial-dmx_usb_module    Support for FTDI RS485 based DMX modules
libkmod                      Linux kernel module handling (library)
open-plc-utils-int6kmod      Utility  from the Open PLC utilities
Search results in feed 'routing':
kmod-batgat                  B.A.T.M.A.N. gateway module
kmod-batman-adv              B.A.T.M.A.N. Adv
kmod-nat46                   Stateless NAT46 translation kernel module
Search results in feed 'local':
kmod-batman-adv-kernelland    B.A.T.M.A.N. layer 2
kmod-ipt-opendpi             OpenDPI net netfilter module

(Last edited by mazilo on 5 Mar 2015, 20:30)

Let's say I want to compile just the "kmod-openvswitch" or "kmod-ipt-opendpi".

  How can I do that?

ronaldoafonso wrote:

Let's say I want to compile just the "kmod-openvswitch" or "kmod-ipt-opendpi".

AFAICT, these two packages are part of kernel modules. So, you will need to compile the kernel so that buildroot will generate the packages.

Hi All,

Just to add one more question to this thread. How can we change the kernel from the current version to the latest Linux Kernel available, say version 4.3 or 4.4? I tried "make target/linux/{clean,compile} V=s", but I was getting the following error:

make[4]: Entering directory `/scratch/openwrt/openwrt/build_dir/target-arm_cortex-a7+vfp_uClibc-0.9.33.2_eabi/linux-brcm2708_bcm2709/linux-4.3'

The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.

make[4]: *** [modules] Error 1
make[4]: Leaving directory `/scratch/openwrt/openwrt/build_dir/target-arm_cortex-a7+vfp_uClibc-0.9.33.2_eabi/linux-brcm2708_bcm2709/linux-4.3'
make[3]: *** [/scratch/openwrt/openwrt/build_dir/target-arm_cortex-a7+vfp_uClibc-0.9.33.2_eabi/linux-brcm2708_bcm2709/linux-4.3/.modules] Error 2
make[3]: Leaving directory `/scratch/openwrt/openwrt/target/linux/brcm2708'
make[2]: *** [compile] Error 2
make[2]: Leaving directory `/scratch/openwrt/openwrt/target/linux'
make[1]: *** [target/linux/compile] Error 2
make[1]: Leaving directory `/scratch/openwrt/openwrt'
make: *** [target/linux/compile] Error 2

Could someone help? Thanks a lot!

Unless you really know what you are doing and I strongly do not recommend this approach but to wait until OpenWRT starts to support the Linux kernel version, you will need modify the include/kernel-version.mk to include the version you want. You will also make sure you have the target/linux/generic/patches-x.y and/or target/linux/<platform>/patches-x.y files to support the Linux kernel version x.y.z (if needed).

The discussion might have continued from here.