Welcome! Log In Create A New Profile

Advanced

HowTo: OpenWrt on Kirkwood boxes

Posted by chessplayer 
HowTo: OpenWrt on Kirkwood boxes
June 06, 2019 04:22PM
bodhi's edit: this is a very good tutorial! If you're looking to install OpenWrt for the Pogo V4, very important to also see this post.

I also made some improvement (in blue) in the installation instruction below.

chessplayer's edit (Aug 14th, 2022): Since there is obviously renewed interest in the subject starting, apparently, in June this year and there is now also a sibling thread for the OXNAS machines, some new insights have been gained (or resurfaced), which is why I am making some corrections and/or additions. Thanks go to many people for this, first and foremost, obviously, to bodhi, but also to daviddyer for his post from three years ago. This goes along with an apology for my dismissing his part A at the time, which now turns out to be essential, especially for the OXNAS, but apparently also for some of the Kirkwood boxes.

Another point is that I am removing all references to LEDE (which was the project's name for a brief period only, but it was during this period that the thread this tutorial is based on was written - this is how it crept in), since it does not have a place here anymore now (and should not have had when this HowTo was originally written).

My major changes will be reflected in dark blue.

========

How to install OpenWrt on Kirkwood boxes

This thread is a new version of one started by joerg_999 since I did run into a few problems with that one and I wanted to suggest a way which seems slightly easier to me and is also more general, since it is not restricted to Pogo E02. Also, I believe Jörg's post is missing a crucial step in connection with bodhi's uBoot. But, a big "Thank you!" goes to Jörg for his original post.

The procedure described in this thread is confirmed to work for Dockstar, GoFlexNet, GoFlexHome, Zyxel NSA325, ZyxelNSA320 (see the hints in steps 1. and 2. for these), Pogo v4 (see the link in bodhi's edit above as well as the hint in steps 1 and 5 for this box), and Pogo E02, so I am confident it will also work for the other Kirkwood boxes OpenWrt provides images for ;-)

Assumptions

I assume that the box in question has the latest uBoot and is able to boot a USB device with the latest kernel and rootfs according to the first two links in section Kirkwood plugs of the wiki.

Remark: The procedure described below also seems to work with older uBoots in connection with older kernels and rootfs, which I tested with a GoFlexNet.

However, it will be absolutely necessary to be able to reach the box via netconsole or serial console.

The plan

We now want to install OpenWrt on our box. The steps we will need to take are
  1. Boot into debian, do some checks on and make some modifications to the uBoot environment variables
  2. Download, rename and copy an OpenWrt Image to a FAT32 USB drive
  3. Reboot the box without a USB device but with netconsole to interact with it and erase NAND <- this is crucial
  4. Boot OpenWrt image from the USB drive created before
  5. SSH into OpenWrt and make sure the uBoot environment is found <- this is crucial
  6. Install to NAND via sysupgrade in OpenWrt
  7. Boot from NAND and SSH into OpenWrt and make sure the uBoot environment is always found
  8. Optionally apply some modifications to OpenWrt
  9. Enjoy!

Implementation
So, let us look at these steps in more detail.

1. Modify uBoot variables

First, we need to boot the box to debian and log in. Then, we perform some checks and add to the environment.

1.a Check mtdparts definition

fw_printenv mtdparts

Expected output is
  1. for most boxes (confirmed for Seagate's Dockstar, GoFlexHome, GoflexNet, Cloudengines Pogo E02):
      mtdparts=mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)  
  2. for Cloudengines Pogo v4 (Mobile) (see bodhi's amendment)
      mtdparts=mtdparts=orion_nand:0x200000@0x0(u-boot),-@0x100000(ubi)  
  3. for Zyxel NSA32x:
      mtdparts=mtdparts=orion_nand:1M(u-boot),512K(uboot_env),512K(key_store),512K(info),10M(etc),10M(kernel_1),48896K(rootfs1),10M(kernel_2),-(rootfs2)
    Important note: This must be changed on the Zyxels for the following to work, so if for some reason you need the above layout, you will have to figure out the necessary modifications yourself!

    On these Zyxels, you should change that to
      fw_setenv mtdparts 'mtdparts=orion_nand:0x100000@0x0(u-boot),-@0x100000(ubi)'
    (same as for Pogo E02 or the old Seagate boxes)

    Remark: This might be true for other Zyxel boxes also, but those I do not have and cannot test on.
If the output is not as expected, make the appropriate modifications (as exemplified above for the Zyxels)!

1.b Add to uBoot environment

We then need to augment the uBoot environment as follows:


fw_setenv partition 'nand0,0'
fw_setenv set_bootargs_owrt 'setenv bootargs console=ttyS0,115200 $mtdparts'
fw_setenv bootcmd_owrt 'run set_bootargs_owrt; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000'

All the other variables can stay the way they were before, but we have to add the OpenWrt boot option to the bootcmd. If we still have bodhi's environment variables as they came, this would be:

fw_setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootcmd_owrt'

The important part is to add 'run bootcmd_owrt' to the bootcmd you are currently using. So, if you changed something, e.g. to be able to boot with a separate boot partition or from SATA or anything like that, just append the OpenWrt boot option to the one you are using.

2. Download an OpenWrt image

Next, we need the appropriate image. Start on the release page of OpenWrt and choose the one you like best (this HowTo was tested with release 21.02.3) and then navigate to
targets/kirkwood/generic
Then, download the uImage appropriate for your box. Rename it to uImage and place it in the root of a FAT32 formatted USB device.

Remark for Zyxel NSA320: Although the NSA320 is not officially supported by OpenWrt and they subsequently do not provide a uImage or sysupgrade for it, @kblayout over in the OpenWrt forum confirmed that this very HowTo also works for that machine (scroll to bottom of the linked post). All you will have to do is use the uImage and sysupgrade for the NSA325. I can confirm this - all five NSA320s I have at my disposal were flashed this way!

Hint: It makes sense to keep the browser tab open for the actual installation to NAND in step 6.

3. Interact with uBoot in (net)console

Then, we need to reboot the box without the debian USB device, but with a way of interacting with it, preferably via netconsole. The latter needs to be started on the server beforehand with
nc -l -u -p 6666
Wait until after a few error messages you see the prompt, e.g.
Dockstar>
in the console window.

Then, make sure OpenWrt lives in a clean environment by erasing the ubi partition:
nand erase.part ubi


4. Reboot to RAM with OpenWrt image

Insert the drive you created in step 2 into the box and boot it by issuing the following command at the (net)console prompt:

To get a correct mtd layout in OpenWrt, set_bootargs_owrt must be run before the bootm
usb reset; fatload usb 0 0x800000 uImage; run set_bootargs_owrt; bootm 0x800000
This should end with
Starting kernel ...
in the console output, meaning that OpenWrt is now running in RAM.

5. Log in to OpenWrt

Find the IP address of your box and ssh into it (user root without password). The following step is absolutely crucial (according to bodhi; see the first reply) in connection with bodhi's environment from the uBoot post, as I can tell from experience, since without it, I ran into problems when I first tried the procedure from Jörgs original post on a Dockstar (see my description there of how to remedy the issue if things have gone awry).

Verify your mtd layout, it should be:

root@OpenWrt:/tmp# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 07f00000 00020000 "ubi"

Or, in case of the Pogo v4 (mobile):
┌─[root@pogo-mobile]─[~]
└──> cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00200000 00020000 "u-boot"
mtd1: 07f00000 00020000 "ubi"

Temporarily generate or modify /etc/fw_env.config
Check whether the file /etc/fw_env.config has the following contents:
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000
If not, or the file does not exist at all, the easiest way to generate/overwrite it is
echo '/dev/mtd0 0xc0000 0x20000 0x20000' > /etc/fw_env.config
Afterwards, check that the uBoot environment is found by printing the variables to screen using
fw_printenv

Remark: Since OpenWrt only runs in RAM at the moment, this is a temporary change. If you want to be able to access the uBoot environment from the OpenWrt rescue system later on, this step will most likely have to be repeated (see step 7 below).

6. Install to NAND

Finally, we can perform a sysupgrade of OpenWrt either using the LUCI WIF (Web Interface) or the command line. Since we are already logged in via ssh, I only describe the latter option, while the former may be found, e.g., in step 4.b of Jörg's original post. We must do:
opkg update
opkg install ca-certificates
cd /tmp
wget <URL of our desired sysupgrade file>
sysupgrade <name of our desired sysupgrade file>
The desired upgrade file may be found the same way as we found the image in step 2 above starting from the release page (but, ideally, you kept the browser tab open in step 2). There you can just copy the link address to the sysupgrade file (tar or bin depending on the release) and paste it into the ssh window.

Remark: For older releases of OpenWrt, there might be more you have to install. E.g., for 18.06.2, ca-bundle, libustream-openssl, and ubi-utils were needed as well.

The upgrade process will result in an automatic reboot (during which I removed the USB stick, but that may not be necessary).

7. Boot from NAND and log in to OpenWrt

It is, unfortunately, quite certain that OpenWrt in NAND also cannot find the uBoot environment (as before in the case of the image loaded into RAM). Therefore, you have to repeat step 5. above in order to be able to modify the uBoot environment. This time, it will be a permanent modification of /etc/fw_env.config allowing you to make changes to the uBoot environment using your new rescue system.

Remark: If ever you decide to do a sysupgrade later on, be it via LUCI WIF or ssh, be aware that you will most probably have to repeat this after the sysupgrade, since only the files in /etc/config seem to be saved and restored during the process!

8. Optional Modifications
Seeing that OpenWrt will most probably only serve as a last resort on these boxes, these modifications are entirely optional, of course. Nonetheless, some people may find them useful, so I thought I would include them in the updated post. All of these modifications can be done via the LUCI WIF and that is what I will describe here. Alternatively, it may be done directly by modifying the relevant files or using opkg via ssh, but whoever wants to do that may figure out themselves how to. The LUCI WIF is reached via
https:// <IP of your box>
  1. Install additional packages
    First, you should update the package lists in System - Software by klicking on the button Update lists .... Afterwards, you can use the Filter-box to find the packages you are looking for. One of those should be ca-certificates. Also, personally, I do not use vim and prefer nano, which I therefore installed.
  2. Set MAC-Address
    Should you experience the problem that OpenWrt does not respect the MAC address provided via uBoot or if you want to test something which requires a different MAC-address, you can achieve this by going to Network - Interfaces and navigating to the Devices tab, where you should set the MAC-address for both br-lan as well as eth0 to the desired value via the Configure ... button.
    Remark: These changes will result in a different IP address to be assigned if you use DHCP, so when the confirmation pop-up appears, you will have to find out the new IP address in time and point your browser to that one for the changes to take effect! Otherwise, they will be rolled back!
  3. Change hostname and Timezone
    This can be done via System - System and making the appropriate modifications in the corresponding fields of the General Settings tab.
  4. Dark Design
    Also in System - System, you can navigate to the Language and Style tab and choose your design.
    Remark: If you also want to be able to choose a different language, you first have to install the relevant language pack.

9. Enjoy

---
Standart ist der Standardfehler



Edited 7 time(s). Last edit at 08/14/2022 09:42AM by chessplayer.
Re: HowTo: OpenWrt on Kirkwood boxes
June 07, 2019 02:07AM
Quote

Find the IP address of your box and ssh into it (user root without password). I am not entirely sure whether the next part is strictly necessary, but I believe so, since without it, I ran into problems when I first tried the procedure on a Dockstar.

Generate or modify /etc/fw_env.config
Check whether the file /etc/fw_env.config has the following contents:
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000
If not, modify it accordingly (e.g., using vim, which is available in OpenWrt/LEDE).

It is a requirement of the new Kirkwood u-boot to do this (see instruction):
Generate or modify /etc/fw_env.config 
Check whether the file /etc/fw_env.config has the following contents: 
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000

Good writeup chessplayer :) will add this as an additional tutorial for the same topic.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: OpenWrt on Kirkwood boxes
June 07, 2019 04:46AM
bodhi,

thanks for the clarification. I updated my original post to make it quite clear that this is essential.

Cheers,

chesspalyer

---
Standart ist der Standardfehler
Re: HowTo: OpenWrt on Kirkwood boxes
June 08, 2019 09:57PM
Tried to install on a dockstar, used tftp boot,

openwrt_dockstar_uImage is https://downloads.openwrt.org/releases/18.06.2/targets/kirkwood/generic/openwrt-18.06.2-kirkwood-seagate_dockstar-initramfs-uImage


Dockstar>tftp 0x800000 openwrt_dockstar_uImage

Dockstar>bootm 0x800000




root login to openwrt ok, tried to install the packages to the initial file system, openwrt complains no space on /overlay


root@OpenWrt:/tmp# opkg install ca-bundle ca-certificates libustream-openssl ubi
-utils
Installing ca-bundle (20190110-1) to root...
Installing ca-certificates (20190110-1) to root...
Installing libustream-openssl (2018-07-30-23a3f283-1) to root...
Package ubi-utils (2.0.2-1) installed in root is up to date.
Collected errors:
 * verify_pkg_installable: Only have 0kb available on filesystem /overlay, pkg ca-bundle needs 113
 * opkg_install_cmd: Cannot install package ca-bundle.
 * verify_pkg_installable: Only have 0kb available on filesystem /overlay, pkg ca-certificates needs 122
 * 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.

root@OpenWrt:/tmp# df -h
Filesystem                Size      Used Available Use% Mounted on
tmpfs                    60.2M    668.0K     59.5M   1% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev



Edited 1 time(s). Last edit at 06/08/2019 10:05PM by daviddyer.
Re: HowTo: OpenWrt on Kirkwood boxes
June 08, 2019 10:14PM
Just found a typo in

echo '/dev/mtd0 0xc0000 0x20000 0x20000' > /etc/fw_envs.config

should be

echo '/dev/mtd0 0xc0000 0x20000 0x20000' > /etc/fw_env.config
Re: HowTo: OpenWrt on Kirkwood boxes
June 08, 2019 10:44PM
Finally used a nasty method and solved it. Download the upgrade file to my http server, then we don't need opkg install those things. Just download from the http server (not https server), run upgrade, yeah!

After that, just do the opkg update and install. :-)
Re: HowTo: OpenWrt on Kirkwood boxes
June 10, 2019 05:21PM
@chessplayer
you can do it like i discribed in the "Lede on Pogo E02" but for step4 your choice should be "4b. LEDE-WIF upgrade" afterwards you should do step5, otherwise you cant get access to your envs. (4a is outdated and not longer working - runnig out of memory - with the newer Lede or openwrt)
I tested this on Pogo E02 and with the suitable files also on GoflexNet.
Also very important is the very long line in the uboot-envs:
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'
its only an extension of bodhis original and is required for correct warm booting either Lede/openwrt from nand or debian from stick.
Tried this procedure also with the new openwrt 18.06.2 and works well on both machines.



Edited 5 time(s). Last edit at 06/11/2019 03:33AM by joerg_999.
Re: HowTo: OpenWrt on Kirkwood boxes
June 11, 2019 03:17AM
joerg_999,

I tried that and it did not work. Maybe I did something wrong somewhere.

Anyway, the method I am describing did work on Dockstar, PogoE02 and also GoFlex Net, in the latter case even with an older uBoot and customised uBoot environment. Thus, I thought I would share. I does seem to me that being able to find the environment variables by having the correct /etc/fw_env.config is necessary, as also mentioned by bodhi.

But thanks for your original post, which did all the heavy lifting!

Cheers,

chessplayer

---
Standart ist der Standardfehler
Re: HowTo: OpenWrt on Kirkwood boxes
June 11, 2019 03:22AM
daviddyer Wrote:
-------------------------------------------------------
> Just found a typo in
>
> echo '/dev/mtd0 0xc0000 0x20000 0x20000' >
> /etc/fw_envs.config
>
> should be
>
> echo '/dev/mtd0 0xc0000 0x20000 0x20000' >
> /etc/fw_env.config

Thanks for pointing this out. I corrected it in the original post.

Cheers,

chessplayer

---
Standart ist der Standardfehler
Re: HowTo: OpenWrt on Kirkwood boxes
June 11, 2019 10:02AM
Yes what joerg said is absolutely correct, the modified bootcmd_exec is required to boot with Debian on USB and fall back to OpenWrt, when the USB rootfs is either corrupted or absent. Without this change, the rescue system will not work as intended.

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'

This bootcmd_exec version is what I will have as default in the next u-boot release (I actually had this on all my boxes for a couple years, but did not thtink it is important to make an update). It is not important to do this if you ony boot with Debian. However, it is a change I have planned for a while to make it more robust anyway.

Thanks for pointing that out joerg :)

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



Edited 1 time(s). Last edit at 06/11/2019 10:13AM by bodhi.
Re: HowTo: OpenWrt on Kirkwood boxes
June 12, 2019 05:33AM
bodhi Wrote:
-------------------------------------------------------
> Yes what joerg said is absolutely correct, the
> modified bootcmd_exec is required to boot with
> Debian on USB and fall back to OpenWrt, when the
> USB rootfs is either corrupted or absent. Without
> this change, the rescue system will not work as
> intended.
>
>
> 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'
>
>
> This bootcmd_exec version is what I will have as
> default in the next u-boot release (I actually had
> this on all my boxes for a couple years, but did
> not thtink it is important to make an update). It
> is not important to do this if you ony boot with
> Debian. However, it is a change I have planned for
> a while to make it more robust anyway.
>
> Thanks for pointing that out joerg :)

Ok, I have one less level of conditions and I think that is what is contained in your default environment (i.e. I have
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
)

Just tested with an empty ext4-USB drive labeled rootfs and it did boot OpenWrt as a result (also, obviously, without any external drives). So: how does the extra if-statement make a difference? Changing it to Jörg's bootcmd_exec yielded the exact same bahavior. Another test with my old stick (which uses a separate boot partition) was the same in both cases as well - it booted the kernel image, but did not obtain an IP address, since it could not find the rootfs, I guess.

But I just realized something else: after flashing OpenWrt to NAND, the problem with etc/fw_env.config persists. Therefore, that has to be checked and corrected once more with the system booted from NAND in order to be able to modify the environment variables if necessary. I will add this step to my instructions in the first post.

Cheers,

chessplayer

---
Standart ist der Standardfehler
Re: HowTo: OpenWrt on Kirkwood boxes
June 12, 2019 06:57AM
chessplayer,

I recall I tested the new boocmd_exec env quite a bit (I wrote it myself) before posting it for joerg to try in the Pogo E02 thread. So you would need to trust me, no need to explain:)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: OpenWrt on Kirkwood boxes
June 12, 2019 07:26AM
Found that post:
https://forum.doozan.com/read.php?4,45989,46039#msg-46039

So look back a few posts, I think joerg showed that it did not fallback to OpenWrt correctly with the original env.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: OpenWrt on Kirkwood boxes
June 12, 2019 09:26AM
@chessplayer

A Maybe you need to add "nand erase.part ubi" in 3 or 4.
B It's not necessary to do "echo '/dev/mtd0 0xc0000 0x20000 0x20000' > /etc/fw_env.config" in step 5 since it won't be saved to NAND. It is necessary to do "echo '/dev/mtd0 0xc0000 0x20000 0x20000' > /etc/fw_env.config" in step 7 after openwrt is flashed to NAND.
C "LEDE/openwrt-WIF upgrade" should be useful when openwrt system (in ram) complains "no space on /overlay" .
Re: HowTo: OpenWrt on Kirkwood boxes
June 12, 2019 10:19AM
daviddyer Wrote:
-------------------------------------------------------
> @chessplayer
>
> A Maybe you need to add "nand erase.part ubi"
> in 3 or 4.

