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 5EE12C433EF for ; Tue, 19 Oct 2021 22:40:28 +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 3D303610E5 for ; Tue, 19 Oct 2021 22:40:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3D303610E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com 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 A3BD581D1F; Wed, 20 Oct 2021 00:40:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="kiRmH10x"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 63D3A829FC; Wed, 20 Oct 2021 00:40:22 +0200 (CEST) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (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 EE53581725 for ; Wed, 20 Oct 2021 00:40:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jh80.chung@samsung.com Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20211019224011epoutp04933a3fe8d656c896817d4a5be90fac2c~vj7hD36OL2244322443epoutp04Z for ; Tue, 19 Oct 2021 22:40:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20211019224011epoutp04933a3fe8d656c896817d4a5be90fac2c~vj7hD36OL2244322443epoutp04Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634683211; bh=QkZYVSjfRm0+YNkYlIT/1oTwcytQPYir9Klg/vYiHMY=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=kiRmH10xDXq8fj0K3pVwOYi3nQv5InibCzs6am15QGQ+m1DfjxXW7An3R57GZGXk7 zpVwM3jzctuXO9pvEc0gqm9+Feq9O/83Lffk+yk0/DxDPm7wo3VVMwyiM/WQHipvJh TRYm4QroNWA+ug/nhdEPg3NvFGqLwD8DA5pLnc6o= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20211019224011epcas1p3faa0410ef7e4dbf628b2bd33292f4785~vj7gy0wM02490524905epcas1p3K; Tue, 19 Oct 2021 22:40:11 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.38.235]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4HYpbS6fBZz4x9Pv; Tue, 19 Oct 2021 22:40:04 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 8E.CA.10331.D394F616; Wed, 20 Oct 2021 07:39:57 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p3.samsung.com (KnoxPortal) with ESMTPA id 20211019223956epcas1p324ddf49bfdc6b4a4bfd707579b6d6796~vj7TtaWeN0820808208epcas1p3K; Tue, 19 Oct 2021 22:39:56 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211019223956epsmtrp2068dfaabe69e1199ae916ee22024b264~vj7TsmOYg2054820548epsmtrp25; Tue, 19 Oct 2021 22:39:56 +0000 (GMT) X-AuditID: b6c32a38-cafff7000000285b-ad-616f493db108 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 65.34.08738.C394F616; Wed, 20 Oct 2021 07:39:56 +0900 (KST) Received: from [10.113.113.235] (unknown [10.113.113.235]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20211019223956epsmtip123cefeb127b5e7b949f134d05988441d~vj7ThBYOZ2801528015epsmtip1Q; Tue, 19 Oct 2021 22:39:56 +0000 (GMT) Subject: Re: please help, "Ram disk image is corrupt or invalid" (qemu virt machine, arm64) To: Chan Kim , =?UTF-8?Q?=27Fran=c3=a7ois_Ozog=27?= Cc: u-boot@lists.denx.de From: Jaehoon Chung Message-ID: <23e08cd9-5ae8-2ef5-ed13-0271e75de334@samsung.com> Date: Wed, 20 Oct 2021 07:40:40 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <0a5e01d7c4e5$427110e0$c75332a0$@etri.re.kr> Content-Language: en-US Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFKsWRmVeSWpSXmKPExsWy7bCmga6tZ36iwatVchbXTkxnsuh9fZ/R 4u3eTnYHZo+tnx8yety5tofN4+ydHYwBzFHZNhmpiSmpRQqpecn5KZl56bZK3sHxzvGmZgaG uoaWFuZKCnmJuam2Si4+AbpumTlAm5QUyhJzSoFCAYnFxUr6djZF+aUlqQoZ+cUltkqpBSk5 BaYFesWJucWleel6eaklVoYGBkamQIUJ2Rl7D79jK1gdW7FqwV/GBsZ/3l2MHBwSAiYSW1cH djFycQgJ7GCUWNT9khHC+cQo8XviZ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ICJhKX955g6mLk4hAS2MEo8WjxSnaIhJTE56dT2boYOYBsYYnDh4shat4ySrz4 /Y4JpEZYIFbi+6Y2RhBbRCBR4v7jFmYQm1lAQmLJofusEA3PmCQO7PwK1sAmoCOx/dtxMJtX wE6ib+EOMJtFQFWi79pbNhBbVCBSounEVjaIGkGJkzOfsIDYnAKWEgfuzmGBWKAu8WfeJahl 4hK3nsxngrDlJZq3zmaewCg0C0n7LCQts5C0zELSsoCRZRWjZGpBcW56brFhgVFearlecWJu cWleul5yfu4mRnDwa2ntYNyz6oPeIUYmDsZDjBIczEoivMfa8xKFeFMSK6tSi/Lji0pzUosP MUpzsCiJ817oOhkvJJCeWJKanZpakFoEk2Xi4JRqYGKJUj1bH+q9xkf/utihWw81i9pYe28p OL64Grtw/eGC7Mrd1WXhc7z53ovE7X4eJHT9biFf+f4JckfVo4RDbZgVCmbv7q4o+pqcI2Qc Yri08j3DlQexfnYnohkS1Jl72lSnZos3u/4Ku7Xy2YocdV7rB68Yvf5NfsOY835ZKL/RJqeH Vz5x5RdvMV/nKyRp8ibw1ek57+bwcO385Z+yyNHnQM/pPTYepk26c15ULwqJWsv78HlD2P2n Gefd+i7ZTHslP+PhOTarv/wK080/VWw69mJOx+rNVtP2Lq7ZqTiJ73vmDrGlC087v+i+zRzk qH17hcGhPxsyfaXW2cXzTpHulz1QP1t//7VJS+7dZVRiKc5INNRiLipOBADQ2njz7QIAAA== X-CMS-MailID: 20211019223956epcas1p324ddf49bfdc6b4a4bfd707579b6d6796 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211019095943epcas1p2590fc8923d532f2e107a47aaf2c72ac2 References: <024601d7bff5$5fbd8e70$1f38ab50$@etri.re.kr> <0a4001d7c4cf$f7123940$e536abc0$@etri.re.kr> <0a5e01d7c4e5$427110e0$c75332a0$@etri.re.kr> 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, On 10/19/21 9:31 PM, Chan Kim wrote: > 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-initrd-and-initramfs, > but with -kernel=Image -initrd=initramfs.cpio.gz, qemu ran ok to the shell prompt), > I followed this procedure under busybox-1.32.1 directory. > > o build busybox > > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig > ==> set CONFIG_CROSS_COMPILE_PREFIX=aarch64-linux-gnu- and set CONFIG_STATIC=y (position independent executable automatically not set) > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- > make ARCH=arm64 CROSS_COMPILE=aarch64-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 AFAIK, you need to create the ramdisk image for U-boot with mkimage tool. or you can include initramfs.cpio.gz in kernel at build time. Best Regards, Jaehoon Chung > > > 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çois Ozog' >> Cc: u-boot@lists.denx.de >> Subject: Re: please help, "Ram disk image is corrupt or invalid" (qemu >> virt machine, arm64) >> >> Hi, >> >> On 10/19/21 6:59 PM, Chan Kim wrote: >>> Hi, François >>> >>> >>> >>> Thank you for the response. >>> >>> I’m now studying u-boot so it’ll take some time to learn about >> SystemReady boot. >>> >>> BTW, inspired by your email, I tried this one. (after tftp of all >>> three files) >>> >>> >>> >>> => fdt addr 0x40000000 >>> >>> => fdt chosen 0x42000000 0x4211e2a1 // the length of >> initramfs.cpio.gz is 1172129 = 0x11e2a1) >>> >>> => fdt print /chosen >>> >>> chosen { >>> >>> linux,initrd-end = <0x00000000 0x4211e2a1>; >>> >>> linux,initrd-start = <0x00000000 0x42000000>; >>> >>> stdout-path = "/pl011@9000000"; >>> >>> }; >>> >>> => booti 0x40200000 0x42000000 0x40000000 >>> >>> Moving Image from 0x40200000 to 0x40280000, end=41c44000 >>> >>> Wrong Ramdisk Image Format >>> >>> Ramdisk image is corrupt or invalid >> >> You can check the debug message in common/image-board.c. >> Did you create ramdisk image the correct format? >> >> Best Regards, >> Jaehoon Chung >> >>> >>> >>> >>> I hoped now I set the device tree to have the initrd location, the >> kernel could find it, but not. >>> >>> Isn’t there a correct method using this approach? >>> >>> Thank you! Best regards, >>> >>> >>> >>> Chan Kim >>> >>> >>> >>> From: François 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= 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 à 07:44, Chan Kim > > a écrit : >>> >>> >>> >>> 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=/dev/ram init=/init >>> nokaslr earlycon ip=dhcp" -m 2048M -nographic -netdev user,id=n1 >>> -device e1000,netdev=n1 >>> >>> >>> >>> 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=pflash,format=raw,index=1,file=envstore.img -netdev >>> user,id=net0,tftp=/opt/tftp -device e1000,netdev=net0 >>> >>> >>> >>> >>> >>> 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... >>> >>> => 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 = 1048576 (100000 hex) >>> >>> => 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 = 26489344 (1943200 hex) >>> >>> => 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 = 1169894 (11d9e6 hex) >>> >>> => booti 0x40200000 0x42000000 0x40000000 >>> >>> Moving Image from 0x40200000 to 0x40280000, end=41c44000 >>> >>> 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 >>> >>> >>> >>> >> > > > > >