Welcome! Log In Create A New Profile

Advanced

recovering a pogoplug from a failed (quasi-bricked) linux installation attempt

Posted by arin 
Some time ago (maybe two or three years) I have (quasi) bricked a Pogoplug E02 Model attempting to install Debian on it. I leave it as I was since I haven't the skill to "repair" it. Now a friend of mine who is very competent has disassembled it and he has told me that the device is not dead and reacts to a jtag connection with some linux output.
Is this the right place to ask for help? Otherwise, where?
I can post the photos of the devices and the output of the trasmitted commands.
Thank you in advance.
Re: recovering a pogoplug from a failed (quasi-bricked) linux installation attempt
November 09, 2016 02:18AM
arin Wrote:
-------------------------------------------------------
> Some time ago (maybe two or three years) I have
> (quasi) bricked a Pogoplug E02 Model attempting to
> install Debian on it. I leave it as I was since I
> haven't the skill to "repair" it. Now a friend of
> mine who is very competent has disassembled it and
> he has told me that the device is not dead and
> reacts to a jtag connection with some linux
> output.
> Is this the right place to ask for help?
> Otherwise, where?
> I can post the photos of the devices and the
> output of the trasmitted commands.
> Thank you in advance.

Yes. It is the right place. Go ahead and post as much info about the box as you can. I'll move this to u-boot subforum.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: recovering a pogoplug from a failed (quasi-bricked) linux installation attempt
November 09, 2016 12:17PM
theres a howto about using jtag recovery somewhere around here using a raspi - i think in the wiki
This is my Pogoplug dissected by my friend:
http://imgur.com/lnan8pu

He told me that:
* he identified a serial port and connected to it through a usb adapter;
* he found the baud rate (115200) and he saw a boot screenshot. Nothing happened apart a prompt:
http://imgur.com/kevW7LK
* he noted two bootloader: the original one and another one.
* using the command run pogo_bootcmd he did succesfully start the original boot
http://imgur.com/FayEQmV
ut he didn't understood how the system is partitioned.
* he was also enable to get a root lowing without password through the serial port:
http://imgur.com/9FbY6Mc

So, now, how has he to proceed?

Thank you for all your patience and your help.
Re: recovering a pogoplug from a failed (quasi-bricked) linux installation attempt
November 11, 2016 01:22AM
arin,

> This is my Pogoplug dissected by my friend:
> http://imgur.com/lnan8pu
>
> He told me that:
> * he identified a serial port and connected to it
> through a usb adapter;
> * he found the baud rate (115200) and he saw a
> boot screenshot. Nothing happened apart a prompt:
> http://imgur.com/kevW7LK

At this u-boot prompt, get the listing of u-boot envs and post here:
printenv

And I will post the rest of the recomendation tomorrow after I see them.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Take your time, I depend also on my friend work...
Thank you for your patience.
output of printenv:

baudrate=115200
bootcmd=usb=start
bootdelay=3
console=ttyS0,115200
ethact=egiga0
ethaddr=00:25:31:00:6D:C9
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
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
partition=nand0,2
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
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=0
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
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


-------------
Mod edit: add code tags



Edited 1 time(s). Last edit at 11/12/2016 12:24AM by bodhi.
Re: recovering a pogoplug from a failed (quasi-bricked) linux installation attempt
November 12, 2016 12:28AM
arin,

Create a new 4.4 rootfs on USB :
http://forum.doozan.com/read.php?2,12096

Quote

Updated 20 Feb 2016:

This Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 is to keep in sync with kernel Linux-4.4.0-kirkwood-tld-1.

Basic minimal Debian Kirkwood rootfs for most Kirwood plugs:


You need to do section 4, since you are booting with an old u-boot:

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).

Please replace kirkwood-goflexnet.dtb below with the correct DTB name for your box (see the folder /media/sdb1/boot/dts).

