Welcome! Log In Create A New Profile

Advanced

Goflex net upgrade went awry

Posted by jj 
jj
Goflex net upgrade went awry
March 13, 2019 07:36PM
Hi all,

My gfn had been running Debian Jessie for a while until last weekend. I went back here, decided to upgrade it to Stretch and downloaded Bohdi's Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2. I am sure I followed Bohdi's instructions very closely. After the upgrade, the device refuses to boot in Stretch. I get the rescue prompt instead when ssh in the box.

I don't really understand what is wrong. Please help.

Thank you. I welcome and appreciate your suggestions.

Below is the dmesg from the rescue prompt.
rescue:~# dmesg
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 2.6.32.18-dockstar (root@stfu.tcbnet) (gcc version 4.3.5 (Buildroot 2010.08) ) #1 Thu Feb 17 03:09:57 EST 2011
[    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 Net
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat c0652758, node_mem_map c06cf000
[    0.000000]   Normal zone: 256 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32512 pages, LIFO batch:7
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
[    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: 128MB = 128MB total
[    0.000000] Memory: 122836KB available (5968K code, 708K data, 128K init, 0K highmem)
[    0.000000] SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:114
[    0.000000] Console: colour dummy device 80x30
[   21.474971] Calibrating delay loop... 1192.75 BogoMIPS (lpj=5963776)
[   21.714929] Security Framework initialized
[   21.714951] SELinux:  Disabled at boot.
[   21.714981] Mount-cache hash table entries: 512
[   21.715288] Initializing cgroup subsys ns
[   21.715305] Initializing cgroup subsys cpuacct
[   21.715316] Initializing cgroup subsys devices
[   21.715325] Initializing cgroup subsys freezer
[   21.715333] Initializing cgroup subsys net_cls
[   21.715379] CPU: Testing write buffer coherency: ok
[   21.716182] devtmpfs: initialized
[   21.717929] regulator: core version 0.5
[   21.718158] NET: Registered protocol family 16
[   21.718693] Kirkwood: MV88F6281-A0, TCLK=200000000.
[   21.718706] Feroceon L2: Enabling L2
[   21.718741] Feroceon L2: Cache support initialised.
[   21.719175] initial MPP regs: 01111111 11113322 00001111 00100000 00000000 00000000 00000000
[   21.719196]   final MPP regs: 01111111 11113322 00001111 00000000 00000000 00000000 00000000
[   21.721831] bio: create slab <bio-0> at 0
[   21.722106] vgaarb: loaded
[   21.722383] SCSI subsystem initialized
[   21.722634] usbcore: registered new interface driver usbfs
[   21.722700] usbcore: registered new interface driver hub
[   21.722786] usbcore: registered new device driver usb
[   21.723226] Switching to clocksource orion_clocksource
[   21.728548] NET: Registered protocol family 2
[   21.728811] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[   21.729627] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[   21.729727] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[   21.729780] TCP: Hash tables configured (established 4096 bind 4096)
[   21.729789] TCP reno registered
[   21.729951] NET: Registered protocol family 1
[   21.730240] RPC: Registered udp transport module.
[   21.730250] RPC: Registered tcp transport module.
[   21.730257] RPC: Registered tcp NFSv4.1 backchannel transport module.
[   21.730398] NetWinder Floating Point Emulator V0.97 (double precision)
[   21.730647] audit: initializing netlink socket (disabled)
[   21.730680] type=2000 audit(0.241:1): initialized
[   21.737472] VFS: Disk quotas dquot_6.5.2
[   21.737733] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[   21.740321] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[   21.741926] Registering the dns_resolver key type
[   21.741978] Slow work thread pool: Starting up
[   21.742096] Slow work thread pool: Ready
[   21.742106] JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[   21.742873] fuse init (API version 7.13)
[   21.743365] SGI XFS with security attributes, large block/inode numbers, no debug enabled
[   21.744917] msgmni has been set to 240
[   21.747008] alg: No test for stdrng (krng)
[   21.747162] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[   21.747175] io scheduler noop registered
[   21.747183] io scheduler anticipatory registered
[   21.747191] io scheduler deadline registered
[   21.747450] io scheduler cfq registered (default)
[   21.753421] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[   21.753882] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
[   22.138075] console [ttyS0] enabled
[   22.142158] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit)
[   22.150782] Scanning device for bad blocks
[   22.230809] 4 cmdlinepart partitions found on MTD device orion_nand
[   22.237124] Creating 4 MTD partitions on "orion_nand":
[   22.242293] 0x000000000000-0x000000100000 : "u-boot"
[   22.247855] 0x000000100000-0x000000500000 : "uImage"
[   22.253310] 0x000000500000-0x000002500000 : "rootfs"
[   22.258771] 0x000002500000-0x000010000000 : "data"
[   22.264478] UBI: attaching mtd2 to ubi0
[   22.268336] UBI: physical eraseblock size:   131072 bytes (128 KiB)
[   22.274648] UBI: logical eraseblock size:    129024 bytes
[   22.280070] UBI: smallest flash I/O unit:    2048
[   22.284806] UBI: sub-page size:              512
[   22.289445] UBI: VID header offset:          512 (aligned 512)
[   22.295312] UBI: data offset:                2048
[   22.359739] UBI: attached mtd2 to ubi0
[   22.363526] UBI: MTD device name:            "rootfs"
[   22.368596] UBI: MTD device size:            32 MiB
[   22.373505] UBI: number of good PEBs:        256
[   22.378144] UBI: number of bad PEBs:         0
[   22.382608] UBI: max. allowed volumes:       128
[   22.387256] UBI: wear-leveling threshold:    4096
[   22.391981] UBI: number of internal volumes: 1
[   22.396455] UBI: number of user volumes:     1
[   22.400920] UBI: available PEBs:             0
[   22.405393] UBI: total number of reserved PEBs: 256
[   22.410295] UBI: number of PEBs reserved for bad PEB handling: 2
[   22.416337] UBI: max/mean erase counter: 1/0
[   22.420628] UBI: image sequence number: 1653365787
[   22.425458] UBI: background thread "ubi_bgt0d" started, PID 38
[   22.431492] MV-643xx 10/100/1000 ethernet driver version 1.4
[   22.437270] mv643xx_eth smi: probed
[   22.442573] net eth0: port 0 with MAC address 00:10:75:26:21:e1
[   22.448617] console [netcon0] enabled
[   22.452298] netconsole: network logging started
[   22.456866] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   22.463472] orion-ehci orion-ehci.0: Marvell Orion EHCI
[   22.468770] orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
[   22.503278] orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
[   22.523264] orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
[   22.529265] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   22.536097] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   22.543363] usb usb1: Product: Marvell Orion EHCI
[   22.548089] usb usb1: Manufacturer: Linux 2.6.32.18-dockstar ehci_hcd
[   22.554567] usb usb1: SerialNumber: orion-ehci.0
[   22.559480] usb usb1: configuration #1 chosen from 1 choice
[   22.565211] hub 1-0:1.0: USB hub found
[   22.569010] hub 1-0:1.0: 1 port detected
[   22.573174] Initializing USB Mass Storage driver...
[   22.578186] usbcore: registered new interface driver usb-storage
[   22.584242] USB Mass Storage support registered.
[   22.589090] mice: PS/2 mouse device common for all mice
[   22.594409] i2c /dev entries driver
[   22.598681] device-mapper: uevent: version 1.0.3
[   22.603734] device-mapper: ioctl: 4.15.0-ioctl (2009-04-01) initialised: dm-devel@redhat.com
[   22.612308] cpuidle: using governor ladder
[   22.616576] cpuidle: using governor menu
[   22.620618] Registered led device: status:green:health
[   22.625869] Registered led device: status:orange:misc
[   22.631002] mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver
[   22.637414] mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver
[   22.683299] mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
[   22.723296] mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )
[   22.763294] mv_xor mv_xor.2: Marvell XOR: ( xor cpy )
[   22.803293] mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
[   22.809100] Netfilter messages via NETLINK v0.30.
[   22.813902] nf_conntrack version 0.5.0 (1921 buckets, 7684 max)
[   22.820325] CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
[   22.827774] nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or
[   22.835734] sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
[   22.844257] ip_tables: (C) 2000-2006 Netfilter Core Team
[   22.849642] TCP cubic registered
[   22.852888] NET: Registered protocol family 17
[   22.857409] Gating clock of unused units
[   22.857418] before: 0x00dfc3fd
[   22.857424]  after: 0x00c7c1c9
[   22.857754] registered taskstats version 1
[   22.862561] Initalizing network drop monitor service
[   22.867652] md: Waiting for all devices to be available before autodetect
[   22.874483] md: If you don't use raid, use raid=noautodetect
[   22.880562] md: Autodetecting RAID arrays.
[   22.884700] md: Scanned 0 and added 0 devices.
[   22.889161] md: autorun ...
[   22.891960] md: ... autorun DONE.
[   22.975299] UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[   22.981341] UBIFS: mounted read-only
[   22.984959] UBIFS: file system size:   30836736 bytes (30114 KiB, 29 MiB, 239 LEBs)
[   22.992653] UBIFS: journal size:       9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
[   23.000003] UBIFS: media format:       w4/r0 (latest is w4/r0)
[   23.005871] UBIFS: default compressor: lzo
[   23.009987] UBIFS: reserved for root:  0 bytes (0 KiB)
[   23.015802] VFS: Mounted root (ubifs filesystem) readonly on device 0:16.
[   23.022663] Freeing init memory: 128K
[   25.997445] eth0: link up, 1000 Mb/s, full duplex, flow control disabled
rescue:~#

Re: Goflex net upgrade went awry
March 13, 2019 08:11PM
Hi, your Go Flex is booting from the UBI flash partition, not from Bohdi's 4.12 rootfs.

To figure out why that is happening you need to print the u-boot variables. If fw_printenv is available from the rescue prompt you maybe able to get it from there, otherwise you will need a serial console and share the serial bootlog.

You could also try creating a new boot usb and see if that works. I'm confused why the ubi partition is labelled 'rootfs', this could cause you issues.

J
Re: Goflex net upgrade went awry
March 13, 2019 09:04PM
jj,

Yes, please do what J recommended above. Post the fw_printenv output, if you don't have serial console.

Since you were careful in creating the rootfs:

My gfn had been running Debian Jessie for a while until last weekend. I went back here, decided to upgrade it to Stretch and downloaded Bohdi's Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2. I am sure I followed Bohdi's instructions very closely. After the upgrade, the device refuses to boot in Stretch. I get the rescue prompt instead when ssh in the box.

The only possible reason why it did not boot could be the envs.

But also describe the LED behavior from the time you power up until the box seems to have stopped. That will provide some clues.

-bodhi
===========================
Forum Wiki
bodhi's corner
jj
Re: Goflex net upgrade went awry
March 14, 2019 06:25AM
Thanks, J and Bodhi.

Please see the fw_printenv output below.

At power on, the LED is flashing green for a few second, then flashing orange for a few second. It stays solid orange after that. The sata drive used is formatted in ext3 and is inserted in the right sata slot (device's right).


rescue:~# fw_printenv
ethact=egiga0
bootdelay=3
baudrate=115200
mainlineLinux=yes
console=ttyS0,115200
led_init=green blinking
led_exit=green off
led_error=orange blinking
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
mtdids=nand0=orion_nand
partition=nand0,2
stdin=serial
stdout=serial
stderr=serial
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
force_rescue=0
force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
usb_scan_list=1 2 3 4
usb_scan_1=usb=0:1 dev=sda1
usb_scan_2=usb=1:1 dev=sdb1
usb_scan_3=usb=2:1 dev=sdc1
usb_scan_4=usb=3:1 dev=sdd1
usb_init=run usb_scan
usb_device=0:1
usb_root=/dev/sda1
usb_rootfstype=ext2
usb_rootdelay=10
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
ipaddr=10.10.10.6
ncip=10.10.10.5
ncipk=10.10.10.4
serverip=10.10.10.3
preboot=run nc_test nc_start
nc_test=ping $ncip
nc_start=setenv stdin nc; setenv stdout nc; setenv stderr nc; version
arcNumber=3089
rescue_installed=1
ethaddr=0a:b2:75:26:90:ee
sata_device=0:1
sata_root=/dev/sda1
sata_rootfstype=ext3
sata_rootdelay=10
sata_set_bootargs=setenv bootargs console=$console root=$sata_root rootdelay=$sata_rootdelay rootfstype=$sata_rootfstype $mtdparts $sata_custom_params
sata_boot=ide reset; mw 0x800000 0 1; ext2load ide $sata_device 0x800000 /boot/uImage; if ext2load ide $sata_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
sata_bootcmd=run sata_set_bootargs; run sata_boot
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run sata_bootcmd; run rescue_bootcmd; run pogo_bootcmd; reset
rescue:~#

Re: Goflex net upgrade went awry
March 14, 2019 05:45PM
jj,

THere are a couple of problems.

1. Your uboot is quite old. Based on the envs, it must be about 2012. This uboot does not recognize FDT kernel. So when you prepare the rootfs you must use section 4.

Quote

4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Skip this step if you have installed the latest U-Boot for Kirkwood (or are installing this u-boot at the same time).

Please replace kirkwood-goflexnet.dtb below with the correct DTB name for your box (see the folder /media/sdb1/boot/dts for the exact spelling of your Kirkwood box name).

Generate the uImage with DTB embedded inside:
cd /media/sdb1/boot
cp -a zImage-4.12.1-kirkwood-tld-1 zImage.fdt
cat dts/kirkwood-goflexnet.dtb >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.12.1-kirkwood-tld-1 -d zImage.fdt uImage
sync

The kernel has not completed booting. Because the rootfs has not been prepared correctly to boot with this old uboot. Did you do step 4?

2. You need to adjust the env so it will boot correctly with this rootfs. It is OK to run old uboot. But the envs will need adjustment.

=====

Perhaps you should install the new u-boot from inside rescue system. If you install new u-boot 2017.07-tld-1 then don't do Step 4 while creating rootfs.

Let's see your answer to the 1 before we go on.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Goflex net upgrade went awry
March 14, 2019 06:57PM
From the rescue prompt can you see the sata drive? It would be good to see what is in the /boot directory.

Though Bodhi's sure to be right about appending the dtb, it's odd to me that the box isn't just crashing when loading the kernel and instead is loading the rescue system from the flash.

If you can give us an fdisk -l output and then mount the sata drive and show the disk layout that would help. You maybe able to get it to boot Stretch before upgrading the u-boot.
jj
Re: Goflex net upgrade went awry
March 14, 2019 07:45PM
Thanks, Bodhi.

I have tried both with and without the section 4. Same behavior. I have also tried it on a usb thumb drive, ext2 formated, still no go.

Indeed, I'd upgrade uboot from inside rescue. Could you please walk me through it?

bodhi Wrote:
-------------------------------------------------------
> jj,
>
> THere are a couple of problems.
>
> 1. Your uboot is quite old. Based on the envs, it
> must be about 2012. This uboot does not recognize
> FDT kernel. So when you prepare the rootfs you
> must use section 4.
>
>
Quote

4. Create uImage with embedded DTB for
> booting with older u-boots (2012 or earlier). Skip
> this step if you have installed the latest U-Boot
> for Kirkwood (or are installing this u-boot at the
> same time).
>
> Please replace kirkwood-goflexnet.dtb below with
> the correct DTB name for your box (see the folder
> /media/sdb1/boot/dts for the exact spelling of
> your Kirkwood box name).
>
> Generate the uImage with DTB embedded inside:
> cd /media/sdb1/boot
> cp -a zImage-4.12.1-kirkwood-tld-1 zImage.fdt
> cat dts/kirkwood-goflexnet.dtb >> zImage.fdt
> mv uImage uImage.orig
> mkimage -A arm -O linux -T kernel -C none -a
> 0x00008000 -e 0x00008000 -n
> Linux-4.12.1-kirkwood-tld-1 -d zImage.fdt uImage
> sync
>
> The kernel has not completed booting. Because the
> rootfs has not been prepared correctly to boot
> with this old uboot. Did you do step 4?
>
> 2. You need to adjust the env so it will boot
> correctly with this rootfs. It is OK to run old
> uboot. But the envs will need adjustment.
>
> =====
>
> Perhaps you should install the new u-boot from
> inside rescue system. If you install new
> u-boot
> 2017.07-tld-1
then don't do Step 4 while
> creating rootfs.
>
> Let's see your answer to the 1 before we go on.
jj
Re: Goflex net upgrade went awry
March 14, 2019 07:51PM
Thanks, J.

I have not tried to mount the sata drive since I did not see it in the dmesg output.

jj


jdwl 101 Wrote:
-------------------------------------------------------
> From the rescue prompt can you see the sata drive?
> It would be good to see what is in the /boot
> directory.
>
> Though Bodhi's sure to be right about appending
> the dtb, it's odd to me that the box isn't just
> crashing when loading the kernel and instead is
> loading the rescue system from the flash.
>
> If you can give us an fdisk -l output and then
> mount the sata drive and show the disk layout that
> would help. You maybe able to get it to boot
> Stretch before upgrading the u-boot.
Re: Goflex net upgrade went awry
March 14, 2019 10:20PM
Ok, that's odd as well.

how about the usb stick you tried? Can you show us the partition table, file structure and contents of /boot?

For the u-boot install instructions are here;
U-boot download and install thread

it should be straightforward as you've shown fw_printenv is present in the rescue system and there's no bad block in the dmesg.

Be sure to flash the default envs (step 8) and that the partition you want to boot from is labelled rootfs.
Re: Goflex net upgrade went awry
March 16, 2019 01:19AM
OK jj,

Use a USB drive. Create a new rootfs using Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 from the release thread. Like you did before with the HDD (remember to be root, use Ext3, and do step 4).

And come back here I wil help you boot that with the current u-boot (without having to install new u-boot at all).

After you booted into Debian, you can take your time to think about installing new u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner
jj
Re: Goflex net upgrade went awry
March 16, 2019 05:18PM
Thanks, J. Please see my reply to Bodhi's post below.
jj
Re: Goflex net upgrade went awry
March 16, 2019 06:34PM
Thanks, Bodhi.

rootfs on usb drive did not work. The LED was flashing green and then off. I used a sata drive instead. I can now ssh to the box and get a prompt.

Please help me in making it boot in Strecth. I will definitely upgrade the uboot when it boots.

Thank you.
-jj

On a debian machine,
root@jj:~# fdisk -l /dev/sdb 

Disk /dev/sdb: 74.5 GiB, 80026361856 bytes, 156301488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4372b4ee

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1        2048 156301487 156299440 74.5G 83 Linux

root@jj:~#
root@jj:~# mke2fs -t ext3 -L rootfs /dev/sdb1 
mke2fs 1.42.12 (29-Aug-2014)
/dev/sdb1 contains a ext3 file system labelled 'rootfs'
	last mounted on /media/adminle/rootfs on Sat Mar 16 18:30:26 2019
Proceed anyway? (y,n) y
Creating filesystem with 19537430 4k blocks and 4890624 inodes
Filesystem UUID: e631ee3c-c42b-4336-a409-ab44e29a5782
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   

root@jj:~#
root@jj:~# tune2fs -l /dev/sdb1 
tune2fs 1.42.12 (29-Aug-2014)
Filesystem volume name:   rootfs
Last mounted on:          <not available>
Filesystem UUID:          e631ee3c-c42b-4336-a409-ab44e29a5782
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype sparse_super large_file
Filesystem flags:         signed_directory_hash 
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              4890624
Block count:              19537430
Reserved block count:     976871
Free blocks:              19184440
Free inodes:              4890613
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1019
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Filesystem created:       Sat Mar 16 18:34:55 2019
Last mount time:          n/a
Last write time:          Sat Mar 16 18:34:59 2019
Mount count:              0
Maximum mount count:      -1
Last checked:             Sat Mar 16 18:34:55 2019
Check interval:           0 (<none>)
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:	          256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      c8bae5ec-1e86-4b9d-aff6-81863722b192
Journal backup:           inode blocks
root@jj:~#
root@jj:~# mount -t ext3 /dev/sdb1 /media/usb
root@jj:~# cd /media/usb
root@jj:/media/usb# tar -xjf Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2
root@jj:/media/usb# cd boot/
root@jj:/media/usb/boot# ls -lart
total 36260
drwxr-xr-x  3 root root    4096 Dec 31  1969 ./
drwxr-xr-x 21 root root    4096 Feb 16  2015 ../
drwxr-xr-x  2 root root    4096 Jul 15  2017 dts/
-rw-r--r--  1 root root  153501 Jul 15  2017 config-4.12.1-kirkwood-tld-1
-rwxr-xr-x  1 root root 3821528 Jul 16  2017 zImage-4.12.1-kirkwood-tld-1*
-rw-------  1 root root 3821528 Jul 16  2017 vmlinuz-4.12.1-kirkwood-tld-1
-rw-------  1 root root 2504031 Jul 16  2017 System.map-4.12.1-kirkwood-tld-1
-rw-r--r--  1 root root 8435004 Jul 16  2017 linux-headers-4.12.1-kirkwood-tld-1_1.0_armel.deb
-rw-r--r--  1 root root 3821592 Jul 20  2017 uImage
-rw-r--r--  1 root root 7245632 Jul 23  2017 initrd.img-4.12.1-kirkwood-tld-1
-rw-r--r--  1 root root 7245696 Jul 23  2017 uInitrd
root@jj:/media/usb/boot# cp -a zImage-4.12.1-kirkwood-tld-1  zImage.fdt
root@jj:/media/usb/boot# cat dts/kirkwood-goflexnet.dtb  >> zImage.fdt
root@jj:/media/usb/boot# mv uImage uImage.orig
root@jj:/media/usb/boot# mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.12.1-kirkwood-tld-1 -d zImage.fdt  uImage
Image Name:   Linux-4.12.1-kirkwood-tld-1
Created:      Sat Mar 16 19:08:47 2019
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    3833423 Bytes = 3743.58 kB = 3.66 MB
Load Address: 00008000
Entry Point:  00008000
root@jj:/media/usb/boot# sync
root@jj:/media/usb/boot#

Power up and ssh to the box.
rescue:~# fdisk -l
rescue:~# cat /etc/fw_env.config 
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd0         0xc0000       0x20000   0x20000
rescue:/# cat /etc/rescue.version 
20110217
rescue:~#


bodhi Wrote:
-------------------------------------------------------
> OK jj,
>
> Use a USB drive. Create a new rootfs using
> Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2
> from the
> release
> thread
. Like you did before with the HDD
> (remember to be root, use Ext3, and do step 4).
>
> And come back here I wil help you boot that with
> the current u-boot (without having to install new
> u-boot at all).
>
> After you booted into Debian, you can take your
> time to think about installing new u-boot.
Re: Goflex net upgrade went awry
March 16, 2019 07:24PM
jj,

There 2 different approaches in making this rootf boot with the old u-boot

1. Change rootfs to conform to what uboot expects.

/etc/fstab


2. Change u-boot envs to conform to what the rootf expects.

usb_rootfstype=ext2
usb_root=/dev/sda1
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
usb_init=run usb_scan
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run sata_bootcmd; run rescue_bootcmd; run pogo_bootcmd; reset

Since you don't have serial console, changing envs is not preferred. We'll try 1 first.

1. Temporarily fix rootfs.

a. The ony drive that should be connected is the USB. Unplug the HDD if it is attached.

b. Modify the fstab of the new rootfs while rescue system. Assuming the USB rootf is mounted on /media/sda1.

cat /media/sda1/etc/fstab
LABEL=rootfs   /               ext3    noatime,user_xattr,acl,errors=remount-ro 0 1

c. Change this to
/dev/sda1   /               ext3    noatime,user_xattr,acl,errors=remount-ro 0 1
d. sync and reboot.
sync 
shutdow -r now


Then look for a new dynamic IP for this box, or try its name (it might be 40 seconds before it will finish booting up and appear)
ping debian.local

e. If the above did not work, try again with the ftsab without any root device, comment out root device in step c. And sync, reboot.

#/dev/sda1   /               ext3    noatime,user_xattr,acl,errors=remount-ro 0 1

-bodhi
===========================
Forum Wiki
bodhi's corner
jj
Re: Goflex net upgrade went awry
March 17, 2019 01:58PM
Thanks, Bodhi.

This temporary fix does not work for me. I have created 2 usb drives, one ext3 and one ext2, and changed fstab as you suggested. At power up, the LED flashes for a while then turns off. No access to the device.

How risky is it to upgrade uboot from rescue?

bodhi Wrote:
-------------------------------------------------------
> jj,
>
> There 2 different approaches in making this rootf
> boot with the old u-boot
>
> 1. Change rootfs to conform to what uboot
> expects.
>
>
> /etc/fstab
>
>
>
> 2. Change u-boot envs to conform to what the rootf
> expects.
>
>
> usb_rootfstype=ext2
> usb_root=/dev/sda1
> usb_set_bootargs=setenv bootargs console=$console
> root=$usb_root rootdelay=$usb_rootdelay
> rootfstype=$usb_rootfstype $mtdparts
> $usb_custom_params
> usb_init=run usb_scan
> usb_bootcmd=run usb_init; run usb_set_bootargs;
> run usb_boot
> bootcmd=usb start; run force_rescue_bootcmd; run
> ubifs_bootcmd; run usb_bootcmd; usb stop; run
> sata_bootcmd; run rescue_bootcmd; run
> pogo_bootcmd; reset
>
>
> Since you don't have serial console, changing envs
> is not preferred. We'll try 1 first.
>
> 1. Temporarily fix rootfs.
>
> a. The ony drive that should be connected is the
> USB. Unplug the HDD if it is attached.
>
> b. Modify the fstab of the new rootfs while rescue
> system. Assuming the USB rootf is mounted on
> /media/sda1.
>
> cat /media/sda1/etc/fstab
>
> LABEL=rootfs   /               ext3   
> noatime,user_xattr,acl,errors=remount-ro 0 1
>
>
> c. Change this to
>
> /dev/sda1   /               ext3   
> noatime,user_xattr,acl,errors=remount-ro 0 1
>
> d. sync and reboot.
>
> sync 
> shutdow -r now
>
>
>
> Then look for a new dynamic IP for this box, or
> try its name (it might be 40 seconds before it
> will finish booting up and appear)
>
> ping debian.local
>
>
> e. If the above did not work, try again with the
> ftsab without any root device, comment out root
> device in step c. And sync, reboot.
>
>
> #/dev/sda1   /               ext3   
> noatime,user_xattr,acl,errors=remount-ro 0 1
> 
Re: Goflex net upgrade went awry
March 17, 2019 03:56PM
jj,

> How risky is it to upgrade uboot from rescue?

Not risky. The procedure has been tested thousand times by users. But as always, if there is problem (power outage, typos,...) then you need serial console to rescue it.

Go ahead and use the installation instruction, list the commands you about to run, I or J will catch any error or strange outputs while you are doing it.

Just don't reboot before everything checked out.

-bodhi
===========================
Forum Wiki
bodhi's corner
jj
Re: Goflex net upgrade went awry
March 18, 2019 07:37PM
Thanks, Bodhi.

I just had it done. There were no errors. Please double check the output below and let me know if everything is ok before I reboot the device.

Thanks in advance.

rescue:/tmp# cat /etc/fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd0         0xc0000       0x20000   0x20000

rescue:/tmp# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 02000000 00020000 "rootfs"
mtd3: 0db00000 00020000 "data"
Step 3
rescue:/tmp# nanddump --noecc --omitoob -l 0x80000 -f mtd0 /dev/mtd0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00080000...
Step 4
rescue:/tmp# dmesg | grep -i 'bad'
[   22.150815] Scanning device for bad blocks
[   22.378178] UBI: number of bad PEBs:         0
[   22.410329] UBI: number of PEBs reserved for bad PEB handling: 2
Step 6
rescue:/tmp# flash_erase /dev/mtd0 0 4
Erase Total 4 Units
Performing Flash Erase of length 131072 at offset 0x60000 done
Step 7
rescue:/tmp# nandwrite /dev/mtd0 uboot.kwb
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Step 8d
rescue:/tmp# /usr/sbin/flash_erase /dev/mtd0 0xc0000 1
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0xc0000 done
rescue:/tmp# /usr/sbin/nandwrite -s 786432 /dev/mtd0 uboot.2016.05-tld-1.environment.img
Writing data to block 6 at offset 0xc0000
step 8e
rescue:/tmp# fw_setenv arcNumber 3089
rescue:/tmp# fw_setenv machid
rescue:/tmp# fw_setenv mtdparts 'mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)'
rescue:/tmp# fw_setenv ethaddr '00:10:b5:26:a1:e1'
rescue:/tmp# fw_setenv bootcmd_uenv 'run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi; sleep 3'
Step 10
rescue:/tmp# fw_setenv 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_netcons
ole; fi'
rescue:/tmp# fw_setenv preboot 'run preboot_nc'
rescue:/tmp# fw_setenv ipaddr '10.87.9.55'
rescue:/tmp# fw_setenv serverip '10.87.9.95'
rescue:/tmp# fw_printenv
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=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
bootdelay=10
bootdev=usb
device=0:1
devices=usb ide mmc
disks=0 1 2 3
ethact=egiga0
if_netconsole=ping $serverip
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb_addr=0x1c00000
load_initrd_addr=0x1100000
load_uimage_addr=0x800000
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
mainlineLinux=yes
mtdids=nand0=orion_nand
partition=nand0,2
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
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;
stderr=serial
stdin=serial
stdout=serial
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_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
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
usb_ready_retry=15
arcNumber=3089
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
ethaddr=00:10:b5:26:a1:e1
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi; sleep 3
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
preboot=run preboot_nc
ipaddr=10.87.9.55
serverip=10.87.9.95
rescue:/tmp#


bodhi Wrote:
-------------------------------------------------------
> jj,
>
> > How risky is it to upgrade uboot from rescue?
>
> Not risky. The procedure has been tested thousand
> times by users. But as always, if there is problem
> (power outage, typos,...) then you need serial
> console to rescue it.
>
> Go ahead and use the installation instruction,
> list the commands you about to run, I or J will
> catch any error or strange outputs while you are
> doing it.
>
> Just don't reboot before everything checked out.
Re: Goflex net upgrade went awry
March 18, 2019 09:09PM
Hi jj,

One question, which uboot image did you flash? Your extract says 'uboot.kwb', was it this one?

nandwrite /dev/mtd0 uboot.2017.07-tld-1.goflexnet.mtd0.kwb

From your envs I take it your wanting to load from sata as well?

Everything else looks accurate to me. Though Bodhi may see something that I've missed.

Take a look at the netconsole setup, you will want to connect it to watch the first boot (through uboot to kernel boot) to make sure everything works 100%

J
Re: Goflex net upgrade went awry
March 18, 2019 11:25PM
Yes. Everything looks good except 2 questions:

1. What J has mentioned: is u-boot.kwb the right u-boot (uboot.2017.07-tld-1.goflexnet.mtd0.kwb)?

rescue:/tmp# nandwrite /dev/mtd0 uboot.kwb

2. Is your router IP 10.87.9.1 ?

ipaddr=10.87.9.55
serverip=10.87.9.95
And you have a box that can run netconsole, and that box IP address is 10.87.9.95?

-bodhi
===========================
Forum Wiki
bodhi's corner
jj
Re: Goflex net upgrade went awry
March 19, 2019 09:20AM
Hi J and Bodhi,

Thank you for taking your time to check the log.

Yes, I downloaded the latest uboot, uboot.2017.07-tld-1.goflexnet.bodhi.tar, and renamed the file to uboot.kwb after untar.

I have another Debian box at 10.87.9.95 and my main router is at 10.87.9.1.

I do want to boot from sata that's why I set the bootcmd_uenv, last cmd in step 8e. Will this prevent gfn from booting from usb?

I think I missed step 8f or did it incorrectly. I'll rerun the cmds before reboot.

-jj
Re: Goflex net upgrade went awry
March 19, 2019 04:26PM
You will be fine to still boot from usb if you want to.

Good catch with the dtb file (8f), the kernel won't boot without it. With that set you will be good to boot.

Still get the netconsole running and capture the uboot log.
Re: Goflex net upgrade went awry
March 19, 2019 05:58PM
jj Wrote:
-------------------------------------------------------
> Hi J and Bodhi,
>
> Thank you for taking your time to check the log.
>
> Yes, I downloaded the latest uboot,
> uboot.2017.07-tld-1.goflexnet.bodhi.tar, and
> renamed the file to uboot.kwb after untar.
>
> I have another Debian box at 10.87.9.95 and my
> main router is at 10.87.9.1.
>
> I do want to boot from sata that's why I set the
> bootcmd_uenv, last cmd in step 8e. Will this
> prevent gfn from booting from usb?
>
> I think I missed step 8f or did it incorrectly.
> I'll rerun the cmds before reboot.
>
> -jj

No it does not prevent booting from usb.

As long as usb is on “devices” list. It will boot usb if HDD is not plugged in.

-bodhi
===========================
Forum Wiki
bodhi's corner
jj
Re: Goflex net upgrade went awry
March 19, 2019 08:29PM
Thank you both, jdwl101 and bodhi, for your great help. It's back in business now with the new uboot and debian stretch????

I noticed that people run openwrt on gfn. I wonder if it's possible to dual boot openwrt and debian.

Again thank you for your time, your patience and your kindness.
-jj
Re: Goflex net upgrade went awry
March 19, 2019 09:30PM
jj Wrote:
-------------------------------------------------------
> Thank you both, jdwl101 and bodhi, for your great
> help. It's back in business now with the new uboot
> and debian stretch????
>
> I noticed that people run openwrt on gfn. I wonder
> if it's possible to dual boot openwrt and debian.
>
> Again thank you for your time, your patience and
> your kindness.
> -jj

Sure, with the newly installed uboot you can:

https://forum.doozan.com/read.php?4,42279

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Goflex net upgrade went awry
March 20, 2019 12:58AM
Well done on resurrecting your GoFlex, they're great little boxes.
jj
Re: Goflex net upgrade went awry
March 20, 2019 02:00PM
Thanks, Bodhi.

There are some boot env settings that need to be set when installing LEDE. Could you please shed me some light upon what will be the correct boot env. settings for gfn, especially the mtdparts variable?


bodhi Wrote:
-------------------------------------------------------
> jj Wrote:
> -------------------------------------------------------
> > Thank you both, jdwl101 and bodhi, for your
> great
> > help. It's back in business now with the new
> uboot
> > and debian stretch????
> >
> > I noticed that people run openwrt on gfn. I
> wonder
> > if it's possible to dual boot openwrt and
> debian.
> >
> > Again thank you for your time, your patience
> and
> > your kindness.
> > -jj
>
> Sure, with the newly installed uboot you can:
>
> https://forum.doozan.com/read.php?4,42279
jj
Re: Goflex net upgrade went awry
March 20, 2019 02:02PM
jdwl101 Wrote:
-------------------------------------------------------
> Well done on resurrecting your GoFlex, they're
> great little boxes.

Indeed, they are.
Re: Goflex net upgrade went awry
March 20, 2019 09:42PM
jj,

> There are some boot env settings that need to be
> set when installing LEDE. Could you please shed me
> some light upon what will be the correct boot env.
> settings for gfn, especially the mtdparts
> variable?

In the procedure that I mentioned:
https://forum.doozan.com/read.php?4,42279

The only thing you need to change is the file names for

lede-kirkwood-pogo_e02-initramfs-uImage
lede-17.01.4-kirkwood-pogo_e02-squashfs-sysupgrade.tar


So download the LEDE version for GoFlex Net, and run through the sam procedure, it should work.

-bodhi
===========================
Forum Wiki
bodhi's corner
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: