Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4FDBC433EF for ; Tue, 19 Oct 2021 12:31:58 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBF8C61378 for ; Tue, 19 Oct 2021 12:31:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BBF8C61378 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=etri.re.kr Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4F17E82D95; Tue, 19 Oct 2021 14:31:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=etri.re.kr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=dooray.com header.i=@dooray.com header.b="IA8lOwLT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DDB6B8119C; Tue, 19 Oct 2021 14:31:52 +0200 (CEST) Received: from mscreen.etri.re.kr (mscreen.etri.re.kr [129.254.9.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 250AA82DA1 for ; Tue, 19 Oct 2021 14:31:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=etri.re.kr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ckim@etri.re.kr Received: from unknown (HELO send002-relay.gov-dooray.com) (211.180.235.153) by 129.254.9.16 with ESMTP; 19 Oct 2021 21:31:38 +0900 X-Original-SENDERIP: 211.180.235.153 X-Original-MAILFROM: ckim@etri.re.kr X-Original-RCPTTO: u-boot@lists.denx.de Received: from [10.162.225.112] (HELO smtp002-imp.gov-dooray.com) ([10.162.225.112]) by send002-relay.gov-dooray.com with SMTP id f34dcf3c616ebaaa; Tue, 19 Oct 2021 21:31:38 +0900 DKIM-Signature: a=rsa-sha256; b=IA8lOwLT00NuCLMzTp8GoGkwN69fnPDpHi8P/2lfwkzSHqSqko5W3IXf3ww9UKQd3eG1pEMdnO pZ3fdPIDUsVSFN+DG8m8TCT0Jcu5c/F5KcZcgU2hG9zHTVU05u9COXhrL8ZuKEdmjscmMoPM+vZV PVEp9bXvCGQvUOivwAxlkCnWli/UxZQYeEjG1j0/Ik8oJVJukVnOCgUxMsk+7FJFf4WOto3WFNkt ISSk9OicmBtm5naAIJLadIWQ5KZrucYG3QQ3KbLsXaV+OO/Qv8yEViB+YqnnsiFySW3xP0oCcwDs GBvyxHoXjSAg1DCh5sYCgABEkbHUYQTCzOOuHPCw==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=q3+0P6YzBVtbvvNB9gjHzbyf+eD5Rj7ileKlKcZrkXI=; h=From:To:Subject:Message-ID; Received: from [129.254.132.39] (HELO CHANKIMPC) ([129.254.132.39]) by smtp002-imp.gov-dooray.com with SMTP id da1b80c8616ebaa9; Tue, 19 Oct 2021 21:31:38 +0900 From: "Chan Kim" To: "'Jaehoon Chung'" , =?utf-8?Q?'Fran=C3=A7ois_Ozog'?= Cc: References: <024601d7bff5$5fbd8e70$1f38ab50$@etri.re.kr> <0a4001d7c4cf$f7123940$e536abc0$@etri.re.kr> In-Reply-To: Subject: RE: please help, "Ram disk image is corrupt or invalid" (qemu virt machine, arm64) Date: Tue, 19 Oct 2021 21:31:36 +0900 Message-ID: <0a5e01d7c4e5$427110e0$c75332a0$@etri.re.kr> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQImBIZPj1iX9syUoKHd7Uri6DO/EwKRT8xsAXP4Zu8DIHwolwHN6QlKqvYRceA= Content-Language: ko X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi, Jaehoon, Thanks for the help. > You can check the debug message in common/image-board.c. > Did you create ramdisk image the correct format? To make ramdisk image (I made initramfs which I know is not a real disk = image format = (https://stackoverflow.com/questions/10603104/the-difference-between-init= rd-and-initramfs,=20 but with -kernel=3DImage -initrd=3Dinitramfs.cpio.gz, qemu ran ok to the = shell prompt),=20 I followed this procedure under busybox-1.32.1 directory. o build busybox make ARCH=3Darm64 CROSS_COMPILE=3Daarch64-linux-gnu- defconfig make ARCH=3Darm64 CROSS_COMPILE=3Daarch64-linux-gnu- menuconfig =3D=3D> set CONFIG_CROSS_COMPILE_PREFIX=3Daarch64-linux-gnu- and set = CONFIG_STATIC=3Dy (position independent executable automatically not = set) make ARCH=3Darm64 CROSS_COMPILE=3Daarch64-linux-gnu- make ARCH=3Darm64 CROSS_COMPILE=3Daarch64-linux-gnu- install o after make install, under _install, mkdir -p dev sudo mknod dev/console c 5 1 sudo mknod dev/ram b 1 0 o make init script which contains (under _install) #!/bin/sh echo "### INIT SCRIPT ###" mkdir /proc /sys /tmp mount -t proc none /proc mount -t sysfs none /sys mount -t tmpfs none /tmp echo -e "\nThis boot took $(cut -d' ' -f1 /proc/uptime) seconds\n" ifconfig eth0 10.0.2.15 netmask 255.255.255.0 up route add default gw 10.0.2.2 exec /bin/sh o make ramdisk image (under _install directory) find -print0 | cpio -0oH newc | gzip -9 > ../initramfs.cpio.gz I tried to set breakpoint in boot_get_ramdisk function in common/image.c = (where "Wrong Ramdisk Image Format" is printed) but somehow the break = point doesn't work. (But I could stop at board_init_f function). I'll try to figure out why the break point isn't working there. Can you find anything suspicious or give me a suggestion? Thank you! Best regards, Chan Kim > -----Original Message----- > From: Jaehoon Chung > Sent: Tuesday, October 19, 2021 7:43 PM > To: Chan Kim ; 'Fran=C3=A7ois Ozog' = > Cc: u-boot@lists.denx.de > Subject: Re: please help, "Ram disk image is corrupt or invalid" (qemu > virt machine, arm64) >=20 > Hi, >=20 > On 10/19/21 6:59 PM, Chan Kim wrote: > > Hi, Fran=C3=A7ois > > > > > > > > Thank you for the response. > > > > I=E2=80=99m now studying u-boot so it=E2=80=99ll take some time to = learn about > SystemReady boot. > > > > BTW, inspired by your email, I tried this one. (after tftp of all > > three files) > > > > > > > > =3D> fdt addr 0x40000000 > > > > =3D> fdt chosen 0x42000000 0x4211e2a1 // the length of > initramfs.cpio.gz is 1172129 =3D 0x11e2a1) > > > > =3D> fdt print /chosen > > > > chosen { > > > > linux,initrd-end =3D <0x00000000 0x4211e2a1>; > > > > linux,initrd-start =3D <0x00000000 0x42000000>; > > > > stdout-path =3D "/pl011@9000000"; > > > > }; > > > > =3D> booti 0x40200000 0x42000000 0x40000000 > > > > Moving Image from 0x40200000 to 0x40280000, end=3D41c44000 > > > > Wrong Ramdisk Image Format > > > > Ramdisk image is corrupt or invalid >=20 > You can check the debug message in common/image-board.c. > Did you create ramdisk image the correct format? >=20 > Best Regards, > Jaehoon Chung >=20 > > > > > > > > I hoped now I set the device tree to have the initrd location, the > kernel could find it, but not. > > > > Isn=E2=80=99t there a correct method using this approach? > > > > Thank you! Best regards, > > > > > > > > Chan Kim > > > > > > > > From: Fran=C3=A7ois Ozog > > Sent: Tuesday, October 19, 2021 4:32 PM > > To: Chan Kim > > Cc: u-boot@lists.denx.de > > Subject: Re: please help, "Ram disk image is corrupt or invalid" = (qemu > > virt machine, arm64) > > > > > > > > Hi > > > > > > > > If you use the second argument to indicate the location of the = initrd > then Linux will use device tree information to get the size of the = initrd. > That information is probably absent or incorrect. > > > > > > > > The initrd=3D in your command line is thus useless as you task = U-boot to > load it. > > > > > > > > You may want to consider the Arm defined SystemReady boot flow to = avoid > issues and benefit from secure boot flow and future extensions. In = the > SystemReady boot flow , the Linux efi stub asks uboot to load the = initrd > and do not need devicectree metadata to get any location or size (this = is > to reinforce the use of device tree for hardware description as = opposed to > hacking all information sharing between boot stages). > > > > > > > > Cheers > > > > > > > > FF > > > > > > > > > > > > > > > > > > > > Le mer. 13 oct. 2021 =C3=A0 07:44, Chan Kim > a =C3=A9crit : > > > > > > > > Hello all, > > > > > > > > I can boot linux kernel using this command line. > > > > ${QEMU_DIR}/qemu-system-aarch64 -M ${QMACHINE} -cpu cortex-a72 = -kernel > > ${LINUX_DIR}/arch/arm64/boot/Image -initrd > > ${BUSYBOX_DIR}/initramfs.cpio.gz --append "root=3D/dev/ram = init=3D/init > > nokaslr earlycon ip=3Ddhcp" -m 2048M -nographic -netdev user,id=3Dn1 > > -device e1000,netdev=3Dn1 > > > > > > > > After reading some docs and getting helps, I tried u-boot. > > > > After loading Image (for arm64) and dtb.dtb, I could see the kernel > > booting to the final stage of deploying initramfs but it failed > > because I didn't give the initramfs.cpio.gz address. (I used "booti > > 0x40200000 - 0x40000000) > > > > > > > > So I added initramfs.cpio.gz under /opt/tftp, and loaded kernel, > > initramfs, and dbt on memory and gave "booti 0x40200000 0x42000000 > > 0x40000000", addresses are kernel, initramfs and dtb). > > > > Below is the log. (please see the final error message below) > > > > > > > > ++ /home/ckim/QEMU/qemu/build/aarch64-softmmu/qemu-system-aarch64 -M > > ++ virt > > -bios u-boot.bin -cpu cortex-a57 -bios u-boot.bin -nographic -drive > > if=3Dpflash,format=3Draw,index=3D1,file=3Denvstore.img -netdev > > user,id=3Dnet0,tftp=3D/opt/tftp -device e1000,netdev=3Dnet0 > > > > > > > > > > > > U-Boot 2021.10-00455-g50c84208ad (Oct 13 2021 - 12:58:40 +0900) > > > > > > > > DRAM: 128 MiB > > > > Flash: 64 MiB > > > > MMC: > > > > Loading Environment from Flash... *** Warning - bad CRC, using = default > > environment > > > > > > > > In: pl011@9000000 > > > > Out: pl011@9000000 > > > > Err: pl011@9000000 > > > > Net: e1000: 52:54:00:12:34:56 > > > > eth0: e1000#0 > > > > Hit any key to stop autoboot: 0 > > > > starting USB... > > > > No working controllers found > > > > USB is stopped. Please issue 'usb start' first. > > > > scanning bus for devices... > > > > > > > > Device 0: unknown device > > > > > > > > Device 0: unknown device > > > > starting USB... > > > > No working controllers found > > > > BOOTP broadcast 1 > > > > BOOTP broadcast 2 > > > > BOOTP broadcast 3 > > > > DHCP client bound to address 10.0.2.15 (1004 ms) > > > > Using e1000#0 device > > > > TFTP from server 10.0.2.2; our IP address is 10.0.2.15 > > > > Filename 'boot.scr.uimg'. > > > > Load address: 0x40200000 > > > > Loading: * > > > > TFTP error: 'File not found' (1) > > > > Not retrying... > > > > BOOTP broadcast 1 > > > > BOOTP broadcast 2 > > > > BOOTP broadcast 3 > > > > DHCP client bound to address 10.0.2.15 (1001 ms) > > > > Using e1000#0 device > > > > TFTP from server 10.0.2.2; our IP address is 10.0.2.15 > > > > Filename 'boot.scr.uimg'. > > > > Load address: 0x40400000 > > > > Loading: * > > > > TFTP error: 'File not found' (1) > > > > Not retrying... > > > > =3D> tftp 0x40000000 dtb.dtb > > > > Using e1000#0 device > > > > TFTP from server 10.0.2.2; our IP address is 10.0.2.15 > > > > Filename 'dtb.dtb'. > > > > Load address: 0x40000000 > > > > Loading: > > ################################################################# > > > > ######### > > > > 963.9 KiB/s > > > > done > > > > Bytes transferred =3D 1048576 (100000 hex) > > > > =3D> tftp 0x40200000 Image > > > > Using e1000#0 device > > > > TFTP from server 10.0.2.2; our IP address is 10.0.2.15 > > > > Filename 'Image'. > > > > Load address: 0x40200000 > > > > Loading: > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################################################# > > > > ################################### > > > > 10 MiB/s > > > > done > > > > Bytes transferred =3D 26489344 (1943200 hex) > > > > =3D> tftp 0x42000000 initramfs.cpio.gz > > > > Using e1000#0 device > > > > TFTP from server 10.0.2.2; our IP address is 10.0.2.15 > > > > Filename 'initramfs.cpio.gz'. > > > > Load address: 0x42000000 > > > > Loading: > > ################################################################# > > > > ################# > > > > 1 MiB/s > > > > done > > > > Bytes transferred =3D 1169894 (11d9e6 hex) > > > > =3D> booti 0x40200000 0x42000000 0x40000000 > > > > Moving Image from 0x40200000 to 0x40280000, end=3D41c44000 > > > > Wrong Ramdisk Image Format > > > > Ramdisk image is corrupt or invalid > > > > > > > > At the end, it says "Ram disk image is corrupt or invalid". What am = I > > doing wrong? > > > > I tried with un-gzipped file of initramfs, the same. Should I use = real > > initrd format(dd image)? > > > > Any help will be very much appreciated. > > > > > > > > Thank you! > > > > Chan Kim > > > > > > > > >=20