Welcome! Log In Create A New Profile

Advanced

Restoring PogoplugPro (OXNAS) to stock uBoot and stock rootfs.

Posted by noah 
Restoring PogoplugPro (OXNAS) to stock uBoot and stock rootfs.
May 05, 2021 07:58AM
I am bit lost with this subject.

In the past I have flashed Bodhi uboot (for debian), but unfortunatly boot from usbstick was never stable for me.

Current state:
U-Boot SPL 2013.10-tld-4 (Sep 07 2014 - 14:10:12)
Boot device: NAND
Attempting to set PLLA to 850 MHz ...
plla_ctrl0 : 0000020a
plla_ctrl1 : 00330000
plla_ctrl2 : 0065008b
plla_ctrl3 : 000000f1

PLLA Set
U-Boot 2015.10-tld-3 (Dec 08 2018 - 03:07:20 -0800)
OXNAS OX820
...

OX820> mtd
mtd
device nand0 <41000000.nand>, # parts = 2
#: name size offset mask_flags
0: boot 0x00e00000 0x00000000 0
1: data 0x07200000 0x00e00000 0

active partition: nand0,0 - (boot) 0x00e00000 @ 0x00000000

defaults:
mtdids : nand0=41000000.nand
mtdparts: mtdparts=41000000.nand:14m(boot),-(data)
OX820>



Lately, i tried openwrt 19.0.7, and after sysupgarde installation method (https://openwrt.org/toh/cloud_engines/pogoplugpro) it is booting from nand now.
But downside is that probaly it messed up my STOCK rootfs...

It seems to me that i am still able to boot (from Bodhi uboot) with stock kernel with that workaround:

setenv autoload n;
setenv bootargs_stock "root=ubi0:rootfs ubi.mtd=2,512 rootfstype=ubifs console=ttyS0,115200 elevator=cfq mac_adr=0x00,0x30,0xe0,0x00,0x00,0x01 mem=128M";
setenv poweroutage yes;
setenv boot "bootm 60500000";
setenv bootcmd_stock_fw "run set_bootargs_stock; run boot_nand";
setenv boot bootm 60500000;
setenv boot_nand "run load_nand boot || run load_nand2 boot";
setenv kernflmode s;
setenv load_nand2 "nboot 60500000 0 800000";
setenv load_nand "nboot 60500000 0 200000";
setenv set_bootargs_stock "setenv bootargs $bootargs_stock";
setenv mainlinelinux no;
run bootcmd_stock_fw
...
Loading from nand0, offset 0x200000
Image Name: Linux-2.6.31.6_SMP_820
Created: 2011-02-08 18:06:30 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2259824 Bytes = 2.2 MiB
Load Address: 60008000
Entry Point: 60008000
## Booting kernel from Legacy Image at 60500000 ...
Image Name: Linux-2.6.31.6_SMP_820
Created: 2011-02-08 18:06:30 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2259824 Bytes = 2.2 MiB
Load Address: 60008000
Entry Point: 60008000
Verifying Checksum ... OK
Starting kernel ...

HOWEVER, stock rootfs is not coming up from nand:
....
[ 5.760000] UBIFS error (pid 1): ubifs_read_node: bad node type (4 but expected 6)
[ 5.770000] UBIFS error (pid 1): ubifs_read_node: bad node at LEB 0:0
[ 5.780000] List of all partitions:
[ 5.780000] 1f00 131072 mtdblock0 (driver?)
[ 5.780000] 1f01 14336 mtdblock1 (driver?)
[ 5.790000] 1f02 116736 mtdblock2 (driver?)
[ 5.790000] No filesystem could mount root, tried: ubifs
[ 5.800000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 5.810000] [<c002da64>] (unwind_backtrace+0x0/0xe8) from [<c03032b0>] (panic+0x44/0x104)
[ 5.820000] [<c03032b0>] (panic+0x44/0x104) from [<c00090e0>] (mount_block_root+0x264/0x2b4)
[ 5.820000] [<c00090e0>] (mount_block_root+0x264/0x2b4) from [<c0009220>] (prepare_namespace+0x8c/0x1bc)
[ 5.830000] [<c0009220>] (prepare_namespace+0x8c/0x1bc) from [<c0008598>] (kernel_init+0x1a8/0x1f0)
[ 5.840000] [<c0008598>] (kernel_init+0x1a8/0x1f0) from [<c0028ae0>] (kernel_thread_exit+0x0/0x8)
[ 5.850000] CPU1: stopping
[ 5.850000] [<c002da64>] (unwind_backtrace+0x0/0xe8) from [<c00272f8>] (do_IPI+0xe4/0x148)
[ 5.850000] [<c00272f8>] (do_IPI+0xe4/0x148) from [<c0027c18>] (__irq_svc+0x38/0xc0)
[ 5.870000] Exception stack(0xc7843f98 to 0xc7843fe0)
[ 5.870000] 3f80: c7842000 00000000
[ 5.870000] 3fa0: c7843fe0 00000000 c7842000 c0404804 c03e6314 c0404d30 00000000 410fb025
[ 5.870000] 3fc0: 60020c80 00000000 c0536748 c7843fe0 c0028b80 c0028b84 60000013 ffffffff
[ 5.900000] [<c0027c18>] (__irq_svc+0x38/0xc0) from [<c0028b84>] (default_idle+0x24/0x28)
[ 5.910000] [<c0028b84>] (default_idle+0x24/0x28) from [<c0029270>] (cpu_idle+0x64/0x98)
[ 5.910000] [<c0029270>] (cpu_idle+0x64/0x98) from [<60008084>] (0x60008084)

I want to revert to full stock nand, and start over from that.
I have some mtd0, mtd1, mtd2 backup dumps outside from plug, which i would like to try (i hope these are as originals as possible):

#ls -la
-rwxr--r-- 1 user1 users 134086656 Nov 17 14:08 mtd0
-rwxr--r-- 1 user1 users 14680064 Nov 17 14:08 mtd1
-rwxr--r-- 1 user1 users 119406592 Nov 17 14:08 mtd2

md5sum hashes for these backups:
# md5sum *
92e45d994190fa854ef64c88e66909c4 mtd0
9a6faf731ae81a58cf5b16bca3dff35f mtd1
24cb75ae1afc6ef3923ae88f547a2a83 mtd2

Also, stock nand layout was saved to file in backup time:
dev: size erasesize name
mtd0: 08000000 00020000 "NAND 128MiB 3,3V 8-bit"
mtd1: 00e00000 00020000 "boot"
mtd2: 07200000 00020000 "rootfs"

Can anyone confirm (by hashes) that these are really stock mtd's ? Or are stock mtd's availablbe somewhere for download?
How to proceed with restoring stock uboot, stock kernel, and stock rootfs?
I have tftp up and running, and have console access.
Does anyone knows where openwrt sysupgrade methods installes its rootfs in nand? Am I corrcect that is was flashed to
mtd2: 07200000 00020000 "rootfs" area?

br Noah'
Re: Restoring PogoplugPro (OXNAS) to stock uBoot and stock rootfs.
May 05, 2021 06:17PM
Noah,

Once you've installed OpenWrt to NAND, you will not be able to run stock FW.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Restoring PogoplugPro (OXNAS) to stock uBoot and stock rootfs.
May 06, 2021 03:02AM
I dont want to run them as dual boot- I want to get rid of OpenWrt. And want to restore stock FW from backup.



Edited 1 time(s). Last edit at 05/06/2021 03:06AM by noah.
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: