Quantcast
Channel: Linux Device Hacking - uBoot
Viewing all articles
Browse latest Browse all 902

how to switch netconsole back to serial? (3 replies)

$
0
0
Hello, i have two nsa320's, that i both want to update to latest u-Boot.
The process went fine on one NSA, but on the other one i have some issues:
Right now there are no harddrives installed, but i could take the HD containing the rootfs from the other working NSA.
Unfortunately, all stdin, stout, stderr are set to nc,(which works fine). But i need to have it set to serial to be able to kwboot the latest u-boot. kwboot-updating worked fine on my other NSA(see my signature)
Below is my environment:
U-Boot 2015.10-tld-1 (Nov 06 2015 - 16:12:51 -0800)
ZyXEL NSA320 2-Bay Power Media Server
gcc (Debian 4.9.2-10) 4.9.2
GNU ld (GNU Binutils for Debian) 2.25
Hit any key to stop autoboot:  9
NSA320> print
print
arcNumber=3956
baudrate=115200
boot_sata1=mw 0x800000 0 1; setenv bootargs console=ttyS0,115200 root=/dev/sda1 rootdelay=10 $mtdparts; ide reset; ext2load ide 0:1 0x800000 /boot/uImage; ext2load ide 0:1 0x01100000 /boot/uInitrd; bootm 0x00800000 0x01100000
boot_sata2=mw 0x800000 0 1; setenv bootargs console=ttyS0,115200 root=/dev/sdb1 rootdelay=10 $mtdparts; ide reset; ext2load ide 1:1 0x800000 /boot/uImage; ext2load ide 1:1 0x01100000 /boot/uInitrd; bootm 0x00800000 0x01100000
bootcmd=run boot_sata1; run boot_sata2; run bootcmd_usb; usb stop; run bootcmd_rescue; reset
bootcmd_usb=run usb_init; run usb_load_uimage; run set_bootargs_usb; run usb_boot;
bootdelay=10
console=ttyS0,115200
ethact=egiga0
ethaddr=b0:b2:dc:ee:d4:f2
if_netconsole=ping $serverip
ipaddr=10.9.1.208
load_dtb=ext2load usb 0:1 0x1c00000 /boot/dts/kirkwood-nsa320.dtb
load_initrd=ext2load usb 0:1 0x1100000 /boot/uInitrd
load_uimage=ext2load usb 0:1 0x800000 /boot/uImage
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),512K(uboot_env),512K(key_store),512K(info),10M(etc),10M(kernel_1),48896K(rootfs1),10M(kernel_2),-(rootfs2)
nc_ready=1
ncip=10.9.1.200
netmask=255.255.255.0
partition=nand0,2
preboot=run preboot_nc
preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test $nc_ready -eq 1; then run start_netconsole; fi
serverip=10.9.1.200
set_bootargs_usb=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=nc
stdin=nc
stdout=nc
usb_boot=run load_dtb; run load_uimage; if run load_initrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi
usb_device=0:1
usb_init=usb start
usb_load_uimage=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage
usb_root=LABEL=USBROOT
usb_rootdelay=10
usb_rootfstype=ext2

Environment size: 2095/131068 bytes
NSA320>
From what i understand i pings my netcat server(10.9.1.200) up to five times, if it responds,it runs start_netconsole.
First i tried to switch the netconsole to serial like this:
 setenv start_netconsole'setenv ncip $serverip; setenv bootdelay 5;setenv stdin serial;setenv stdout serial;setenv stderr serial; version;'
but to no avail,when i executed this command, it just printed it(without error), but the environment stays unchanged.
Then i did:
NSA320> setenv serverip 10.9.1.201
setenv serverip 10.9.1.201
saveenv
Saving Environment to NAND...
Erasing NAND...
Erasing at 0xc0000 -- 100% complete.
Writing to NAND... OK
NSA320> reset
reset
Now it seems i've locked myself out, since nc doesnt come up(10.9.1.201 isnt pingable right now), and also the serial console doesnt react. The NSA is in a reboot loop.
Of course i could help myself by setting up my machine to the 10.9.1.201 address, but thats not the point.
What did i do wrong?
Whats the difference between serverip and ncip ?
Which other / better ways are there to set the stdin/-out/-err to serial?
should i maybe opt to install the new uboot from a working linux system?

Viewing all articles
Browse latest Browse all 902

Trending Articles