aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-06-30 01:43:38 +0700
committerShulhan <ms@kilabit.info>2022-07-30 01:45:01 +0700
commit015e2edf17ef7bdb7fd05a9f848c4747a62e7a6f (patch)
treec9fdd06d1e39fe0c48789f985a34ed43d06a21ee
parent6be2b52c31ad996e260eef68044ff1bced922d9c (diff)
downloadcompute-archlinux-image-builder-015e2edf17ef7bdb7fd05a9f848c4747a62e7a6f.tar.xz
all: add shell script to test the image using qemu
Testing using qemu require adding "block" hooks to mkinitcpio.conf.
-rw-r--r--README.md9
-rwxr-xr-xqemu.sh10
-rw-r--r--sys/etc/mkinitcpio.conf2
3 files changed, 20 insertions, 1 deletions
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 <disk | image-name>
+```
+
+
## 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