From 015e2edf17ef7bdb7fd05a9f848c4747a62e7a6f Mon Sep 17 00:00:00 2001 From: Shulhan Date: Thu, 30 Jun 2022 01:43:38 +0700 Subject: all: add shell script to test the image using qemu Testing using qemu require adding "block" hooks to mkinitcpio.conf. --- README.md | 9 +++++++++ qemu.sh | 10 ++++++++++ sys/etc/mkinitcpio.conf | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 qemu.sh diff --git a/README.md b/README.md index 5f129ec..0b18597 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,15 @@ want: $ gsutil rm gs://BUCKET_NAME/arch-vDATE.tar.gz ``` +## Testing with qemu + +Change the owner of disk or tar.gz files to your own user and then run + +``` +$ ./qemu.sh +``` + + ## Contributing Changes * See [CONTRIB.md](CONTRIB.md) diff --git a/qemu.sh b/qemu.sh new file mode 100755 index 0000000..559313a --- /dev/null +++ b/qemu.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +image=$1 +echo $image +qemu-system-x86_64 -enable-kvm \ + -drive format=raw,file=$image,if=virtio \ + -net none \ + -m 512M \ + -bios /usr/share/ovmf/x64/OVMF.fd \ + -boot menu=on diff --git a/sys/etc/mkinitcpio.conf b/sys/etc/mkinitcpio.conf index de97b63..abe6299 100644 --- a/sys/etc/mkinitcpio.conf +++ b/sys/etc/mkinitcpio.conf @@ -49,7 +49,7 @@ FILES=() # ## NOTE: If you have /usr on a separate partition, you MUST include the # usr, fsck and shutdown hooks. -HOOKS=(systemd modconf) +HOOKS=(systemd autodetect block modconf) # COMPRESSION # Use this to compress the initramfs image. By default, zstd compression -- cgit v1.3