Dual boot with Openwrt on NAND
April 02, 2018 06:10AM
Hello,

I installed Openwrt on my Dockstar on the nand memory accordung to this tutorial:
https://wiki.openwrt.org/toh/seagate/dockstar
I used the single stage uboot installation and now I have the following uboot version:
U-Boot 2014.10 (Jan 02 2016 - 02:33:53)Seagate FreeAgent DockStar
SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Openwrt is running fine, but I wanted to use it as dual boot system, i.e. when there is a USB stick inserted, it should boot it, but is does not.
Can anybody please tell me what I have to configure at the console to enable it?
(I have a serial console available)
Is there a tutorial to prepare the USB system? I am not sure if my old one is corrupted.

Kind Regards, Dieter
Re: Dual boot with Openwrt on NAND
April 02, 2018 09:35AM
These are my boot messages:
Hit any key to stop autoboot:  0
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=3", size 254 MiB) to ubi0
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512
UBI: VID header offset: 512 (aligned 512), data offset: 2048
UBI: good PEBs: 2031, bad PEBs: 1, corrupted PEBs: 0
UBI: user volume: 2, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
UBI: available PEBs: 0, total reserved PEBs: 2031, PEBs reserved for bad PEB handling: 39
Loading file '/boot/zImage' to addr 0x00800000 with size 1739190 (0x001a89b6)...
Done
Unmounting UBIFS volume rootfs!
Kernel image @ 0x800000 [ 0x000000 - 0x1a61b0 ]

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 3.18.23 (buildbot@builder1) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r47269) ) #1 Sun Jan 31 11:40:01 CET 2016

I don't see, that uboot is checking any USB drives. (But I am obviously no expert)
Re: Dual boot with Openwrt on NAND
April 02, 2018 03:16PM
Dieter,

> Openwrt is running fine, but I wanted to use it as
> dual boot system, i.e. when there is a USB stick
> inserted, it should boot it, but is does not.
> Can anybody please tell me what I have to
> configure at the console to enable it?
> (I have a serial console available)
> Is there a tutorial to prepare the USB system? I
> am not sure if my old one is corrupted.
>

What is in the USB drive? Debian, OpenWrt?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dual boot with Openwrt on NAND
April 02, 2018 03:20PM
Thanks!

It is Debian.

As I said, I am nicht sure if it is ok. I would generate a new one, if I knew how.

I have several linux systems running, but no other Dockstar.

Dieter
Re: Dual boot with Openwrt on NAND
April 02, 2018 07:30PM
Somewhere in this Rescue subforum there was a post that showed how to boot Debian with OpenWrt u-boot.

But if you flashed my released u-boot, you can also boot both OpenWrt and Debian.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dual boot with Openwrt on NAND
April 03, 2018 01:10AM
Hi bodhi,

thanks for your support.
Ok, I will try to flash your u-boot tonight. Will the boot paremeters of Openwrt remain the same as before? Or how do I ensure, that my Openwrt will boot again?

Regards, Dieter
Re: Dual boot with Openwrt on NAND
April 03, 2018 02:55PM
Hi bodhi,

I am a bit scared to update uboot, because my mtd sizes look very different:

root@OpenWrt-Dockstar:/tmp/tools# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000e0000 00020000 "uboot"
mtd1: 00020000 00020000 "uboot_env"
mtd2: 00100000 00020000 "second_stage_uboot"
mtd3: 0fe00000 00020000 "root"

Specially, the size of mtd0 does not fit. Can I still upgrade? What have I got to consider?

If I update, should I use the default uboot.2016.05-tld-1.environment.bodhi.tar, too?

What do I have to set to boot my openwrt again?

Thanks again for your support!!

Regards, Dieter



Edited 1 time(s). Last edit at 04/03/2018 02:58PM by Dieter.
Re: Dual boot with Openwrt on NAND
April 03, 2018 06:48PM
Dieter,

You're right to be careful. You should not upgrade u-boot without knowing that it still boots OpenWrt.

> Specially, the size of mtd0 does not fit. Can I
> still upgrade?

No, you can't upgrade u-boot just yet.

> What have I got to consider?

If you are willing to reinstall OpenWrt/LEDE then see joerg's howto here:
https://forum.doozan.com/read.php?4,42279

The Dockstar has its own images at that download site.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dual boot with Openwrt on NAND
April 06, 2018 11:08AM
Hi bodhi,

I am trying to update uboot, now, but flash_erase is not working:
root@OpenWrt-Dockstar:/tmp/tools# ls
busybox        flash_erase    fw_printenv    nandwrite
e2fsck         fw_env.config  nanddump
root@OpenWrt-Dockstar:/tmp/tools# ./flash_erase  /dev/mtd0 0 4
/bin/ash: ./flash_erase: not found
root@OpenWrt-Dockstar:/tmp/tools# /tmp/tools/flash_erase  /dev/mtd0 0 4
/bin/ash: /tmp/tools/flash_erase: not found
root@OpenWrt-Dockstar:/tmp/tools#

Very strange, because fw_printenv works.

Any idea what is going wrong?

Couldn't I do it via serial as for the openwrt:
mw 0x800000 0xffff 0x80000
tftpboot uboot.2017.07-tld-1.dockstar.mtd0.kwb
nand erase 0x000000 0x100000
nand write.e 0x800000 0x000000 0x80000
setenv bootcmd nand read.e 0x2000000 0x100000 0x400000\; go 0x2000000
saveenv

Probably need to adjust the addresses, right?
How about the envs I have to set afterwards?