Don't know about that, since I went through this process on 2 Dockstars, 3 Pogo E02 and a GoFlex Net (I know, I overdid it a bit with these boxes way back when ...) and did not need this.

> B It's not necessary to do "echo '/dev/mtd0
> 0xc0000 0x20000 0x20000' > /etc/fw_env.config" in
> step 5 since it won't be saved to NAND. It is
> necessary to do "echo '/dev/mtd0 0xc0000 0x20000
> 0x20000' > /etc/fw_env.config" in step 7 after
> openwrt is flashed to NAND.

As I said, for some reason, when I left that out when trying for the first time, something went wrong. Maybe, however, I made some other foolish mistake. All I know is that it certainly does not hurt.

> C "LEDE/openwrt-WIF upgrade" should be useful
> when openwrt system (in ram) complains "no space
> on /overlay" .

Again, I do not know about that, as this did not occur in my cases. But I guess you are right about this and I am pointing people to this possibility in the above instructions should they see the need.

Maybe your points will become relevant for me when I update my NSA320 and GoFlex Home .... If so, I will be sure to report back.

---
Standart ist der Standardfehler
Re: HowTo: OpenWrt on Kirkwood boxes
June 13, 2019 12:14PM
Well, sysupgrade can do the mtd format / etc when needed, but it is always a good idea to format the new mtd when the mtd is changed / created.
Re: HowTo: OpenWrt on Kirkwood boxes
June 13, 2019 07:04PM
Well actually, what joerg did was quite important.

Quote
https://forum.doozan.com/read.php?4,42279

# when you change/add a new partition layout you always need to erase the ubi nand first before new install:
nand erase.part ubi

This will make it work the same way in the subsequent steps in different environment (stock OS, Debian,....).

If you skip the erase, it might work in Debian, but most likely it will fail in stock OS.

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



Edited 1 time(s). Last edit at 06/14/2019 03:03AM by bodhi.
Re: HowTo: OpenWrt on Kirkwood boxes
June 29, 2019 03:26PM
Hi All

Having looked at the Cisco ON-100 OpenWRT installation notes which install OpenWRT from TFTP via u-boot i wanted todo the same for my Pogo E02 but ran into issues with the older installation notes and the Cisco ON-100 method when using the newer U-Boot and am using the older U-Boot 2016.05-tld-1 without issue now

Im using modified notes from https://loetzimmer.de/openwrt/lede-make_ubifs.txt to create a UBI filesystem with the kernel and then writing it via TFTP nand write



Create kirkwood-pogo_e02-root.ubifs.conf
[rootfs]
mode=ubi
image=kirkwood-pogo_e02-root.ubifs
vol_id=0
vol_type=dynamic
vol_name=rootfs
vol_alignment=1
vol_flags=autoresize

Get OpenWRT image here or use your own compiled version
wget -c https://downloads.openwrt.org/releases/18.06.2/targets/kirkwood/generic/openwrt-18.06.2-kirkwood-cloudengines_pogoe02-squashfs-sysupgrade.bin


Commands to create the UBI filesystem kirkwood-pogo_e02-root.ubi
tar xf openwrt-kirkwood-cloudengines_pogoe02-squashfs-sysupgrade.bin
unsquashfs sysupgrade-pogo_e02/root
mkdir squashfs-root/boot
cp sysupgrade-pogo_e02/kernel squashfs-root/boot/uImage

mkfs.ubifs -r squashfs-root/ -m 2048 -e 129024 -c 1032 -o kirkwood-pogo_e02-root.ubifs

ubinize -vv -o kirkwood-pogo_e02-root.ubi -m 2048 -p 131072 -s 512 kirkwood-pogo_e02-root.ubifs.conf


U-Boot commands to install kirkwood-pogo_e02-root.ubi
mtdparts delall

mtdparts add nand0 0x00100000@0x0 u-boot
mtdparts add nand0 0x07f00000@0x00100000 data

tftpboot 0x2000000 uboot.2016.05-tld-1.pogo_e02.mtd0.kwb
or
tftpboot 0x2000000 uboot.2017.07-tld-1.pogo_e02.mtd0.kwb

nand erase 0x0 0x80000
nand write 0x2000000 0x0 ${filesize}

tftpboot 0x2000000 kirkwood-pogo_e02-root.ubi
nand erase 0x00100000 0x07f00000
nand write 0x2000000 0x00100000 ${filesize}

setenv ubifs_boot 'if ubi part data && ubifsmount ubi:rootfs && ubifsload 0x800000 /boot/uImage && ubifsumount; then bootm 0x800000; fi'
setenv ubifs_bootcmd 'run ubifs_set_bootargs; run ubifs_boot'
setenv ubifs_set_bootargs 'setenv bootargs console=$console $mtdparts'
setenv bootcmd 'run ubifs_bootcmd; usb start; run usb_bootcmd; usb stop; reset'
saveenv

reset

Restore my maccaddr

setenv ethaddr '52:xx:xx:xx:xx:xx'
saveenv


Complete Bootlog of my Mesh firmware
U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:23:43 -0700)
Pogo E02

SoC:   Kirkwood 88F6281_A0
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Hit any key to stop autoboot:  0 
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=1", size 127 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: 1016, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 1873734927
ubi0: available PEBs: 0, total reserved PEBs: 1016, PEBs reserved for bad PEB handling: 20
Loading file '/boot/uImage' to addr 0x00800000...
Done
Unmounting UBIFS volume rootfs!
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM OpenWrt Linux-4.14.128
   Created:      2019-06-21  12:17:25 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2247378 Bytes = 2.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.14.128 (user@t30) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7798-97ae9e0ccb)) #0 Fri Jun 21 12:17:25 2019
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Cloud Engines Pogoplug E02
[    0.000000] Memory policy: Data cache writeback
[    0.000000] random: get_random_bytes called from start_kernel+0x70/0x424 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 65024
[    0.000000] Kernel command line: console=ttyS0,115200 mtdparts=orion_nand:1m(u-boot),127m(data)
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 251044K/262144K available (4808K kernel code, 312K rwdata, 1332K rodata, 1024K init, 210K bss, 11100K 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 : 0xd0800000 - 0xff800000   ( 752 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc05b23d8   (5801 kB)
[    0.000000]       .init : 0xc0800000 - 0xc0900000   (1024 kB)
[    0.000000]       .data : 0xc0900000 - 0xc094e120   ( 313 kB)
[    0.000000]        .bss : 0xc094e120 - 0xc0982af4   ( 211 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000009] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.000039] Switching to timer-based delay loop, resolution 5ns
[    0.000104] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=2000000)
[    0.000125] pid_max: default: 32768 minimum: 301
[    0.000248] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000268] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000818] CPU: Testing write buffer coherency: ok
[    0.001609] Setting up static identity map for 0x100000 - 0x10003c
[    0.001867] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x2
[    0.005009] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.005036] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.005126] pinctrl core: initialized pinctrl subsystem
[    0.005975] NET: Registered protocol family 16
[    0.006350] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.007322] cpuidle: using governor ladder
[    0.007684] Feroceon L2: Enabling L2
[    0.007727] Feroceon L2: Cache support initialised.
[    0.007986] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.011380] No ATAGs?
[    0.027741] SCSI subsystem initialized
[    0.028428] usbcore: registered new interface driver usbfs
[    0.028490] usbcore: registered new interface driver hub
[    0.028547] usbcore: registered new device driver usb
[    0.030500] clocksource: Switched to clocksource orion_clocksource
[    0.061187] NET: Registered protocol family 2
[    0.061744] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[    0.061780] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.061810] TCP: Hash tables configured (established 2048 bind 2048)
[    0.061894] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.061916] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.062047] NET: Registered protocol family 1
[    0.064859] Crashlog allocated RAM at address 0x3f00000
[    0.065446] workingset: timestamp_bits=30 max_order=16 bucket_order=0
[    0.069685] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.069697] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.077018] io scheduler noop registered
[    0.077032] io scheduler deadline registered (default)
[    0.078274] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    0.102124] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.102997] console [ttyS0] disabled
[    0.103073] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 25, base_baud = 12500000) is a 16550A
[    0.568636] console [ttyS0] enabled
[    0.573345] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1
[    0.579732] nand: Samsung NAND 128MiB 3,3V 8-bit
[    0.584400] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    0.592028] Scanning device for bad blocks
[    0.704167] 2 cmdlinepart partitions found on MTD device orion_nand
[    0.710463] Creating 2 MTD partitions on "orion_nand":
[    0.715638] 0x000000000000-0x000000100000 : "u-boot"
[    0.721171] 0x000000100000-0x000008000000 : "data"
[    0.727350] libphy: Fixed MDIO Bus: probed
[    0.731743] libphy: orion_mdio_bus: probed
[    0.738581] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    0.747156] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 52:xx:xx:xx:xx:xx
[    0.755995] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.762567] ehci-pci: EHCI PCI platform driver
[    0.767078] ehci-orion: EHCI orion driver
[    0.771284] orion-ehci f1050000.ehci: EHCI Host Controller
[    0.776820] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    0.784655] orion-ehci f1050000.ehci: irq 29, io mem 0xf1050000
[    0.820516] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    0.827104] hub 1-0:1.0: USB hub found
[    0.831099] hub 1-0:1.0: 1 port detected
[    0.835479] usbcore: registered new interface driver usb-storage
[    1.200514] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    1.402528] hub 1-1:1.0: USB hub found
[    1.406669] hub 1-1:1.0: 4 ports detected
[    1.730513] usb 1-1.4: new high-speed USB device number 3 using orion-ehci
[    1.780500] random: fast init done
[    1.920514] rtc-mv f1010300.rtc: internal RTC not ticking
[    1.926061] i2c /dev entries driver
[    1.930184] orion_wdt: Initial timeout 21 sec
[    1.938564] marvell-cesa f1030000.crypto: CESA device successfully registered
[    1.946556] NET: Registered protocol family 10
[    1.952673] Segment Routing with IPv6
[    1.956411] NET: Registered protocol family 17
[    1.960945] 8021q: 802.1Q VLAN Support v1.8
[    1.968035] UBI: auto-attach mtd1
[    1.971414] ubi0: attaching mtd1
[    2.160382] ubi0: scanning is finished
[    2.175716] ubi0: attached mtd1 (name "data", size 127 MiB)
[    2.181355] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[    2.188260] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[    2.195007] ubi0: VID header offset: 512 (aligned 512), data offset: 2048
[    2.201841] ubi0: good PEBs: 1016, bad PEBs: 0, corrupted PEBs: 0
[    2.207958] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[    2.215228] ubi0: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 1873734927
[    2.224409] ubi0: available PEBs: 0, total reserved PEBs: 1016, PEBs reserved for bad PEB handling: 20
[    2.234051] hctosys: unable to open rtc device (rtc0)
[    2.239538] ubi0: background thread "ubi_bgt0d" started, PID 919
[    2.273276] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 922
[    2.365412] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[    2.372873] UBIFS (ubi0:0): LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    2.382848] UBIFS (ubi0:0): FS size: 126572544 bytes (120 MiB, 981 LEBs), journal size 9033728 bytes (8 MiB, 71 LEBs)
[    2.393515] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
[    2.399377] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID 8D73FE77-B530-46E6-8B52-1CE57FB8B341, small LPT model
[    2.411497] VFS: Mounted root (ubifs filesystem) on device 0:11.
[    2.420383] Freeing unused kernel memory: 1024K
[    2.518417] init: Console is alive
[    2.522820] init: - watchdog -
[    2.732292] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    2.802520] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    2.810951] init: - preinit -
[    2.983000] random: jshn: uninitialized urandom read (4 bytes read)
[    3.019086] random: jshn: uninitialized urandom read (4 bytes read)
[    3.050228] random: jshn: uninitialized urandom read (4 bytes read)
[    3.152708] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[    3.162631] mv643xx_eth_port mv643xx_eth_port.0 eth0: link down
[    3.169757] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
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
[    6.177361] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[    6.187297] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    6.291166] mount_root: mounting /dev/root
[    6.302339] mount_root: loading kmods from internal overlay
[    6.327803] kmodloader: loading kernel modules from //etc/modules-boot.d/*
[    6.335954] kmodloader: done loading kernel modules from //etc/modules-boot.d/*
[    6.455656] block: attempting to load /etc/config/fstab
[    6.463329] block: extroot: not configured
[    6.469819] urandom-seed: Seeding with /etc/urandom.seed
[    6.507920] procd: - early -
[    6.511352] procd: - watchdog -
[    7.313584] procd: - watchdog -
[    7.316950] procd: - ubus -
[    7.337549] urandom_read: 3 callbacks suppressed
[    7.337555] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.372678] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.380093] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.387416] procd: - init -
Please press Enter to activate this console.
[    7.598405] kmodloader: loading kernel modules from /etc/modules.d/*
[    7.639049] NET: Registered protocol family 38
[    7.707422] device-mapper: ioctl: 4.37.0-ioctl (2017-09-20) initialised: dm-devel@redhat.com
[    7.756548] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    7.806635] cryptodev: driver 1.9 loaded.
[    7.826579] Loading modules backported from Linux version wt-2017-11-01-0-gfe248fc2c180
[    7.834666] Backport generated by backports.git v4.14-rc2-1-31-g86cf0e5d
[    7.862595] ip_tables: (C) 2000-2006 Netfilter Core Team
[    7.879375] lib80211: common routines for IEEE802.11 drivers
[    7.905060] nf_conntrack version 0.5.0 (4096 buckets, 16384 max)
[    7.955633] xt_time: kernel timezone is -0000
[    8.185188] PPP generic driver version 2.4.2
[    8.191497] NET: Registered protocol family 24
[    8.243900] batman_adv: B.A.T.M.A.N. advanced openwrt-2018.1-8 (compatibility version 15) loaded
[    8.370520] usb 1-1.4: reset high-speed USB device number 3 using orion-ehci
[    8.531297] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5390, rev 0502 detected
[    8.567296] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 5370 detected
[    8.576346] usbcore: registered new interface driver rt2800usb
[    8.593406] kmodloader: done loading kernel modules from /etc/modules.d/*
[   13.581905] br-lan: port 1(eth0) entered blocking state
[   13.587160] br-lan: port 1(eth0) entered disabled state
[   13.592675] device eth0 entered promiscuous mode
[   13.609843] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   13.693764] IPv6: ADDRCONF(NETDEV_UP): eth0_17: link is not ready
[   14.007087] batman_adv: bat0: Adding interface: dummy0
[   14.012310] batman_adv: bat0: The MTU of interface dummy0 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1532 would solve the problem.
[   14.036520] batman_adv: bat0: Interface activated: dummy0
[   14.043281] 8021q: adding VLAN 0 to HW filter on device bat0
[   14.049997] br-lan: port 2(bat0) entered blocking state
[   14.055309] br-lan: port 2(bat0) entered disabled state
[   14.060785] device bat0 entered promiscuous mode
[   14.065481] br-lan: port 2(bat0) entered blocking state
[   14.070752] br-lan: port 2(bat0) entered forwarding state
[   14.077145] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   14.510631] batman_adv: bat0: No IGMP Querier present - multicast optimizations disabled
[   14.518769] batman_adv: bat0: No MLD Querier present - multicast optimizations disabled
[   14.565349] batman_adv: bat0: distributed_arp_table: Changing from: enabled to: disabled
[   14.652750] batman_adv: bat0: Changing gw mode from: off to: client
[   14.659299] batman_adv: bat0: multicast_mode: Changing from: enabled to: disabled
[   16.237228] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[   16.247245] br-lan: port 1(eth0) entered blocking state
[   16.252526] br-lan: port 1(eth0) entered forwarding state
[   16.288201] IPv6: ADDRCONF(NETDEV_CHANGE): eth0_17: link becomes ready
[   16.681009] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
[   16.770748] ieee80211 phy0: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.36
[   17.205685] IPv6: ADDRCONF(NETDEV_UP): wlan0-ap: link is not ready
[   17.315092] br-lan: port 3(wlan0-ap) entered blocking state
[   17.320876] br-lan: port 3(wlan0-ap) entered disabled state
[   17.326741] device wlan0-ap entered promiscuous mode
[   17.434469] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0-ap: link becomes ready
[   17.441357] br-lan: port 3(wlan0-ap) entered blocking state
[   17.446962] br-lan: port 3(wlan0-ap) entered forwarding state
[   17.470929] br-lan: port 4(wlan0-apname) entered blocking state
[   17.476881] br-lan: port 4(wlan0-apname) entered disabled state
[   17.483135] device wlan0-apname entered promiscuous mode
[   17.548024] IPv6: ADDRCONF(NETDEV_UP): wlan0-apname: link is not ready
[   17.554642] br-lan: port 4(wlan0-apname) entered blocking state
[   17.560612] br-lan: port 4(wlan0-apname) entered forwarding state
[   17.623889] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0-apname: link becomes ready
[   17.902508] IPv6: ADDRCONF(NETDEV_UP): wlan0-mesh: link is not ready
[   18.256466] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0-mesh: link becomes ready
[   18.876094] batman_adv: bat0: Adding interface: wlan0-mesh_29
[   18.881909] batman_adv: bat0: Interface activated: wlan0-mesh_29
[   39.492954] random: crng init done
[   39.496381] random: 1 urandom warning(s) missed due to ratelimiting



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

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 18.06.3, r7798-97ae9e0ccb
 -----------------------------------------------------
  ___   __ __                _______             __
 |   |_|__|  |--.----.-----.|   |   |-----.-----|  |--.
 |     |  |  _  |   _|  -__||       |  -__|__ --|     |
 |_____|__|_____|__| |_____||__|_|__|_____|_____|__|__|

 ------------------------------------------------------
 LiMe master development (master rev. ce7a730 20190629_1306)
 ------------------------------------------------------
 http://libremesh.org
 ------------------------------------------------------
=== 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.
--------------------------------------------------
root@LiMe-9c1151:/#



Edited 10 time(s). Last edit at 06/29/2019 04:06PM by markbirss@gmail.com.
Re: HowTo: OpenWrt on Kirkwood boxes
December 25, 2019 01:14PM
Hi, guys.

I have a Netgear Stora. Now it runs Debian from the bodhi's renewed thread but I want to replace the rootfs at the /dev/mtd2 with openwrt and run NAS from the NAND.

I looked at openwrt's site and not found binaries. But Stora has exactly the same hardware as goflex home. And I am thinking, is it possible to run openwrt using DTB's bodhi provided and some magic?
Re: HowTo: OpenWrt on Kirkwood boxes
July 11, 2020 12:02PM
Signed up to say thanks.

Followed https://gist.github.com/braian87b/2f7e711ebdd48e7a7d37f286e5245b0d to get OpenWrt Chaos Calmer installed on a Pogoplug V4, but it failed to upgrade on to higher versions of OpenWrt through web interface (sysupgrade said not possible), your instruction saved the day (wiped the old install, and went straight to 19.07.3).

The guide above gives you however the possibility to boot from SD-card, USB or SATA in parallell to the internal storage, since the other three got priority - internal is the last boot step.

Also this thread was very hard to find, since it doesn't mention the kirkwood units supported, so I'm just adding them here for googability ;)

Cisco ON100
Pogo E02
IOM Iconnect 1.1 IX2 200
Linksys Audi Viper
Raidsonic IB NAS62X0
Seagate Dockstar Goflexhome Goflexnet
Zyxel NSA310B NSA325



Edited 2 time(s). Last edit at 07/11/2020 12:37PM by frollic.
Re: HowTo: OpenWrt on Kirkwood boxes
July 11, 2020 04:51PM
frollic,

Thanks for the feedback! I did not add this to the Wiki as I did for the other tutorials because I think some of the steps were incorrect or need enhancements.

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

Rescue Systems

Rescue System V2 (Original)
MacPlug & SMBPLug
Rescue System Pogo V3
Rescue System V4, using a custom LEDE firmware (BETA)
Rescue System for Pogo E02 using LEDE/OpenWrt (Install with Serial Console)
Rescue System for Pogo V4/Mobile using OpenWrt (Install with NetConsole)

But since you have confirmed that, I will look at that again to see my reservation was justifed or not, and add it to the Wiki.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: OpenWrt on Kirkwood boxes
July 11, 2020 06:51PM
Quote

bodhi Wrote:
-------------------------------------------------------
frollic,

Thanks for the feedback! I did not add this to the
Wiki as I did for the other tutorials because I
think some of the steps were incorrect or need
enhancements.

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

Rescue Systems

Rescue System V2 (Original)
MacPlug & SMBPLug
Rescue System Pogo V3
Rescue System V4, using a custom LEDE firmware
(BETA)
Rescue System for Pogo E02 using LEDE/OpenWrt
(Install with Serial Console)
Rescue System for Pogo V4/Mobile using OpenWrt
(Install with NetConsole)

But since you have confirmed that, I will look at
that again to see my reservation was justifed or
not, and add it to the Wiki.

LOL, I didn't actually find/see that link in the Wiki, might have been easier for me ;)

My point of entry might also been slightly different though - I already had a newish
u-boot installed, so I didn't upgrade it (there's always a risk involved), and the V4
was running an oldish Debian - kernel 3.12 or so off a SD card.

What gave me the most headache was the storage layout (if it was correct or not),
and the u-boot params, since I was trying to keep the multi boot functionality intact.

I ended up temp changing the bootcmd so it'd only boot from internal, then modified it
back to multi boot, once I had openwrt up and running.

I had no issues booting openwrt 19 using TFTP, but it simply wouldn't install using
sysupgrade, or boot afterwards.



Edited 1 time(s). Last edit at 07/11/2020 06:53PM by frollic.
Re: HowTo: OpenWrt on Kirkwood boxes
October 24, 2020 09:56AM
have working openwrt on pogoplug v3 runnning on nand, the trouble I run into is switching from nand to usb boot when I want to run debian from the usb. Here is what I have to do so far and its probably a simple fix.

if I want to run openwrt I have to interrupt boot on serial connection and run the following:
setenv bootcmd 'nboot 60500000 0 440000; bootm'
saveenv 
boot

to run debian usb I have to interrupt boot on serial connection runs run the following:
setenv bootcmd 'run dt_bootcmd_usb'
saveenv
boot

now this will work if I want to always connect to the serial to switch between them however that is cumbersome, how can I set it to run openwrt if no usb and run debian if usb is inserted?

little bit stuck on that! any help would be nice ! Thanks!!

Echowarrior108

device: pogoplug-pro v3

Currently running:
Debian GNU/Linux Bullseye 12-9-22
Linux 5.4.224-oxnas-tld-1 armv6l GNU/Linux 11-27-22
Re: HowTo: OpenWrt on Kirkwood boxes
October 24, 2020 08:44PM
Can't recall the syntax off the top of my head, but you need to add a conditional statement to your bootcmd. Essentially you want to check if there is a bootable device in USB and if so boot from USB, otherwise boot from NAND. If you check the uboot environment that bodhi publishes there are examples of using conditional elements in his environment variables. See the uenv_read_disk for one example of using test and if/then/else conditionals.
Re: HowTo: OpenWrt on Kirkwood boxes
October 24, 2020 09:25PM
Echowarrior108,

As always, first thing to do is posting your current envs while in serial console

printenv

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: HowTo: OpenWrt on Kirkwood boxes
October 25, 2020 11:34AM
Opening new thread as mine is a pogoplug pro v3, many thanks to raynight and bodhi!
https://forum.doozan.com/read.php?4,109979,109984#msg-109984

Echowarrior108

device: pogoplug-pro v3

Currently running:
Debian GNU/Linux Bullseye 12-9-22
Linux 5.4.224-oxnas-tld-1 armv6l GNU/Linux 11-27-22
Re: HowTo: OpenWrt on Kirkwood boxes
May 02, 2022 03:22PM
Just want to add that OpenWrt 21.02 works on E02 just follow the top post.

Thanks a lot.
Re: HowTo: OpenWrt on Kirkwood boxes
May 02, 2022 04:00PM
Hope this is useful:

fw_printenv(difference between default debian uboot and mine):
mtdparts=mtdparts=orion_nand:1M(uboot),-(ubi)
bootubi=echo Trying to boot from NAND ...; ubi part ubi; ubi read 0x800000 kernel; setenv bootargs console=ttyS0,115200 ${mtdparts}; bootm 0x800000
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootubi


dmesg
[    0.608281] Creating 2 MTD partitions on "orion_nand":
[    0.613444] 0x000000000000-0x000000100000 : "uboot"
[    0.618988] 0x000000100000-0x000008000000 : "ubi"

root@OpenWrt:/tmp# ubinfo -a
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:62
Present UBI devices:            ubi0

ubi0
Volumes count:                           3
Logical eraseblock size:                 129024 bytes, 126.0 KiB
Total amount of logical eraseblocks:     1016 (131088384 bytes, 125.0 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  20
Current maximum erase counter value:     4
Minimum input/output unit size:          2048 bytes
Character device major/minor:            250:0
Present volumes:                         0, 1, 2

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        19 LEBs (2451456 bytes, 2.3 MiB)
State:       OK
Name:        kernel
Character device major/minor: 250:1
-----------------------------------
Volume ID:   1 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        18 LEBs (2322432 bytes, 2.2 MiB)
State:       OK
Name:        rootfs
Character device major/minor: 250:2
-----------------------------------
Volume ID:   2 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        955 LEBs (123217920 bytes, 117.5 MiB)
State:       OK
Name:        rootfs_data
Character device major/minor: 250:3
Re: HowTo: OpenWrt on Kirkwood boxes
May 28, 2022 12:51PM
pm4888 Wrote:
-------------------------------------------------------
> Just want to add that OpenWrt 21.02 works on E02
> just follow the top post.
>
> Thanks a lot.

Do you mean the first post from chessplayer / How to install OpenWrt on Kirkwood boxes & just use the image from latest 21.02.3 or do you upgrade from openwrt version 19 or 18?
Re: HowTo: OpenWrt on Kirkwood boxes
May 28, 2022 01:55PM
happydiy Wrote:
-------------------------------------------------------
> pm4888 Wrote:
> -------------------------------------------------------
> > Just want to add that OpenWrt 21.02 works on
> E02
> > just follow the top post.
> >
> > Thanks a lot.
>
> Do you mean the first post from chessplayer / How
> to install OpenWrt on Kirkwood boxes & just use
> the image from latest 21.02.3 or do you upgrade
> from openwrt version 19 or 18?

I meant the first post. The essence is to boot with initramfs-uImage, modify fw_env.config and finally sysupgrade with squashfs-sysupgrade image.
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: