Enabling Netconsole
-
Hello,
I'm trying to get remote logs on my Omega and I think that netconsole might be great https://kernelnewbies.org/KernelDebug
Any ideas about how to enable it? I didn't find netconsole in the list of available modules (make menuconfig)...
Best
-
Why not just ssh into the omega and run
logread -f
?For normal logging this should be sufficient. Of course, if you need to debug a kernel crash that brings down the system, you might need netconsole to see the "famous last words" of your kernel...
If you have the Onion Omega2 Firmware Build System already up and running, it's easy:
Just call
make kernel_menuconfig
And then navigate to -> Device Drivers -> Network device support -> Network core driver support and enable Netconsole.
Then exit the menu and save the config.Now build the firmware on the openwrt level:
make # can take hours if it's the first time you do it...
Now you have a complete firmware, containing a kernel with Netconsole built-in, or, if you had configured
<M>
in the menu and not<*>
, the netconsole loadable kmod.BTW: this generally works for tweaking kernel options that are not directly exposed in the openwrt level
make menuconfig
.
But asmake kernel_menuconfig
modifies the kernel config template files of openwrt, changes might interfere with changes openwrt later tries to apply on top.
-
I use remote logging extensively, you just need to configure it in your /etc/config/system:
uci set system.@system[0].log_ip=$HOST
uci set system.@system[0].log_port='514'
uci set system.@system[0].log_proto='udp'
uci commit system
reload_configMake sure you have the firewall configured on your remote logging host to allow the incoming logging.
-
@crispyoz Thanks. This is super useful
-
To enable netconsole logging, you will specify the interface used to reach the syslog server, the IP and port of the syslog server, and optionally the MAC address of that server www.mcdvoice.com thank you