Welcome! Log In Create A New Profile

Advanced

OpenWrt u-boot with Read-Only mtd0?

Posted by rayknight 
OpenWrt u-boot with Read-Only mtd0?
June 08, 2016 12:21AM
Results:

root@debian:~# fw_printenv | grep -i dtb
root@debian:~# fw_printenv bootcmd
bootcmd=run bootcmd_uenv; run bootcmd_usb; run bootcmd_nand; reset
root@debian:~# fw_printenv mtdparts
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
root@debian:~# ls -l /boot/dts/*e02*
-rw-r--r-- 1 root root 10446 May 18 2016 /boot/dts/kirkwood-pogo_e02.dtb
root@debian:~# uname -a
Linux debian 4.6.0-kirkwood-tld-1 #1 PREEMPT Wed May 18 03:54:14 PDT 2016 armv5tel GNU/Linux

Additional results:
root@debian:~# myinfo
debian

eth0: error fetching interface information: Device not found
Machine model: CloudEngines Pogoplug E02
Linux version 4.6.0-kirkwood-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 PREEMPT Wed May 18 03:54:14 PDT 2016

Troubling items from dmesg:

[ 0.160975] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[ 0.165887] No ATAGs?

Which explains why I can't bring up the ethernet port. I have serial access.

Thanks for whatever help you can provide.

Ray



Edited 1 time(s). Last edit at 06/08/2016 01:55AM by bodhi.
Re: OpenWrt u-boot with Read-Only mtd0?
June 08, 2016 01:53AM
rayknight,

> root@debian:~# fw_printenv bootcmd
> bootcmd=run bootcmd_uenv; run bootcmd_usb; run
> bootcmd_nand; reset

> root@debian:~# fw_printenv mtdparts
> mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage)
> ,32M(rootfs),-(data)

You've already flashed the new u-boot default envs, or were these set manually?

> I have serial access.

I think it is best that you capture the entire serial console log and post here. What you've posted above are not consistent with what I expected to see. There is some information that you have not mentioned. You are booting with OpenWrt u-boot, but the envs above are probably not from that u-boot.

- boot with serial console
- interrupt it and
printenv
boot

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



Edited 1 time(s). Last edit at 06/08/2016 01:57AM by bodhi.
Re: OpenWrt u-boot with Read-Only mtd0?
June 08, 2016 08:49AM
I can do that tonight, but a little history might be helpful. I acquired this PogoPlug after someone else attempted to install OpenWrt. They were not successful as the boot fails to load an OS. I was able to manually enter commands to boot Debian from USB. The installed u-boot appears to have a limit on the length of an environment variable which made the task more difficult. So yes I manually set the mtdparts. My goal here is to replace get your latest u-boot installed and booting Debian from USB. I will then install my own recover image to nand. I do have serial access and a tftp server if necessary for recovery.
Re: OpenWrt u-boot with Read-Only mtd0?
June 16, 2016 11:47PM
Here are the results you asked for (1st without USB drive, then with USB drive):

U-Boot 2014.10 (Jan 02 2016 - 02:37:49)M
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 
PogoE02> printenv
arcNumber=3542
baudrate=115200
bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
bootargs_root=ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs rw
bootcmd=setenv bootargs ${console} ${mtdparts} ${bootargs_root}; ubi part root; ubifsmount ubi:rootfs; ubifsload 0x800000 ${kernel}; ubifsload 0x700000 ${fdt}; ubifsumount; fdt addr 0x700000; fdt resize; fdt chosen; bootz 0x800000 - 0x700000
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=3
bootdev=usb
console=console=ttyS0,115200
device=0:1
devices=usb
dtb_file=/boot/dts/kirkwood-pogo_e02.dtb
ethact=egiga0
ethaddr=00:25:31:04:B3:41
fdt=/boot/pogo_e02.dtb
filesize=28ce
ipaddr=192.168.1.1
kernel=/boot/zImage
load_dtb=echo loading DTB $dtb_file ...; ext2load $bootdev $device 0x1c00000 $dtb_file
load_initrd=echo loading uInitrd ...; ext2load $bootdev $device 0x1100000 /boot/uInitrd
load_uimage=echo loading uImage ...; ext2load $bootdev $device 0x800000 /boot/uImage
machid=dd6
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
scan_disk=scan_done=1
scan_done=1
scan_usb="usb start"
serverip=192.168.1.15
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts
stderr=serial
stdin=serial
stdout=serial

Environment size: 1411/131068 bytes
PogoE02> boot
incorrect device type in root
Partition root not found!
Error reading superblock on volume 'ubi:rootfs' errno=-19!
ubifsmount - mount UBIFS volume

Usage:
ubifsmount <volume-name>
    - mount 'volume-name' volume
UBIFS not mounted, use ubifs mount to mount volume first!
ubifsload - load file from an UBIFS filesystem

Usage:
ubifsload <addr> <filename> [bytes]
    - load file 'filename' to address 'addr'
UBIFS not mounted, use ubifs mount to mount volume first!
ubifsload - load file from an UBIFS filesystem

Usage:
ubifsload <addr> <filename> [bytes]
    - load file 'filename' to address 'addr'
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
Bad Linux ARM zImage magic!
PogoE02> 
PogoE02> reset
resetting ...


U-Boot 2014.10 (Jan 02 2016 - 02:37:49)
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 
incorrect device type in root
Partition root not found!
Error reading superblock on volume 'ubi:rootfs' errno=-19!
ubifsmount - mount UBIFS volume

Usage:
ubifsmount <volume-name>
    - mount 'volume-name' volume
UBIFS not mounted, use ubifs mount to mount volume first!
ubifsload - load file from an UBIFS filesystem

Usage:
ubifsload <addr> <filename> [bytes]
    - load file 'filename' to address 'addr'
UBIFS not mounted, use ubifs mount to mount volume first!
ubifsload - load file from an UBIFS filesystem

Usage:
ubifsload <addr> <filename> [bytes]
    - load file 'filename' to address 'addr'
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
Bad Linux ARM zImage magic!
PogoE02> 
Re: OpenWrt u-boot with Read-Only mtd0?
June 17, 2016 01:11AM
I see. It was a botched attempt to install OpenWrt. So it can not boot either OpenWrt or Debian.

You said you can adjust the envs to boot into Debian, let's do that again. Adjust the envs, but before booting,
printenv
and then boot.

The dmesg error that you've listed previously is not relevant to Ethernet. As long as you have ethaddr set correctly, then it should be OK.

So it might be the case that the rootfs is reused (the rootfs was a backup from other Kirkwood box)? if this is true then you need to adjust the udev rules for network, after cloning the rootfs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: OpenWrt u-boot with Read-Only mtd0?
June 17, 2016 11:00PM
Tried booting to a fresh USB drive created from Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2. Then followed the instructions for installing the Kirkwood U-Boot. I had to install mtd-utils, but after that the instructions were successful and I'm now booting straight into the USB drive!!!

I guess starting from a fresh install of Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 may have been the fix. When you create a newer image you may want to install mtd-utils and ca-certificates so the nandwrite tools are there and wget will work with your dropbox files.

Thanks for your work!
Re: OpenWrt u-boot with Read-Only mtd0?
June 17, 2016 11:32PM
> Tried booting to a fresh USB drive created from
> Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2.
> Then followed the instructions for installing the
> Kirkwood U-Boot. I had to install mtd-utils, but
> after that the instructions were successful and
> I'm now booting straight into the USB drive!!!

That was what I suspected above why you did not get network connection. You needs udev rules cleanup when reusing rootfs.

-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: