Welcome! Log In Create A New Profile

Advanced

PogoPlug v4 Soft Brick Recovery / Restoring MTDs

Posted by the_wondersmith 
PogoPlug v4 Soft Brick Recovery / Restoring MTDs
October 11, 2019 08:04PM
I PM'd bodhi for advice about restoring the MTDs on my PogoPlug v4. He requested that I make a new thread here, I'd imagine in the interest of helping anyone else that's gotten themselves in the same situation I have.

To recap --

I (naturally) messed up my PogoPlug by not reading carefully enough when flashing and by also not keeping a better record or any kind of backup of what I had / hadn't done to it over the course of messing with it. The short version is that I used one of the earliest versions of bodhi's guide to convert it to Debian years ago, briefly used it for something that now eludes my memory, lost it in the back of a closet for a while, recently rediscovered it and would like to use it as a network ad blocker via PiHole.

When I went to update everything to the latest versions of bodhi's uBoot and Debian image, I obviously did something wrong, though I'm not sure what. I suspect that I've managed to mess up the envvars, but again I'm not 100% sure.

Typically when I get myself into situations like this, I'll wipe everything back to the way it was when I started (back to known-good) and simply try again. In this instance, 1) I'm not sure that's the best solution, and 2) not sure how to go about doing it if it is. I did try to grab bodhi's MTDs archive from here, but it looks like the link is dead. Reading through the thread, it seemed like the better option to simply send bodhi a message rather than continue to possibly make things worse by messing with it on my own. I guess the pertinent details of my specific issue are:

[*] My PogoPlug v4 will no longer boot correctly, or identify itself to the network
[*] I do still have serial console access though, and can in fact interrupt the boot process and get to the "PogoPlug v4>" prompt
[*] When all is said and done, I'd ideally like to have your latest uBoot and Debian Buster image be the only things on the Plug and running smoothly

So if I've not already taken up too much of your time, and if it's not asking too much, what do I do?

Bodhi asked that I post the output of the `printvars` command, which I have done below:

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01 -0700)
Pogoplug V4

SoC:   Kirkwood 88F6192_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:   MVEBU_MMC: 0
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Hit any key to stop autoboot: 10

Pogov4> 

Pogov4> printenv

arcNumber=3960
bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root) init=/bin/systemd
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
device=0:1
device_type=mmc
devices=usb ide mmc
disk_number=3
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-pogoplug_v4.dtb
ethact=egiga0
ethaddr=00:25:31:03:2b:1b
if_netconsole=ping $serverip
init_ide=ide reset
init_mmc=mmc rescan
init_usb=usb start
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
machid=f78
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_ide "ide reset";  setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
scan_ide=ide reset
scan_mmc=mmc rescan
scan_usb=usb start
serverip=192.168.0.220
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root) init=/bin/systemd
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=echo Initializing devices...; setenv init_usb "usb start";  setenv init_ide "ide reset";  setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in $disks; do if test $uenv_loaded -eq 0; then setenv device_type $devtype; setenv disk_number $disknum; run uenv_read; fi; done; done;
uenv_loaded=0
uenv_read=echo Loading envs from $device_type $disk_number...; if load $device_type  $disk_number:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; echo ... envs loaded; fi
usb_ready_retry=15

Environment size: 3275/131068 bytes

Pogov4>


Bodhi explained that the steps to fix whatever I've done should be easy enough, he described them as:

- Recreate the Buster image to make sure I have a good rootfs.
- Power up, interrupt serial console and load a default set of envs, adjust a few envs for Pogo V4 and my network.
- Boot


Three steps certainly does seem simple enough, hopefully Bodhi will be along shortly with a few more details.
Re: PogoPlug v4 Soft Brick Recovery / Restoring MTDs
October 11, 2019 09:39PM
the_wondersmith,

Your u-boot installation was fine, the envs look OK, too. So I think your rootfs must have had some problem.

- Recreate the Buster image to make sure you have a good rootfs. Using Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2

Scroll down to

Quote

Updated 25 Aug 2019:

Basic Debian buster Kirkwood rootfs for most Kirwood plugs:

And make sure you skip Step 4

Quote

4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Skip this step if you have installed the latest U-Boot for Kirkwood (or are installing this u-boot at the same time).

- Connect serial console, attach the new USB rootfs. Power up and let it boot autimatically. Watch serial console to see if it will boot all the ways to Debian prompt. If it stops somewhere before, then post the entire serial console log here.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: PogoPlug v4 Soft Brick Recovery / Restoring MTDs
October 12, 2019 12:17PM
That worked a treat!

In case it's helpful for anyone else, it looks like the point I screwed up at was thinking that the "skip this" warning on step 4 was more-or-less optional.

Also, the only point I deviated from bodhi's instructions above was in editing the fstab to reflect the fact that I couldn't seem to get Ubuntu to let me format the card I used in ext3, so I had to use ext4.
Re: PogoPlug v4 Soft Brick Recovery / Restoring MTDs
October 12, 2019 05:58PM
the_wondersmith,

> That worked a treat!
>
> In case it's helpful for anyone else, it looks
> like the point I screwed up at was thinking that
> the "skip this" warning on step 4 was more-or-less
> optional.
>

Cool!

I think I need to make that instruction more prominent to avoid mis-interpretation. Thanks!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Hi!
Can someone help me bring to live Pogoplug v4, two days trying and can't make it.

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01 -0700)
Pogoplug V4

SoC:   Kirkwood 88F6192_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:   MVEBU_MMC: 0
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Hit any key to stop autoboot:  0
Pogov4> printenv
arcNumber=3960
baudrate=115200
bootcmd=ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm$load_uimage_addr; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
console=ttyS0,115200
device=0:1
devices=usb ide mmc
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-pogoplug_v4
ethact=egiga0
ethaddr=00:25:31:05:27:0F
if_netconsole=ping $serverip
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_ide "ide reset";  setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
serverip=192.168.0.220
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=setenv init_usb "usb start";  setenv init_ide "ide reset";  setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices;  do for disknum in 0; do run uenv_read_disk; done; done;
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read;  fi; else if $devtype part $disknum; then run uenv_read; fi;  fi
usb_ready_retry=15

Environment size: 2887/131068 bytes
Pogov4>
Re: PogoPlug v4 Soft Brick Recovery / Restoring MTDs
March 14, 2021 05:02PM
Tirik,

You need to be more specific about what you trying to do. Did you create the rootfs on USB using Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2?

Your bootcmd and the DTB are wrong.

With the USB rootfs attched. Power up, interrupt serial console and

setenv bootcmd 'run scan_disk; run set_bootargs; run bootcmd_exec; reset'
setenv dtb_file '/boot/dts/kirkwood-pogoplug_v4.dtb'
and then boot
boot

It should boot into the Debian rootfs. If you see any error or it failed to boot to Debian, post the entire serial console log here.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: PogoPlug v4 Soft Brick Recovery / Restoring MTDs
March 16, 2021 05:24PM
Thanks bodhi,

i booted to Debian, will it stay if restart Pogoplug without USB?
Re: PogoPlug v4 Soft Brick Recovery / Restoring MTDs
March 16, 2021 09:01PM
Tirik,

> i booted to Debian, will it stay if restart
> Pogoplug without USB?

No, it won't boot to stock OS in NAND (or whatever is installed there now).

These envs needed to be saved (in Debian), in order for the next boot will boot into Debian on USB.

fw_setenv bootcmd 'run scan_disk; run set_bootargs; run bootcmd_exec; reset'
fw_setenv dtb_file '/boot/dts/kirkwood-pogoplug_v4.dtb'

=====

You'll need to modify the envs to booting OpenWrt on NAND (if that is there). And further changes are needed if you want to boot stock on NAND.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: PogoPlug v4 Soft Brick Recovery / Restoring MTDs
March 17, 2021 01:26AM
bodhi,

i don't know what is on my Pogoplug.. i tried to do something with it few years ago and after all i bricked it.
How can i now flash Debian or OpenWrt to nand? Can you help me with that?
Re: PogoPlug v4 Soft Brick Recovery / Restoring MTDs
March 17, 2021 04:51PM
Tirik,

> How can i now flash Debian or OpenWrt to nand? Can
> you help me with that?

Debian is too big to be on NAND. Currently, we only run it on USB or HDD.

OpenWrt will fit

See the Wiki thread:

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)

Install can be using serial console, same way as netconsole. Ask question if you are not sure about some steps.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: PogoPlug v4 Soft Brick Recovery / Restoring MTDs
March 18, 2021 02:37PM
bodhi, thank you very much for showing me in which direction to look to restore my Pogoplug.
Installed Openwrt and everything seems to be fine.

Only thing, cannot ping the serverip.
ip address is correct.

ping failed; host 192.168.3.16 is not alive
Using egiga0 device
ping failed; host 192.168.3.16 is not alive
Using egiga0 device
ping failed; host 192.168.3.16 is not alive
Using egiga0 device
ping failed; host 192.168.3.16 is not alive
Using egiga0 device
ping failed; host 192.168.3.16 is not alive
Re: PogoPlug v4 Soft Brick Recovery / Restoring MTDs
March 18, 2021 09:58PM
Tirik,

> ping failed; host 192.168.3.16 is not alive

Usually if this box is set to 192.168.3.xxx (xxx is whatever you want the Pogo V4 IP addess is, from 2 to 255), it should be able to ping 192.168.3.16.

But it does not hurt to set all related envs to be sure (192.168.3.1 is the router IP):

setenv serverip 192.168.3.16
setenv ipaddr 192.168.3.xxx
setenv netmask 255.255.255.0
setenv gateway 192.168.3.1

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: PogoPlug v4 Soft Brick Recovery / Restoring MTDs
March 19, 2021 04:11PM
Ok i will try this and again very big thanks for your help.
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: