Welcome! Log In Create A New Profile

Advanced

Replace ArchLinuxARM with Debian on GoFlexHome

Posted by spindles7 
Replace ArchLinuxARM with Debian on GoFlexHome
July 13, 2018 05:35PM
Hi,
Came across your website after installing ArchLinuxARM on my GoFlexHome device. I would prefer to use Debian Stretch, so looking for help to get this up and running. I assume I have to replace the Uboot code with the version on this website and then install the latest kirkwood package. However before I start, would appreciate any tips, pitfalls and pointing me to the correct instructions.

Many thanks,

spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 13, 2018 06:50PM
spindles7,

You could run Debian with Arch u-boot as a starter. And then install my release u-boot. That way you would go slow and making sure you have a working Debian system first.

This is one of the topics in the Wiki thread here.

Migrating from Arch to Debian:
https://forum.doozan.com/read.php?3,23727

And then in while Debian, install new u-boot.

Of course you could also install both rootfs Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 from the rootfs/kernel release thread. and the new u-boot at the same time while in Arch. But this needs some precaution, such as you should connect serial console to make sure you can recover from mistake.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 14, 2018 05:13AM
Thanks for that. I have tried to get this working but it will not boot. These are the steps I've taken:

1. On a separate disc in the first ext3 partition on the disc, I have created the rootfs using the tarball Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 and labelled it as rootfs.
2. I left the uImage as it came with the tarball.
3. Downloaded and edited the uEnv_arch_uboot_boot_debian.txt file and saved it as uEnv.txt in /boot
4. Plugged the new disc into the GoflexHome and rebooted. Fails.
5. Checked for presence of uInitrd on the original ArchLinuxARM disc, and confirmed it is missing.
6. Tried option b, adding the env setting to uEnv.txt and retried to boot - still fails.

Not sure what I am doing wrong. I attach my uEnv.txt.

I haven't got a serial console set up and tried to get netconsole working, but I don't think this works with the ArchLinuxARM uBoot, so can't tell what's happening. Just the led on the front of the unit flashes continuously and never turns red then solid green.

TIA,

spindles7
Attachments:
open | download - uEnv.txt (850 bytes)
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 14, 2018 03:33PM
spindles7,

If you can boot and log into Arch rootfs, then get output of

cat /proc/mtd
fw_printenv

If you can no longer boot Arch, it is harder, because without serial console, we have to guess what the envs currently are (do you remember when you install Arch?).

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 14, 2018 04:08PM
Yes, I can still boot into the Arch system as I am doing the testing on a separate disc. I installed Arch a couple of days ago, so all is recent. Anyway I show below the output of those two commands as requested.

cat /proc/mtd:
==========
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 0ff00000 00020000 "rootfs"


fw_printenv:
=========
baudrate=115200
bootcmd=ide reset; usb start; setenv letter 9;for type in ide usb; do for disk in 0; do if ${type} part ${disk};then setexpr letter $letter + 1;run load;fi;done;done;
bootdelay=3
bootm=echo Booting from ${disk} ...; run setargs; bootm ${loadaddr};
bootz=echo Booting from ${disk} ...; run setargs; bootz ${loadaddr} - ${fdt_addr};
console=ttyS0
ethact=egiga0
fdt_addr=0x800000
fdt_file=/boot/dtbs/kirkwood-goflexnet.dtb
importbootenv=echo Importing environment (uEnv.txt)...; env import -t $loadaddr $filesize
load=echo Attempting to boot from ${type} ${disk}:1...;if run loadbootenv; then run importbootenv;fi;echo Checking if uenvcmd is set ...;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;echo Running default loadzimage ...;if run loadzimage; then run loadfdt;run bootz;fi;echo Running default loaduimage ...;if run loaduimage; then run bootm;fi;
loadaddr=0x810000
loadbootenv=load ${type} ${disk}:1 ${loadaddr} /boot/uEnv.txt
loadfdt=load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}
loaduimage=load ${type} ${disk}:1 ${loadaddr} ${uimage}
loadzimage=load ${type} ${disk}:1 ${loadaddr} ${zimage}
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),-(rootfs)
setargs=setenv bootargs console=${console},${baudrate} ${optargs} root=/dev/sd${letter}1 rw rootwait ${mtdparts}
uimage=/boot/uImage
zimage=/boot/zImage
ethaddr=00:10:75:29:8A:30
serverip=192.168.2.6
ipaddr=192.168.2.40
if_netconsole=ping $serverip
preboot=run if_netconsole start_netconsole
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;


The last few lines above were my attempt to get netconsole working, which also failed.

Thanks,

spindles7

----
Mod edit: pls use code tags to post envs and log (the formatted code button on the top right of the message box where you typing).



Edited 1 time(s). Last edit at 07/14/2018 04:20PM by bodhi.
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 14, 2018 04:40PM
spindles7,

Looks like Arch has changed the u-boot envs a bit in this version.

I'll write a differrent uEnv.txt for you to test.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 14, 2018 04:56PM
OK here is the content of the uEnv.txt.

With the rootfs Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 in the original state (no change after creation).

/boot/uEnv.txt

fdt_file=/boot/dts/kirkwood-goflehome.dtb
setargs=setenv bootargs console=${console},${baudrate} ${optargs} root=LABEL=rootfs rw rootwait ${mtdparts}
bootm=echo Booting from ${disk} ...; run setargs; load ${type} ${disk}:1 0x1100000 /boot/uInitrd; load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}; bootm ${loadaddr} 0x1100000 ${fdt_addr}

Try booting with this uEnv.txt, and observe the LED light behavior (and record it for possible troubleshooting if it does not boot).

If the system LED becomes solid green, then wait about 15 seconds and look for the new IP in the network. Or wait about 30 seconds and ping this host.

ping debian.local

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 14, 2018 05:34PM
Many thanks for that. I have tried the new uEnv.txt but the unit still refuses to boot properly. The led just continues to flash green and never stops blinking. Have left it for several minutes with no change. Have set the boot flag on the partition, and tried again, but still no joy.

spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 14, 2018 06:48PM
Quote

1. On a separate disc in the first ext3 partition on the disc, I have created the rootfs using the tarball Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 and labelled it as rootfs.

Is this a USB drive, and there is only 1 EXT3 partition? were you root user when you create it?

You could post the log of how you create this (you can do this while inside Arch). Copy/paste the whole terminal session. Sometime there is a wrong step in this.

The LED behavior indicate that the kernel has not even been loaded successfully, or were there error in finding the kernel files (missing files would be amber LED).

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 14, 2018 08:14PM
No it's a SATA drive in place of the stock drive that comes with the GFH. There's one ext3 partition and a swap partition and yes, I was logged in as root the whole time. I've re-done the rootfs on the drive - I attach the session text. I used the new uEnv.txt you sent earlier.

Now the led flashes green for a few seconds then flashes red and stays that way, so obviously something different from the first try. But still does not boot properly.

Thanks for your help.

spindles7
Attachments:
open | download - session.txt (18 KB)
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 14, 2018 10:08PM
spindles7,

> No it's a SATA drive in place of the stock drive
> that comes with the GFH. There's one ext3
> partition and a swap partition

/dev/sdc1  *        2048 41945087 41943040   20G 83 Linux
/dev/sdc2       41945088 42993663  1048576  512M 82 Linux swap / Solaris


To make it simpler to get it booting, you could use a USB drive and have only 1 partition, later set up a swap file. Or use this HDD but remove the swap partition and later set up swap file. The performance of swap file is comparable to swap partition, and have less things that could break.


> and yes, I was
> logged in as root the whole time. I've re-done
> the rootfs on the drive - I attach the session
> text. I used the new uEnv.txt you sent earlier.

Now the log showing a wrong set of envs


root@debian-vb:/mnt/sdc1/boot# cat uEnv.txt
fdt_file=/boot/dts/kirkwood-goflehome.dtb
setargs=setenv bootargs console=,  root=LABEL=rootfs rw rootwait 
bootm=echo Booting from  ...; run setargs; load  :1 0x1100000 /boot/uInitrd; load  :1  ; bootm  0x1100000

The new envs needs to be:
fdt_file=/boot/dts/kirkwood-goflehome.dtb
setargs=setenv bootargs console=${console},${baudrate} ${optargs} root=LABEL=rootfs rw rootwait ${mtdparts}
bootm=echo Booting from ${disk} ...; run setargs; load ${type} ${disk}:1 0x1100000 /boot/uInitrd; load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}; bootm ${loadaddr} 0x1100000 ${fdt_addr}

>
> Now the led flashes green for a few seconds then
> flashes red and stays that way, so obviously
> something different from the first try. But
> still does not boot properly.

It means the kernel files was not found, or a malformed u-boot env. And this makes senses, because what you have in this uEnv.txt contains syntax error. Note the load :1.

The correct syntax is load 0:1

bootm=echo Booting from  ...; run setargs; load  :1 0x1100000 /boot/uInitrd; load  :1  ; bootm  0x1100000

Try the new envs I posted and see if you can boot:
fdt_file=/boot/dts/kirkwood-goflehome.dtb
setargs=setenv bootargs console=${console},${baudrate} ${optargs} root=LABEL=rootfs rw rootwait ${mtdparts}
bootm=echo Booting from ${disk} ...; run setargs; load ${type} ${disk}:1 0x1100000 /boot/uInitrd; load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}; bootm ${loadaddr} 0x1100000 ${fdt_addr}

And you could also try the old envs after correcting the syntax error. Perhaps it will boot far enough that will alllow you to ssh into Debian. But the full system will not be running (lack of uInitrd).

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 15, 2018 05:08AM
OK that was my fault - in order to show the contents of the uEnv.txt file in the terminal session I used cat > uEnv.txt << EOF. This meant that the environment variables were evaluated, and of course they were not set so the file was wrong. Sorry about that. So I have deleted the swap partition and corrected the uEnv.txt file and tried again. This time, the led flashes green and never changes.

So I created the rootfs on a USB stick and tried that with the SATA HDD removed. Same result - flashing green led.

I assume the uEnv.txt is the same regardless of using the SATA or USB drive?

After I wrote the above I was trying to get netconsole to work and installed the ArchLinuxARM uboot-goflexhome package using:
pacman -S uboot-goflexhome

and now whilst it still boots OK into ArchLinux, (led flashes briefly green then solid red then solid green) no ip address is assigned! I suspect the MAC address was cleared when the NAND was flashed. Interestingly when I put the debian rootfs disc in now, the led flashes briefly green but then turns red and stays that way.

I suspect that's broken it completely now?
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 15, 2018 04:23PM
spindles7,

> I assume the uEnv.txt is the same regardless of
> using the SATA or USB drive?

Yes, same. It redefined some envs that execute after the device alerady figured out by other envs execution.

> pacman -S uboot-goflexhome

Bad move :) this made it harder for me to help you. Because now I don't know what's in your installed u-boot until you can boot Arch again.

> and now whilst it still boots OK into ArchLinux,
> (led flashes briefly green then solid red then
> solid green) no ip address is assigned! I
> suspect the MAC address was cleared when the NAND
> was flashed.

You could mount tthe Arch drive on another Linux box and correct this.


> Interestingly when I put the debian
> rootfs disc in now, the led flashes briefly green
> but then turns red and stays that way.
>

It meant the kernel files were not found as u-boot expected to find them at certain location.

> I suspect that's broken it completely now?

Not broken. You should try to boot Arch and SSH in. After that is done successfully, restart this effort.

==========

Note that if you had serial console, we could have solved this booting problem in 5 minutes. I understood sometime it is not convenient to get that installed right away, so I tried to help. However, if we spend this much time and still not get Debian booting, I don't think we will get that done soon (that could be either because my lack of understanding about Arch u-boot version, or you've made some mistakes that I could not see).

Now there are 2 alternatives:

1. After you have booted Arch again, and can SSH, you can install my released u-boot and Debian at the same time. This will ensure high probability that will work without needing serial console. But if there is problem with u-boot installation, you will then need serial console to recover.

2. Connect serial console.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 16, 2018 08:55AM
bodhi Wrote:
-------------------------------------------------------
>
> Bad move :) this made it harder for me to help
> you. Because now I don't know what's in your
> installed u-boot until you can boot Arch again.
>
Yes, indeed, silly thing to do!

> > and now whilst it still boots OK into
> ArchLinux,
> > (led flashes briefly green then solid red then
> > solid green) no ip address is assigned! I
> > suspect the MAC address was cleared when the
> NAND
> > was flashed.
>
> You could mount tthe Arch drive on another Linux
> box and correct this.
>
Not sure how best to do this. On the assumption that something changed in the u-boot variables I tried adding these lines to uEnv.txt:

baudrate=115200
console=ttyS0
ethact=egiga0
ethaddr=00:10:75:29:8A:30

but that had no effect. I wonder if it somehow changed the name of the interface? The config on the HDD assumes it's called eth0, but if the name got changed then the network wouldn't come up.

> Not broken. You should try to boot Arch and SSH
> in. After that is done successfully, restart this
> effort.

All the tests have been done using the Arch HDD or a Arch rescue USB stick, both of which used to work before and both now boot up (OK according to the led) but no network.

>
> ==========
>
> Note that if you had serial console, we could have
> solved this booting problem in 5 minutes. I
> understood sometime it is not convenient to get
> that installed right away, so I tried to help.
> However, if we spend this much time and still not
> get Debian booting, I don't think we will get that
> done soon (that could be either because my lack of
> understanding about Arch u-boot version, or you've
> made some mistakes that I could not see).
>
> Now there are 2 alternatives:
>
> 1. After you have booted Arch again, and can SSH,
> you can install my released u-boot and Debian at
> the same time. This will ensure high probability
> that will work without needing serial console. But
> if there is problem with u-boot installation, you
> will then need serial console to recover.

That's not an option 'cos I can't start Arch

>
> 2. Connect serial console.

I guess I'll have to get the bits. Some of the links on your website point to ebay items which are no longer available - are there any current recommended sources?

Thanks,
spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 16, 2018 07:06PM
spindles7,

>
> That's not an option 'cos I can't start Arch

You could mount this rootfs on another Linux box. Being root, and modify the network config on this rootfs. In sysvinit it is /etc/network/interfaces, where you can specify the MAC address. How to do this for systemd. you will need to find info at Arch site.

> I guess I'll have to get the bits. Some of the
> links on your website point to ebay items which
> are no longer available - are there any current
> recommended sources?

One of the topic in the Wiki thread:

Serial Port connector - what are people using to make it work
https://forum.doozan.com/read.php?8,13263

So find this in eBay USB 2.0 to TTL UART 6PIN Module Serial Converter CP2102 it is the right one.

You can also find these on Amazon.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
July 17, 2018 02:21AM
Thanks for that. I now realise that it's not booting into the Arch system, because it boots without any storage attached at all!! Instead it is booting into a rescue partition in the NAND which I had installed earlier; unfortunately the rescue system is not connecting to the LAN, so I can't access it.

So I have ordered the serial/USB adapter and will have to wait for that to arrive to proceed further.

Many thanks for your help.

spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 07, 2018 09:07AM
Ok, adapter has arrived and I've hooked it up. This is what I get with just the rescue memory stick in the usb port:


U-Boot 2016.09.01-1 (Oct 10 2016 - 23:11:39 -0600) Arch Linux ARM
Seagate GoFlex Home

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
IDE:   ide_preinit failed
No link on egiga0
ping failed; host 10.10.10.5 is not alive
Hit any key to stop autoboot:  0

Reset IDE: ide_preinit failed
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

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

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            786432          000008e1-01     83
setexpr - set environment variable as the result of eval expression

Usage:
setexpr [.b, .w, .l] name [*]value1 <op> [*]value2
    - set environment variable 'name' to the result of the evaluated
      expression specified by <op>.  <op> can be &, |, ^, +, -, *, /, %
      size argument is only meaningful if value1 and/or value2 are
      memory addresses (*)
setexpr[.b, .w, .l] name [*]value
    - load a value into a variable
setexpr name gsub r s [t]
    - For each substring matching the regular expression <r> in the
      string <t>, substitute the string <s>.  The result is
      assigned to <name>.  If <t> is not supplied, use the old
      value of <name>
setexpr name sub r s [t]
    - Just like gsub(), but replace only the first matching substring
Attempting to boot from usb 0:1...
load - load binary file from a filesystem

Usage:
load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]
    - Load binary file 'filename' from partition 'part' on device
       type 'interface' instance 'dev' to address 'addr' in memory.
      'bytes' gives the size to load in bytes.
      If 'bytes' is 0 or omitted, the file is read until the end.
      'pos' gives the file byte position to start reading from.
      If 'pos' is 0 or omitted, the file is read from the start.
Checking if uenvcmd is set ...
Running default loadzimage ...
** No boot file defined **
Running default loaduimage ...
** No boot file defined **

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

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            786432          000008e1-01     83
setexpr - set environment variable as the result of eval expression

Usage:
setexpr [.b, .w, .l] name [*]value1 <op> [*]value2
    - set environment variable 'name' to the result of the evaluated
      expression specified by <op>.  <op> can be &, |, ^, +, -, *, /, %
      size argument is only meaningful if value1 and/or value2 are
      memory addresses (*)
setexpr[.b, .w, .l] name [*]value
    - load a value into a variable
setexpr name gsub r s [t]
    - For each substring matching the regular expression <r> in the
      string <t>, substitute the string <s>.  The result is
      assigned to <name>.  If <t> is not supplied, use the old
      value of <name>
setexpr name sub r s [t]
    - Just like gsub(), but replace only the first matching substring
Attempting to boot from usb 0:1...
load - load binary file from a filesystem

Usage:
load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]
    - Load binary file 'filename' from partition 'part' on device
       type 'interface' instance 'dev' to address 'addr' in memory.
      'bytes' gives the size to load in bytes.
      If 'bytes' is 0 or omitted, the file is read until the end.
      'pos' gives the file byte position to start reading from.
      If 'pos' is 0 or omitted, the file is read from the start.
Checking if uenvcmd is set ...
Running default loadzimage ...
** No boot file defined **
Running default loaduimage ...
** No boot file defined **

