diff options
author | Helmut Grohne <helmut@subdivi.de> | 2022-12-21 21:16:10 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2022-12-21 21:16:10 +0100 |
commit | 332168e258d157a2f8db5d03803b94676a7079e8 (patch) | |
tree | c9a1908cdc2264872a0223142bade74c3522a98d | |
parent | 6aa2bcd8e69e7a5ff9a2fb689711cba6a277ecf6 (diff) | |
parent | 7bf0476dc5e8a09e524b3116627d57aa5edbfd2b (diff) | |
download | debvm-332168e258d157a2f8db5d03803b94676a7079e8.tar.gz |
Merge branch josch into main
-rwxr-xr-x | debvm-create | 10 | ||||
-rwxr-xr-x | debvm-run | 19 |
2 files changed, 10 insertions, 19 deletions
diff --git a/debvm-create b/debvm-create index c271207..6f0c33c 100755 --- a/debvm-create +++ b/debvm-create @@ -122,15 +122,7 @@ set -- \ "$@" # unless we set up a fstab, / will be read-only -case "$ARCHITECTURE" in - amd64|i386|ppc64el) - DISKDEV=sda - ;; - *) - DISKDEV=vda - ;; -esac -set -- "--customize-hook=echo '/dev/$DISKDEV / ext4 defaults 0 1' >"'"$1/etc/fstab"' "$@" +set -- "--customize-hook=echo '/dev/vda / ext4 defaults 0 1' >"'"$1/etc/fstab"' "$@" # set up a hostname set -- \ @@ -44,6 +44,7 @@ while test "$#" -gt 0; do done test -f "$IMAGE" || die "image '$IMAGE' not found" +test -s "$IMAGE" || die "image '$IMAGE' is empty" cleanup() { set +x @@ -63,14 +64,6 @@ if command -v elf-arch >/dev/null 2>&1; then VMARCH=$(elf-arch "$KERNELTMP") fi case "$VMARCH" in - amd64|i386|ppc64el) - DISKDEV=sda - ;; - *) - DISKDEV=vda - ;; -esac -case "$VMARCH" in mips*|ppc64el) KERNELLINK=vmlinux ;; @@ -85,15 +78,16 @@ INITRDNAME=$(/sbin/debugfs "$IMAGE" -R "stat initrd.img" | sed 's/Fast link dest test -n "$KERNELNAME" || die "failed to discover kernel image" test -n "$INITRDNAME" || die "failed to discover initrd image" -KERNEL_CMDLINE=root=/dev/$DISKDEV +KERNEL_CMDLINE=root=/dev/vda NETDEV="user,id=net0" set -- \ + -no-user-config \ -m 1G \ -smp "$(nproc)" \ -kernel "$KERNELTMP" \ -initrd "$INITRDTMP" \ - -drive "media=disk,format=raw,discard=unmap,file=$IMAGE" \ + -drive "media=disk,format=raw,discard=unmap,file=$IMAGE,if=virtio" \ -device "virtio-net-pci,netdev=net0" \ "$@" @@ -104,6 +98,11 @@ if test "$ARCHITECTURE" = "$VMARCH"; then if test -w /dev/kvm; then set -- -enable-kvm -cpu host "$@" fi + case "$VMARCH" in + arm64) + set -- -machine type=virt,gic-version=host "$@" + ;; + esac else case "$VMARCH" in arm64) |