Welcome! Log In Create A New Profile

Advanced

u-boot with openwrt-kirkwood-uImage not uImage

Posted by InYen 
u-boot with openwrt-kirkwood-uImage not uImage
May 15, 2011 08:17AM
I have updated my Seagate DockStar original u-boot code with Jeff's u-boot code from this Update uBoot on your Dockstar, GoFlex, or Pogoplug NAS page, I works just fine to boot OpenWRT firmware stored in an external USB partition. However, since the default kernel file name for an OpenWRT firmware for a Seagate DockStar is openwrt-kirkwood-uImage and not uImage, I have to either rename or create a link from openwrt-kirkwood-uImage to uImage; otherwise, Jeff's u-boot can't find the /boot/uImage kernel file to load. So, every time when I freshly compile an OpenWRT firmware for my Seagate DockStar, I have to rename openwrt-kirkwood-uImage to uImage and this has become a nuisance for me. For this, I would like to know if it is possible to change some u-boot environments so that the new u-boot will look for a /boot/openwrt-kirkwood-uImage instead of a /boot/uImage file.

Thanks.
fw_printenv usb_bootcmd
Look for the fsload command and modify the uImage filename accordingly.
Re: u-boot with openwrt-kirkwood-uImage not uImage
May 15, 2011 08:49PM
Here is the output from fw_printenv usb_bootcmd and I don't see any fsload command:

Pogoplug:~$ /usr/sbin/fw_printenv usb_bootcmd 
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
Pogoplug:~$
Pogoplug:~$ /usr/sbin/fw_printenv usb_boot   
usb_boot=mw 0x800000 0 1; ext2load usb  0x800000 /boot/openwrt-kirkwood-uImage; if ext2load usb  0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi

Anyways, I took a liberty to dump the environment as shown below and ho knows you will be able to spot something.

Pogoplug:~$ /usr/sbin/fw_printenv usb_boot   
usb_boot=mw 0x800000 0 1; ext2load usb  0x800000 /boot/openwrt-kirkwood-uImage; if ext2load usb  0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
Pogoplug:~$ /usr/sbin/fw_printenv         
ethact=egiga0
bootdelay=3
baudrate=115200
mainlineLinux=yes
console=ttyS0,115200
led_init=green blinking
led_exit=green off
led_error=orange blinking
mtdids=nand0=orion_nand
partition=nand0,2
stdin=serial
stdout=serial
stderr=serial
rescue_installed=0
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
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
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
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
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
usb_scan_list=1 2 3 4
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_init=run usb_scan
usb_device=0:1
usb_root=/dev/sda1
usb_rootfstype=ext2
usb_rootdelay=10
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset
ethaddr=00:10:72:06:82:12
ipaddr=192.168.1.170
if_netconsole=ping $serverip
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;fw_setenv preboot run if_netconsole start_netconsole
arcNumber=2998
serverip=192.168.1.11
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
usb_boot=mw 0x800000 0 1; ext2load usb  0x800000 /boot/openwrt-kirkwood-uImage; if ext2load usb  0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
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/openwrt-kirkwood-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
ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/openwrt-kirkwood-uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd;
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_boot=mw 0x800000 0 1; ext2load usb 0x800000 /boot/openwrt-kirkwood-uImage; if ext2load usb 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi

It's already loading /boot/openwrt-kirkwood-uImage.
Re: u-boot with openwrt-kirkwood-uImage not uImage
May 16, 2011 08:33AM
dpffan Wrote:
-------------------------------------------------------
> bootcmd=usb start; run force_rescue_bootcmd; run
> ubifs_bootcmd; run usb_bootcmd;
> usb_bootcmd=run usb_init; run usb_set_bootargs;
> run usb_boot
> usb_boot=mw 0x800000 0 1; ext2load usb 0x800000
> /boot/openwrt-kirkwood-uImage; if ext2load usb
> 0x1100000 /boot/uInitrd; then bootm 0x800000
> 0x1100000; else bootm 0x800000; fi
>
> It's already loading
> /boot/openwrt-kirkwood-uImage.

That's what I first thought so, but my Seagate DockStar still boots its original PogoPlug firmware and I have /boot/openwrt-kirkwood-uImage file on an external USB memory stick formatted as ext3. When I first flashed Jeff Doozan's u-boot to my Seagate DockStar, I had to create a link file, i.e. ln -sf openwrt-kirkwood-uImage uImage, so that my Seagate DockStar will boot into the external USB memory stick. Now, even I changed the environment back to uImage (from openwrt-kirkwood-uImage and created the linked uImage file), my Seagate DockStar no longer wants to boot into the external USB memory stick. Perhaps, I should reflash my Seagate DockStar with the same Jeff Doozan's u-boot again.
Re: u-boot with openwrt-kirkwood-uImage not uImage
May 16, 2011 10:03AM
I have another Seagate DockStar confiugred with a 3-rd party u-boot where its arcNumber has been set to 2998. It perfectly runs with a self-built OpenWRT system on an external 1GB USB memory stick. I took out the USB memory stick and plugged in into the problematic Seagate DockStar flashed with a Doozan's u-boot and set its arcNumber to 2998. Then, I connected the problematic Seagate DockStar to a WindowsXP computer through its serial-console PINs with a serial-console cable and excerpted the boot process as shown below. Doozan's u-boot complained that the /boot/openwrt-kirkwood-uImage has a Wrong Image Format for bootm command. After that, it went to boot with the original (PogoPlug?) firmware.

U-Boot 2010.09 (Oct 23 2010 - 11:49:22)
Marvell-Dockstar/Pogoplug by Jeff Doozan

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  3  2  1  0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 3 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
Loading file "/rescueme" from usb device 0:1 (usbda1)
** File not found /rescueme
reading /rescueme.txt

** Unable to read "/rescueme.txt" from usb 0:1 **
Creating 1 MTD partitions on "nand0":
UBI: logical eraseblock size:    (aligned 512)
UBI: data offset:                2048
UBI: attached mtd1 to ubi0
number of bad PEBs:         of user volumes:     0
UBI: availamax/mean erase counter: 1/1
UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:rootfs", error -19
Error reading superblock on volume 'ubi:rootfs'!
Loading file "/boot/openwrt-kirkwood-uImage" from usb device 0:1 (usbda1)
1 bytes read
Found bootable drive on usb 0:1
** No boot file defined **
** No boot file defined **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
stopping USB..
### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000
Scanning JFFS2 FS:   .  .  .  .  .  .  .  .   done.

### JFFS2 load complete: 524288 bytes loaded to 0x800000
## Starting application at 0x00800200 ...


U-Boot 1.1R2)
CPU running @ 12e 0x00000000   size 12tion (8M - 7M): Done
NAND:256 MB

CPU : Marvell Feroceon (Rev 1)
CLOUD ENGINES BOARD: REDSTONE:1.0

Streaming disabled 
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  3  2  1  0 

NAND read: device 0 offset 0x100000, size 0x300000


Reading data from 0x100000 --   0% complete.
Reading data from 0x107800 --   1% complete.
Reading data from 0x10f000 --   2% complete.
...
Reading data from 0x3f0800 --  98% complete.
Reading data from 0x3f8000 --  99% complete.
Reading data from 0x3ff800 -- 100% complete.
 3145728 bytes read: OK
## Boinux Kernel Image (ksum ... OK
OK

Starting kernel ...

Uncompressing Linux............................................................................................................................ done, booting the kernel.