Generate the uImage with DTB embedded inside:
cd /media/sdb1/boot
cp -a zImage-4.4.0-kirkwood-tld-1 zImage.fdt
cat dts/kirkwood-goflexnet.dtb >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.4.0-kirkwood-tld-1 -d zImage.fdt uImage
sync

Note: if your Linux box does not have mkimage, then install it

apt-get install u-boot-tools

And remmeber to follow instruction very closely (being root user, single Ext3 partition,....).

Plug in this rootfs and boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Thank you Bodhi and excuse me for my late reply (I got ill).
Moreover, forgive but my understanding is very poor.
So, I pray you to not blame me if my questions appear stupid.
The instructions you cited explain downloading a file and then running some terminal commands. But where? On the pogoplug directly, or on another machine (is Ubuntu good?), to save on a usb pendrive (as your words "Create a new 4.4 rootfs on USB") suggest? But if this is the case, do I need to keep the pogoplug opened or can I reassemble it because all will go fine (at least this is the hope) when I will insert a new usb pendrive into it?
Moreover, in step 1 of your instructions you write: "1. Backup your current uImage and uInitrd. In the /boot directory, these are files for your current kernel (xx.xx.xx is the version number)". From where? From the pogoplug?
Thank you for your patience.
Re: recovering a pogoplug from a failed (quasi-bricked) linux installation attempt
November 24, 2016 03:41AM
arin,

> The instructions you cited explain downloading a
> file and then running some terminal commands. But
> where? On the pogoplug directly, or on another
> machine (is Ubuntu good?),

Yes, Ubuntu is good. Remember you have to be root the whole time (not using sudo) while you create the rootfs. If you can not be the root user, then it will not work.

> to save on a usb
> pendrive (as your words "Create a new 4.4 rootfs
> on USB") suggest? But if this is the case, do I
> need to keep the pogoplug opened or can I
> reassemble it because all will go fine (at least
> this is the hope)

The USB is mounted on Ubuntu when you run the tar command to create the rootfs.

> when I will insert a new usb
> pendrive into it?

When you are done with the rootfs. Bring it to the Pogo, insert, and power up.

> Moreover, in step 1 of your instructions you
> write: "1. Backup your current uImage and uInitrd.
> In the /boot directory, these are files for your
> current kernel (xx.xx.xx is the version number)".
> From where? From the pogoplug?

You are reading the wrong section. That is the kernel section. The rootfs (complete Debian system with kernel 4.4) is:

Quote

Updated 20 Feb 2016:

This Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 is to keep in sync with kernel Linux-4.4.0-kirkwood-tld-1.

Basic minimal Debian Kirkwood rootfs for most Kirwood plugs:

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
> The USB is mounted on Ubuntu when you run the tar
> command to create the rootfs.
>
> > when I will insert a new usb
> > pendrive into it?
>
> When you are done with the rootfs. Bring it to the
> Pogo, insert, and power up.

Does this mean that I do not need to do some strange operation inside the pogoplug as jtag or serial connection? and that my first failed installation hasn't bricked the device and above all that it is ready to accept a boot from an opportune usb pendrive? Sorry to ask you a confirmation, but I want to be sure to tell my friend that I can continue by myself.

> > Moreover, in step 1 of your instructions you
> > write: "1. Backup your current uImage and
> uInitrd.
> > In the /boot directory, these are files for
> your
> > current kernel (xx.xx.xx is the version
> number)".
> > From where? From the pogoplug?
>
> You are reading the wrong section. That is the
> kernel section. The rootfs (complete Debian system
> with kernel 4.4) is:

Are you saying to me that I can skip sections 1,2 and 3?

Please forgive my inexperience, I only want to be sure ha have well understood.

Thanks for your patience.
Re: recovering a pogoplug from a failed (quasi-bricked) linux installation attempt
November 25, 2016 03:53PM
arin,

> Does this mean that I do not need to do some
> strange operation inside the pogoplug as jtag or
> serial connection? and that my first failed
> installation hasn't bricked the device and above
> all that it is ready to accept a boot from an
> opportune usb pendrive?
Sorry to ask you a
> confirmation, but I want to be sure to tell my
> friend that I can continue by myself.

The information you've posted here: http://forum.doozan.com/read.php?3,30868,30906#msg-30906 and here http://forum.doozan.com/read.php?3,30868,30923#msg-30923 indicated that u-boot was successfully installed and the envs are OK.

This u-boot is old, so when you create the rootfs on a USB pen drive, you need to pay attention to section 4, as I described here http://forum.doozan.com/read.php?3,30868,30926#msg-30926

> Please forgive my inexperience, I only want to be
> sure ha have well understood.

That's OK. You are not yet familiar with the Linux rootfs and kernel concept, hence the confusion. The rootfs contains the kernel already, so that's the only thing you need for now (it is a complete Linux system).

The kernel/rootfs thread contains both kernel releases and rootfs releases. The latest rootfs is currently at 4.4:

Quote

Latest kernel:linux-4.8.3-kirkwood-tld-1-bodhi.tar.bz2 (24 Oct 2016)
Latest rootfs: Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 (20 Feb 2016)

So you need to scroll down to the section where the Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 is. And follow the instruction in that section only:


Quote

Updated 20 Feb 2016:

This Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 is to keep in sync with kernel Linux-4.4.0-kirkwood-tld-1.

Basic minimal Debian Kirkwood rootfs for most Kirwood plugs:

- tarball size: 137M
- install size: 398M
- a basic jessie rootfs.
- 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.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2
md5:
9f957e1dc5a36f90a285ab4615cb02fd
sha256:
d33349118e34bd078ca635cd2d6776f3e312accfc77d29da5870b9980add5c36

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

Installation:

Installation can be done on any Linux box, with a fresh USB drive (SD card or HDD would work fine too).

Note: all steps below must be done while logging in as root user (not sudo). If you are not the root user then don't continue, because the rootfs will not work.

1. Format a new USB drive with a single Ext3 partition, and label it rootfs.

2. Mount the drive on a Linux box. cd to top level directory and extract it. It is assuming the USB drive is mounted at /media/sdb1
cd /media/sdb1
tar -xjf Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2

3. Adjust fstab. Skip this step if you have installed the latest U-Boot for Kirkwood (or are installing this u-boot at the same time).

Edit /media/sdb1/etc/fstab entry for /dev/root to match the rootfstype of your usb_rootfstype. However, you can keep it as is without problem in booting since the u-boot env bootargs takes precedent.
/dev/root / ext3 noatime,errors=remount-ro 0 1

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).

Please replace kirkwood-goflexnet.dtb below with the correct DTB name for your box (see the folder /media/sdb1/boot/dts).

Generate the uImage with DTB embedded inside:
cd /media/sdb1/boot
cp -a zImage-4.4.0-kirkwood-tld-1 zImage.fdt
cat dts/kirkwood-goflexnet.dtb >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.4.0-kirkwood-tld-1 -d zImage.fdt uImage
sync

Note: if your Linux box does not have mkimage, then install it

apt-get install u-boot-tools

5. Done. Take this USB rootfs to your plug and cold start. After booted into Debian, see Note1 and Note2 below. It is very important that you do Note1 steps to secure your box.

Note1:

After logging in this rootf the first time, remember to generate new SSH key to make it your own unique rootfs. And also update your rootfs to get the latest Debian package security updates:
rm /etc/ssh/ssh_host*
ssh-keygen -A

apt-get update
apt-get upgrade

Note2:

To boot with systemd, add this parameter to your u-boot env bootargs. If you are booting with my latest u-boot images then use the uEnv.txt capability to do this. See the instruction about uEnvt.txt in that thread.
init=/bin/systemd
For example,
fw_setenv usb_set_bootargs 'setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts init=/bin/systemd'

If that's still not possible to run systemd, you might want to install it again:
apt-get install systemd

Once you have booted into Debian with this rootfs 4.4, then come back to the thread to see which kernel is the latest (it is 4.8.3 now), and consider upgrading the kernel.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: