Welcome! Log In Create A New Profile

Advanced

no .dtb file

Posted by habibie 
no .dtb file
May 23, 2016 09:55AM
Hello Bodhi,

Is it possible to boot using ONLY uImage kernel file without its .dtb file? If so, can you help me to modify the following uEnv.txt file so that it won't need the openwrt-oxnas-pogoplug-pro.dtb file to properly boot, i.e. what needs to change in the bootcmd_usb line?
bootargs_usb=setenv bootargs 'console=ttyS0,115200n8 root=/dev/sda1 rootdelay=2 rootfstype=ext4 LABEL=usb_rootfs'
bootcmd_usb=run bootargs_usb; ext2load $bootdev $device $u_image_addr $u_image; ext2load $bootdev $device $dtb_image_addr $dtb_image; bootm $u_image_addr - $dtb_image_addr
dtb_image=/boot/openwrt-oxnas-pogoplug-pro.dtb
dtb_image_addr=0x62c00000
initrd_image_addr=0x62000000
u_image=/boot/openwrt-oxnas-uImage
u_image_addr=0x60500000
Re: no .dtb file
May 23, 2016 12:49PM
habibie,

>
> Is it possible to boot using ONLY uImage kernel
> file without its .dtb file?

No it's not posible. If you want to boot with FDT kernel, and using uImage only, then you have to append the DTB to uImage. Use the example in Debian kernel.

Quote

4b. Boot with DTB file embedded in the kernel image (no U-Boot envs changes are needed if your system already booting on USB or HDD)

Again, please replace kirkwood-goflexnet.dtb below with the correct DTB name for your box.

Generate the uImage and uInitrd:
cd /boot
mv uImage uImage.orig
cp -a zImage-4.6.0-kirkwood-tld-1 zImage.fdt
cat dts/kirkwood-goflexnet.dtb >> zImage.fdt
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.6.0-kirkwood-tld-1 -d zImage.fdt uImage

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: no .dtb file
May 24, 2016 08:47AM
bodhi Wrote:
-------------------------------------------------------
> habibie,
>
> >
> > Is it possible to boot using ONLY uImage kernel
> > file without its .dtb file?
>
> No it's not posible. If you want to boot with FDT
> kernel, and using uImage only, then you have to
> append the DTB to uImage. Use the example in
> Debian kernel.
>
>
Quote

4b. Boot with DTB file embedded in the
> kernel image (no U-Boot envs changes are needed if
> your system already booting on USB or HDD)
>
> Again, please replace kirkwood-goflexnet.dtb below
> with the correct DTB name for your box.
>
> Generate the uImage and uInitrd:
> cd /boot
> mv uImage uImage.orig
> cp -a zImage-4.6.0-kirkwood-tld-1 zImage.fdt
> cat dts/kirkwood-goflexnet.dtb >> zImage.fdt
> mkimage -A arm -O linux -T kernel -C none -a
> 0x00008000 -e 0x00008000 -n
> Linux-4.6.0-kirkwood-tld-1 -d zImage.fdt
> uImage

Hello Bodhi,

I think this is the default settings on OpenWRT where its uImage kernel file already includes the .dtb file. But, I don't know how to modify the bootcmd_usb= line on my existing uExt.txt file without the dtb file and am hoping you can help.
Re: no .dtb file
May 24, 2016 03:42PM
habibie,

> I think this is the default settings on OpenWRT
> where its uImage kernel file already includes the
> .dtb file. But, I don't know how to modify the
> bootcmd_usb= line on my existing uExt.txt
> file without the dtb file and am hoping you can
> help.

I see. In that case,

bootcmd_usb=run bootargs_usb; ext2load $bootdev $device $u_image_addr $u_image; bootm $u_image_addr

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: no .dtb file
May 24, 2016 09:31PM
Bodhi, thank you.

EDIT: I gave it a try and the kernel had a problem to boot as shown below, i.e. stucked @ Uncompressing Linux... done, booting the kernel.

From serial/console cable:
U-Boot 2013.10-tld-5 (Mar 07 2015 - 16:50:17) for OXNAS                                                                           
                                                                                                                                  
DRAM:  128 MiB                                                                                                                    
NAND:  128 MiB                                                                                                                    
In:    serial                                                                                                                     
Out:   serial                                                                                                                     
Err:   serial                                                                                                                     
Net:                                                                                                                              
Led:    GREEN                                                                                                                     
mii0                                                                                                                              
Main Loop                                                                                                                         
Waiting for PHY auto negotiation to complete... done                                                                              
ENET Speed is 1000 Mbps - FULL duplex connection                                                                                  
Using mii0 device                                                                                                                 
host 10.0.0.100 is alive                                                                                                          
Uncompressing Linux... done, booting the kernel.

From Net console side:
U-Boot 2013.10-tld-5 (Mar 07 2015 - 16:50:17) for OXNAS
gcc (Debian 4.9.1-19) 4.9.1
GNU ld (GNU Binutils for Debian) 2.24.90.20141023
Hit any key to stop autoboot:  0 
Use bootcmd_nand before scan_disk
Scanning usb device
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Scanning device: usb 0:1
555 bytes read in 301 ms (1000 Bytes/s)
Found bootable drive on usb 0:1
## Info: input data size = 653 = 0x28D
## Info: input data size = 669 = 0x29D
## Info: input data size = 37685 = 0x9335
Use bootcmd_usb after scan_disk
2039448 bytes read in 582 ms (3.3 MiB/s)
## Booting kernel from Legacy Image at 60500000 ...
   Image Name:   ARM LEDE Linux-4.4.11
   Created:      2016-05-23  19:44:54 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2039384 Bytes = 1.9 MiB
   Load Address: 60008000
   Entry Point:  60008000
   Verifying Checksum ... OK


Starting kernel ...

Regardless whether with and/or without a .dtb file, sometimes I do get some warning/error messages as shown below on the net console side. I really don't know if that is harmful or not, but I gathered perhaps it had something to do with the USB storage issue.
Starting kernel ...
U-Boot 2013.10-tld-5 (Mar 07 2015 - 16:50:17) for OXNAS
gcc (Debian 4.9.1-19) 4.9.1
GNU ld (GNU Binutils for Debian) 2.24.90.20141023
Hit any key to stop autoboot:  0 
Use bootcmd_nand before scan_disk
Scanning usb device
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Scanning device: usb 0:1
454 bytes read in 296 ms (1000 Bytes/s)
Found bootable drive on usb 0:1
## Info: input data size = 455 = 0x1C7
## Info: input data size = 265 = 0x109
## Warning: Input data exceeds 1048576 bytes - truncated
## Info: input data size = 1048578 = 0x100002
ERROR: Environment import failed: errno = 12

at cmd_nvedit.c:1049/do_env_import()
Use bootcmd_usb after scan_disk
2039448 bytes read in 582 ms (3.3 MiB/s)
6993 bytes read in 281 ms (23.4 KiB/s)
## Booting kernel from Legacy Image at 60500000 ...
   Image Name:   ARM LEDE Linux-4.4.11
   Created:      2016-05-23  19:44:54 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2039384 Bytes = 1.9 MiB
   Load Address: 60008000
   Entry Point:  60008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 62c00000
   Booting using the fdt blob at 0x62c00000


Starting kernel ...



Edited 1 time(s). Last edit at 05/25/2016 07:06AM by habibie.
Re: no .dtb file
May 29, 2016 11:17PM
> Use bootcmd_usb after scan_disk

Wrong boot device. Reason: bootcmd still tried to scandisk and found the kernel uImage in the attached USB drive.

Do either:

1. Boot without the USB drive attached.

or

2. Make sure the rootfs has only OpenWrt kernel files, not Debian kernel files. WTH are you mixing kernels in this rootfs? :))

a. Mount the USB on another Linux box and remove uEnv.txt

rm /media/sdb1/boot/uEnv.txt

b. Move uImage somewhere else

mv /media/sdb1/boot/uImage /media/sdb1/boot/uImage.orig

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