Welcome! Log In Create A New Profile

Advanced

broken uboot?

Posted by gigaguy 
Re: broken uboot?
March 02, 2018 11:18PM
yeehaa,

> ok.. i may have confused the hell out of you..
> here is what i did on this pogo plug mobile.. i
> have the arch rescue on the mtd1 partition.. i
> went ahead and flashed your uboot and uboot envs
> to mtd0 as per the thread you linked.. then....
>

> U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01
> -0700)
> Pogoplug V4
> gcc (Debian 6.3.0-18) 6.3.0 20170516
> GNU ld (GNU Binutils for Debian) 2.28
> Hit any key to stop autoboot: 0

Cool! so we are at the same point :)

> Kernel image @ 0x810000 [ 0x000000 - 0x3f05c8 ]
> ## Flattened Device Tree blob at 00800000
> Booting using the fdt blob at 0x800000
>
>
> Starting kernel ...
>
> so the commands you wrote seemed to have worked to
> boot arch rescue from your uboot..

Excellent!

>now how do i
> make this permanent? once made permanent, i would
> like to boot to debian on usb and fall back to
> arch rescue in case no usb is attached.. also just
> so that there is no confusion, this will all be on
> a pogo mobile with your uboot on it..
>

You could repeat this with the USB Debian rootfs attached first to see it works both ways. I usually do this before I save the envs.


However, this is now safe to save the envs, since you can see it is working. So to do that, before you boot, do a saveenv.

Repeat these commands
setenv bootcmd 'run scan_disk; run set_bootargs; run bootcmd_exec; printenv; printenv bootargs; run arch_rescue'
setenv bootcmd_exec 'if run load_uimage; then; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_adr; 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; fi'
setenv arch_dtb_file '/boot/dtbs/kirkwood-pogoplugv4.dtb'
setenv arch_mountubi 'ubi part rootfs; ubifsmount ubi0:rootfs'
setenv arch_loadaddr '0x810000'
setenv arch_fdtaddr '0x800000'
setenv arch_console 'ttyS0,115200'
setenv arch_mtdparts 'mtdparts=orion_nand:1M(u-boot),-(rootfs)'
setenv arch_rescue 'echo Trying to boot from NAND ...;  if run arch_mountubi; then ubifsload ${arch_loadaddr} /boot/zImage;ubifsload ${arch_fdtaddr} ${arch_dtb_file}; ubifsumount; setenv bootargs console=${arch_console} ubi.mtd=1 root=ubi0:rootfs ro rootfstype=ubifs  rootwait ${arch_mtdparts};bootz ${arch_loadaddr} - ${arch_fdtaddr};fi'

and then save

saveenv

and then reset to let it boot automatically from the beginning (or do a boot as before).
reset

Now when you power down and up again, it will boot into Arch rescue if there is no rootfs attached.

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



Edited 1 time(s). Last edit at 03/02/2018 11:19PM by bodhi.
Re: broken uboot?
March 03, 2018 09:22AM
bodhi Wrote:
-------------------------------------------------------
> yeehaa,
>
> > ok.. i may have confused the hell out of you..
> > here is what i did on this pogo plug mobile.. i
> > have the arch rescue on the mtd1 partition.. i
> > went ahead and flashed your uboot and uboot
> envs
> > to mtd0 as per the thread you linked.. then....
> >
>
> > U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01
> > -0700)
> > Pogoplug V4
> > gcc (Debian 6.3.0-18) 6.3.0 20170516
> > GNU ld (GNU Binutils for Debian) 2.28
> > Hit any key to stop autoboot: 0
>
> Cool! so we are at the same point :)
>
> > Kernel image @ 0x810000 [ 0x000000 - 0x3f05c8 ]
> > ## Flattened Device Tree blob at 00800000
> > Booting using the fdt blob at 0x800000
> >
> >
> > Starting kernel ...
> >
> > so the commands you wrote seemed to have worked
> to
> > boot arch rescue from your uboot..
>
> Excellent!
>
> >now how do i
> > make this permanent? once made permanent, i
> would
> > like to boot to debian on usb and fall back to
> > arch rescue in case no usb is attached.. also
> just
> > so that there is no confusion, this will all be
> on
> > a pogo mobile with your uboot on it..
> >
>
> You could repeat this with the USB Debian rootfs
> attached first to see it works both ways. I
> usually do this before I save the envs.
>
>
> However, this is now safe to save the envs, since
> you can see it is working. So to do that, before
> you boot, do a saveenv.
>
> Repeat these commands
>
> setenv bootcmd 'run scan_disk; run set_bootargs;
> run bootcmd_exec; printenv; printenv bootargs; run
> arch_rescue'
> setenv bootcmd_exec 'if run load_uimage; then; if
> run load_initrd; then if run load_dtb; then bootm
> $load_uimage_addr $load_initrd_addr $load_dtb_adr;
> 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; fi'
> setenv arch_dtb_file
> '/boot/dtbs/kirkwood-pogoplugv4.dtb'
> setenv arch_mountubi 'ubi part rootfs; ubifsmount
> ubi0:rootfs'
> setenv arch_loadaddr '0x810000'
> setenv arch_fdtaddr '0x800000'
> setenv arch_console 'ttyS0,115200'
> setenv arch_mtdparts
> 'mtdparts=orion_nand:1M(u-boot),-(rootfs)'
> setenv arch_rescue 'echo Trying to boot from NAND
> ...;  if run arch_mountubi; then ubifsload
> ${arch_loadaddr} /boot/zImage;ubifsload
> ${arch_fdtaddr} ${arch_dtb_file}; ubifsumount;
> setenv bootargs console=${arch_console} ubi.mtd=1
> root=ubi0:rootfs ro rootfstype=ubifs  rootwait
> ${arch_mtdparts};bootz ${arch_loadaddr} -
> ${arch_fdtaddr};fi'
>
>
> and then save
>
>
> saveenv
>
>
> and then reset to let it boot automatically from
> the beginning (or do a boot as before).
>
> reset
>
>
> Now when you power down and up again, it will boot
> into Arch rescue if there is no rootfs attached.

thanks.. will try out debian on this device once i get a chance.. would it be possible to boot archlinux with your uboot as well? that way i can upgrade uboot on all my devices, keep the arch rescue and have the choice of arch on some and debian on others.. right now i have different versions of uboot on different devices and the arch has started having issues with the latest ext4 formatting.. (arch uboot required me to format using "mkfs.ext4 -O ^metadata_csum,^64bit /dev/sdX1")

thanks for being patient and all the help!
Re: broken uboot?
March 03, 2018 02:06PM
spoke too soon.. i created a new debian ext4 usb stick as shown in the thread here and got this when i booted..

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01 -0700)
Pogoplug V4
gcc (Debian 6.3.0-18) 6.3.0 20170516
GNU ld (GNU Binutils for Debian) 2.28
Hit any key to stop autoboot:  0 
running scan_disk ...
Scan device usb
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 
Use USB retry period from the environment: 15 second(s)
1 Storage Device(s) found
device usb 0:1
1 bytes read in 692 ms (0 Bytes/s)
Found bootable drive on usb 0
loading uImage ...
3821592 bytes read in 866 ms (4.2 MiB/s)
loading uInitrd ...
7245696 bytes read in 885 ms (7.8 MiB/s)
loading DTB /boot/dts/kirkwood-pogoplug_v4.dtb ...
10284 bytes read in 1768 ms (4.9 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.12.1-kirkwood-tld-1
   Created:      2017-07-20   8:11:24 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3821528 Bytes = 3.6 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-4.12.1-kirkwood-tld-1
   Created:      2017-07-24   0:18:23 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7245632 Bytes = 6.9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK


Starting kernel ...

but the device never showed up in the device list on my router and has a solid orange light now.. cant ping or ssh into it..
since i do not have kernel messages, i cannot figure out whats happening..

so i reset the device and at uboot did

Pogov4> setenv 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'
setenv 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'
Pogov4> setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec'
setenv bootcmd 'run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec'
Pogov4> boot
boot
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 
Use USB retry period from the environment: 15 second(s)
1 Storage Device(s) found

Reset IDE: ide_preinit failed
Card did not respond to voltage select!
mmc_init: -95, time 73

Partition Map for USB device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	2048      	15699968  	c097e6c8-01	83

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** File not found /boot/uEnv.txt **

no IDE devices available
Card did not respond to voltage select!
mmc_init: -95, time 94
running scan_disk ...
Scan device usb
device usb 0:1
1 bytes read in 692 ms (0 Bytes/s)
Found bootable drive on usb 0
loading uImage ...
3821592 bytes read in 872 ms (4.2 MiB/s)
loading uInitrd ...
7245696 bytes read in 898 ms (7.7 MiB/s)
loading DTB /boot/dts/kirkwood-pogoplug_v4.dtb ...
10284 bytes read in 1768 ms (4.9 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.12.1-kirkwood-tld-1
   Created:      2017-07-20   8:11:24 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3821528 Bytes = 3.6 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-4.12.1-kirkwood-tld-1
   Created:      2017-07-24   0:18:23 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7245632 Bytes = 6.9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000


Starting kernel ...
which boot into the debian usb stick.. so i've saved this for now.. seems like your modifications let uboot boot into arch rescue, but then we lost the ability to boot into the debian rootfs
Re: broken uboot?
March 03, 2018 02:17PM
now i'm getting this when i boot..

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:34:01 -0700)
Pogoplug V4
gcc (Debian 6.3.0-18) 6.3.0 20170516
GNU ld (GNU Binutils for Debian) 2.28
Hit any key to stop autoboot:  0 
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 
Use USB retry period from the environment: 15 second(s)
1 Storage Device(s) found

Reset IDE: ide_preinit failed
Card did not respond to voltage select!
mmc_init: -95, time 74

Partition Map for USB device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	2048      	15699968  	c097e6c8-01	83

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** File not found /boot/uEnv.txt **

no IDE devices available
Card did not respond to voltage select!
mmc_init: -95, time 96
running scan_disk ...
Scan device usb
device usb 0:1
1 bytes read in 692 ms (0 Bytes/s)
Found bootable drive on usb 0
loading uImage ...
3821592 bytes read in 866 ms (4.2 MiB/s)
loading uInitrd ...
EHCI timed out on TD - token=0xbe008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
 ** ext4fs_devread read error - block
loading DTB /boot/dts/kirkwood-pogoplug_v4.dtb ...
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x801f8c80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
** Can't read partition table on 0:0 **
** Invalid partition 1 **
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.12.1-kirkwood-tld-1
   Created:      2017-07-20   8:11:24 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3821528 Bytes = 3.6 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK


Starting kernel ...
i think i may have messed up the hardware playing with the board and an old usb ttl serial cable that i dug up.. its corrupting (or doing something) to the usb sticks.. they boot fine the first time, but on subsequent boots i'm getting this error and blinking green led.. fsck on the ext4 stick shows its clean.. i've reached the depth of my "expertise"!

i still have a debian pogo e02 with your uboot if we can still try the arch rescue thing if i have to retire this pogo mobile.
Re: broken uboot?
March 03, 2018 04:13PM
yeehaa,

1.

> i think i may have messed up the hardware playing
> with the board and an old usb ttl serial cable
> that i dug up.. its corrupting (or doing
> something) to the usb sticks.. they boot fine the
> first time, but on subsequent boots i'm getting
> this error and blinking green led.. fsck on the
> ext4 stick shows its clean.. i've reached the
> depth of my "expertise"!
>

The USB drive partition is now no good, even on the other box you got a clean fsck. What you should do during testing: wipe this drive (recreate the Ext4 partition) and recreate the rootfs. Or better yet, use Ext3. Don't worry about Ext4 during testing. Once everything works, then use Ext4 if that's what you want for the final rootfs. Ext4 has been troublesome lately (it does not play well with older u-boot Ext4 driver).

2. And regarding

Quote

which boot into the debian usb stick.. so i've saved this for now.. seems like your modifications let uboot boot into arch rescue, but then we lost the ability to boot into the debian rootfs

I would like you to boot into Debian, reflash the default envs image, adjust the envs to your box (like initial installation). And make sure that can boot with Debian USB rootfs a couple times. And then at netconsole, try the the envs for Arch rescue again. But don't save them. And then boot into Debian in the next boot. Alternate the tests a few times. Post the bootlog when it does not boot like you expect it to.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: broken uboot?
March 04, 2018 08:21PM
bodhi Wrote:

> rootfs. Ext4 has been troublesome lately (it does
> not play well with older u-boot Ext4 driver).
>

When formatting use mkfs.ext4dev instead of mkfs.ext4 to avoid the issues with older u-boot.
Re: broken uboot?
March 11, 2018 05:42PM
rayknight Wrote:
-------------------------------------------------------
> bodhi Wrote:
>
> > rootfs. Ext4 has been troublesome lately (it
> does
> > not play well with older u-boot Ext4 driver).
> >
>
> When formatting use mkfs.ext4dev instead of
> mkfs.ext4 to avoid the issues with older u-boot.

Thanks Ray. Is that becasue mkfs.ext4dev default to 32-bit?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: broken uboot?
March 11, 2018 10:38PM
bodhi Wrote:
-------------------------------------------------------
> rayknight Wrote:
> -------------------------------------------------------
> > bodhi Wrote:
> >
> > > rootfs. Ext4 has been troublesome lately (it
> > does
> > > not play well with older u-boot Ext4 driver).
> > >
> >
> > When formatting use mkfs.ext4dev instead of
> > mkfs.ext4 to avoid the issues with older
> u-boot.
>
> Thanks Ray. Is that becasue mkfs.ext4dev default
> to 32-bit?

Yes mkfs.ext4dev defaults to 32-bit. I can't recall where I discovered this option, and apparently mkfs.ext4dev is not available on some distros.
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: