UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
78 Views
Registered: ‎05-14-2019

U-Boot: ramdisk in FIT image

Jump to solution

I've followed the instructions in the Xilinx Wiki U-Boot Images article under "Flattened Image Tree" and created a U-Boot FIT image which contains a ramdisk (a gzipped cpio archive).

How do tell Linux to use that ramdisk? I.e., which kernel boot args do I have to use?

Currently I load and boot the FIT image using

 

setenv bootargs earlycon clk_ignore_unused ramdisk_size=262144 rw
load mmc 0: ${netstart} image.ub bootm ${netstart}

and U-Boot correctly extracts the components:

 

## Loading kernel from FIT Image at 10000000 ...
   Using 'conf@1' configuration
   Trying 'kernel@1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x100000c0
     Data Size:    14283264 Bytes = 13.6 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x00080000
     Entry Point:  0x00080000
     Hash algo:    sha1
     Hash value:   8eebdc947fe938249809a1b64c70a8e6ae1706eb
   Verifying Hash Integrity ... sha1+ OK
## Loading ramdisk from FIT Image at 10000000 ...
   Using 'conf@1' configuration
   Trying 'ramdisk@1' ramdisk subimage
     Description:  Minimal ramdisk
     Type:         RAMDisk Image
     Compression:  gzip compressed
     Data Start:   0x10da739c
     Data Size:    77415568 Bytes = 73.8 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x00000000
     Entry Point:  0x00000000
     Hash algo:    sha1
     Hash value:   b73396c885259d95f5d04ec8876c613ef65598cd
   Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf@1' configuration
   Trying 'fdt@1' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x10d9f3b8
     Data Size:    32551 Bytes = 31.8 KiB
     Architecture: AArch64
     Hash algo:    sha1
     Hash value:   f0da15eab72a61584a410c8e42a219f243f4bf8e
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x10d9f3b8
   Loading Kernel Image ... OK
   Loading Ramdisk to 0362b000, end 07fff490 ... OK
   Loading Device Tree to 0000000003620000, end 000000000362af26 ... OK
 
Starting kernel ...
[...]
[ 1.337214] Trying to unpack rootfs image as initramfs...
[ 4.232428] Freeing initrd memory: 75600K
[...]
[ 6.090556] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 6.097973] Please append a correct "root=" boot option; here are the available partitions:
[ 6.106296] 0100 65536 ram0
[ 6.106298] (driver?)
[ 6.112364] 0101 65536 ram1
[ 6.112366] (driver?)
[ 6.118436] 0102 65536 ram2
[ 6.118438] (driver?)
[ 6.124516] 0103 65536 ram3
[ 6.124518] (driver?)
[ 6.130588] 0104 65536 ram4
[ 6.130590] (driver?)
[ 6.136668] 0105 65536 ram5
[ 6.136670] (driver?)
[ 6.142740] 0106 65536 ram6
[ 6.142742] (driver?)
[ 6.148820] 0107 65536 ram7
[ 6.148822] (driver?)
[ 6.154893] 0108 65536 ram8
[ 6.154894] (driver?)
[ 6.160972] 0109 65536 ram9
[ 6.160976] (driver?)
[ 6.167045] 010a 65536 ram10
[ 6.167046] (driver?)
[ 6.173211] 010b 65536 ram11
[ 6.173213] (driver?)
[ 6.179370] 010c 65536 ram12
[ 6.179372] (driver?)
[ 6.185537] 010d 65536 ram13
[ 6.185539] (driver?)
[ 6.191696] 010e 65536 ram14
[ 6.191697] (driver?)
[ 6.197863] 010f 65536 ram15
[ 6.197865] (driver?)
[ 6.204031] 1f00 16384 mtdblock0
[ 6.204033] (driver?)
[ 6.210532] 1f01 16384 mtdblock1
[ 6.210534] (driver?)
[ 6.217046] 1f02 16384 mtdblock2
[ 6.217048] (driver?)
[ 6.223552] 1f03 16384 mtdblock3
[ 6.223553] (driver?)
[ 6.230066] 1f04 16384 mtdblock4
[ 6.230068] (driver?)
[ 6.236576] b300 1955840 mmcblk0
[ 6.236578] driver: mmcblk
[ 6.243343] b301 102400 mmcblk0p1 3b47545e-01
[ 6.243344]
[ 6.250112] b302 945152 mmcblk0p2 3b47545e-02
[ 6.250114]
[ 6.256887] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I suppose I have to set the "root" parameter? I've tried "root=/dev/ram" and "root=/dev/ram0" without success.

(U-Boot and Linux versions: xilinx-v2018.2)

0 Kudos
1 Solution

Accepted Solutions
30 Views
Registered: ‎05-14-2019

Re: U-Boot: ramdisk in FIT image

Jump to solution

I solved it: I forgot to create a symbolic link /init -> /sbin/init in my ramdisk. Without that, the kernel silently ignored the ramdisk and went on to look for another root filesystem, which it didn't find.

No kernel command line parameters are necessary, because U-Boot puts the start and end address of the ramdisk into the /chosen node of the device tree, from where the kernel can access it.

0 Kudos
1 Reply
31 Views
Registered: ‎05-14-2019

Re: U-Boot: ramdisk in FIT image

Jump to solution

I solved it: I forgot to create a symbolic link /init -> /sbin/init in my ramdisk. Without that, the kernel silently ignored the ramdisk and went on to look for another root filesystem, which it didn't find.

No kernel command line parameters are necessary, because U-Boot puts the start and end address of the ramdisk into the /chosen node of the device tree, from where the kernel can access it.

0 Kudos