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 EAAA3C433EF for ; Tue, 19 Oct 2021 10:42:47 +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 23F8160F6E for ; Tue, 19 Oct 2021 10:42:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 23F8160F6E 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 3B03682DB3; Tue, 19 Oct 2021 12:42:45 +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="kUi7DtBJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 94ED282128; Tue, 19 Oct 2021 12:42:43 +0200 (CEST) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) (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 37B3E82DB3 for ; Tue, 19 Oct 2021 12:42:38 +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 epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20211019104231epoutp020b65867426c977f5448cf1cba1a64725~vaI60lP9K0273502735epoutp02U for ; Tue, 19 Oct 2021 10:42:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20211019104231epoutp020b65867426c977f5448cf1cba1a64725~vaI60lP9K0273502735epoutp02U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1634640151; bh=TthmLIZPFvsno7w3iIhqxqFvLAPs9P0F/oYof9Meryw=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=kUi7DtBJOm+79URZWjL6bwQCXLInP24o9xigNa9WeB7PD8CKO66c77EZOMKnGNFvN iM7qglaeEXY7oUOoencHc6pl/r9bAG2NR3ugfEF9JHDIlowh2H9B9kjcJZfMZdU3uQ 9t/pZcE0GOhvF9UgJPTmBDA0bnKn2VMDpAWGRc6U= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20211019104231epcas1p25e8b66f8573c29f0e521053b8387be64~vaI6lcLu90797907979epcas1p2_; Tue, 19 Oct 2021 10:42:31 +0000 (GMT) Received: from epsmges1p2.samsung.com (unknown [182.195.38.232]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4HYVgN6R41z4x9Q5; Tue, 19 Oct 2021 10:42:24 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 48.33.09577.D01AE616; Tue, 19 Oct 2021 19:42:21 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20211019104220epcas1p2152a66d39ff372e621e68a879615ee3e~vaIwVnGgc0797907979epcas1p2w; Tue, 19 Oct 2021 10:42:20 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211019104220epsmtrp2ec3ece9fe5481cb9266d04d92608a5d3~vaIwU4e762673926739epsmtrp2h; Tue, 19 Oct 2021 10:42:20 +0000 (GMT) X-AuditID: b6c32a36-f4bff70000002569-33-616ea10d37d5 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 81.0D.08738.C01AE616; Tue, 19 Oct 2021 19:42:20 +0900 (KST) Received: from [10.113.113.235] (unknown [10.113.113.235]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211019104220epsmtip2519fbae905c76be1c199ceea0bc60061~vaIwHWdTm2215122151epsmtip2F; Tue, 19 Oct 2021 10:42:20 +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: Date: Tue, 19 Oct 2021 19:43:04 +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: <0a4001d7c4cf$f7123940$e536abc0$@etri.re.kr> Content-Language: en-US Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNKsWRmVeSWpSXmKPExsWy7bCmni7vwrxEg5bDHBbXTkxnsuh9fZ/R 4u3eTnYHZo+tnx8yety5tofN4+ydHYwBzFHZNhmpiSmpRQqpecn5KZl56bZK3sHxzvGmZgaG uoaWFuZKCnmJuam2Si4+AbpumTlAm5QUyhJzSoFCAYnFxUr6djZF+aUlqQoZ+cUltkqpBSk5 BaYFesWJucWleel6eaklVoYGBkamQIUJ2Rk/5u1gL1jpUrHt5SP2Bsbvpl2MnBwSAiYSx9q3 s3cxcnEICexglLj97wILhPOJUWLN7zWsEM5nRom5zevYYFpe3XgHldjFKLHoyXOo/veMElcf v2IFq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2boYOYBsYYnDh4shat4yStw4 8ZYdpEZYIFbi+6Y2RhBbRCBR4v7jFmYQm1lAQmLJoftQQ5uYJGadaQMbyiagI7H923EmEJtX wE7ixPN5YA0sAqoSn8+uB4uLCkRKNJ3YygZRIyhxcuYTFhCbU8BS4sH9qVAL1CX+zLsEZYtL 3HoynwnClpdo3jqbeQKj0Cwk7bOQtMxC0jILScsCRpZVjJKpBcW56bnFhgVGeanlesWJucWl eel6yfm5mxjBwa+ltYNxz6oPeocYmTgYDzFKcDArifAea89LFOJNSaysSi3Kjy8qzUktPsQo zcGiJM57oetkvJBAemJJanZqakFqEUyWiYNTqoFJ9ffmoJyLqU8deY+8O7Dw8/QF/4Sa73w/ seiRp5xQeX1595uHwuIHgpIurvNcwLljjYD1UttfC/UW5+T9lGm+9W7p3knLPb79szU3DV5/ 3UpX/Znoc4aEDVay51XMtr0XmL798NQfmvscVx+QvSjm9DZ88Qqhi247S74Yhn0skm27P++c iXTk1G9bXS8xrnG89SYuo1dSV/k+/+llM279abcOvndBf2HLtc8Vx62DjYPZWPQnmEw85ZM+ 1yXns1Dij8th0T/zXcWtIm2zuV3u9p0Tmat9SmijweynBtP0K04qz4n51LzF7tGF/bY2BzQ7 Vsob/PGZmDfXb36UzVzhN7/q5kRuUtmREqZ1paBptxJLcUaioRZzUXEiAOWheartAgAA X-CMS-MailID: 20211019104220epcas1p2152a66d39ff372e621e68a879615ee3e 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> 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 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 > > > >