From patchwork Fri Nov 19 20:24:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1557412 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=jKecjQCH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HwpCT5K8sz9sRN for ; Sat, 20 Nov 2021 07:28:37 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 003F883433; Fri, 19 Nov 2021 21:26:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="jKecjQCH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DD3108377C; Fri, 19 Nov 2021 21:25:50 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 19D748344C for ; Fri, 19 Nov 2021 21:24:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x32a.google.com with SMTP id h19-20020a9d3e53000000b0056547b797b2so18487783otg.4 for ; Fri, 19 Nov 2021 12:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/SO7fzayF7eXvQvuY2F9/23gpZJkgnMZgcZIKKuuBjs=; b=jKecjQCH4P8kNWwFRHkQKlX5DdQpj50u+ecjqI7HHbx+0GbrXngX1PJf+5UrMY7b0L /4BgAK6z8PodHlc8cZX9wPaFru/px94rxfdGvJBoREpUVGQTntZgRsJ0yuQX8XNjH3o3 uLaHxTk/EYKplBMCAxYox+zq15XddVnLQ8nFw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/SO7fzayF7eXvQvuY2F9/23gpZJkgnMZgcZIKKuuBjs=; b=OZn/PZu3/fFCd/GmGA8MvQGWnDk78oyGENknfGFUdw5GiqknfECbK93p6RCjM7NLvA 4nSWFNeNe1/yPZ7MQ3aTfHLnuRAvRre9fMfIJY48DV6jRAWfeRdydzhD9w+dKzYAWkNl rgdnq01mtBEBYhef2pOyyCcf/U/pnedDVMv3L+xiSS2l8OvGMbTtunTylrqGOI3FVSQy em098Wtbj0zn4AFju/YV0kScddq9Cxy6Id6c8aiGTASCeTp1YKUPwsceejeZgCMlH8Ak pZIq1IqiYB9zwDk1xb+h447tLHHHlUvm1gr85PHBQ/sa7BnMHsDE/gM7T8/Yt6VfKSPL wGlw== X-Gm-Message-State: AOAM533ZVFFaBmPTfmhAPirEWnzTZwfsdWUiIt64TRTkZe0vB/WZsaG2 vtsUXroJLUcxqyiqsbrDo3jke/IVyr2mCA== X-Google-Smtp-Source: ABdhPJys0spuNxh1sHhCDyiAuJ7EFvl2Nv5F4Su/YinmdiOT0rVM5XjY04BK/Ie3jIBpRfHjg9jJQA== X-Received: by 2002:a9d:7459:: with SMTP id p25mr6972586otk.247.1637353482559; Fri, 19 Nov 2021 12:24:42 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id bl33sm197093oib.47.2021.11.19.12.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 12:24:42 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Tom Rini , Simon Glass , Bin Meng , Stefan Reinauer , Vadim Bendebury Subject: [PATCH 23/23] x86: coreboot: Add a sample script to build a qemu image Date: Fri, 19 Nov 2021 13:24:07 -0700 Message-Id: <20211119132342.23.Icb01ad86feafba851e35b20efc4c1e653414ec39@changeid> X-Mailer: git-send-email 2.34.0.rc2.393.gf8c9666880-goog In-Reply-To: <20211119202408.1815506-1-sjg@chromium.org> References: <20211119202408.1815506-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 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 It is useful to boot coreboot (with U-Boot as a payload) from qemu. Add a sample script to show how to do this. Signed-off-by: Simon Glass --- scripts/build-cb.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 scripts/build-cb.sh diff --git a/scripts/build-cb.sh b/scripts/build-cb.sh new file mode 100755 index 00000000000..1da708fb6e1 --- /dev/null +++ b/scripts/build-cb.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0+ +# +# Sample script to build a disk image suitable for use with coreboot. The image +# includes a kernel and initrd. +# +# YOU WILL NEED to modify this for your needs, e.g. select a kernel. +# +# Run this with: +# qemu-system-i386 -bios coreboot.rom -drive file=disk.img,if=virtio + +qemu-img create -f raw disk.img 120M +mkfs.ext2 -F disk.img +sudo mkdir -p /mnt/rootfs +sudo mount -o loop disk.img /mnt/rootfs +sudo mkdir -p /mnt/rootfs/boot +sudo cp /boot/vmlinuz /mnt/rootfs/boot/. +sudo cp /boot/initrd.img /mnt/rootfs/boot/. +sudo umount /mnt/rootfs