Skip to main content
Lead
August 26, 2024
Question

Wrong Ramdisk Image Format - Ramdisk image is corrupt or invalid

  • August 26, 2024
  • 0 replies
  • 1475 views

I tried to replace the uImage and .dtb file inside the starter package.

First I copied over the kernel and .dtb file.

sudo mount -o loop st-image-bootfs-openstlinux-weston-stm32mp1.ext4 /mnt/bootfs
sudo cp ../linux-6.1.82/build/arch/arm/boot/uImage /mnt/bootfs/
sudo cp ../linux-6.1.82/build/arch/arm/boot/dts/stm32mp151a-stm32-computer-firmware-mx.dtb /mnt/bootfs
sudo umount /mnt/bootfs

 Then I booted the Linux kernel. See the log file log.txt. It stopped at the USB Hub decleration. So I guess that linux kernel was booted, but not initrd.

I tried to boot the system manually via U-boot and this happen.

STM32MP> part list mmc 0

Partition Map for MMC device 0 -- Partition Type: EFI

Part	Start LBA	End LBA		Name
	Attributes
	Type GUID
	Partition GUID
 1	0x00000400	0x000007ff	"metadata1"
	attrs:	0x0000000000000000
	type:	8a7a84a0-8387-40f6-ab41-a8b9a5a60d23
		(8a7a84a0-8387-40f6-ab41-a8b9a5a60d23)
	guid:	92f0b426-e174-4bac-9287-019e4f858971
 2	0x00000800	0x00000bff	"metadata2"
	attrs:	0x0000000000000000
	type:	8a7a84a0-8387-40f6-ab41-a8b9a5a60d23
		(8a7a84a0-8387-40f6-ab41-a8b9a5a60d23)
	guid:	31227fc6-8d76-4b65-a8be-90720614ecce
 3	0x00000c00	0x00002bff	"fip-a"
	attrs:	0x0000000000000000
	type:	19d5df83-11b0-457b-be2c-7559c13142a5
		(19d5df83-11b0-457b-be2c-7559c13142a5)
	guid:	4fd84c93-54ef-463f-a7ef-ae25ff887087
 4	0x00002c00	0x00004bff	"fip-b"
	attrs:	0x0000000000000000
	type:	19d5df83-11b0-457b-be2c-7559c13142a5
		(19d5df83-11b0-457b-be2c-7559c13142a5)
	guid:	09c54952-d5bf-45af-acee-335303766fb3
 5	0x00004c00	0x00004fff	"u-boot-env"
	attrs:	0x0000000000000000
	type:	3de21764-95bd-54bd-a5c3-4abe786f38a8
		(u-boot-env)
	guid:	2c809cbe-60fb-4bfd-abfb-20d86de1f22e
 6	0x00005000	0x00024fff	"bootfs"
	attrs:	0x0000000000000004
	type:	0fc63daf-8483-4772-8e79-3d69d8477de4
		(linux)
	guid:	b168bf89-4526-46f1-a200-9d9c2682a2ad
 7	0x00025000	0x0002cfff	"vendorfs"
	attrs:	0x0000000000000000
	type:	0fc63daf-8483-4772-8e79-3d69d8477de4
		(linux)
	guid:	a7b0fddd-33cf-4516-a2ec-5c4bc237d80e
 8	0x0002d000	0x0019cfff	"rootfs"
	attrs:	0x0000000000000000
	type:	0fc63daf-8483-4772-8e79-3d69d8477de4
		(linux)
	guid:	e91c4e10-16e6-4c0e-bd0e-77becf4a3582
 9	0x0019d000	0x00e8fbff	"userfs"
	attrs:	0x0000000000000000
	type:	0fc63daf-8483-4772-8e79-3d69d8477de4
		(linux)
	guid:	7bc0d1fe-94a1-461d-8ee4-bcefdcb68617

STM32MP> ext4ls mmc 0:6 /
<DIR> 2048 .
<DIR> 2048 ..
<DIR> 12288 lost+found
 4187 boot.scr.uimg
<DIR> 1024 mmc0_extlinux
<DIR> 1024 mmc1_extlinux
<DIR> 1024 nand0_extlinux
 7802 splash_landscape.bmp
 89462 splash_portrait.bmp
 6232362 st-image-resize-initrd
 65603 stm32mp135f-dk-a7-examples.dtb
 63622 stm32mp135f-dk.dtb
 127101 stm32mp157a-dk1.dtb
 135636 stm32mp157a-ev1.dtb
 130031 stm32mp157c-dk2-a7-examples.dtb
 130417 stm32mp157c-dk2-m4-examples.dtb
 129643 stm32mp157c-dk2.dtb
 122602 stm32mp157c-ed1.dtb
 136313 stm32mp157c-ev1-a7-examples.dtb
 136657 stm32mp157c-ev1-m4-examples.dtb
 136078 stm32mp157c-ev1.dtb
 127367 stm32mp157d-dk1-a7-examples.dtb
 128105 stm32mp157d-dk1-m4-examples.dtb
 127331 stm32mp157d-dk1.dtb
 135909 stm32mp157d-ev1.dtb
 130325 stm32mp157f-dk2-a7-examples.dtb
 130711 stm32mp157f-dk2-m4-examples.dtb
 129937 stm32mp157f-dk2.dtb
 122832 stm32mp157f-ed1.dtb
 136543 stm32mp157f-ev1-a7-examples.dtb
 136887 stm32mp157f-ev1-m4-examples.dtb
 136308 stm32mp157f-ev1.dtb
 8249920 uImage
 79018 stm32mp151a-stm32-computer-firmware-mx.dtb

STM32MP> ext4ls mmc 0:7 /
<DIR> 1024 .
<DIR> 1024 ..
<DIR> 12288 lost+found
<DIR> 1024 lib

STM32MP> ext4ls mmc 0:8 /
<DIR> 4096 .
<DIR> 4096 ..
<DIR> 16384 lost+found
<DIR> 4096 bin
<DIR> 4096 boot
<DIR> 4096 dev
<DIR> 4096 etc
<DIR> 4096 home
<DIR> 4096 lib
<DIR> 4096 media
<DIR> 4096 mnt
<DIR> 4096 proc
<DIR> 4096 run
<DIR> 4096 sbin
<DIR> 4096 srv
<DIR> 4096 sys
<DIR> 4096 tmp
<DIR> 4096 usr
<DIR> 4096 var
<DIR> 4096 vendor

STM32MP> ext4ls mmc 0:9 /
<DIR> 1024 .
<DIR> 1024 ..
<DIR> 12288 lost+found
<DIR> 1024 Cube-M4-examples
<DIR> 1024 Linux-A7-examples
<DIR> 1024 demo
<DIR> 1024 weston-start-at-startup

STM32MP> ext4load mmc 0:6 0xC2000000 /uImage
8249920 bytes read in 955 ms (8.2 MiB/s)
STM32MP> ext4load mmc 0:6 0xC4000000 /stm32mp151a-stm32-computer-firmware-mx.dtb
79018 bytes read in 78 ms (989.3 KiB/s)
STM32MP> ext4load mmc 0:6 0xC6000000 /st-image-resize-initrd
6232362 bytes read in 738 ms (8.1 MiB/s)

STM32MP> bootm 0xC2000000 0xC6000000 0xC4000000
## Booting kernel from Legacy Image at c2000000 ...
 Image Name: Linux-6.1.82
 Created: 2024-08-26 20:05:23 UTC
 Image Type: ARM Linux Kernel Image (uncompressed)
 Data Size: 8249856 Bytes = 7.9 MiB
 Load Address: c2000040
 Entry Point: c2000040
 Verifying Checksum ... OK
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
STM32MP>

I also did use another address for the Ramdisk file. Same result.

STM32MP> ext4load mmc 0:6 0xC8000000 /st-image-resize-initrd
6232362 bytes read in 739 ms (8 MiB/s)
STM32MP> bootm 0xC2000000 0xC8000000 0xC4000000
## Booting kernel from Legacy Image at c2000000 ...
 Image Name: Linux-6.1.82
 Created: 2024-08-26 20:05:23 UTC
 Image Type: ARM Linux Kernel Image (uncompressed)
 Data Size: 8249856 Bytes = 7.9 MiB
 Load Address: c2000040
 Entry Point: c2000040
 Verifying Checksum ... OK
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
STM32MP>

 

So that means that the Ramdisk file is corrupted. Notice that I have another hardware, the MP151 series, instead of the MP157 series. Perhaps I need to build my own initrd?

Yes. I have replace the "old" ramdisk file with a new ram disk file, and I still get the same error.

Question:

Is there any way for me to manually boot a correct image of initrd file by building my own?