This is the output of "env print"
GoFlexHome> env print
baudrate=115200
bootcmd=ide reset; usb start; setenv letter 9;for type in ide usb; do for disk in 0; do if usb part 0;then setexpr letter  + 1;run load;fi;done;done;
bootdelay=3
bootdir=/boot
bootfilem=uImage
bootfilez=zImage
bootm=echo Booting from 0 ...; run setargs; bootm ;
bootubi=echo Trying to boot from NAND ...;if run mountubi; then ubifsload ${loadaddr} /boot/zImage;ubifsload ${fdtaddr} /boot/dtbs/${fdtfile};ubifsumount; setenv bootargs console=${console} ubi.mtd=1 root=ubi0:rootfs ro rootfstype=ubifs  rootwait ${mtdparts};bootz ${loadaddr} - ${fdtaddr};fi
bootz=echo Booting from 0 ...; run setargs; bootz  - ;
console=ttyS0
ethact=egiga0
ethaddr=00:10:75:29:8A:30
fdt_addr=0x800000
fdt_file=/boot/dtbs/kirkwood-goflexnet.dtb
fdtaddr=0x800000
fdtdir=/boot/dtbs
fdtfile=kirkwood-goflexhome.dtb
importbootenv=echo Importing environment (uEnv.txt)...; env import -t
ipaddr=10.10.10.3
letter=9
load=echo Attempting to boot from usb 0:1...;if run loadbootenv; then run importbootenv;fi;echo Checking if uenvcmd is set ...;if test -n ; then echo Running uenvcmd ...;run uenvcmd;fi;echo Running default loadzimage ...;if run loadzimage; then run loadfdt;run bootz;fi;echo Running default loaduimage ...;if run loaduimage; then run bootm;fi;
loadaddr=0x810000
loadbootenv=load usb 0:1  /boot/uEnv.txt
loadfdt=load usb 0:1
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfilez} || load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfilem}
loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}
loaduimage=load usb 0:1
loadzimage=load usb 0:1
mainargs=setenv bootargs console=${console} ${mtdparts} root=${root} rw rootwait ${optargs} ${ncargs}
mountubi=ubi part rootfs; ubifsmount ubi0:rootfs
mtdids=nand0 orion_nand
mtdparts=mtdparts orion_nand:1M(u-boot),-(rootfs)
ncip=10.10.10.5
ncipk=10.10.10.4
netconsole=on
preboot=if env exists netconsole && test ${netconsole} = on; then if ping ${ncip}; then  setenv stdin nc; setenv stdout nc;  setenv stderr nc; version; if env exists ncargsusr; then echo ncargs has been defined by user; setenv ncargs ${ncargsusr}; else setenv ncargs ignore_loglevel netconsole=6665@${ipaddr}/eth0,6666@${ncipk}/; fi; fi; else echo Netconsole has been turned off.; echo To turn it on, set netconsole variable to on.; setenv stdin; setenv stdout; setenv stderr; setenv ncargs; fi
rdaddr=0x1100000
rdfile=initramfs-linux.img
setargs=setenv bootargs console ,  root /dev/sd1 rw rootwait
startboot=usb start; ide reset; for devtype in usb ide; do  setenv devnum 0; while ${devtype} dev ${devnum}; do  echo ${devtype} found on device ${devnum}; setenv bootpart ${devnum}:1; echo Checking for: ${bootdir}/uEnv.txt ...; if test -e ${devtype} ${bootpart} ${bootdir}/uEnv.txt; then  load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/uEnv.txt; env import -t ${loadaddr} ${filesize}; echo Loaded environment from ${bootdir}/uEnv.txt; echo Checking if uenvcmd is set ...; if test -n ${uenvcmd}; then  echo Running uenvcmd ...; run uenvcmd; fi; fi; if run loadimage; then if env exists root; then echo root has been defined by user; else part uuid ${devtype} ${bootpart} uuid; setenv root PARTUUID=${uuid}; fi;  run mainargs; if run loadfdt; then  if run loadrd; then  bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr}; else  bootz ${loadaddr} - ${fdtaddr}; fi; else  if run loadrd; then echo Booting uImage with initrd;  bootm ${loadaddr} ${rdaddr}:${filesize}; else  bootm ${loadaddr}; fi; fi; else  echo No kernel found; fi; setexpr devnum ${devnum} + 1; done; done;
uimage=/boot/uImage
zimage=/boot/zImage

Environment size: 3665/131068 bytes
GoFlexHome>

Appreciate your advice on what to do next to get it running. Many thanks,

spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 07, 2018 10:06PM
spindles7,

>
> U-Boot 2016.09.01-1 (Oct 10 2016 - 23:11:39 -0600)
> Arch Linux ARM
> Seagate GoFlex Home

This Arch u-boot is older than your current envs. A few commands are not available in this u-boot version. Thay's why it had trouble booting.

I'll be back and recommend the next step.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 08, 2018 04:55AM
I think the inconsistency between your Arch u-boot and envs is too cumbersome to get it working. So the steps to do:

- Boot with kwboot using the latest GoFlex Home u-boot from this tarball: uboot.2017.07-tld-1.goflexhome.bodhi.tar
https://forum.doozan.com/read.php?3,12381

-The procedure is similar to this post (which use the NSA310S u-boot).
https://forum.doozan.com/read.php?3,51739,51919#msg-51919

