Welcome! Log In Create A New Profile

Advanced

Replace ArchLinuxARM with Debian on GoFlexHome

Posted by spindles7 
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 10, 2018 02:08AM
Alright, here we go again...
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:21:31 -0700)
Seagate GoFlex Home
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
GoFlexHome> setenv devices ide
GoFlexHome> setenv bootdev ide
GoFlexHome> boot

Reset IDE: Bus 0: OK Bus 1: not available
  Device 0: Model: ST1000DM000-9TS15E Firm: CC92 Ser#: 5YA0FYGY
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)

Partition Map for IDE device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            41943040        00000000-01     83
  2     41945088        1911580080      00000000-02     83
running scan_disk ...
Scan device ide

Reset IDE: Bus 0: OK Bus 1: not available
  Device 0: Model: ST1000DM000-9TS15E Firm: CC92 Ser#: 5YA0FYGY
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
device ide 0:1
1 bytes read in 399 ms (0 Bytes/s)
Found bootable drive on ide 0
loading uImage ...
3821592 bytes read in 771 ms (4.7 MiB/s)
loading uInitrd ...
7706670 bytes read in 1498 ms (4.9 MiB/s)
loading DTB /boot/dts/kirkwood-goflexhome.dtb ...
10603 bytes read in 1451 ms (6.8 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:      2018-08-09   7:38:25 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7706606 Bytes = 7.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 ...

Unfortunately, same result.

spinldles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 10, 2018 02:11AM
Alright, here we go again:
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:21:31 -0700)
Seagate GoFlex Home
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
GoFlexHome> setenv devices ide
GoFlexHome> setenv bootdev ide
GoFlexHome> boot

Reset IDE: Bus 0: OK Bus 1: not available
  Device 0: Model: ST1000DM000-9TS15E Firm: CC92 Ser#: 5YA0FYGY
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)

Partition Map for IDE device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            41943040        00000000-01     83
  2     41945088        1911580080      00000000-02     83
running scan_disk ...
Scan device ide

Reset IDE: Bus 0: OK Bus 1: not available
  Device 0: Model: ST1000DM000-9TS15E Firm: CC92 Ser#: 5YA0FYGY
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
device ide 0:1
1 bytes read in 399 ms (0 Bytes/s)
Found bootable drive on ide 0
loading uImage ...
3821592 bytes read in 771 ms (4.7 MiB/s)
loading uInitrd ...
7706670 bytes read in 1498 ms (4.9 MiB/s)
loading DTB /boot/dts/kirkwood-goflexhome.dtb ...
10603 bytes read in 1451 ms (6.8 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:      2018-08-09   7:38:25 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7706606 Bytes = 7.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 ...

Unfortunately the result is the same - ie not working:-(

Regards,
spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 10, 2018 02:14AM
oops, sorry didn't realise the first one had gone onto a 2nd page so sent it again in error.
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 10, 2018 03:15AM
Try

setenv devices ide
setenv bootdev ide
printenv
boot

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 10, 2018 03:39AM
OK, here's the session capture log:
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:21:31 -0700)
Seagate GoFlex Home
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
GoFlexHome> setenv devices ide
GoFlexHome> setenv bootdev ide
GoFlexHome> printenv
arcNumber=3338
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
device=0:1
devices=ide
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-goflexhome.dtb
ethact=egiga0
ethaddr=00:10:75:29:8A:30
if_netconsole=ping $serverip
ipaddr=192.168.1.40
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts orion_nand:1M(u-boot),-(rootfs)
nc_ready=1
ncip=192.168.1.2
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
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
serverip=192.168.1.2
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=nc
stdin=nc
stdout=nc
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=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
usb_ready_retry=15

Environment size: 3004/131068 bytes
GoFlexHome> boot

Reset IDE: Bus 0: OK Bus 1: not available
  Device 0: Model: ST1000DM000-9TS15E Firm: CC92 Ser#: 5YA0FYGY
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)

Partition Map for IDE device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            41943040        00000000-01     83
  2     41945088        1911580080      00000000-02     83
running scan_disk ...
Scan device ide

Reset IDE: Bus 0: OK Bus 1: not available
  Device 0: Model: ST1000DM000-9TS15E Firm: CC92 Ser#: 5YA0FYGY
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
device ide 0:1
1 bytes read in 400 ms (0 Bytes/s)
Found bootable drive on ide 0
loading uImage ...
3821592 bytes read in 771 ms (4.7 MiB/s)
loading uInitrd ...
7706670 bytes read in 1499 ms (4.9 MiB/s)
loading DTB /boot/dts/kirkwood-goflexhome.dtb ...
10603 bytes read in 1450 ms (6.8 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:      2018-08-09   7:38:25 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7706606 Bytes = 7.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 ...
Again, not working...

Regards,
spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 10, 2018 05:07AM
spindles7,

For whatever reason, the bootcmd_unenv was never executed before the scandisk

bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi; sleep 3


GoFlexHome> boot

Reset IDE: Bus 0: OK Bus 1: not available
  Device 0: Model: ST1000DM000-9TS15E Firm: CC92 Ser#: 5YA0FYGY
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)

Partition Map for IDE device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            41943040        00000000-01     83
  2     41945088        1911580080      00000000-02     83
running scan_disk ...

So your SATA partition 1 is the suspect. What is in it and why do you have 2 partitions on this SATA disk? (Note the rootfs installation requirement of a single Ext3 partition).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 10, 2018 05:46PM
The SATA partition 1 is the rootfs (newly created), formatted as ext4 (as I am using the latest uBoot) but now has additional software installed etc. Partition 2 is for data eg where samba shares will reside, as I intend to run it as a fileserver. You will recall in an earlier post I asked if it was OK to create additional partitions on the SATA drive. It doesn't seem to have changed anything - ie this didn't work before I added the 2nd partition.

So, I tried a new HDD plugged into the SATA port, deleted all existing partitions, created a new ext3 partition and copied the rootfs onto it. I edited /boot/uEnv.txt and rebooted. This is the sessions log before re-boot:

Script started on Fri Aug 10 14:15:04 2018
root@debian:~# fdisk /dev/sda
Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): p
Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 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: 0xefb7e0e2

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-488397167, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-488397167, default 488397167): +20G

Created a new partition 1 of type 'Linux' and of size 20 GiB.
Partition #1 contains a ext3 signature.

Do you want to remove the signature? [Y]es/[N]o: y

The signature will be removed by a write command.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

root@debian:~# mkfs.ext3 /dev/sda1
mke2fs 1.43.4 (31-Jan-2017)
Creating filesystem with 5242880 4k blocks and 1310720 inodes
Filesystem UUID: bfbeac84-d882-4277-a6c5-fd91d2977da1
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000

Allocating group tables:   0/160       done                            
Writing inode tables:   0/160 32/160 59/160 85/160109/160133/160158/160       done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:   0/160       done

