Setting up netconsole

Raspberry Pi 2

Setting up netconsole

Postby hachel » Mon Jan 25, 2016 3:49 pm

Hi there,
I'm trying to set up netconsole for the potential case of a non-booting rspi2. First of all I don't know if it's possible at all, hardware-wise?
I tried the arch-wikie page (https://wiki.archlinux.org/index.php/Netconsole) and added $this->bbcode_second_pass_code('', 'netconsole=6665@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5') (with my rspi2's ip and my laptops ip respectively) to my cmdline.txt. nc -u -l 6666 on my laptop yields nothing while rebooting the rspi2.
I tried the manual way as described in the wiki:
$this->bbcode_second_pass_code('', '
# set log level for kernel messages
dmesg -n 8

modprobe configfs
modprobe netconsole
mount none -t configfs /sys/kernel/config

# 'netconsole' dir is auto created if the module is loaded
mkdir /sys/kernel/config/netconsole/target1
cd /sys/kernel/config/netconsole/target1

# set local IP address
echo 192.168.0.111 > local_ip
# set destination IP address
echo 192.168.0.17 > remote_ip
# set local network device name (find it trough ifconfig, examples: eth0, eno1, wlan0)
echo eno1 > dev_name
# find destination MAC address
arping $(cat remote_ip) -f | grep -o ..:..:..:..:..:.. > remote_mac

echo 1 > enabled') but after modprobing configfs (the second step) lsmod doesn't show it as being loaded. also $this->bbcode_second_pass_code('', 'mount none -t configfs /sys/kernel/config') tells me $this->bbcode_second_pass_code('', 'mount: none is already mounted or /sys/kernel/config busy') but /sys/kernel/config/ is empty and there is no way for me to set the ip addresses.

Any help?

thanks
hachel
 
Posts: 26
Joined: Fri Mar 07, 2014 3:24 pm

Re: Setting up netconsole

Postby WarheadsSE » Mon Jan 25, 2016 6:33 pm

If the Pi2 is not booting,you can't use the configfs to configure it.

Your best bet is to hook up serial. You're assuming that the kernel is even loading, which you don't know.

http://elinux.org/R-Pi_Troubleshooting
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Setting up netconsole

Postby hachel » Mon Jan 25, 2016 9:51 pm

sorry I haven't been too clear.
What I meant by "non-booting rspi2" was me not beeing able to log in via ssh. earlier today I rebooted and couldn't log in afterwards and non of the services that normally run on the rspi2 were reachable. I knew how to fix it because of what I did prior to rebooting, but I thought I'd like to set up netconsole for cases where I don't know what went wrong.
So for the hypothetical case of a booting, but non-reachable rspi2 I would like to set up a working netconsole.
hachel
 
Posts: 26
Joined: Fri Mar 07, 2014 3:24 pm

Re: Setting up netconsole

Postby WarheadsSE » Mon Jan 25, 2016 9:56 pm

Sounds like the network didn't come up at all. At which point, netconsole has a low chance of working.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Setting up netconsole

Postby hachel » Tue Jan 26, 2016 8:43 am

I could see on my routers webinterface that the rspi2 came up.
Anyway, back with my rspi 1 I had cases where a functioning netconsole actually helped me debug a problem, so I would like to set it up for my rspi2 as well. As I said in the OP it didn't work the way it is described in the arch wiki. Do you or anyone have any idea why not or what I have to do in order for it to work?
thank you!
hachel
 
Posts: 26
Joined: Fri Mar 07, 2014 3:24 pm

Re: Setting up netconsole

Postby sdjf » Wed Jan 27, 2016 6:04 pm

Maybe you could test whether the network came up by having a crontab job run shortly after reboot that runs debugging commands and saves them to a file you can look at later, either in /boot or in your home directory.

I get stuff to run this way by having a crontab job set to run at 2 minutes after every hour, so things I want to run automatically without a service file, run at that point. In my case, after a reboot, they run at January 1, 1970 at 2 minutes after midnight, before the pi updates to real time.

Commands like dmesg, ifconfig, route might give you a clue.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm

Re: Setting up netconsole

Postby hachel » Fri Jan 29, 2016 10:15 am

that sounds interesting, I'll give that a try! thanks.

Does that mean that netconsole is not an option on the pi2? I mean is it technically possible?
hachel
 
Posts: 26
Joined: Fri Mar 07, 2014 3:24 pm

Re: Setting up netconsole

Postby wobble » Sat Jan 30, 2016 10:22 am

Have you tried following this guide for setting up netconsole?

I have no experience with the RPi2, but on my Pogoplug it only worked after listening on both the boot and the kernel address like detailed there.
wobble
 
Posts: 31
Joined: Fri Dec 04, 2015 2:15 pm

Re: Setting up netconsole

Postby hachel » Wed Feb 03, 2016 4:53 pm

As far as I know the raspi2 doesn't use uboot like the pogoplug, so that's not an option for me.
hachel
 
Posts: 26
Joined: Fri Mar 07, 2014 3:24 pm


Return to Broadcom

Who is online

Users browsing this forum: No registered users and 12 guests