diff --git a/.gitignore b/.gitignore index 13cd0d6..de28944 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ build/ # generated ssh keys keys/* + +# boostrap packages +/*-stage4/ diff --git a/boot.sh b/boot.sh index a87a639..de44bc5 100755 --- a/boot.sh +++ b/boot.sh @@ -112,6 +112,17 @@ qemu_setargs_riscv64() { ) } +qemu_setargs_ppc64() { + qemu_args+=( + -machine pseries + -m 2G + -kernel "$1"/vmlinuz-linux-libre + -initrd "$1"/initramfs-linux-libre.img + -append "console=ttyS0 rw root=/dev/sda3" + -drive file="$2" + ) +} + qemu_setargs_i386() { qemu_setargs_x86_64 "$@" } @@ -141,15 +152,17 @@ boot_from_image() { check_kernel_arch "$TOPBUILDDIR"/mnt || return case "$machine" in - RISC-V) arch=riscv64 ;; - ARM) arch=arm ;; - i386) arch=i386 ;; - i386:*) arch=x86_64 ;; - *) error "unrecognized machine '$machine'" - return "$ERROR_UNSPECIFIED" ;; + RISC-V) arch=riscv64 ;; + PowerPC64) arch=ppc64 ;; + ARM) arch=arm ;; + i386) arch=i386 ;; + i386:*) arch=x86_64 ;; + *) error "unrecognized machine '$machine'" + return "$ERROR_UNSPECIFIED" ;; esac - qemu_args=(-snapshot -nographic) + #qemu_args=(-snapshot -nographic) + qemu_args=(-nographic) "qemu_setargs_$arch" "$TOPBUILDDIR"/mnt "$1" "$loopdev" qemu_arch_is_foreign "$arch" || qemu_args+=(-enable-kvm) QEMU_AUDIO_DRV=none "qemu-system-$arch" "${qemu_args[@]}" diff --git a/src/qemu.sh b/src/qemu.sh index afea16d..da4b16b 100644 --- a/src/qemu.sh +++ b/src/qemu.sh @@ -43,6 +43,10 @@ qemu_img_partition_and_mount_for_riscv64() { qemu_img_partition_and_mount_for_x86_64 "$@" } +qemu_img_partition_and_mount_for_powerpc64le() { + qemu_img_partition_and_mount_for_x86_64 "$@" +} + qemu_img_partition_and_mount_for_i686() { qemu_img_partition_and_mount_for_x86_64 "$@" } @@ -72,6 +76,7 @@ qemu_img_losetup() { echo -n "checking for free loop device ... " loopdev=$(losetup -f --show "$1") || loopdev=no echo "$loopdev" + partprobe "$loopdev" [ "x$loopdev" == "xno" ] && return "$ERROR_MISSING" @@ -101,8 +106,9 @@ qemu_arch_is_foreign() { qemu_setup_user_static() { local interpreter case "$ARCH" in - armv7h) interpreter=/usr/bin/qemu-arm- ;; - *) interpreter=/usr/bin/qemu-"$ARCH"- ;; + armv7h) interpreter=/usr/bin/qemu-arm- ;; + powerpc64le) interpreter=/usr/bin/qemu-ppc64le- ;; + *) interpreter=/usr/bin/qemu-"$ARCH"- ;; esac if qemu_arch_is_foreign "$ARCH"; then @@ -136,6 +142,10 @@ qemu_img_finalize_for_riscv64() { -O "$1"/boot/bbl } +qemu_img_finalize_for_powerpc64le() { + true +} + qemu_img_finalize_for_i686() { true }