Regards, Dieter



Edited 2 time(s). Last edit at 04/06/2018 11:13AM by Dieter.
Re: Dual boot with Openwrt on NAND
April 06, 2018 05:01PM
Dieter ,

Try using the OpenWrt flash_erase.

----

If you flash it in serial console, you also need to flash the default envs image too. Or you can also use a script I had posted to populate the envs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 04/06/2018 05:06PM by bodhi.
Re: Dual boot with Openwrt on NAND
April 08, 2018 07:04AM
Hello bodhi,

I tried, and still get the same message:
root@OpenWrt-Dockstar:/tmp# /usr/sbin/flash_erase /dev/mtd0 0 4
/bin/ash: /usr/sbin/flash_erase: not found

So again, I must try it with the serial, I see no other way, do you?

Before I brick my Dockstar, is the input for the serial connection above right, or does it need to be adjusted?
How do I flash the envs?
I currently don't have a booting debian on a stick, so I can not use the script. How do I set up a booting debian image on a stick from scratch?
I can not find the manual to do it.

Sorry to ask so many question, but I am lost right now.

Thank you, Dieter
Re: Dual boot with Openwrt on NAND
April 08, 2018 05:13PM
Dieter,

I am not familiar with OnenWrt so I can't tell why you got this error with flash_erase.

> Before I brick my Dockstar, is the input for the
> serial connection above right, or does it need to
> be adjusted?

The Dockstar does not have a UART booting recovery. So it is best to flash u-boot inside Debian. Because if the flashing went wrong, there might be still some way for us to fix it. When you flash in serial console, and it is bad then it is bricked! and It is actually easier to flash u-boot if you boot with Debian first.

> I currently don't have a booting debian on a
> stick, so I can not use the script. How do I set
> up a booting debian image on a stick from
> scratch?


Create the Debian rootfs Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 as instructed in the 1st post:

https://forum.doozan.com/read.php?2,12096

Scroll down to section:

Quote

Updated 24 Jul 2017:

Basic Debian stretch Kirkwood rootfs for most Kirwood plugs:

- tarball size: 188M
- install size: 488M
- The init system used in this rootfs is sysvinit . To boot with systemd, see note 2 below.
- Installed packages: nano, avahi, ntp, busybox-syslogd (log to RAM), htop, isc-dhcp-client, dialog, bzip2, nfs server/client, iperf, ethtool, sysvinit-core, sysvinit, and sysvinit-utils.
- see LED controls in /etc/rc.local, and /etc/init.d/halt
- see some useful aliases in /root/.profile
- root password: root

Download at Dropbox:

Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2

md5:
bf3d29569943875df348fb5ca03b348c
sha256:
4ed5714fdb123cdb40e973f3d0754e91cd199b75a9874018f2b5dc9cfa8ae8bb

And remember to check the hash of what you download, as always.

Yoiu can create the USB Debian rootfs while in OpenWrt. And reboot. Interrupt serial console and enter some envs to boot from USB. Once you get to that point, if you not sure how to proceed, please post the question.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dual boot with Openwrt on NAND
April 10, 2018 03:27PM
Hello bodhi,

Thank you for your ongoing excellent support.
I got now this far: I generated my new USB Debian rootfs. But I don't know how to alter the envs to boot from usb.
Could you please, once more, please help me?
Thank you so much,

Dieter
Re: Dual boot with Openwrt on NAND
April 10, 2018 09:37PM
Dieter Wrote:
-------------------------------------------------------
> Hello bodhi,
>
> Thank you for your ongoing excellent support.
> I got now this far: I generated my new USB Debian
> rootfs. But I don't know how to alter the envs to
> boot from usb.
> Could you please, once more, please help me?
> Thank you so much,
>
> Dieter

Sure. Please post your latest uboot envs in serial console.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dual boot with Openwrt on NAND
April 11, 2018 03:56PM
Hello bodhi,

here it is:
U-Boot 2014.10 (Jan 02 2016 - 02:33:53)Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
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
dockstar => printenv
baudrate=115200
bootargs_root=ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs rw
bootcmd=setenv bootargs ${console} ${mtdparts} ${bootargs_root}; ubi part root;                                                                       ubifsmount ubi:rootfs; run ubiboot_n1
bootdelay=3
console=console=ttyS0,115200
ethact=egiga0
ethaddr=00:10:75:1A:DD:17
fdt=/boot/dockstar.dtb
fileaddr=800000
filesize=44e800
ipaddr=192.168.180.5
kernel=/boot/zImage
mtddevname=uboot
mtddevnum=0
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100                                                                      000@0x100000(second_stage_uboot),-@0x200000(root)
netmask=255.255.255.0
partition=nand0,0
serverip=192.168.180.21
stderr=serial
stdin=serial
stdout=serial
ubiboot_n1=ubifsload 0x800000 ${kernel}; ubifsumount; bootz 0x800000

Environment size: 776/131068 bytes
dockstar =>

Thanks again, Dieter
Re: Dual boot with Openwrt on NAND
April 12, 2018 12:00AM
On another Linux box, mount the Debian rootfs that you meant to run on this Dockstar and put the attached u-boot script in the /boot folder (if it was mounted at /media/sdb1):

cp -a uboot.2016.05-tld-1.environment.scr /media/sdb1/boot/

Power up this box and interrupt serial console, run the script loading commands:

usb start
ext2load usb 0:1 0x800000 /boot/uboot.2016.05-tld-1.environment.scr
source 0x800000
printenv

Adjust the other specific envs and then boot the rootfs (replace xx:xx:xx:xx:xx:xx with your real ethaddr):
setenv devices 'usb'
setenv ethaddr xx:xx:xx:xx:xx:xx
setenv dtb_file '/boot/dts/kirkwood-dockstar.dtb'
boot

Once you've booted into Debian, let's pause and take look at your mtd partitions before proceeding to flash new u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - uboot.2016.05-tld-1.environment.scr (3.2 KB)
Re: Dual boot with Openwrt on NAND
April 12, 2018 12:49PM
Hello bodhi,

I did not get very far:

dockstar => usb start
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
dockstar => ext2load usb 0:1 0x800000 /boot/uboot.2016.05-tld-1.environment.scr
3232 bytes read in 301 ms (9.8 KiB/s)
dockstar => source 0x800000
## Executing script at 00800000
** Too many args (max. 16) **
** Too many args (max. 16) **
** Too many args (max. 16) **
** Too many args (max. 16) **
** Too many args (max. 16) **
** Too many args (max. 16) **
** Too many args (max. 16) **
dockstar =>

Probably, because the uboot is too old to handle so many arguments per command?

Regards, Dieter

PS: I still have it running, can I switch it off?



Edited 1 time(s). Last edit at 04/12/2018 02:06PM by Dieter.
Re: Dual boot with Openwrt on NAND
April 12, 2018 05:21PM
Dieter,

> Probably, because the uboot is too old to handle
> so many arguments per command?

True.

> PS: I still have it running, can I switch it off?

Sure, you did not save anything.

Let me write a few envs. I was hoping I can use the script, but it is too new for this u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dual boot with Openwrt on NAND
April 15, 2018 01:00AM
Try

setenv bootdev usb
setenv device 0:1
setenv set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
setenv load_dtb_addr 0x1c00000
setenv load_initrd_addr 0x1100000
setenv load_uimage_addr 0x800000
setenv dtb_file '/boot/dts/kirkwood-dockstar.dtb'
setenv load_dtb 'echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file'
setenv load_initrd 'echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd'
setenv load_uimage 'echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage'
setenv bootcmd_exec 'run load_uimage; run load_initrd; run load_dtb; bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr'
setenv bootcmd 'usb reset; run set_bootargs; run bootcmd_exec; reset'

and then
boot

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dual boot with Openwrt on NAND
April 16, 2018 02:29PM
Dear bodhi,

the uboot seems to have problems with your commands:

All the setenvs were fine, but then:
...
dockstar => boot
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
loading uImage ...
Unknown command 'load' - try 'help'
loading uInitrd ...
Unknown command 'load' - try 'help'
loading DTB $dtb_file ...
Unknown command 'load' - try 'help'
bootm - boot application image from memory

Usage:
bootm [addr [arg ...]]
    - boot application image stored in memory
        passing arguments 'arg ...'; when booting a Linux kernel,
        'arg' can be the address of an initrd image
        When booting a Linux kernel which requires a flat device-tree
        a third argument is required which is the address of the
        device-tree blob. To boot that kernel without an initrd image,
        use a '-' for the second argument. If you do not pass a third
        a bd_info struct will be passed instead

For the new multi component uImage format (FIT) addresses
        must be extened to include component or configuration unit name:
        addr:<subimg_uname> - direct component image specification
        addr#<conf_uname>   - configuration specification
        Use iminfo command to get the list of existing component
        images and configurations.

Sub-commands to do part of the bootm sequence.  The sub-commands must be
issued in the order below (it's ok to not issue all sub-commands):
        start [addr [arg ...]]
        loados  - load OS image
        ramdisk - relocate initrd, set env initrd_start/initrd_end
        fdt     - relocate flat device tree
        cmdline - OS specific command line processing/setup
        bdt     - OS specific bd_t processing
        prep    - OS specific prep before relocation or go
        go      - start OS
resetting ...


U-Boot 2014.10 (Jan 02 2016 - 02:33:53)Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
...

Could you please try once more?

Regards, Dieter



Edited 1 time(s). Last edit at 04/16/2018 02:30PM by Dieter.
Re: Dual boot with Openwrt on NAND
April 16, 2018 03:15PM
Hello Dieter
maybe i can help you, i wrote a short how2 for a dualbootsystem with debian on USB stick and LEDE in nand for dockstar:
# NOTE you need serial console to do this job!
# the most is in german, because i posted it in a german forum
# but if necessary i can translate for you
--------------------------------------------------------------------------------
# am Windows Rechner tftp.zip runterladen
(tftp server)
# am Windows PC ein Verzeichnis erstellen c:/TFTP und hier alles rein kopieren
# entpacken und starten
# die kwb files, die enviroment.img und die LEDE Files ins c:/TFTP kopieren
# am Windows Rechner IP ermitteln:
cmd
ipconfig
# z.b. 192.168.1.100
--------------------------------------------------------------------------------
# auf der Dockstar @console ip's entsprechen setzen:
# set tftp-server ip
setenv serverip <ip_von_ipconfig>

# mac adresse von Dockstar auslesen: <ethaddr Userbox> hier notieren!

printenv ethaddr z.b. 00:25:31:04:xx:xx
###. TFTP bootng - this works:
# set Dockstar net ip (beliebig aber im selben Nummernkreis wie serverip)

setenv ipaddr 192.168.1.240

# test auf bad nand-blocks
nand info
nand bad
# Wenn die Zahl größer ist als "0x00100000" ist das kein Problem!!
# sonst nicht flashen - es besteht Gefahr die Dockstar zu bricken.
--------------------------------------------------------------------------------
# original uboot.2017.07-tld-1.dockstar.mtd0.kwb # Dockstar
--------------------------------------------------------------------------------
Nun solltet ihr spätestens den tftp Server aufrufen den wir zuvor heruntergeladen habt,
es geht weiter mit:

tftpboot 0x800000 uboot.2017.07-tld-1.dockstar.mtd0.kwb
nand erase 0 0x80000
nand write.e 0x800000 0x0 0x80000
--------------------------------------------------------------------------------
# original uboot-envs uboot.2016.05-tld-1.environment.img # universal
--------------------------------------------------------------------------------
# zur Sicherheit Dockstar neu durchstarten mit und Start wieder abrechen
# restart the dockstar once after flashing uboot in nand and interrupt start again
reset

# dann fortfahren:
tftpboot 0x800000 uboot.2016.05-tld-1.environment.img
nand erase 0xc0000  0x20000
nand write.e 0x800000 0xc0000 0x20000

# @uboot Dockstar:
# Eigene mac adresse wieder herstellen und variablen setzen:
# restart dockstar again and interrupt start
reset

setenv ethaddr <ethaddr Userbox>
setenv arcNumber 2998
setenv machid
setenv dtb_file '/boot/dts/kirkwood-dockstar.dtb'
saveenv
reset
# fertich das wars mit uboot und envs
--------------------------------------------------------------------------------
# wenn du LEDE im nand hast (oder willst) dann diese envs noch eingeben:
--------------------------------------------------------------------------------
# @bootloader

setenv mtdparts 'mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)'
setenv set_bootargs_lede 'setenv bootargs console=ttyS0,115200 $mtdparts'
setenv bootcmd_lede 'run set_bootargs_lede; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000'
setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_lede'
setenv bootcmd_exec 'if run load_uimage; then; 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; fi'
saveenv

# Achtung hier wird der nand Speicher gelöscht und vorbereitet für LEDE Installation!
nand erase.part ubi

reboot (or unplug Dockstar)

# fertich das wars mit den envs für LEDE/debian dualboot

--------------------------------------------------------------------------------
# LEDE Installation auf der Dockstar:
--------------------------------------------------------------------------------
# Run the following code for starting the process:
# ladet euch die Datei lede-kirkwood-dockstar-initramfs-uImage auf einen fat32 formatierten USB Stick
# steckt ihn an der Dockstar an starten, und in der seriellen Konsole den Start abbrechen, von hier geht es so weiter:

# @bootloader run LEDE from usb pendrive

usb reset; fatload usb 0 0x800000 lede-kirkwood-dockstar-initramfs-uImage; bootm 0x800000

# sobald die Dockstar hochgefahren ist (dauert ca. 1Minute) einmal enter Taste dann:

opkg update
opkg install ca-bundle ca-certificates libustream-openssl luci-ssl ubi-utils kmod-mtd-rw

# log in a Webbrowser session @Dockstars ipadress:
# Empfehlung: Google Chrome oder FireFox, der Edge von Mircosoft geht nicht!
# (nehmt den upgrade-File von meinem Download .)

lede-17.01.4-kirkwood-dockstar-squashfs-sysupgrade.tar

in LEDE Menü nach Upgrade device/router suchen den obigen File auswählen und
upgrade drücken und warten.....
Sollte jetzt im nand sein und nach reboot ohne Stick im LEDE landen.

Download all necessary files from my dropbox: dockstar files+tftp server from dropbox

and here is a working debian.img file (stretch with latest kernel) tested on a dockstar treated like above:
debian image file with kernel 4.16.1 (root/root)

see pictures:
LEDE booting
ready for debian booting

good luck
joerg_999



Edited 9 time(s). Last edit at 04/22/2018 02:16PM by joerg_999.
Re: Dual boot with Openwrt on NAND
April 16, 2018 05:39PM
Dieter Wrote:
-------------------------------------------------------
> Dear bodhi,
>
> the uboot seems to have problems with your
> commands:
>
> All the setenvs were fine, but then:
>
> ...
> dockstar => boot
> (Re)start USB...
> USB0:   USB EHCI 1.00
> scanning bus 0 for devices... 4 USB Device(s)
> found
>        scanning usb for storage devices... 1
> Storage Device(s) found
> loading uImage ...
> Unknown command 'load' - try 'help'
> loading uInitrd ...
> Unknown command 'load' - try 'help'
> loading DTB $dtb_file ...
> Unknown command 'load' - try 'help'
> bootm - boot application image from memory
> 
> Usage:
> bootm [addr [arg ...]]
>     - boot application image stored in memory
>         passing arguments 'arg ...'; when booting
> a Linux kernel,
>         'arg' can be the address of an initrd
> image
>         When booting a Linux kernel which requires
> a flat device-tree
>         a third argument is required which is the
> address of the
>         device-tree blob. To boot that kernel
> without an initrd image,
>         use a '-' for the second argument. If you
> do not pass a third
>         a bd_info struct will be passed instead
> 
> For the new multi component uImage format (FIT)
> addresses
>         must be extened to include component or
> configuration unit name:
>         addr:<subimg_uname> - direct component
> image specification
>         addr#<conf_uname>   - configuration
> specification
>         Use iminfo command to get the list of
> existing component
>         images and configurations.
> 
> Sub-commands to do part of the bootm sequence. 
> The sub-commands must be
> issued in the order below (it's ok to not issue
> all sub-commands):
>         start [addr [arg ...]]
>         loados  - load OS image
>         ramdisk - relocate initrd, set env
> initrd_start/initrd_end
>         fdt     - relocate flat device tree
>         cmdline - OS specific command line
> processing/setup
>         bdt     - OS specific bd_t processing
>         prep    - OS specific prep before
> relocation or go
>         go      - start OS
> resetting ...
> 
> 
> U-Boot 2014.10 (Jan 02 2016 - 02:33:53)Seagate
> FreeAgent DockStar
> 
> SoC:   Kirkwood 88F6281_A0
> DRAM:  128 MiB
> ...
>
>
> Could you please try once more?
>
> Regards, Dieter


Ah. I forgot the load commands. Try

setenv bootdev usb
setenv device 0:1
setenv set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial'
setenv load_dtb_addr 0x1c00000
setenv load_initrd_addr 0x1100000
setenv load_uimage_addr 0x800000
setenv dtb_file '/boot/dts/kirkwood-dockstar.dtb'
setenv load_dtb 'echo loading DTB $dtb_file ...; ext2load $bootdev $device $load_dtb_addr $dtb_file'
setenv load_initrd 'echo loading uInitrd ...; ext2load $bootdev $device $load_initrd_addr /boot/uInitrd'
setenv load_uimage 'echo loading uImage ...; ext2load $bootdev $device $load_uimage_addr /boot/uImage'
setenv bootcmd_exec 'run load_uimage; run load_initrd; run load_dtb; bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr'
setenv bootcmd 'usb reset; run set_bootargs; run bootcmd_exec; reset'

and then

boot

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dual boot with Openwrt on NAND
April 19, 2018 01:21PM
Hello both of you,

First of all, thanks again for your support!

I followed joerg's suggestion and I believe I got pretty far.
uboot is updated and so on.
I booted lede, but the opkg installation failed:
root@LEDE:/# opkg install ca-bundle ca-certificates libustream-openssl luci-ssl
ubi-utils kmod-mtd-rw
Installing ca-bundle (20170717) to root...
Installing ca-certificates (20170717) to root...
Installing libustream-openssl (2016-07-02-ec80adaa-4) to root...
Installing luci-ssl (git-18.098.72829-575e327-1) to root...
Package ubi-utils (1.5.2-1) installed in root is up to date.
Installing kmod-mtd-rw (4.4.92+git-20160214-1) to root...
Collected errors:
 * verify_pkg_installable: Only have 0kb available on filesystem /overlay, pkg ca-bundle needs 132
 * opkg_install_cmd: Cannot install package ca-bundle.
 * verify_pkg_installable: Only have 0kb available on filesystem /overlay, pkg ca-certificates needs 143
 * opkg_install_cmd: Cannot install package ca-certificates.
 * verify_pkg_installable: Only have 0kb available on filesystem /overlay, pkg libustream-openssl needs 4
 * opkg_install_cmd: Cannot install package libustream-openssl.
 * verify_pkg_installable: Only have 0kb available on filesystem /overlay, pkg luci-ssl needs 1
 * opkg_install_cmd: Cannot install package luci-ssl.
 * verify_pkg_installable: Only have 0kb available on filesystem /overlay, pkg kmod-mtd-rw needs 2
 * opkg_install_cmd: Cannot install package kmod-mtd-rw.
root@LEDE:/# [   55.777780] random: nonblocking pool is initialized
It seems, I am running out of file space.
Please, what can I do?

Regards, Dieter
Re: Dual boot with Openwrt on NAND
April 19, 2018 05:21PM
Dieter,

> uboot is updated and so on.

Cool!

> I booted lede, but the opkg installation failed:

joerg should be able to help you.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dual boot with Openwrt on NAND
April 21, 2018 12:18PM
Is something wrong with my mtd?
Here is it:
root@LEDE:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000e0000 00020000 "u-boot"
mtd1: 00100000 00020000 "u-boot environment"
mtd2: 00200000 00020000 "second stage u-boot"
mtd3: 0fe00000 00020000 "ubi"

These are my boot message, there is an UBI Error:
DockStar> usb reset; fatload usb 0 0x800000 lede-kirkwood-dockstar-initramfs-uIm                                                                                          age; bootm 0x800000
resetting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
reading lede-kirkwood-dockstar-initramfs-uImage
3219188 bytes read in 209 ms (14.7 MiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM LEDE Linux-4.4.92
   Created:      2017-10-17  17:46:20 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3219124 Bytes = 3.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.4.92 (buildbot@builds-02.infra.lede-project.org)                                                                                           (gcc version 5.4.0 (LEDE GCC 5.4.0 r3103-1b51a49) ) #0 Tue Oct 17 17:46:20 2017
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397                                                                                          f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine model: Seagate FreeAgent Dockstar
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pag                                                                                          es: 32512
[    0.000000] Kernel command line: console=ttyS0,115200n8 earlyprintk root=/dev                                                                                          /sda1 rootdelay=10
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 119600K/131072K available (4082K kernel code, 142K rwdata                                                                                          , 652K rodata, 5128K init, 201K bss, 11472K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc8800000 - 0xff800000   ( 880 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc04a7db4   (4736 kB)
[    0.000000]       .init : 0xc04a8000 - 0xc09aa000   (5128 kB)
[    0.000000]       .data : 0xc09aa000 - 0xc09cdbc8   ( 143 kB)
[    0.000000]        .bss : 0xc09cdbc8 - 0xc0a0027c   ( 202 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xff                                                                                          ffffff, max_idle_ns: 9556302233 ns
[    0.000009] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737                                                                                          418237ns
[    0.000085] Calibrating delay loop... 1191.11 BogoMIPS (lpj=5955584)
[    0.090090] pid_max: default: 32768 minimum: 301
[    0.090205] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090225] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090744] CPU: Testing write buffer coherency: ok
[    0.091086] Setting up static identity map for 0x81e0 - 0x821c
[    0.091330] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x2
[    0.096044] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, ma                                                                                          x_idle_ns: 19112604462750000 ns
[    0.096071] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.096157] pinctrl core: initialized pinctrl subsystem
[    0.097227] NET: Registered protocol family 16
[    0.097619] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.098347] cpuidle: using governor ladder
[    0.098696] Feroceon L2: Enabling L2
[    0.098741] Feroceon L2: Cache support initialised.
[    0.099014] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet                                                                                          0-port@0: local-mac-address is not set
[    0.116643] SCSI subsystem initialized
[    0.117367] usbcore: registered new interface driver usbfs
[    0.117443] usbcore: registered new interface driver hub
[    0.117507] usbcore: registered new device driver usb
[    0.118335] clocksource: Switched to clocksource orion_clocksource
[    0.119226] NET: Registered protocol family 2
[    0.119824] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.119849] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.119868] TCP: Hash tables configured (established 1024 bind 1024)
[    0.119924] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.119946] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.120138] NET: Registered protocol family 1
[    0.206758] Crashlog allocated RAM at address 0x3f00000
[    0.219357] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.219372] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORIT                                                                                          Y) (c) 2001-2006 Red Hat, Inc.
[    0.222071] io scheduler noop registered
[    0.222085] io scheduler deadline registered (default)
[    0.223200] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driv                                                                                          er
[    0.223762] irq: Cannot allocate irq_descs @ IRQ32, assuming pre-allocated
[    0.224115] irq: Cannot allocate irq_descs @ IRQ64, assuming pre-allocated
[    0.255553] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.258590] console [ttyS0] disabled
[    0.258661] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 25, base_baud =                                                                                           12500000) is a 16550A
[    0.706021] console [ttyS0] enabled
[    0.710954] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
[    0.717335] nand: Micron MT29F2G08AAD
[    0.721042] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB siz                                                                                          e: 64
[    0.728670] Scanning device for bad blocks
[    0.861721] Bad eraseblock 1697 at 0x00000d420000
[    0.893060] 4 ofpart partitions found on MTD device orion_nand
[    0.898937] Creating 4 MTD partitions on "orion_nand":
[    0.904098] 0x000000000000-0x0000000e0000 : "u-boot"
[    0.910819] 0x0000000e0000-0x0000001e0000 : "u-boot environment"
[    0.917954] 0x000000100000-0x000000300000 : "second stage u-boot"
[    0.925194] 0x000000200000-0x000010000000 : "ubi"
[    0.932027] libphy: orion_mdio_bus: probed
[    0.936953] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    0.945386] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address                                                                                           00:10:75:1a:dd:17
[    0.954204] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.960781] ehci-pci: EHCI PCI platform driver
[    0.965309] ehci-platform: EHCI generic platform driver
[    0.970703] ehci-orion: EHCI orion driver
[    0.974883] orion-ehci f1050000.ehci: EHCI Host Controller
[    0.980444] orion-ehci f1050000.ehci: new USB bus registered, assigned bus nu                                                                                          mber 1
[    0.988266] orion-ehci f1050000.ehci: irq 29, io mem 0xf1050000
[    1.008355] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    1.015096] hub 1-0:1.0: USB hub found
[    1.019083] hub 1-0:1.0: 1 port detected
[    1.023475] usbcore: registered new interface driver usb-storage
[    1.338348] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    1.490434] hub 1-1:1.0: USB hub found
[    1.494532] hub 1-1:1.0: 4 ports detected
[    1.778347] usb 1-1.1: new high-speed USB device number 3 using orion-ehci
[    1.890871] usb-storage 1-1.1:1.0: USB Mass Storage device detected
[    1.897504] scsi host0: usb-storage 1-1.1:1.0
[    1.978349] usb 1-1.3: new high-speed USB device number 4 using orion-ehci
[    2.038346] rtc-mv f1010300.rtc: internal RTC not ticking
[    2.043873] i2c /dev entries driver
[    2.048113] orion_wdt: Initial timeout 21 sec
[    2.055929] marvell-cesa f1030000.crypto: CESA device successfully registered
[    2.064101] NET: Registered protocol family 10
[    2.070229] NET: Registered protocol family 17
[    2.074740] bridge: automatic filtering via arp/ip/ip6tables has been depreca                                                                                          ted. Update your scripts to load br_netfilter if you need this.
[    2.087438] 8021q: 802.1Q VLAN Support v1.8
[    2.093803] UBI error: no valid UBI magic found inside mtd3
[    2.099441] hctosys: unable to open rtc device (rtc0)
[    2.120558] Freeing unused kernel memory: 5128K
[    2.135967] usb 1-1.3: config 1 interface 0 altsetting 0 has 7 endpoint descr                                                                                          iptors, different from the interface descriptor's value: 5
[    2.172321] init: Console is alive
[    2.175924] init: - watchdog -
[    2.185590] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    2.192809] kmodloader: done loading kernel modules from /etc/modules-boot.d/                                                                                          *
[    2.202741] init: - preinit -
[    2.277428] random: jshn: uninitialized urandom read (4 bytes read, 5 bits of                                                                                           entropy available)
[    2.311044] random: jshn: uninitialized urandom read (4 bytes read, 5 bits of                                                                                           entropy available)
[    2.342715] random: jshn: uninitialized urandom read (4 bytes read, 5 bits of                                                                                           entropy available)
[    2.375142] random: jshn: uninitialized urandom read (4 bytes read, 5 bits of                                                                                           entropy available)
[    2.404796] random: jshn: uninitialized urandom read (4 bytes read, 5 bits of                                                                                           entropy available)
[    2.434065] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, ful                                                                                          l duplex, flow control disabled
[    2.443994] mv643xx_eth_port mv643xx_eth_port.0 eth0: link down
[    2.451122] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    2.472121] random: procd: uninitialized urandom read (4 bytes read, 6 bits o                                                                                          f entropy available)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    3.184370] scsi 0:0:0:0: Direct-Access     USB      Flash Disk       1100 PQ                                                                                          : 0 ANSI: 4
[    3.194960] sd 0:0:0:0: [sda] 7866368 512-byte logical blocks: (4.03 GB/3.75                                                                                           GiB)
[    3.203557] sd 0:0:0:0: [sda] Write Protect is off
[    3.209427] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, does                                                                                          n't support DPO or FUA
[    3.226343]  sda: sda1
[    3.233182] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    5.573775] procd: - early -
[    5.576739] procd: - watchdog -
[    6.404764] procd: - watchdog -
[    6.408130] procd: - ubus -
[    6.415373] random: ubusd: uninitialized urandom read (4 bytes read, 22 bits                                                                                           of entropy available)
[    6.461351] random: ubusd: uninitialized urandom read (4 bytes read, 22 bits                                                                                           of entropy available)
[    6.470678] random: ubusd: uninitialized urandom read (4 bytes read, 22 bits                                                                                           of entropy available)
[    6.479745] random: ubusd: uninitialized urandom read (4 bytes read, 22 bits                                                                                           of entropy available)
[    6.489723] procd: - init -
Please press Enter to activate this console.
[    6.584780] kmodloader: loading kernel modules from /etc/modules.d/*
[    6.593422] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    6.604980] ip_tables: (C) 2000-2006 Netfilter Core Team
[    6.614459] nf_conntrack version 0.5.0 (1948 buckets, 7792 max)
[    6.637956] xt_time: kernel timezone is -0000
[    6.648767] PPP generic driver version 2.4.2
[    6.654600] NET: Registered protocol family 24
[    6.661963] kmodloader: done loading kernel modules from /etc/modules.d/*
[    9.839591] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, ful                                                                                          l duplex, flow control disabled
[    9.885577] device eth0 entered promiscuous mode
[    9.911870] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   10.818918] br-lan: port 1(eth0) entered forwarding state
[   10.824390] br-lan: port 1(eth0) entered forwarding state
[   10.868415] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   12.818347] br-lan: port 1(eth0) entered forwarding state



BusyBox v1.25.1 () built-in shell (ash)

     _________
    /        /\      _    ___ ___  ___
   /  LE    /  \    | |  | __|   \| __|
  /    DE  /    \   | |__| _|| |) | _|
 /________/  LE  \  |____|___|___/|___|                      lede-project.org
 \        \   DE /
  \    LE  \    /  -----------------------------------------------------------
   \  DE    \  /    Reboot (17.01.4, r3560-79f57e422d)
    \________\/    -----------------------------------------------------------

=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------



Edited 1 time(s). Last edit at 04/21/2018 12:21PM by Dieter.
Re: Dual boot with Openwrt on NAND
April 22, 2018 05:41AM
yes dieter i have changed the mtds because you dont need now a second stage bootloader and a seperate definition for the boot-envs
so you have the fully nand for pakets in LEDE and never run out of space.
I have defined the mtds only for:
bootloader + envs starting at 0x0 size 0x100000
LEDE starting at 0x100000 size <till the end of nand>
you should only define your mtds like this:
# @bootloader

setenv mtdparts 'mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)'
saveenv

# Attention, dont forget to nand erase your new mtd "ubi" before you flash LEDE on it.
nand erase.part ubi
you should do the paket installation after
DockStar> usb reset; fatload usb 0 0x800000 lede-kirkwood-dockstar-initramfs-uImage; bootm 0x800000
to install pakets before its not necessary anymore because you do your sysupgrade from LEDE-WIF and not from CLI.

--joerg_999



Edited 2 time(s). Last edit at 04/22/2018 07:20AM by joerg_999.
Re: Dual boot with Openwrt on NAND
April 22, 2018 01:50PM
Hello,

ok, system upgrade worked, I am able to run LEDE now. :-)
However, it seems my envs are not fine, yet, I can not boot from stick.
I inserted a stick, prepared as bodhi told me to, but Lede still boots and I get the following error messages:

U-Boot 2017.07-tld-1 (Oct 24 2017 - 22:32:36 -0700)
Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Using egiga0 device
ping failed; host 192.168.180.21 is not alive
Hit any key to stop autoboot:  0
## Error: "bootcmd_uenv" not defined
## Error: "scan_disk" not defined
## Error: "set_bootargs" not defined
## Error: "load_uimage" not defined
invalid partition number 2 for device nand0 (orion_nand)
no such partition
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=1", size 255 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
ubi0: VID header offset: 512 (aligned 512), data offset: 2048
ubi0: good PEBs: 2039, bad PEBs: 1, corrupted PEBs: 0
ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 1517712165
ubi0: available PEBs: 8, total reserved PEBs: 2031, PEBs reserved for bad PEB handling: 39
Read 0 bytes from volume kernel to 800000
No size specified -> Using max size (1935360)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM LEDE Linux-4.4.92

My env is set as follows:
DockStar> printenv
arcNumber=2998
baudrate=115200
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_lede
bootcmd_exec=if run load_uimage; then; 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; fi
bootcmd_lede=run set_bootargs_lede; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000
bootdelay=3
console=ttyS0,115200
dtb_file=/boot/dts/kirkwood-dockstar.dtb
ethact=egiga0
ethaddr=00:10:75:1A:DD:17
fileaddr=800000
filesize=20000
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
if_netconsole=ping $serverip
ipaddr=192.168.180.64
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)
partition=nand0,2
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
preboot=run if_netconsole start_netconsole
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=1
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
serverip=192.168.180.21
set_bootargs_lede=setenv bootargs console=ttyS0,115200 $mtdparts
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
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: 3093/131068 bytes
DockStar>

I am afraid to mix setting up, so could finally some tell me what I have to set now to be able to dual boot?

Once again, thank you for your support, both of you!

Regards, Dieter
Re: Dual boot with Openwrt on NAND
April 22, 2018 02:01PM
hello dieter, you are right, this are the old envs.
maybe i forgot to tell you
you have to restart the dockstar once after flashing uboot in nand and interrupt start again
reset
than you can tftp boot the new envs and fllash them in nand.
than do the rest of modification for uboot-envs for your dockstar like in my discription above:
setenv ethaddr <ethaddr Userbox>
setenv arcNumber 2998
setenv machid
setenv dtb_file '/boot/dts/kirkwood-dockstar.dtb'
saveenv
reset


--joerg_999
Re: Dual boot with Openwrt on NAND
April 22, 2018 02:16PM
Hello,

I tried again, but it is still not working?!?
Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Using egiga0 device
ping failed; host 192.168.180.21 is not alive
Hit any key to stop autoboot:  0
DockStar> tftpboot 0x800000 uboot.2016.05-tld-1.environment.img
Using egiga0 device
TFTP from server 192.168.180.21; our IP address is 192.168.180.64
Filename 'uboot.2016.05-tld-1.environment.img'.
Load address: 0x800000
Loading: #########
         2.7 MiB/s
done
Bytes transferred = 131072 (20000 hex)
DockStar> nand erase 0xc0000  0x20000

NAND erase: device 0 offset 0xc0000, size 0x20000
Erasing at 0xc0000 -- 100% complete.
OK
DockStar> nand write.e 0x800000 0xc0000 0x20000

NAND write: device 0 offset 0xc0000, size 0x20000
 131072 bytes written: OK
DockStar> setenv ethaddr 00:10:75:1A:DD:17
DockStar> setenv arcNumber 2998
DockStar> setenv machid
DockStar> setenv dtb_file '/boot/dts/kirkwood-dockstar.dtb'
DockStar> saveenv
Saving Environment to NAND...
Erasing NAND...
Erasing at 0xc0000 -- 100% complete.
Writing to NAND... OK
DockStar> setenv mtdparts 'mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)'
DockStar> setenv set_bootargs_lede 'setenv bootargs console=ttyS0,115200 $mtdparts'
DockStar> setenv bootcmd_lede 'run set_bootargs_lede; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000'
DockStar> setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_lede'
DockStar> bootcmd_exec 'if run load_uimage; then; 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; fi'
Unknown command 'bootcmd_exec' - try 'help'
DockStar> saveenv
Saving Environment to NAND...
Erasing NAND...
Erasing at 0xc0000 -- 100% complete.
Writing to NAND... OK
DockStar> reset
resetting ...


U-Boot 2017.07-tld-1 (Oct 24 2017 - 22:32:36 -0700)
Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Using egiga0 device
ping failed; host 192.168.180.21 is not alive
Hit any key to stop autoboot:  0
## Error: "bootcmd_uenv" not defined
## Error: "scan_disk" not defined
## Error: "set_bootargs" not defined
## Error: "load_uimage" not defined
invalid partition number 2 for device nand0 (orion_nand)
no such partition
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=1", size 255 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
ubi0: VID header offset: 512 (aligned 512), data offset: 2048
ubi0: good PEBs: 2039, bad PEBs: 1, corrupted PEBs: 0
ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 1517712165
ubi0: available PEBs: 8, total reserved PEBs: 2031, PEBs reserved for bad PEB handling: 39
Read 0 bytes from volume kernel to 800000
No size specified -> Using max size (1935360)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM LEDE Linux-4.4.92
   Created:      2017-10-17  17:46:20 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1810212 Bytes = 1.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...
Re: Dual boot with Openwrt on NAND
April 22, 2018 02:31PM
Hallo dieter
in this part you got an error you forgot to put "setenv" befor see here:
DockStar> setenv mtdparts 'mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)'
DockStar> setenv set_bootargs_lede 'setenv bootargs console=ttyS0,115200 $mtdparts'
DockStar> setenv bootcmd_lede 'run set_bootargs_lede; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000'
DockStar> setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_lede'
DockStar> bootcmd_exec 'if run load_uimage; then; 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; fi'
Unknown command 'bootcmd_exec' - try 'help'
DockStar> saveenv
Saving Environment to NAND...
Erasing NAND...
Erasing at 0xc0000 -- 100% complete.
Writing to NAND... OK
DockStar> reset
resetting ...
the right command should be:
setenv bootcmd_exec 'if run load_uimage; then; 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; fi'
and everthing should be fine.

-joerg_999



Edited 2 time(s). Last edit at 04/22/2018 02:33PM by joerg_999.
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: