Welcome! Log In Create A New Profile

Advanced

Kirkwood U-Boot and Debian Installer Script (WORK-IN-PROGRESS)

Posted by bodhi 
Re: Kirkwood U-Boot and Debian Installer Script (WIP)
September 27, 2016 06:16PM
Good, here is the new script, now it can flash also the recovery.

By default it will install everything, but I have added command line options to choose the type of installation
-install-uboot
-install-rootfs
-install-recovery
-install-uboot-rootfs
-install-uboot-recovery
-install-rootfs-recovery

before you try it on the pogoplug can you run a test to see if the blparam is handled correctly?
You start the script normally, but instead of choosing the device by writing a number, please write "X" (uppercase x) and press return.

That will download tools and try to read bootcmd (an env that you will have) and then try to read a non-existent env, to see if the former reads it ok and the latter errors and quits the script.


I added variables to be filled in the device section to let the script install the recovery.

I have all uimages in my dropbox currently, they have the same name as the dtb file, so in the RECOVERY_PLATFORM= variable you just need to write the name of the dtb dropping the "kirkwood-" (i.e. for pogoplug v4 the dtb is called "kirkwood-pogoplug_v4.dtb" so in the variable I wrote "pogoplug_v4").

Btw, the recovery should have avahi set up for ssh, so you can ssh in it by ssh root@lede.local
If you can't reach it, please check the PC's firewall as my linux PCs (OpenSUSE) had the firewall blocking that by default.
Attachments:
open | download - kirkwood-installer-14.sh (80.7 KB)
Re: Kirkwood U-Boot and Debian Installer Script (WIP)
September 30, 2016 02:47PM
I have bought a goflexnet as they are rather cheeep and are a "pogoplug OS" device so I can test on something that isn't a zyxel.
I tested the "X" test above and the script is using stock blparam fine.

I have backed up the mtd partitions and I'll try soon kwbooting it, then it will probably become another testing platform for a while before being flashed to LEDE.

On a secondary note, I'm not sure how the goflexnet's stock system is supposed to work for a normal user.
All links in manual for connecting to my device either lead to dead pages or to the main pogoplug website and not to my device.
I try to connect to the device's IP with my browser, and I get a blank page. :/

Are these devices dead weight without hacking, like the Cisco box?

I mean, I'm connected through its hardware serial so it's not an issue, but... I'm curious.



Edited 1 time(s). Last edit at 09/30/2016 02:51PM by bobafetthotmail.
Re: Kirkwood U-Boot and Debian Installer Script (WIP)
September 30, 2016 05:40PM
bobafetthotmail Wrote:
-------------------------------------------------------
> I have bought a goflexnet as they are rather
> cheeep and are a "pogoplug OS" device so I can
> test on something that isn't a zyxel.
> I tested the "X" test above and the script is
> using stock blparam fine.
>
> I have backed up the mtd partitions and I'll try
> soon kwbooting it, then it will probably become
> another testing platform for a while before being
> flashed to LEDE.
>
> On a secondary note, I'm not sure how the
> goflexnet's stock system is supposed to work for a
> normal user.
> All links in manual for connecting to my device
> either lead to dead pages or to the main pogoplug
> website and not to my device.
> I try to connect to the device's IP with my
> browser, and I get a blank page. :/
>
> Are these devices dead weight without hacking,
> like the Cisco box?
>

No it is not dead!

> I mean, I'm connected through its hardware serial
> so it's not an issue, but... I'm curious.

Pogoplug.com is no longer good. So you need to stop pogo OS to phone home (pogoplug_kill_program). And enable ssh:

http://forum.doozan.com/read.php?4,22570

But we have rescue systems.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Kirkwood U-Boot and Debian Installer Script (WIP)
October 01, 2016 12:44PM
bodhi Wrote:
-------------------------------------------------------
>
> No it is not dead!
>

Umm, the device's firmware works at least, yes, but it is supposed to work through pogoplug.com site that seems to have dropped support as I cannot find a way to use my goflexnet the way it was supposed to be used.

How can normal users (not people like us that can open SSH or connect serial to the board) use this box?

That's what I'm curious about.
Re: Kirkwood U-Boot and Debian Installer Script (WIP)
October 27, 2016 01:57AM
From my experience you can't. When I last tried enabling SSH on the box, it was impossible without serial.
And the pogo service isn't available anymore.
But I doubt, that anyone without knowledge of the open source modification would bother buying this anyway, with it's bad reputation at amazon and such.