- Your command would be

kwboot  -t -B 115200 /dev/ttyUSB0 -b uboot.2017.07-tld-1.goflexhome.mtd0.kwb  -p

- Once you can kwboot with this uboot.2017.07-tld-1.goflexhome.mtd0.kwb image, the next step is to plug in the Debian USB rootfs and try booting it.

Please post serial console log of your kwboot session.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 08, 2018 05:48AM
Thanks for that. Tried kwboot - the only other arm-based device I have is a Raspberry pi - which seemed to run kwboot, but just hung on the following:
./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2017.07-tld-1.goflexhome.mtd0.kwb  -p
Sending boot message. Please reboot the target.../

I then switched on the GFH and the led on the unit never comes on. The serial port shows the pi sending stuff out continuously and an occasional reply from the GFH but it just sat there until I pressed ctrl-\ or switched off the GFH.

It may be that the serial communication was flakey with the pi as I had trouble using screen on the pi, and in the end resorted to using putty from my Windows PC to proceed.

So I tried re-setting the environment variables manually to what I had before using setenv etc. and then plugged in the rootfs on the usb memory stick, and hey presto! - it boots into debian on the stick. I then followed the WiKi instructions to install the latest uBoot image and environment, and have set up the netconsole so have now dispensed with the serial connection. However, while installing uBoot I noticed the following differences:

cat /proc/mtd produces this which is different to the WiKi:
root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00600000 00020000 "uImage"
mtd2: 0d800000 00020000 "root"

Is this anything to worry about?

Now when the GFH boots up with the rootfs in the SATA drive, the netconsole gives this output:
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
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

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)
Unknown command 'mmc' - try 'help'
## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** Bad device usb 0 **

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

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            41943040        00000000-01     83
Unknown command 'mmc' - try 'help'
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
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 772 ms (4.7 MiB/s)
loading uInitrd ...
7245696 bytes read in 1431 ms (4.8 MiB/s)
loading DTB /boot/dts/kirkwood-goflexhome.dtb ...
10603 bytes read in 1452 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:      2017-07-24   0:18:23 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7245632 Bytes = 6.9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000


Starting kernel ...

So is the unknown command 'mmc' anything to worry about? And what about the 'Unknown partition table type 0' entries?

Seems to be working perfectly now though. I assume I can now create additional partitions on the SATA drive for data etc?

Many thanks for your help, and sorry for my mistakes earlier which led us down this longer route.

Kind regards,

spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 08, 2018 06:43AM
I spoke too soon! It seems that uBoot is ignoring the /boot/uEnv.txt file:

root@debian:~# cat /boot/uEnv.txt
custom_params=init=/bin/systemd

After rebooting the /proc/cmdline entry shows just:
root@debian:~# cat /proc/cmdline
console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts orion_nand:1M(u-boot),-(rootfs)

So I had to add the 'init=/bin/systemd' to the set_bootargs variable (as described in the WiKi) but shouldn't the uEnv.txt entry have done that? (I can't find anywhere in the new uBoot environment which reads the /boot/uEnv.txt file - so has this been omitted, or have I got the wrong version? - I used uboot.2016.05-tld-1.environment.bodhi.tar.)

Thanks,

spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 08, 2018 11:19AM
spindles7.,

Quote

Seems to be working perfectly now though. I assume I can now create additional partitions on the SATA drive for data etc?

Right! that's a great plan.

Don't worry about systemd for now. Once you got everything working, booting the rootfs as you want, then worry about that set up.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 09, 2018 07:11AM
So, all is booting fine form the rootfs installed on the SATA drive now. I now want to add the boot arguments to /boot/uEnv.txt such as:
custom_params=init=/bin/systemd ipv6.disable=1
to enable systemd and disable IP v6 but it ignores anything I enter in that file. What am I doing wrong?

Let me know what extra info you need.

Once again many thanks for your help.

spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 09, 2018 07:23AM
spindles7,

custom_params=init=/bin/systemd ipv6.disable=1

to enable systemd and disable IP v6 is correct. No other redefition is needed.

No other env should be added, unless you want redefine an existing env. New env cannot be defined in uEnv.txt.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 09, 2018 07:37AM
Thanks for that, but when I add that to /boot.uEnv.txt and reboot it doesn't work - ie the /proc/cmdline doesn't show the extra parameters and ipv 6 is still active and systemd not running.

My environment includes the setting:
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params

but custom_params doesn't seem to be getting the contents from /boot/uEnv.txt. After reboot the /proc/cmdline entry is:
~# cat /proc/cmdline
console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts orion_nand:1M(u-boot),-(rootfs)
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 09, 2018 07:46AM
spindles7,

Power up, interrupt serial console, and

printenv
boot

Please post the entire serial console log here.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 09, 2018 08:39AM
OK, here goes:
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:    5 4
printenv
boot
^C

[1]+  Stopped                 nc -l -u -p 6666
root@raspberrypi:/var/log # fg
nc -l -u -p 6666
                                                                              0
GoFlexHome>
GoFlexHome>
GoFlexHome>
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=usb
device=0:1
devices=usb ide mmc
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: 3012/131068 bytes
GoFlexHome> boot
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

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)
Unknown command 'mmc' - try 'help'
## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** Bad device usb 0 **

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
Unknown command 'mmc' - try 'help'
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
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 770 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 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 ...

BTW I got it to work by entering:
fw_setenv custom_params 'init=/bin/systemd ipv6.disable=1'
but all that proves is that custom_params is not being set by /boot/uEnv.txt.

thanks,
spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 09, 2018 11:38AM
spindles7,

Make sure the /boot/uEnv.txt file exists on the SATA rootfs.

Power up, interrupt serial console, and

setenv devices 'ide usb'
setenv bootdev ide
boot

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 09, 2018 04:09PM
Ok, here's the 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 usb'
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)
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

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
## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** Bad device usb 0 **
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 407 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 ...

After it started up, I show the contents of /boot:
# ls -l /boot
total 37112
drwxr-xr-x  3 root root    4096 Aug  9 08:37 .
drwxr-xr-x 21 root root    4096 Aug  8 09:36 ..
-rw-r--r--  1 root root  153501 Jul 16  2017 config-4.12.1-kirkwood-tld-1
drwxr-xr-x  2 root root    4096 Jul 15  2017 dts
-rw-r--r--  1 root root 7706606 Aug  9 08:37 initrd.img-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-------  1 root root 2504031 Jul 16  2017 System.map-4.12.1-kirkwood-tld-1
-rw-r--r--  1 root root      47 Aug  9 15:14 uEnv.txt
-rw-r--r--  1 root root 3821592 Jul 20  2017 uImage
-rw-r--r--  1 root root 7706670 Aug  9 08:38 uInitrd
-rw-------  1 root root 3821528 Jul 16  2017 vmlinuz-4.12.1-kirkwood-tld-1
-rwxr-xr-x  1 root root 3821528 Jul 16  2017 zImage-4.12.1-kirkwood-tld-1

and the contents of /boot/uEnv.txt:
# cat /boot/uEnv.txt
custom_params=init=/bin/systemd ipv6.disable=1

and the resulting cmdline passed to the kernel on boot:
# cat /proc/cmdline
console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts orion_nand:1M(u-boot),-(rootfs)

Note there's no mention of init=/bin/systemd ipv6.disable=1.

In the original environment there was a line:
importbootenv=echo Importing environment (uEnv.txt)...; env import -t $loadaddr $filesize
but there's no such line in the current environment. Is the uEnv.txt file read some other way?

Thanks,

spindles7
Re: Replace ArchLinuxARM with Debian on GoFlexHome
August 09, 2018 10:34PM
spindles7,

Quote

Is the uEnv.txt file read some other way?

No, the envs just did not seem to execute correctly.

Let's try again:

setenv devices ide
setenv bootdev ide
boot

-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: