diff options
author | Helmut Grohne <helmut@subdivi.de> | 2022-12-21 12:29:14 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2022-12-21 12:29:14 +0100 |
commit | 0434e4b932a1f94725b423925d8583ba03900496 (patch) | |
tree | 0eb05e98d8f12c5784801569b9047fc06b7187ec | |
parent | e31e3c7b2f78c6680bcbb7a87939d9646f3807c8 (diff) | |
download | debvm-0434e4b932a1f94725b423925d8583ba03900496.tar.gz |
support ppc64el
-rwxr-xr-x | debvm-create | 9 | ||||
-rwxr-xr-x | debvm-run | 19 |
2 files changed, 21 insertions, 7 deletions
diff --git a/debvm-create b/debvm-create index b2a213d..8870e09 100755 --- a/debvm-create +++ b/debvm-create @@ -95,6 +95,9 @@ case "$ARCHITECTURE" in i386) KERNEL_SUFFIX=-686-pae ;; + ppc64el) + KERNEL_SUFFIX=-powerpc64le + ;; esac INCLUDE_PACKAGES="$INCLUDE_PACKAGES,linux-image$KERNEL_SUFFIX" @@ -113,11 +116,11 @@ set -- \ # unless we set up a fstab, / will be read-only case "$ARCHITECTURE" in - s390x) - DISKDEV=vda + amd64|i386|ppc64el) + DISKDEV=sda ;; *) - DISKDEV=sda + DISKDEV=vda ;; esac set -- "--customize-hook=echo '/dev/$DISKDEV / ext4 defaults 0 1' >"'"$1/etc/fstab"' "$@" @@ -45,9 +45,6 @@ done test -f "$IMAGE" || die "image '$IMAGE' not found" -KERNELNAME=$(/sbin/debugfs "$IMAGE" -R "stat vmlinuz" | sed 's/Fast link dest: "\(.*\)"/\1/;t;d') -INITRDNAME=$(/sbin/debugfs "$IMAGE" -R "stat initrd.img" | sed 's/Fast link dest: "\(.*\)"/\1/;t;d') - cleanup() { set +x test -n "$KERNELTMP" && rm -f "$KERNELTMP" @@ -66,13 +63,24 @@ if command -v elf-arch >/dev/null 2>&1; then VMARCH=$(elf-arch "$KERNELTMP") fi case "$VMARCH" in - amd64|i386) + amd64|i386|ppc64el) DISKDEV=sda ;; *) DISKDEV=vda ;; esac +case "$VMARCH" in + ppc64el) + KERNELLINK=vmlinux + ;; + *) + KERNELLINK=vmlinuz + ;; +esac + +KERNELNAME=$(/sbin/debugfs "$IMAGE" -R "stat $KERNELLINK" | sed 's/Fast link dest: "\(.*\)"/\1/;t;d') +INITRDNAME=$(/sbin/debugfs "$IMAGE" -R "stat initrd.img" | sed 's/Fast link dest: "\(.*\)"/\1/;t;d') KERNEL_CMDLINE=root=/dev/$DISKDEV NETDEV="user,id=net0" @@ -103,6 +111,9 @@ else QEMU=qemu-system-arm set -- -machine virt -cpu max "$@" ;; + ppc64el) + QEMU=qemu-system-ppc64 + ;; *) QEMU="qemu-system-$VMARCH" ;; |