Simon Glass | 92302ab | 2021-11-19 13:24:07 -0700 | [diff] [blame] | 1 | #!/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 | |
| 12 | qemu-img create -f raw disk.img 120M |
| 13 | mkfs.ext2 -F disk.img |
| 14 | sudo mkdir -p /mnt/rootfs |
| 15 | sudo mount -o loop disk.img /mnt/rootfs |
| 16 | sudo mkdir -p /mnt/rootfs/boot |
| 17 | sudo cp /boot/vmlinuz /mnt/rootfs/boot/. |
| 18 | sudo cp /boot/initrd.img /mnt/rootfs/boot/. |
| 19 | sudo umount /mnt/rootfs |