Izik
Izik

Reputation: 948

How to add netconsole to kernel with OpenWRT

I'm using OpenWRT and I'm trying to work with netconsole instead of serial cable to debug kernel messages. By default, netconsole is not defined in OpenWRT, and I can't add it through menuconfig. There is no documentation for it anywhere. Any help to add netconsole to the kernel would be much appreciated! Thanks

Upvotes: 0

Views: 831

Answers (2)

m95d
m95d

Reputation: 11

Run: make kernel_menuconfig and select the option. But that alone won't help you. Netconsole requires kernel boot parameters to be set, most important, the destination address where the console messages are sent. You need to modify your bootloader to pass that parameter to the kernel.

Upvotes: 1

Izik
Izik

Reputation: 948

I found one way to do this. First you need to look at your .config file, which is found in the linux folder with the version you working with. for example, I'm working with qca/src/linux-3.14. This .config is being build in the compilation. you can see the field

# CONFIG_NETCONSOLE is not set

The configurations in this file will define what will be built and what not.

So in order to build this module, go to your target folder, in linux/generic/ there is another configs files, mine is config-3.14. yours will be as your linux version you using. change CONFIG_NETCONSOLE is not set to CONFIG_NETCONSOLE=m and add CONFIG_NETCONSOLE_DYNAMIC=y'. Now in compilation, the first .config file will be with the correct configuration and netconsole.ko module will be created.

This is valid for adding to kernel any module that affected by .config file. Of course, you need to add this module manually, or add the module as part of kernel CONFIG_NETCONSOLE=y but I've had some problems with this.

Upvotes: 0

Related Questions