No Netconsole output at booting Uboot

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

No Netconsole output at booting Uboot

Postby sambul13 » Sat Feb 06, 2016 7:12 pm

I installed current Uboot and the latest ArchLnux ARM. Either on a Linux or Windows PCs, I'm getting Netconsole output from kernel, but not from Uboot while running the commands described here with firewall disabled. Does this Uboot image installed from current ARM repo have Netconsole disabled or removed? Why the repo stores U-Boot 2014.04, and not current Uboot 2015.10? Any way to enable Netconsole for Uboot startup stage? If no, where to download compiled Uboot 2015.10 for DockStar?

Netconsole Output:
$this->bbcode_second_pass_code('', '[ 802.082540] shutdown[1]: Detaching loop devices.
[ 802.093791] shutdown[1]: All loop devices detached.
[ 802.098748] shutdown[1]: Detaching DM devices.
[ 802.103852] shutdown[1]: All DM devices detached.
[ 802.110263] shutdown[1]: Rebooting.
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.1-1-ARCH (builduser@leming) (gcc version 5.3.0 (GCC) ) #1 PREEMPT Tue Feb 2 07:05:54 MST 2016
[ 0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache')

Serial Console Output:
$this->bbcode_second_pass_code('', '[ 78.469065] shutdown[1]: Rebooting.
[ 78.473062] reboot: Restarting system


U-Boot 2014.04.R2-1 (May 15 2014 - 14:35:47) Arch Linux ARM
Seagate FreeAgent DockStar

SoC: Kirkwood 88F6281_A0
DRAM: 128 MiB
WARNING: Caches not enabled
NAND: 512 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot: 0
(Re)start USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found')

Another question is, how I can change the default IPs set in the image if any? Why corresponding env variables aren't disclosed? Most people would find very difficult to look for such variables in sources. I tried to add envs usually used with Netconsole such as ipaddr, serverip, ncip, ncipk, set netconsole=on, preboot command, etc. but it doesn't change the output. Default Uboot environment doesn't print any Netconsole related settings or commands, while default IPs 10.10.10.5 etc may not be accessible on certain networks, and users should be allowed to change them. Anyway, Uboot doesn't appear to send Netconsole packets during bootloader startup stage - why?
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm

Re: No Netconsole output at booting Uboot

Postby sambul13 » Sun Feb 07, 2016 8:22 pm

It appears, Uboot version linked for DockStar at ARM Platforms portal was compiled without Netconsole enabled. Surprisingly, one can update to latest Uboot from repo with pacman, no download link needed:

$this->bbcode_second_pass_code('', '# pacman -Syu uboot-<device>')

Once Uboot 2015.10 was flashed to NAND, I rebooted and printed the envs:

$this->bbcode_second_pass_code('', 'root@alarm ~]# fw_printenv
bootcmd=run startboot;run bootubi
bootdir=/boot
bootfilem=uImage
bootfilez=zImage
bootubi=echo Trying to boot from NAND ...;if run mountubi; then ubifsload ${loadaddr} /boot/zImage;ubifsload ${fdtaddr} /boot/dtbs/${fdtfile};ubifsumount; setenv bootargs console=${console} ubi.mtd=1 root=ubi0:rootfs ro rootfstype=ubifs rootwait ${mtdparts};bootz ${loadaddr} - ${fdtaddr};fi
console=ttyS0,115200
ethact=egiga0
fdtaddr=0x800000
fdtdir=/boot/dtbs
fdtfile=kirkwood-dockstar.dtb
ipaddr=10.10.10.3
loadaddr=0x810000
loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfilez} || load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfilem}
loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}
mainargs=setenv bootargs console=${console} ${mtdparts} root=${root} rw rootwait ${optargs} ${ncargs}
mountubi=ubi part rootfs; ubifsmount ubi0:rootfs
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),-(rootfs)
ncip=10.10.10.5
ncipk=10.10.10.4
netconsole=on
preboot=if env exists netconsole && test ${netconsole} = on; then if ping ${ncip}; then setenv stdin nc; setenv stdout nc; setenv stderr nc; version; if env exists ncargsusr; then echo ncargs has been defined by user; setenv ncargs ${ncargsusr}; else setenv ncargs ignore_loglevel netconsole=6665@${ipaddr}/eth0,6666@${ncipk}/; fi; fi; else echo Netconsole has been turned off.; echo To turn it on, set netconsole variable to on.; setenv stdin; setenv stdout; setenv stderr; setenv ncargs; fi
rdaddr=0x1100000
rdfile=initramfs-linux.img
startboot=usb start; for devtype in usb; do setenv devnum 0; while ${devtype} dev ${devnum}; do echo ${devtype} found on device ${devnum}; setenv bootpart ${devnum}:1; echo Checking for: ${bootdir}/uEnv.txt ...; if test -e ${devtype} ${bootpart} ${bootdir}/uEnv.txt; then load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/uEnv.txt; env import -t ${loadaddr} ${filesize}; echo Loaded environment from ${bootdir}/uEnv.txt; echo Checking if uenvcmd is set ...; if test -n ${uenvcmd}; then echo Running uenvcmd ...; run uenvcmd; fi; fi; if run loadimage; then if env exists root; then echo root has been defined by user; else part uuid ${devtype} ${bootpart} uuid; setenv root PARTUUID=${uuid}; fi; run mainargs; if run loadfdt; then if run loadrd; then bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr}; else bootz ${loadaddr} - ${fdtaddr}; fi; else if run loadrd; then echo Booting uImage with initrd; bootm ${loadaddr} ${rdaddr}:${filesize}; else bootm ${loadaddr}; fi; fi; else echo No kernel found; fi; setexpr devnum ${devnum} + 1; done; done;
ethaddr=00:11:63:1A:02:UA
root@alarm ~]#
')

Now its clear, you can update ipaddr, ncip, ncipk to your preferred IPs. At first, I tried to add correct IPs to uEnv.txt with optargs command. It didn't work, probably because uEnv.txt is read after Wait is over and boot started, so it doesn't match current code logic pinging the target before showing Wait prompt. So I had to change the envs with fw_setenv command in running system. Once updated and rebooted, neither ASUC no Netcat would show Uboot wait prompt or allow to interrupt the process and enter text.

An interesting tweak: if your PC IP is up, this Uboot version won't show Wait prompt in Serial Console before loading kernel, but you could see it in Netconsole only if Uboot and kernel output set to different IPs. Otherwise I had to disable PC network adapter to get Wait prompt appear in Serial Console again. This looks like a bug to me rather than a useful feature.

Lets see how it works in a Ubuntu VM.
Last edited by sambul13 on Mon Feb 08, 2016 5:38 pm, edited 3 times in total.
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm

Re: No Netconsole output at booting Uboot

Postby sambul13 » Mon Feb 08, 2016 12:47 am

Just tested how Netconsole included with Uboot 2015.10 works with a Ubuntu VM on a Windows PC with a bridged network adapter, i.e. its own local IP. Switching the VM Firewall off, starting Netcat and watching in parallel output in Serial Console, I can see kernel output ONLY, but not initial Uboot output, and neither Uboot Wait prompt - its not present neither in Serial, no in Netconsole, therefore its again impossible to interrupt the boot process. Trying to sent boot interrupt commands to Uboot Netconsole failed. Here Netconsole implementation in Uboot 2015.0 doesn't work as it should in communication with either Windows or Linux PCs.

What's interesting, the Uboot 2015.10 announcement post says "Pull requests are welcome for new devices and/or fixes/enhancements for existing devices". However, the author never replied to my early post and PM about the issue. May be I'm doing something wrong?

In Serial Console Wait prompt is replaced with ping message "host is alive", so its not possible to interrupt and most of Uboot output is missing:

$this->bbcode_second_pass_code('', 'U-Boot 2015.10-1 (Nov 28 2015 - 01:53:40 -0700) Arch Linux ARM
Seagate FreeAgent DockStar

SoC: Kirkwood 88F6281_A0
DRAM: 128 MiB (ECC not enabled)
WARNING: Caches not enabled
NAND: 512 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
88E1116 Initialized on egiga0
Using egiga0 device
host 192.168.2.27 is alive
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.1-1-ARCH (builduser@leming) (gcc version 5.3.0 (GCC) ) #1 PREEMPT Tue Feb 2 07:07:27 MST 2016
[ 0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] Machine model: Seagate FreeAgent Dockstar
[ 0.000000] debug: ignoring loglevel setting.
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] On node 0 totalpages: 32768
[ 0.000000] free_area_init_node: node 0, pgdat c0927b8c, node_mem_map c7ed9000
[ 0.000000] Normal zone: 288 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 32768 pages, LIFO batch:7
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32480')

In Ubuntu Netconsole, Uboot output and Wait prompt is not seen either. I set both ncip and ncipk to the same IP for convenience to watch Uboot and kernel output at Arch reboot in the same console:

$this->bbcode_second_pass_code('', '[ 186.975003] EXT4-fs (sda1): re-mounted. Opts: data=ordered
[ 186.980640] shutdown[1]: Unmounting /oldroot.
[ 187.042987] shutdown[1]: Remounting '/' read-only with options 'mode=755'.
[ 187.050682] shutdown[1]: Remounting '/' read-only with options 'mode=755'.
[ 187.057838] shutdown[1]: All filesystems unmounted.
[ 187.062880] shutdown[1]: Deactivating swaps.
[ 187.067506] shutdown[1]: All swaps deactivated.
[ 187.072403] shutdown[1]: Detaching loop devices.
[ 187.083766] shutdown[1]: All loop devices detached.
[ 187.088734] shutdown[1]: Detaching DM devices.
[ 187.093824] shutdown[1]: All DM devices detached.
[ 187.100472] shutdown[1]: Rebooting.
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.1-1-ARCH (builduser@leming) (gcc version 5.3.0 (GCC) ) #1 PREEMPT Tue Feb 2 07:07:27 MST 2016
[ 0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] Machine model: Seagate FreeAgent Dockstar
[ 0.000000] debug: ignoring loglevel setting.
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] On node 0 totalpages: 32768
[ 0.000000] free_area_init_node: node 0, pgdat c0927b8c, node_mem_map c7ed9000
[ 0.000000] Normal zone: 288 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 32768 pages, LIFO batch:7
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32480
')

Can someone explain, how to interrupt the boot process? The only way I found so far is to abandon Netconsole, disable PC network adapter, and only then the Wait prompt and Uboot output will show up in Serial Console:

$this->bbcode_second_pass_code('', 'U-Boot 2015.10-1 (Nov 28 2015 - 01:53:40 -0700) Arch Linux ARM
Seagate FreeAgent DockStar

SoC: Kirkwood 88F6281_A0
DRAM: 128 MiB (ECC not enabled)
WARNING: Caches not enabled
NAND: 512 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
88E1116 Initialized on egiga0
Using egiga0 device
ping failed; host 192.168.2.27 is not alive
Hit any key to stop autoboot: 0
starting USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found

USB device 0:
Device 0: Vendor: JetFlash Rev: 1100 Prod: Transcend 4GB
Type: Removable Hard Disk
Capacity: 3862.0 MB = 3.7 GB (7909376 x 512)
... is now current device
usb found on device 0
Checking for: /boot/uEnv.txt ...
70 bytes read in 156 ms (0 Bytes/s)
Loaded environment from /boot/uEnv.txt
Checking if uenvcmd is set ...
4642496 bytes read in 328 ms (13.5 MiB/s)
loading /boot/dtbs/kirkwood-dockstar.dtb ...
10398 bytes read in 559 ms (17.6 KiB/s)
2624785 bytes read in 286 ms (8.8 MiB/s)
Kernel image @ 0x810000 [ 0x000000 - 0x46d6c0 ]
## Flattened Device Tree blob at 00800000
Booting using the fdt blob at 0x800000
Loading Ramdisk to 0789b000, end 07b1bd11 ... OK
Loading Device Tree to 07895000, end 0789a89d ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
')

If I assign separate IPs to Uboot and kernel, Netconsole works, but it requires adding extra virtual interface. Its easy to add such interfaces in Linux, but not in Windows. Why there's a need to lock kernel and Uboot output to separate IPs, when its possible to combine them to the same IP? Any way to do that without recompiling Uboot?
sambul13
 
Posts: 258
Joined: Sat Aug 18, 2012 10:32 pm


Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 27 guests