Edited 2 time(s). Last edit at 10/27/2016 02:02AM by ElMariachi.
Re: Kirkwood U-Boot and Debian Installer Script (WIP)
November 03, 2016 05:28AM
I uploaded the script to github with also the other missing tools (made a pull request on bodhi's, here https://github.com/mibodhi/kirkwood).

After he merged it (could I also get write access to that repo too? I'm not a NSA goon, I swear :) ), anyone can read the script and add support for his device. I don't have most kirwkood devices around so I lack the information to do it.

If you cannot add the device on your own, you can at least run the script's information-gathering function from inside the stock firmware and post the logs here so I can add support to it.

More appropriate instructions to do so and in general to use the script in its current incarnation will appear when the github PR is merged so I can also give you a download link from there.
Re: Kirkwood U-Boot and Debian Installer Script (WIP)
November 03, 2016 02:12PM
bobafetthotmail,

I must have deleted the GitHub notification email by mistake! Will get to that PR.

-bodhi
===========================
Forum Wiki
bodhi's corner
Hi,

does this script already work for Goflex NET.

Got a second one recently and wanted to add debian as I did some years ago.
First thing I noticed: I'm not able to enable ssh via pogoplug webpage. So I was forced to enabled ssh via serial connection.
Then I tried the installer script in v14 but got the following error message when running the blparam test ('X')

....
# Successfully installed /tmp/tools/etc/fw_env.config.
we will now read the bootcmd, then try reading a non-existing env
stock blparam detected, reading envs with it
env read, it is nand read.e 0x800000 0x100000 0x300000; setenv bootargs $(console) $(bootargs_root); bootm 0x800000
stock blparam detected, reading envs with it
##
##
## INSTALLATION FAILED!
##
## ## Could not read NON-EXISTING_ENV uboot variable.
##
##
## THE INSTALLATION FAILED BUT NO
## DAMAGE WAS MADE, YOU CAN SAFELY
## SHUTDOWN YOUR DEVICE

The box is still running stock os.
Furthermore in the code of the script I wasn't able to detect Goflex specific parts.

best regards,
cokker
Re: Kirkwood U-Boot and Debian Installer Script (WIP)
December 22, 2016 03:44PM
cokker,

This script has not been released.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Kirkwood U-Boot and Debian Installer Script (WIP)
December 23, 2016 02:26PM
cokker Wrote:
-------------------------------------------------------
> Hi,
>
> does this script already work for Goflex NET.
>

No, it lacks the settings to deal with Goflex NET, but they can be added.

>Then I tried the installer script in v14 but got the following error message when running the blparam test ('X')

That test is actually successful, it first tries to read an existing env and succeeds so it proceeds with the second test. the second test is trying to read a non-existing env variable and it fails (see the error message, "NON-EXISTING_ENV" is an env that does not exist) and this error blocks installation before doing any damage. It's a test to make sure that the script is working as intended on devices with blparam tool like yours.

> Furthermore in the code of the script I wasn't
> able to detect Goflex specific parts.

Yeah, because there are none. Currently the script supports Zyxel nsa 310 only as that's the device I used to develop it.

If you are able to add support for your device and test it, feel free to do so.

For a Goflex NET you need to copy and then edit the
1) #zyxel nsa310
entry to fit your device,

the
PLATFORM="nsa310"
must become a
PLATFORM="goflexnet"

the
STOCK_MTD0="/dev/mtd0"
must remain the same

the
ENV_DTB_FILE="/boot/dts/kirkwood-nsa310b-lmsensor-redusbled.dtb"
must become
ENV_DTB_FILE="/boot/dts/kirkwood-goflexnet.dtb"

the
MACHID=""
should remain like that

the
ARCNUMBER="4022"
must become
ARCNUMBER=""
(technically speaking, it was not needed even for the zyxel nsa 310)

you can ignore the variables that start with RECOVERY_ as they are to install a custom recovery firmware I don't have for Goflex NET.

the
UBOOT_URL=$UBOOT_NSA310_URL
must become a
UBOOT_URL=$UBOOT_GOFLEXNET_URL

the
zyxel_kill_programs
must become
pogoplug_kill_programs

Please note, goflexnet and similar pogoplug derivatives do not allow easy recovery in case of wrong bootloader flash, so in case the script fails, you might brick the device.
STANDARD DISCLAIMER: IF YOU PROCEED YOU DO SO AT YOUR OWN RISK

The script is designed to abort installation before it has done any change to the bootloader (component needed to start any operating system on that device), and changing the bootloader is the last step, so if downloading/formatting/installing debian in the external drive fails for some reason it's not an issue and you can retry.
You have already seen how a harmless error looks like with the test you ran.

If you want I can attach a modified script to another post so you can download and use it directly.
Hi,

thanks for your response. Unfortunately I wasn't able the answer earlier
I'm somehow busy these days....

I was able to use your script to prepare a usb drive as booting device. This worked well. Thanks so far.

But before I was able to read your answer and since the script didn't support my goflex, I flashed it with the original script from here. Suprisingly this still work but uses an rather old uboot.

Then the next problem came up: This version was not able to boot the goflex using the root fs on usb. So I was forced to update. This time I tweaked your script according to your advice. Then I tested it step by step before actually doing any serious things. There came up some points I just want you to know. When I find time the next days I'm able to test it further and then provide some more details.:

1. flashing Environment:
This actually works but somehow my mdtparts got screwed up. I was able to restore it to:
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)

2. flashing uboot image
this worked too but the script wasn't able to verify the md5 for some reason.

As already mentioned I will test it further but I have to do some data recovery beforehand ;).

best regards,
cokker
Re: Kirkwood U-Boot and Debian Installer Script (WIP)
January 13, 2017 01:16PM
>1. flashing Environment:
>This actually works but somehow my mdtparts got screwed up.

If you can be more descriptive it's better, what was the (wrong) mtdparts written by the script?

>2. flashing uboot image
>this worked too but the script wasn't able to verify the md5 for some reason.

So you saw the scary error and you went through anyway?

I currently don't have much time to look at this, will do next week probably.
Re: Kirkwood U-Boot and Debian Installer Script (WORK-IN-PROGRESS)
November 06, 2017 05:36AM
This is a pretty long thread and haven't gone through it in detail, but am I to understand that I can use a script to update my GoFlexHome with the latest Kirkwood U-Boot? I'm currently unable to get kwboot working but can boot from USB and have access via ssh.

My U-Boot is Arch Linux ARM 2014.04.R2-1.
Re: Kirkwood U-Boot and Debian Installer Script (WORK-IN-PROGRESS)
November 06, 2017 06:27AM
balanga Wrote:
-------------------------------------------------------
> This is a pretty long thread and haven't gone
> through it in detail, but am I to understand that
> I can use a script to update my GoFlexHome with
> the latest Kirkwood U-Boot? I'm currently unable
> to get kwboot working but can boot from USB and
> have access via ssh.
>
> My U-Boot is Arch Linux ARM 2014.04.R2-1.

No, it is incompleted and has not been released yet.

See here for GFHome uboot installation:
https://forum.doozan.com/read.php?3,12381

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



Edited 1 time(s). Last edit at 11/06/2017 06:29AM by bodhi.
Re: Kirkwood U-Boot and Debian Installer Script (WORK-IN-PROGRESS)
November 08, 2017 04:30AM
If I understand the instructions correctly, it involves using kwboot. Unfortunately, it seems there is something wrong with my GFH base unit and I can't establish a serial connection. It does boot up OK and I can ssh into it though I don't know if I may have damaged the pinhole connections in some way through using them too much, if that is possible.. I've tried a different USB serial connector but that doesn't make any difference.
Re: Kirkwood U-Boot and Debian Installer Script (WORK-IN-PROGRESS)
November 08, 2017 04:59AM
balanga,

> If I understand the instructions correctly, it
> involves using kwboot.

No, it does not. kwboot is only a rescue mechanism when your u-boot installation was not successful (and result in semi-bricked box).

> Unfortunately, it seems
> there is something wrong with my GFH base unit and
> I can't establish a serial connection. It does
> boot up OK and I can ssh into it though I don't
> know if I may have damaged the pinhole connections
> in some way through using them too much, if that
> is possible.. I've tried a different USB serial
> connector but that doesn't make any difference.

Please start a new u-boot thread for you GHome u-boot intstallation and serial console problem. I will be glad to help you with that specific topic. And describe in details what has been done to the box.

-bodhi
===========================
Forum Wiki
bodhi's corner
Sorry, you can't reply to this topic. It has been closed.