Welcome! Log In Create A New Profile

Advanced

Goflex net - stuck not sure on what

Posted by su_A_ve 
Goflex net - stuck not sure on what
April 21, 2020 01:59PM
Looking into what to do with an old GoFlex, I figured let's try to play with openmediavault or something and got here.

I followed the instructions to create a USB stick with 5.2.9. And nothing happens after booting the kernel.

Thanks in advance.

Here's the output (it has the original uBoot)

U-Boot 2011.12 (Apr 18 2012 - 23:08:20)
Seagate GoFlexNet

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0
(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
Loading file "/rescueme" from usb device 0:1 (usbda1)
** File not found /rescueme
reading /rescueme.txt

** Unable to read "/rescueme.txt" from usb 0:1 **
Creating 1 MTD partitions on "nand0":
0x000002500000-0x000010000000 : "mtd=3"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=3"
UBI: MTD device size:            219 MiB
UBI: number of good PEBs:        1750
UBI: number of bad PEBs:         2
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             1729
UBI: total number of reserved PEBs: 21
UBI: number of PEBs reserved for bad PEB handling: 17
UBI: max/mean erase counter: 1/1
UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:rootfs", error -19
Error reading superblock on volume 'ubi:rootfs'!
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
1 bytes read
Found bootable drive on usb 0:1
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
4975125 bytes read
Loading file "/boot/uInitrd" from usb device 0:1 (usbda1)
9713936 bytes read
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-5.2.9-kirkwood-tld-1
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4975061 Bytes = 4.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-5.2.9-kirkwood-tld-1
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9713872 Bytes = 9.3 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

And just in case, printenv

GoFlexNet> printenv
arcNumber=2097
baudrate=115200
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset
bootdelay=3
console=ttyS0,115200
dtb_file=/boot/dts/kirkwood-goflexnet.dtb
ethact=egiga0
ethaddr=00:10:75:26:73:F8
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
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
partition=nand0,2
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
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
rescue_installed=0
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
stderr=serial
stdin=serial
stdout=serial
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
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
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
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_device=0:1
usb_init=run usb_scan
usb_root=/dev/sda1
usb_rootdelay=10
usb_rootfstype=ext2
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_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_scan_list=1 2 3 4
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params

Environment size: 2386/131068 bytes
GoFlexNet>
Re: Goflex net - stuck not sure on what
April 21, 2020 05:12PM
su_A_ve,

> Here's the output (it has the original uBoot)
>
> U-Boot 2011.12 (Apr 18 2012 - 23:08:20)
> Seagate GoFlexNet

With this old u-boot, when you create the USB rootfs, you need to do Step 4:

Quote

4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Do not do 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-5.2.9-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-5.2.9-kirkwood-tld-1 -d zImage.fdt uImage
sync

If your Linux box does not have mkimage, then install it

apt-get install u-boot-tools

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Goflex net - stuck not sure on what
April 22, 2020 09:08AM
I did step 4.

Here's the output of what I did. In case I missed something, there it is again. But still nothing happens after booting the kernel.

Thanks for your help.

[root@localhost /]# su -
Last login: Tue Apr 21 16:52:38 EDT 2020 on pts/0
[root@localhost ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
237104 inodes, 946944 blocks
47347 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=973078528
29 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736

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

[root@localhost ~]# e2label /dev/sdb1 rootfs
[root@localhost ~]# e2label /dev/sdb1
rootfs
[root@localhost ~]# mount /dev/sdb1 /media/sdb1
[root@localhost ~]# cd /media/sdb1
[root@localhost sdb1]# tar -xjf /tmp/Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2 
[root@localhost sdb1]# cd /media/sdb1/boot
[root@localhost boot]# cp -a zImage-5.2.9-kirkwood-tld-1  zImage.fdt
[root@localhost boot]# cat dts/kirkwood-goflexnet.dtb  >> zImage.fdt
[root@localhost boot]# mv uImage uImage.orig
[root@localhost /]# su -
Last login: Tue Apr 21 16:52:38 EDT 2020 on pts/0
[root@localhost ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
237104 inodes, 946944 blocks
47347 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=973078528
29 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736

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

[root@localhost ~]# e2label /dev/sdb1 rootfs
[root@localhost ~]# e2label /dev/sdb1
rootfs
[root@localhost ~]# mount /dev/sdb1 /media/sdb1
[root@localhost ~]# cd /media/sdb1
[root@localhost sdb1]# tar -xjf /tmp/Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2 
[root@localhost sdb1]# cd /media/sdb1/boot
[root@localhost boot]# cp -a zImage-5.2.9-kirkwood-tld-1  zImage.fdt
[root@localhost boot]# cat dts/kirkwood-goflexnet.dtb  >> zImage.fdt
[root@localhost boot]# mv uImage uImage.orig
[root@localhost boot]# mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.2.9-kirkwood-tld-1 -d zImage.fdt  uImage
Image Name:   Linux-5.2.9-kirkwood-tld-1
Created:      Wed Apr 22 10:03:11 2020
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    4975061 Bytes = 4858.46 KiB = 4.74 MiB
Load Address: 00008000
Entry Point:  00008000
[root@localhost boot]# sync
[root@localhost boot]# cd
[root@localhost ~]# umount /media/sdb1
Re: Goflex net - stuck not sure on what
April 22, 2020 04:36PM
Tried a different flash drive - same results.
Re: Goflex net - stuck not sure on what
April 22, 2020 04:51PM
su_A_ve,

I see. rootfs looks good.

One thing I kept forgetting is eventhough it is not stock, Jeff's u-boot 2011 still old enough that you need to do adjust the load address to boot with the current kernel.

Power up, interrupt serial console and

setenv usb_boot 'mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x2100000 /boot/uInitrd; then bootm 0x800000 0x2100000; else bootm 0x800000; fi'

And then
boot

And then after login into Debian, you can save it with fw_setenv

For sanity, make sure the envs are listed ok first.
fw_printenv
and then set it
fw_setenv usb_boot 'mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x2100000 /boot/uInitrd; then bootm 0x800000 0x2100000; else bootm 0x800000; fi'

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Goflex net - stuck not sure on what
April 22, 2020 06:27PM
Works! Thank you!!

Also performed the steps under Note 1, changed root password and updated timezone. SSH also works so can disconnect serial cable.

Now, chicken and egg question - Should I update to 5.5.1 kernel first or latest U-Boot first?
Re: Goflex net - stuck not sure on what
April 22, 2020 06:38PM
And one more thing...

Simulated a power failure. That is, I just unplugged the unit (which will happen no matter what even if I have a UPS on it).

But on bootup, it wanted me to run fsck manually.

Is there a way to automate this? Otherwise, I'd had to keep serial console on this right? Or is this taken care of on newer u-boot?
Re: Goflex net - stuck not sure on what
April 22, 2020 08:57PM
su_A_ve,

> Simulated a power failure. That is, I just
> unplugged the unit (which will happen no matter
> what even if I have a UPS on it).
>
> But on bootup, it wanted me to run fsck manually.
>
>
> Is there a way to automate this? Otherwise, I'd
> had to keep serial console on this right? Or is
> this taken care of on newer u-boot?

Ext3 file system is resilient from power outage. It should not have problem with fixing itself. I have not run 2011 u-boot for so long I cannot remember if it has anything to do with this.

My rootfs are always booting ok after power outage. I test it all the time with my Kirkwood test unit (running new u-boot). If I'm lazy or sleepy, I would just power off test unit, and the next day it will boot up just fine. My "production" boxes also experience power outage a few times a year, no problem.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Goflex net - stuck not sure on what
April 22, 2020 08:59PM
Quote

Now, chicken and egg question - Should I update to 5.5.1 kernel first or latest U-Boot first?

5.5.1 is a drop-in replacement for 5.2.9 so it should be OK to upgrade the kernel first.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Goflex net - stuck not sure on what
April 23, 2020 12:21PM
Thanks for all the help.

Running 5.5.1 and latest uBoot, and got netconsole working. But seeing this output which is not on the serial connection:

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:17:19 -0700)
Seagate GoFlex Net
gcc (Debian 6.3.0-18) 6.3.0 20170516
GNU ld (GNU Binutils for Debian) 2.28
Hit any key to stop autoboot:  0
Initializing devices...
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices...
Use USB retry period from the environment: 15 second(s)
1 Storage Device(s) found

Reset IDE: ide_preinit failed
Unknown command 'mmc' - try 'help'
Loading envs from usb 0...
** File not found /boot/uEnv.txt **
Loading envs from usb 1...
** Bad device usb 1 **
Loading envs from usb 2...
** Bad device usb 2 **
Loading envs from usb 3...
** Bad device usb 3 **
Loading envs from ide 0...
** Bad device ide 0 **
Loading envs from ide 1...
** Bad device ide 1 **
Loading envs from ide 2...
** Bad device ide 2 **
Loading envs from ide 3...
** Bad device ide 3 **
Loading envs from mmc 0...
** Bad device mmc 0 **
Loading envs from mmc 1...
** Bad device mmc 1 **
Loading envs from mmc 2...
** Bad device mmc 2 **
Loading envs from mmc 3...
** Bad device mmc 3 **
running scan_disk ...
Scan device usb
device usb 0:1
1 bytes read in 476 ms (0 Bytes/s)
Found bootable drive on usb 0
loading uImage ...
5214373 bytes read in 843 ms (5.9 MiB/s)
loading uInitrd ...
9742447 bytes read in 2136 ms (4.3 MiB/s)
loading DTB /boot/dts/kirkwood-goflexnet.dtb ...
11445 bytes read in 1677 ms (5.9 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-5.5.1-kirkwood-tld-1
   Created:      2020-04-23  14:55:56 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5214309 Bytes = 5 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-5.5.1-kirkwood-tld-1
   Created:      2020-04-23  14:56:05 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9742383 Bytes = 9.3 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 ...

I'm booting from USB and no other drives are attached at this time. And don't have /boot/uEnv.txt - should I?
Re: Goflex net - stuck not sure on what
April 23, 2020 01:23PM
And followup... After "Starting kernel ..." I don't get any more output from netconsole. It seems the OS starts to boot and output goes back to the serial console and not to netconsole.

Anyway to continue to get the output? In case fsck doesn't work for example?

TIA.
Re: Goflex net - stuck not sure on what
April 23, 2020 04:48PM
su_A_ve,

You don't need /boot/uEnv.txt right now. Only later when you want to change u-boot envs on the fly to test something.


> Anyway to continue to get the output? In case fsck
> doesn't work for example?

There is a way to see more kernel log during booting. See the Wiki thread:
https://forum.doozan.com/read.php?2,23630

Quote

Netconsole

Use netconsole to troubleshoot uBoot without a serial cable
Use netconsole to troubleshoot Debian kernel booting


However, it will not output all the kernel booting activities, and you cannot see the part where fsck is running. For the complete log, you must have serial console.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Goflex net - stuck not sure on what
April 24, 2020 10:04AM
So now I see - if netconsole detects the ip of the receiver up, it'll send the commands to it. Otherwise, they go to serial.

But what about this? This wasn't before with the old uBoot...

Reset IDE: ide_preinit failed
Unknown command 'mmc' - try 'help'
Loading envs from usb 0...
** File not found /boot/uEnv.txt **
Loading envs from usb 1...
** Bad device usb 1 **
Loading envs from usb 2...
** Bad device usb 2 **
Loading envs from usb 3...
** Bad device usb 3 **
Loading envs from ide 0...
** Bad device ide 0 **
Loading envs from ide 1...
** Bad device ide 1 **
Loading envs from ide 2...
** Bad device ide 2 **
Loading envs from ide 3...
** Bad device ide 3 **
Loading envs from mmc 0...
** Bad device mmc 0 **
Loading envs from mmc 1...
** Bad device mmc 1 **
Loading envs from mmc 2...
** Bad device mmc 2 **
Loading envs from mmc 3...
** Bad device mmc 3 **
running scan_disk ...

Thanks in advance
Re: Goflex net - stuck not sure on what
April 24, 2020 04:40PM
> Reset IDE: ide_preinit failed
> Unknown command 'mmc' - try 'help'
> Loading envs from usb 0...
> ** File not found /boot/uEnv.txt **
> Loading envs from usb 1...
> ** Bad device usb 1 **
> Loading envs from usb 2...
> ** Bad device usb 2 **
> Loading envs from usb 3...
> ** Bad device usb 3 **
> Loading envs from ide 0...
> ** Bad device ide 0 **
> Loading envs from ide 1...
> ** Bad device ide 1 **
> Loading envs from ide 2...
> ** Bad device ide 2 **
> Loading envs from ide 3...
> ** Bad device ide 3 **
> Loading envs from mmc 0...
> ** Bad device mmc 0 **
> Loading envs from mmc 1...
> ** Bad device mmc 1 **
> Loading envs from mmc 2...
> ** Bad device mmc 2 **
> Loading envs from mmc 3...
> ** Bad device mmc 3 **
> running scan_disk ...

That was OK. The uEnv scanning script tried to look for the uEnv.txt in all possible disk drive and found no such script exists. You have no HDD plugged in. And this box does not have MMC. And there is no uEnv.txt in the USB drive currently plugged in.

The env that determine which type of disk you have is devices. So you can change it to make it less noisy.

Depending on which drive has the rootfs (that should be 1st one on the list to make the scanning go faster)
fw_setenv devices 'usb ide'
or
fw_setenv devices 'ide usb'

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Goflex net - stuck not sure on what
April 25, 2020 07:00PM
Thanks for all your help. Learning a lot here on how Debian works.
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: