how to switch netconsole back to serial? November 20, 2016 02:18PM |
Registered: 9 years ago Posts: 42 |
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.
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.
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 resetNow 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.
Re: how to switch netconsole back to serial? November 20, 2016 02:20PM |
Registered: 9 years ago Posts: 42 |
Re: how to switch netconsole back to serial? November 20, 2016 05:33PM |
Registered: 9 years ago Posts: 226 |
serverip=10.9.1.200This sets the value of serverip to 10.9.1.200. It gets used in the following line:
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;So in this line, the value of ncip gets set to the value of serverip. You get the value of an environment variable (which serverip and ncip both are) by preceding the variable name with a $:
setenv ncip $serveripThis sets the value of ncip to 10.9.1.200
stderr=nc stdin=nc stdout=ncI think you've permanently assigned stderr/in/out to netconsole. The point of
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;is to only set stdin and stdout to nc if you're using netconsole
setenv stdinbut I'm not sure. You'll want to try it and then print out your uboot environment again to ensure they're gone before you do the saveenv.
Re: how to switch netconsole back to serial? November 20, 2016 05:57PM |
Admin Registered: 13 years ago Posts: 18,555 |
ipaddr=10.9.1.208
serverip=10.9.1.200
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
nc -lup 6666 10.9.1.208 6666
fw_setenv stderr serial fw_setenv stdin serial fw_setenv stdout serial fw_setenv preboot
fw_setenv preboot 'run preboot_nc'
Re: how to switch netconsole back to serial? April 03, 2017 05:46PM |
Registered: 10 years ago Posts: 168 |
Re: how to switch netconsole back to serial? September 22, 2017 03:02PM |
Registered: 9 years ago Posts: 42 |
U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:52:06 -0700) ZyXEL NSA320 2-Bay Power Media Server SoC: Kirkwood 88F6281_A1 DRAM: 512 MiB WARNING: Caches not enabled NAND: 128 MiB In: serial Out: serial Err: serial Net: egiga0 MV88E1318 PHY initialized on egiga0 Using egiga0 device host 10.9.1.202 is aliveThen i get the following printed to nc (first line is my netcat invocation (on mac OSX10.11.6)
[517][dirk.Alubook17-2: /Users/dirk]$ nc -v -v -v -k -l -u 6666 U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:52:06 -0700) 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: 0 Reset IDE: Bus 0: OK Bus 1: OK Device 0: Model: WDC WD20EARS-00MVWB0 Firm: 51.0AB51 Ser#: WD-WCAZA7723695 Type: Hard Disk Supports 48-bit addressing Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512) Device 1: Model: WDC WD20EARS-00MVWB0 Firm: 51.0AB51 Ser#: WD-WCAZA7719300 Type: Hard Disk Supports 48-bit addressing Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512) Partition Map for IDE device 0 -- Partition Type: DOS Part Start Sector Num Sectors UUID Type 1 2048 6144000 60d88db4-01 83 Boot 2 6146048 3900883120 60d88db4-02 83 Partition Map for IDE device 1 -- Partition Type: DOS Part Start Sector Num Sectors UUID Type 1 2048 3907584 7dbcc20b-01 83 Boot 2 3909632 3903119536 7dbcc20b-02 83 loading envs from ide 0 ... 147 bytes read in 50 ms (2 KiB/s) importing envs ... running scan_disk ... Scan device ide Reset IDE: Bus 0: OK Bus 1: OK Device 0: Model: WDC WD20EARS-00MVWB0 Firm: 51.0AB51 Ser#: WD-WCAZA7723695 Type: Hard Disk Supports 48-bit addressing Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512) Device 1: Model: WDC WD20EARS-00MVWB0 Firm: 51.0AB51 Ser#: WD-WCAZA7719300 Type: Hard Disk Supports 48-bit addressing Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512) device ide 0:1 1 bytes read in 30 ms (0 Bytes/s) Found bootable drive on ide 0 3821592 bytes read in 1378 ms (2.6 MiB/s) 7245696 bytes read in 2046 ms (3.4 MiB/s) 13691 bytes read in 29 ms (460.9 KiB/s) ## Booting kernel from Legacy Image at 00800000 ... Image Name: Linux-4.12.1-kirkwood-tld-1 Created: 2017-07-20 8:11:24 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3821528 Bytes = 3.6 MiB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK ## Loading init Ramdisk from Legacy Image at 01100000 ... Image Name: initramfs-4.12.1-kirkwood-tld-1 Created: 2017-07-24 0:18:23 UTC Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 7245632 Bytes = 6.9 MiB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK ## Flattened Device Tree blob at 01c00000 Booting using the fdt blob at 0x1c00000 Starting kernel ...after that all the following boot stuff is on the serial console.
root@publik2:~# fw_printenv arcNumber=3956 bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 orion_nand:1M(u-boot),512K(uboot_env),512K(key_store),512K(info),10M(etc),10M(kernel_1),48896K(rootfs1),10M(kernel_2),-(rootfs2) bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi; sleep 3 bootdelay=10 bootdev=ide console=ttyS0,115200 devices=ide disks=0 1 dtb_file=/boot/dts/kirkwood-nsa320.dtb ethact=egiga0 ethaddr=b0:b2:dc:c9:a9:13 fileaddr=1c00000 filesize=357b if_netconsole=ping $serverip init_ide=ide reset init_mmc=mmc rescan init_usb=usb start ipaddr=10.9.1.209 load_dtb_addr=0x1c00000 load_initrd_addr=0x1100000 load_uimage_addr=0x800000 mainlineLinux=yes mtdids=nand0=orion_nand 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) partition=nand0,2 preboot_nc=run if_netconsole start_netconsole scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_ide "ide reset"; setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done scan_ide=ide reset scan_mmc=mmc rescan scan_usb=usb start set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version; uenv_addr=0x810000 uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize uenv_init_devices=setenv init_usb "usb start"; setenv init_ide "ide reset"; setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done; uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in 0; do run uenv_read_disk; done; done; uenv_loaded=1 uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read; fi; else if $devtype part $disknum; then run uenv_read; fi; fi uimage=ext2load ide 0:1 0x800000 /boot/uImage usb_boot=run load_dtb; run load_uimage; if run load_initrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi usb_ready_retry=15 serverip=10.9.1.202 led_error=orange led_exit=green off led_init=green blinking stdin=nc stdout=nc stderr=nc load_uimage=ext2load ide 0:1 0x800000 /boot/uImage load_initrd=ext2load ide 0:1 0x1100000 /boot/uInitrd load_dtb=ext2load ide 0:1 0x1c00000 /boot/dts/kirkwood-nsa320.dtb preboot=run preboot_nc device=1:1 root@publik2:~#
Re: how to switch netconsole back to serial? September 22, 2017 04:59PM |
Admin Registered: 13 years ago Posts: 18,555 |
Re: how to switch netconsole back to serial? September 23, 2017 05:57AM |
Registered: 9 years ago Posts: 42 |
Re: how to switch netconsole back to serial? September 23, 2017 05:13PM |
Admin Registered: 13 years ago Posts: 18,555 |