Skip to content
Snippets Groups Projects
Commit 92302ab1 authored by Simon Glass's avatar Simon Glass Committed by Anatolij Gustschin
Browse files

x86: coreboot: Add a sample script to build a qemu image


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: default avatarSimon Glass <sjg@chromium.org>
parent e567122b
No related branches found
No related tags found
No related merge requests found
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment