diff options
author | Helmut Grohne <helmut@subdivi.de> | 2022-12-21 12:08:35 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2022-12-21 12:08:35 +0100 |
commit | 5b8d9f4326b4a6352cc52a8f761bd85a3b840ecc (patch) | |
tree | 030e16366581bb01ca2ac5acffea30d7e82df6b7 | |
parent | acffc500345e8eeb7a5873d276bb7b92462d5a67 (diff) | |
download | debvm-5b8d9f4326b4a6352cc52a8f761bd85a3b840ecc.tar.gz |
make it work for armhf
* Pick the right kernel image
* The disk is vda
* Use the right qemu and pass the right flags
Reported-by: Jochen Sprickerhof <git@jochen.sprickerhof.de>
-rwxr-xr-x | debvm-create | 17 | ||||
-rwxr-xr-x | debvm-run | 27 |
2 files changed, 29 insertions, 15 deletions
diff --git a/debvm-create b/debvm-create index aa06b46..85c2f66 100755 --- a/debvm-create +++ b/debvm-create @@ -81,15 +81,20 @@ if test -n "$SSHKEY" && ! test -f "$SSHKEY"; then die "error: ssh keyfile '$SSHKEY' not found" fi -KERNEL_SUFFIX= -if test "$ARCHITECTURE" = amd64; then - KERNEL_SUFFIX=-cloud -fi +KERNEL_SUFFIX=-$ARCHITECTURE +case "$ARCHITECTURE" in + amd64) + KERNEL_SUFFIX=-cloud-$ARCHITECTURE + ;; + armhf) + KERNEL_SUFFIX=-armmp + ;; +esac if test "$SUITE" = jessie || test "$SUITE" = stretch; then - KERNEL_SUFFIX= + KERNEL_SUFFIX=-$ARCHITECTURE fi -INCLUDE_PACKAGES="$INCLUDE_PACKAGES,linux-image$KERNEL_SUFFIX-$ARCHITECTURE" +INCLUDE_PACKAGES="$INCLUDE_PACKAGES,linux-image$KERNEL_SUFFIX" if test -n "$SSHKEY"; then INCLUDE_PACKAGES="$INCLUDE_PACKAGES,openssh-server" @@ -66,11 +66,11 @@ if command -v elf-arch >/dev/null 2>&1; then VMARCH=$(elf-arch "$KERNELTMP") fi case "$VMARCH" in - arm64|s390x) - DISKDEV=vda + amd64|i386) + DISKDEV=sda ;; *) - DISKDEV=sda + DISKDEV=vda ;; esac @@ -99,19 +99,28 @@ else QEMU=qemu-system-aarch64 set -- -machine virt -cpu max "$@" ;; + arm|armel|armhf) + QEMU=qemu-system-arm + set -- -machine virt -cpu max "$@" + ;; *) QEMU="qemu-system-$VMARCH" ;; esac fi -if test "$VMARCH" = arm64; then - set -- -nographic "$@" -elif test "$VMARCH" = s390x; then - set -- -M s390-ccw-virtio -nographic "$@" -elif test -z "$GRAPHICAL"; then - KERNEL_CMDLINE="$KERNEL_CMDLINE console=ttyS0" + +if test -z "$GRAPHICAL"; then set -- -nographic "$@" + case "$VMARCH" in + s390x) + set -- -M s390-ccw-virtio "$@" + ;; + amd64) + KERNEL_CMDLINE="$KERNEL_CMDLINE console=ttyS0" + ;; + esac fi + if test -n "$SSHPORT"; then NETDEV="$NETDEV,hostfwd=tcp:127.0.0.1:$SSHPORT-:22" fi |