[    0.000000] Linux version 2.6.on 1 (ARMv5TE), cr=00053177
[  abled, Data cache writeback
[       0.000000] CPU0: D cache: 1638command line: console=ttyS0, dummy device 80x30
[    0.er: 3, 32768 bytes)
[    0.000000]40000] Mount-cache hash table ent000] 
[    0.240000] CPU Intele
[    0.240000] SDRAM_CS2 ....dibase f2000000, size   1MB 
[   I_CS ....base f4000000, size  16Mize   2MB 
[    0.240000] 
[E
[    0.240000] 
[    0.240000] roller #0: c0537600
[    0.74000m initialized
[    0.740000bcore: registered new device driver  0.840000] IP route cache hash tab.840000] TCP bind hash tableTCP reno registered
[    0.the following functions:
[    0.87XOR engines to use: 4
[    0.8er Load
[    0.870000] squasversion 2.2. (NAND) © 2001-2006 0.890000] Serial: 8250/16550 driv
[    0.900000] serial8250.0: ttyS1 at MMIO 0xf1000] Loading Marvell Ethernet Drivee support - ETH_DEF_RXQ=0
[    0.9ive checksum offload enabled
[    0.94Driver ERROR statistics enabled
[    
[    0.970000]   o Tx descripors: q0=532
[    0.98000 2, GbE port = 1
[    0.990000] 
[    1.I
[    1.010000] Copyright (c) 19(c) 1999-2006 Intel Corporation
[    1.02ion: 1.41 $
[    1.040000] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit)
[    1.050000] Scanning device for bad blocks
[    1.150000] Using static partiti160000] 0x00100000-0x00500000 : "uImage"
[   ll.70059: Marvell Orion EHCI
[    1.180000] ehci_marvell ehci_marvell.70059: new USB bus registered, assigned bus number 1
[    1.220000] ehci_marvell ehci_marvell.70059: irq 19, io base 0xf1050100
[    n #1 chosen from 1 choice
[    1.250000] hub 1-0:1.0: USB hub found
[    1.250000] hub 1-0:1.0: 1 port detected
[    1.370000] USB Universal Host Controller Interface driver v3.0
[    1.650000] usb 1-1: new high speed USB device using ehci_marvell and address 2
[    1.800000] usb 1-1: configuration #1 chosen from 1 choice
[    1.800000] hub 1-1:1.0: USB hub found
[    1.810000] hub 1-1:1.0: 4 ports detected
[    2.160000] usb 1-1.4: new high speed USB device using ehci_marvell and address 3
[    2.260000] usb 1-1.4: configurablp.c: v0.13: USB Printer Device Classces
[    2.290000] usbcore: registce common for all mice
[    2.31000r level -1
[    2.320000] md: raid0 personality registered for level 0
[    2.320000] md: raid1 personality registered for level 1
[    2.500000] raid6: int32x1     97 MB/s
[    2.670000] raid6: int32x2    114 MB/s
[    2.840000] raid6: int32x4    122 MB/s
[    3.010000] raid6: int32x8    110 MB/s
20000] md: raid5 personality registd
[    3.080000]    arm4regs  :  1071.600 MB/sec
[    3.130000]    8regs     :   754.800 MB/sec
[    3.180000]    32regs    0-ioctl (2006-10-12) initialised: dme driver
[    3.200000] sdhci: Copyri.c: v2.6:USB HID core driver
[    3.2
[    3.230000] md: Autodetecting RAID arrays.
[    3.240000] md: autorun ...
[    3.240000] md: ... autorun DONE.
[    7.860000] Empty flash at 0x00de8e44 ends at 0x00de9000
[    8.440000] VFS: Mounted root (jffs2 filesystem) readonly.
[    8.450000] Freeing init memory: 120K
[    8.470000] scsi 0:0:0:0: Direct-Access              USB Flash Memory 5.00 PQ: 0 ANSI: 0 CCS
[    8.510000] sd 0:0:0:0: [sda] 2013 Assuming drive cache: write through
[    8.570000] sd 0:0:0:0: [sda] 2013184 512-byteive cache: write through
[    8.590000]  sda: sda1 sda2
[    8.600000] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    8.600000] sd 0:0:0:0: Attached scsi generic sg0 type 0

init started: BusyBox v1.7.0 (2008-02-26 19:25:17 IST)

starting pid 286, tty '': '/etc/init.d/rcS'
[   10.630000] eth0: link down
[   10.630000] eth0: started
udhcpc (v1.7.0) started
HWADDR 00 0x10 0x75 0x1a 0xa6 0x44
PIP0 166
PIP1 68
Sending discover...
[   12.280000] eth0: link up, full duplex, speed 100 Mbps
Sending discover...
Sending select for 192.168.1.170...
Lease of 192.168.1.170 obtained, lease time 43200
HWADDR 00 0x10 0x75 0x1a 0xa6 0x44
PIP0 166
PIP1 68
eth0      Link encap:Ethernet  HWNING MULTICAST  MTU:1500  Meer:0
          collisions:0 txqueuHWaddr 00:10:75:1A:A6:44  
   tric:1
          Interrupt:11 


starting pid 340, tty '': '/bin/sh'
-sh-3.2# 
Try a different usb stick.
For boot partition, try using ext2 instead of ext3.
The u-boot header for openwrt and debian kirkwood kernels may be different.
Re: u-boot with openwrt-kirkwood-uImage not uImage
May 17, 2011 05:39AM
dpffan Wrote:
-------------------------------------------------------
> Try a different usb stick.

I did and still have the same problem.

> For boot partition, try using ext2 instead of
> ext3.

IIRC, doozan's u-boot does have a support for EXT3. I wondered if it has a support for EXT4. If so, I sure don't mind to try.

When I replaced the original u-boot with Doozan's u-boot, set archNumber to 2998, created an EXT3 partition on a USB memory stick to hol dmy OpenWRT system, and created a /boot/uImage link to /boot/openwrt-kirkwood-uImage, my Seagate DockStar had no problem to boot into OpenWRT system on the external EXT3 partition. Since the doozan's u-boot recognizes uImage file and since OpenWRT only produces openwrt-kirkwood-uImage file, I thought to replace all uImage occurrence in the environment so that when I create a new external EXT partition, I can just copy the openwrt-kirkwood-uImage sans renaming it to uImage.

> The u-boot header for openwrt and debian kirkwood
> kernels may be different.

If they are different, then whey the doozan's u-boot was able to boot into my external EXT3 partition that contains OpenWRT system with /boot/uImage file before the modifications I made?

I tried to revert the environment by changing all openwrt-kirkwood-uImage occurrences to uImage and the doozan's u-boot now fails to boot into the external EXT3 partition that contains the OPenWRT system.

It looks like the only way to fix this problem is to restore to original u-boot which I have no idea how to proceed. Then, reflash it with the doozan's u-boot again. However, my preference is to hope someone who is knowledgeable in this matter to help me to fix this problem first.
Re: u-boot with openwrt-kirkwood-uImage not uImage
May 18, 2011 10:14AM
It looks like I am on a dead end and would certainly like to get some help to restore the original u-boot. I noticed the doozan's u-boot update process created a /uboot-original-mtd0.kwb when my Seagate DockStar boots into its original Pogo firmware. The question is can I use this /uboot-original-mtd0.kwb file along with the instructions on Old: Restore old uBoot on mtd0 (last section) to restore to its original u-boot as shown below without bricking my Seagate DockStar? And, what about how to restore the environments to original settings?

/usr/sbin/flash_erase /dev/mtd0 0 4
/usr/sbin/nandwrite /dev/mtd0 /uboot-original-mtd0.kwb

Once I restore the original u-boot with the /uboot-original-mtd0.kwb file, I sure would like to try again to reflash my Seagate DockStar with doozan's u-boot.
Re: u-boot with openwrt-kirkwood-uImage not uImage
June 06, 2011 11:48AM
OK. Now, I am back from vacation. I sure will appreciate if anyone out here can help me out to restore the original u-boot. This way, I can start all over again to install Doozan's u-boot.
IMHO it's the usb stick - try another one and not u-boot. Reflashing uboot is seriously overkill for the problem you are trying to solve.

I bricked my dockstar messing with fw_setenv which modifies mtd0's uboot. It took a while before I figured out how to JTAG and acquire the necessary tools to actually do it. Now the dockstar is hard to come by these days - if I can help it and I were in your shoes, I won't reflash uboot.
Re: u-boot with openwrt-kirkwood-uImage not uImage
June 09, 2011 08:32AM
dpffan Wrote:
-------------------------------------------------------
> IMHO it's the usb stick - try another one and not
> u-boot. Reflashing uboot is seriously overkill for
> the problem you are trying to solve.
>
The external USB stick is no problem. It works with other DockStar unit. That's why I believe it is better to reflash with Doozan's u-boot (if possible) or original u-boot and then Doozan's u-boot.
Re: u-boot with openwrt-kirkwood-uImage not uImage
January 21, 2012 10:09AM
I already have Debian booting from an USB pendrive formatted ext3 (on the nand I still have the original firmware). I'd like to install OpenWRT on another pendrive but I have no idea how exactly to prepare and copy the files.

Could anybody give me a hand?
Thanks
dpffan
Re: u-boot with openwrt-kirkwood-uImage not uImage
January 21, 2012 07:10PM
Do you have serial console access?

From the output of fw_printenv above, it looks like TS uses sda1 as root. Since openwrt doesn't use uInitrd and rootfs is on mtd2 by default, I am wondering if TS uses openwrt's ExtRoot support or simply unpacked rootfs onto sda1 - you could try that as a first option.
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: