Comment 8 for bug 1265560

Revision history for this message
Scott Moser (smoser) wrote :

Hi, heres what I tested just now as functional for the power builds:

$ for arch in powerpc ppc64 ppc64le;
  do burl=http://download.cirros-cloud.net/daily/20150604/cirros-d150604-$arch;
 for f in kernel initramfs; do [ -f "${burl##*/}-$f" ] || wget $burl-$f; done; done

$ ls -l cirros-d150604-p*
-rw-rw-r-- 1 ubuntu ubuntu 4362299 Jun 4 04:53 cirros-d150604-powerpc-initramfs
-rw-rw-r-- 1 ubuntu ubuntu 25280072 Jun 4 04:53 cirros-d150604-powerpc-kernel
-rw-rw-r-- 1 ubuntu ubuntu 8702396 Jun 4 04:54 cirros-d150604-ppc64-initramfs
-rw-rw-r-- 1 ubuntu ubuntu 25280072 Jun 4 04:54 cirros-d150604-ppc64-kernel
-rw-rw-r-- 1 ubuntu ubuntu 8461981 Jun 4 04:54 cirros-d150604-ppc64le-initramfs
-rw-rw-r-- 1 ubuntu ubuntu 21761512 Jun 4 04:54 cirros-d150604-ppc64le-kernel

On the Ubuntu host, I did:
  sudo apt-get install -qy qemu-system-ppc
  sudo ppc64_cpu --smt=off
  sudo modprobe kvm_hv
  sudo modprobe kvm_pv
  sudo chmod 666 /dev/kvm

Then for each of the kernel/initramfs pairs, i ran 'go' (see below).

$ ./go cirros-d150604-ppc64le-kernel cirros-d150604-ppc64le-initramfs

For each kernel, it booted to finding the root device, the seed image, copied itself
over to the disk image and brought up networking via dhcp.

$ cat go
#!/bin/sh
kernel="$1"
initrd="$2"
shift 2
cmdline="$1"
disk="disk.img"
fail() { echo "$@" 1>&2; exit 1; }

rm -f "$disk"
qemu-img create -f raw "$disk" 1G || fail
out=$(mkfs.ext2 -F -L cirros-rootfs "$disk" >/dev/null 2>&1) ||
   fail "failed mkfs $disk: $out"

if [ ! -f seed.img ]; then
    echo '{"instance-id": "9068aef2-213e-4e43-830f-accdbadde897"}' > meta-data
    { echo '#!/bin/sh'; echo 'poweroff'; } > user-data
    cloud-localds seed.img user-data meta-data
fi

qemu-system-ppc64 -enable-kvm -machine pseries,usb=off -device spapr-vscsi \
   -device spapr-vlan,netdev=net00 -netdev type=user,id=net00 \
   -drive if=virtio,file=$disk -drive if=virtio,file=seed.img \
   -m 1G -echr 0x05 -nographic -vga none \
   -kernel "$kernel" -initrd "$initrd" -append "$cmdline"