blob: 1da708fb6e15a2368a2810c8994cd8f3872b8f8e [file] [log] [blame]
Simon Glass92302ab2021-11-19 13:24:07 -07001#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0+
3#
4# Sample script to build a disk image suitable for use with coreboot. The image
5# includes a kernel and initrd.
6#
7# YOU WILL NEED to modify this for your needs, e.g. select a kernel.
8#
9# Run this with:
10# qemu-system-i386 -bios coreboot.rom -drive file=disk.img,if=virtio
11
12qemu-img create -f raw disk.img 120M
13mkfs.ext2 -F disk.img
14sudo mkdir -p /mnt/rootfs
15sudo mount -o loop disk.img /mnt/rootfs
16sudo mkdir -p /mnt/rootfs/boot
17sudo cp /boot/vmlinuz /mnt/rootfs/boot/.
18sudo cp /boot/initrd.img /mnt/rootfs/boot/.
19sudo umount /mnt/rootfs