Quantcast
Channel: Linux Device Hacking
Viewing all articles
Browse latest Browse all 46971

Re: Use netconsole to troubleshoot uBoot without a serial cable

$
0
0
Thanks, bohdi.

Here's what I did:

Followed your link and setup a second USB flash drive with Debian. Then I connected the GoFlex Home via ethernet directly to my laptop's ethernet port. I used wireshark on my laptop to monitor the ethernet traffic while the GoFlex Home booted with the Debian USB flash drive in its single USB port. The packet capture showed that the address 10.10.10.6 was arping for 10.10.10.5's mac address.

So I edited my laptop's /etc/network config file to add secondary addresses in addition to the existing eth0 address of 192.168.1.1: 10.10.10.5 on eth0:0, 10.10.10.4 on eth0:1, and 10.10.10.2 on eth0:2.

I then opened three Gnome terminals. In the first, I ran the command as a normal user the command "nc -lup 6666 &" then "nc -u 10.10.10.6 6666" in the foreground. In the second, "nc -l 10.10.10.5 6666", the third, "nc -l 10.10.10.4 6666", and the fourth, "nc -l 10.10.10.2 6666"

I get the following from "nc -u 10.10.10.6 6666":
U-Boot 2010.09 (Feb 16 2011 - 18:44:23)
UBIT v0.6 by Jeff Doozan and Peter Carmichael
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
Hit any key to stop autoboot:  0 
UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:fast", error -19
Error reading superblock on volume 'ubi:fast'!
UBIFS not mounted, use ubifs mount to mount volume first!
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
2399792 bytes read
Loading file "/uInitrd" from usb device 0:1 (usbda1)
** File not found /uInitrd
Loading file "/boot/uInitrd" from usb device 0:1 (usbda1)
6568066 bytes read
## Booting kernel from Legacy Image at 00680000 ...
   Image Name:   Linux-3.13.1-kirkwood-tld-2
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2399728 Bytes = 2.3 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-3.13.1-kirkwood-tld-2
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    6568002 Bytes = 6.3 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

I get nothing from the others. But at least it's a start. And I can confirm that the kernel is booting, as Wireshark finds that the GoFlex on 10.10.10.6 is sending the following to 10.10.10.4 (although the nc instance listening to the socket at 10.10.10.4 doesn't):

[    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 3.13.1-kirkwood-tld-2 (root@tldDebian) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 PREEMPT Tue Feb 4 03:19:07 PST 2014
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine: Seagate GoFlex Home
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 mtdparts=orion_nand:1M(u-boot),6M(uImage),-(root) root=/dev/sda1 rootdelay=10 rootfstype=auto netconsole=@10.10.10.6/eth0,@10.10.10.4/
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 116220K/131072K available (4659K kernel code, 346K rwdata, 1588K rodata, 211K init, 425K bss, 14852K reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc06220ac   (6249 kB)
[    0.000000]       .init : 0xc0623000 - 0xc0657e4c   ( 212 kB)
[    0.000000]       .data : 0xc0658000 - 0xc06ae824   ( 347 kB)
[    0.000000]        .bss : 0xc06ae824 - 0xc0718d6c   ( 426 kB)
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:114
[    0.000000] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 21474836475ns
[    0.000000] Console: colour dummy device 80x30
[   20.256020] Calibrating delay loop... 1191.11 BogoMIPS (lpj=5955584)
[   20.345821] pid_max: default: 32768 minimum: 301
[   20.345902] Security Framework initialized
[   20.345955] Mount-cache hash table entries: 512
[   20.346480] Initializing cgroup subsys devices
[   20.346497] Initializing cgroup subsys freezer
[   20.346507] Initializing cgroup subsys net_cls
[   20.346516] Initializing cgroup subsys blkio
[   20.346572] CPU: Testing write buffer coherency: ok
[   20.346869] Setting up static identity map for 0x469248 - 0x469284
[   20.348210] devtmpfs: initialized
[   20.350236] prandom: seed boundary self test passed
[   20.354248] prandom: 100 self tests passed
[   20.354256] pinctrl core: initialized pinctrl subsystem
[   20.354491] regulator-dummy: no parameters
[   20.354726] NET: Registered protocol family 16
[   20.355137] DMA: preallocated 256 KiB pool for atomic coherent allocations
[   20.355548] cpuidle: using governor ladder
[   20.355558] cpuidle: using governor menu
[   20.355666] Kirkwood: MV88F6281-A1, TCLK=200000000.
[   20.355685] Feroceon L2: Cache support initialised.
[   20.359735] bio: create slab <bio-0> at 0
[   20.360186] vgaarb: loaded
[   20.360411] usbcore: registered new interface driver usbfs
[   20.360464] usbcore: registered new interface driver hub
[   20.360569] usbcore: registered new device driver usb
[   20.361201] Switched to clocksource orion_clocksource
[   20.381660] NET: Registered protocol family 2
[   20.382318] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[   20.382344] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[   20.382364] TCP: Hash tables configured (established 1024 bind 1024)
[   20.382432] TCP: reno registered
[   20.382446] UDP hash table entries: 256 (order: 0, 4096 bytes)
[   20.382468] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[   20.382671] NET: Registered protocol family 1
[   20.382999] RPC: Registered named UNIX socket transport module.
[   20.383010] RPC: Registered udp transport module.
[   20.383017] RPC: Registered tcp transport module.
[   20.383024] RPC: Registered tcp NFSv4.1 backchannel transport module.
[   20.383269] Unpacking initramfs...
[   20.927169] Freeing initrd memory: 6408K (c1101000 - c1743000)
[   20.927298] NetWinder Floating Point Emulator V0.97 (double precision)
[   20.927894] audit: initializing netlink socket (disabled)
[   20.927947] type=2000 audit(0.660:1): initialized
[   20.928728] zbud: loaded
[   20.928898] VFS: Disk quotas dquot_6.5.2
[   20.928952] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[   20.929334] NFS: Registering the id_resolver key type
[   20.929394] Key type id_resolver registered
[   20.929403] Key type id_legacy registered
[   20.929422] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[   20.929431] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[   20.929604] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[   20.929876] msgmni has been set to 239
[   20.929997] Key type big_key registered
[   20.931914] alg: No test for stdrng (krng)
[   20.932006] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[   20.932018] io scheduler noop registered
[   20.932026] io scheduler deadline registered
[   20.932050] io scheduler cfq registered (default)
[   20.932263] mv_xor mv_xor.0: Marvell shared XOR driver
[   20.971264] mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
[   21.011262] mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
[   21.011364] mv_xor mv_xor.1: Marvell shared XOR driver
[   21.051263] mv_xor mv_xor.1: Marvell XOR: ( xor cpy )
[   21.091262] mv_xor mv_xor.1: Marvell XOR: ( xor cpy )
[   21.091527] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[   21.112099] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33, base_baud = 12500000) is a 16550A
[   21.638716] console [ttyS0] enabled
[   21.643061] NAND device: Manufacturer ID: 0x98, Chip ID: 0xda (Toshiba NAND 256MiB 3,3V 8-bit)
[   21.651738] NAND device: 256MiB, SLC, page size: 2048, OOB size: 64
[   21.658038] Scanning device for bad blocks
[   21.877644] 3 cmdlinepart partitions found on MTD device orion_nand
[   21.883957] Creating 3 MTD partitions on "orion_nand":
[   21.889126] 0x000000000000-0x000000100000 : "u-boot"
[   21.894355] 0x000000100000-0x000000700000 : "uImage"
[   21.899552] 0x000000700000-0x000010000000 : "root"
[   21.905346] libphy: Fixed MDIO Bus: probed
[   21.921337] libphy: orion_mdio_bus: probed
[   21.925535] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[   22.933258] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 02:50:43:67:ed:34
[   22.942181] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   22.948740] ehci-pci: EHCI PCI platform driver
[   22.953271] ehci-orion: EHCI orion driver
[   22.957352] orion-ehci orion-ehci.0: EHCI Host Controller
[   22.962822] orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
[   22.970651] orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
[   22.991233] orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
[   22.997359] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   23.004198] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   23.011473] usb usb1: Product: EHCI Host Controller
[   23.016375] usb usb1: Manufacturer: Linux 3.13.1-kirkwood-tld-2 ehci_hcd
[   23.023121] usb usb1: SerialNumber: orion-ehci.0
[   23.028220] hub 1-0:1.0: USB hub found
[   23.032050] hub 1-0:1.0: 1 port detected
[   23.036458] mousedev: PS/2 mouse device common for all mice
[   23.042404] rtc-mv rtc-mv: rtc core: registered rtc-mv as rtc0
[   23.048335] i2c /dev entries driver
[   23.052425] drop_monitor: Initializing network drop monitor service
[   23.058905] TCP: cubic registered
[   23.062272] NET: Registered protocol family 17
[   23.066833] Key type dns_resolver registered
[   23.071616] registered taskstats version 1
[   23.076577] rtc-mv rtc-mv: setting system clock to 2014-02-11 19:57:08 UTC (1392148628)
[   23.085527] Freeing unused kernel memory: 208K (c0623000 - c0657000)
[   23.161862] udevd[54]: starting version 175
[   23.309703] SCSI subsystem initialized
[   23.351359] usb 1-1: new high-speed USB device number 2 using orion-ehci
[   23.383373] sata_mv sata_mv.0: cannot get optional clkdev
[   23.388853] sata_mv sata_mv.0: slots 32 ports 1
[   23.438269] scsi0 : sata_mv
[   23.451376] ata1: SATA max UDMA/133 irq 21
[   23.514785] usb 1-1: New USB device found, idVendor=0718, idProduct=0708
[   23.521551] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   23.528735] usb 1-1: Product: Micro
[   23.532257] usb 1-1: Manufacturer: Memorex
[   23.536375] usb 1-1: SerialNumber: 0707330DB5DBC920
[   23.557907] usb-storage 1-1:1.0: USB Mass Storage device detected
[   23.564347] scsi1 : usb-storage 1-1:1.0
[   23.569730] usbcore: registered new interface driver usb-storage
[   23.801245] ata1: SATA link down (SStatus 0 SControl F300)
[   24.563633] scsi 1:0:0:0: Direct-Access     Memorex  Micro            PMAP PQ: 0 ANSI: 4
[   24.600216] sd 1:0:0:0: [sda] 7570752 512-byte logical blocks: (3.87 GB/3.60 GiB)
[   24.608692] sd 1:0:0:0: [sda] Write Protect is off
[   24.614182] sd 1:0:0:0: [sda] No Caching mode page found
[   24.619532] sd 1:0:0:0: [sda] Assuming drive cache: write through
[   24.629805] sd 1:0:0:0: [sda] No Caching mode page found
[   24.635211] sd 1:0:0:0: [sda] Assuming drive cache: write through
[   24.642679]  sda: sda1
[   24.647930] sd 1:0:0:0: [sda] No Caching mode page found
[   24.653312] sd 1:0:0:0: [sda] Assuming drive cache: write through
[   24.659435] sd 1:0:0:0: [sda] Attached SCSI removable disk
[   24.675466] sd 1:0:0:0: Attached scsi generic sg0 type 0
[   33.869693] netpoll: netconsole: local port 6665
[   33.874414] netpoll: netconsole: local IPv4 address 10.10.10.6
[   33.880271] netpoll: netconsole: interface 'eth0'
[   33.885027] netpoll: netconsole: remote port 6666
[   33.889751] netpoll: netconsole: remote IPv4 address 10.10.10.4
[   33.895764] netpoll: netconsole: remote ethernet address ff:ff:ff:ff:ff:ff
[   33.902705] netpoll: netconsole: device eth0 not up yet, forcing it
[   33.910713] mv643xx_eth_port mv643xx_eth_port.0 eth0: link down
[   37.030038] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[   37.042367] console [netcon0] enabled
[   37.046054] netconsole: network logging started
[   37.094352] F2FS-fs (sda1): Magic Mismatch, valid(0xf2f52010) - read(0x39c60)
[   37.101657] F2FS-fs (sda1): Can't find a valid F2FS filesystem in 1th superblock
[   37.109832] F2FS-fs (sda1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[   37.116744] F2FS-fs (sda1): Can't find a valid F2FS filesystem in 2th superblock
[   37.248186] uhci_hcd: USB Universal Host Controller Interface driver
[   37.261458] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[   37.277435] hidraw: raw HID events driver (C) Jiri Kosina
[   37.285173] usbcore: registered new interface driver usbhid
[   37.290816] usbhid: USB HID core driver

The boot process basically hangs there.

So how (and what) do I change the Magic number to? How do I configure nc so I can have an interactive session so I can change the appropriate uboot firmware variable to boot the Debian image?

Viewing all articles
Browse latest Browse all 46971

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>