root@debian:~# e2label /dev/sda1 rootfs
root@debian:~# mount /dev/sda1 /mnt/sata
root@debian:~# cp /Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 /mnt/sata
root@debian:~# cd /mnt/sata
root@debian:/mnt/sata# ls -l
total 191960
-rw-r--r-- 1 root root 196352036 Aug 10 14:23 Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2
drwx------ 2 root root     16384 Aug 10 14:17 lost+found
root@debian:/mnt/sata# tar -xjf Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz 
root@debian:/mnt/sata# ls -l
total 192032
-rw-r--r--  1 root root 196352036 Aug 10 14:23 Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2
drwxr-xr-x  2 root root      4096 Jul 23  2017 bin
drwxr-xr-x  3 root root      4096 Dec 31  1969 boot
drwxr-xr-x  5 root root      4096 Feb 24  2012 dev
drwxr-xr-x 57 root root      4096 Dec 31  1969 etc
drwxr-xr-x  2 root root      4096 Jan 22  2012 home
drwxr-xr-x 14 root root      4096 Jul 20  2017 lib
drwx------  2 root root     16384 Feb 24  2012 lost+found
drwxr-xr-x  2 root root      4096 Feb 24  2012 media
drwxr-xr-x  2 root root      4096 Feb 10  2015 mnt
drwxr-xr-x  2 root root      4096 Feb 24  2012 opt
drwxr-xr-x  2 root root      4096 Jan 22  2012 proc
drwx------  5 root root      4096 Jul 23  2017 root
drwxr-xr-x  2 root root      4096 Feb  7  2013 run
drwxr-xr-x  2 root root      4096 Jul 23  2017 sbin
drwxr-xr-x  2 root root      4096 Feb 24  2012 srv
drwxr-xr-x  2 root root      4096 Dec 31  2010 sys
drwxrwxrwt  2 root root      4096 Dec 31  1969 tmp
drwxr-xr-x 10 root root      4096 Feb 24  2012 usr
drwxr-xr-x 11 root root      4096 Dec 31  1969 var
echo "custom_params=init=/bin/systemd" > /boot/uEnv.txt
exit

Script done on Fri Aug 10 14:30:21 2018

And this is the session log after logging on 1st boot:
Script started on Fri Aug 10 14:34:01 2018
root@debian:~# cat /proc/cmdline
console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts orion_nand:1M(u-boot),-(rootfs)
root@debian:~# cat /boot/uEnv.txt
custom_params=init=/bin/systemd
root@debian:~# exit
exit

Script done on Fri Aug 10 14:35:18 2018

As you can see it didn't work.

Interestingly I repeated the above on a fresh usb memory stick and, lo and behold it works!
(I have the session log if you need it, but essentially it's the same as above).

So my conclusion is that:
a) it works OK if booting from a USB device
b) it doesn't work if booting from the drive in the SATA interface.

I have a supplementary question:
I have noticed that if I disconnect the netconsole, the GFH will not boot, or at least it will wait until the netconsole is connected. Is that expected behaviour?

Many thanks,

Regards,
spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 11, 2018 12:50AM
spindles7,

Ah. You did everything by the book and still it did not work.

> a) it works OK if booting from a USB device
> b) it doesn't work if booting from the drive in
> the SATA interface.

I will need to test this IDE uEnv.txt myself and let you know (in about 2-3 weeks when I get back to my development rig). Please remind me!

In the mean time, if you are going to boot with systemd then just set it directly in the bootargs (instead of using uEnv.txt).

fw_setenv custom_params 'init=/bin/systemd'
And reverse it when you want to boot sysvinit
fw_setenv custom_params



> I have a supplementary question:
> I have noticed that if I disconnect the
> netconsole, the GFH will not boot, or at least it
> will wait until the netconsole is connected. Is
> that expected behaviour?

The u-boot netconsole driver has some flaw in that you don't want to disconnect it by bringing down the server while it is connecting. It will keep retrying. And it tends to have false negative so I set it up to ping 5 times (to make sure the negative results are real).

Quote

10. Set up netconsole. It's important to set up neconsole if you don't already have serial console connected. If you have serial console, don't set up netconsole at this moment, because it will interfere with serial console.

If you've flashed the default environments in step 8 then activate netconsole with the following envs:

Adjust 192.168.0.xxx and 192.168.0.yyy below to the real numbers in your network configuration. 192.168.0.xxx is this plug IP address, and 192.168.0.yyy is the IP address of the netconsole server where it will monitor the output from the this plug (adjust them to the real values in your own local network settings).

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_netconsole; fi'
fw_setenv preboot 'run preboot_nc'
fw_setenv ipaddr '192.168.0.xxx'
fw_setenv serverip '192.168.0.yyy'

But if netconsole server is not running, your box u-boot should eventually time out and boot after a long period, not stuck.

Unfortunately, I did not have time to sit down and fix this code, yet (It is not difficult).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 11, 2018 04:05AM
That's great. Many thanks.

Regards,
spindles7
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: