From 2414a742e41e015acebe35a09d7c132f81fc31b0 Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Sun, 11 Apr 2021 10:48:05 +0100 Subject: [PATCH] Move to qemu 5.2 --- Dockerfile | 8 ++++---- entrypoint.sh | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index e2f513a..6fd48d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Build stage for qemu-system-arm FROM debian:stable-slim AS qemu-builder -ARG QEMU_VERSION=5.1.0 +ARG QEMU_VERSION=5.2.0 ENV QEMU_TARBALL="qemu-${QEMU_VERSION}.tar.xz" WORKDIR /qemu @@ -23,7 +23,7 @@ RUN tar xvf "${QEMU_TARBALL}" RUN # Build source # These seem to be the only deps actually required for a successful build -RUN apt-get -y install python build-essential libglib2.0-dev libpixman-1-dev +RUN apt-get -y install python build-essential libglib2.0-dev libpixman-1-dev ninja-build # These don't seem to be required but are specified here: https://wiki.qemu.org/Hosts/Linux RUN apt-get -y install libfdt-dev zlib1g-dev # Not required or specified anywhere but supress build warnings @@ -90,8 +90,8 @@ ENTRYPOINT ["./entrypoint.sh"] # It's just the VM image with a compressed Raspbian filesystem added FROM dockerpi-vm as dockerpi LABEL maintainer="Luke Childs " -ARG FILESYSTEM_IMAGE_URL="http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2020-02-14/2020-02-13-raspbian-buster-lite.zip" -ARG FILESYSTEM_IMAGE_CHECKSUM="12ae6e17bf95b6ba83beca61e7394e7411b45eba7e6a520f434b0748ea7370e8" +ARG FILESYSTEM_IMAGE_URL="https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-03-25/2021-03-04-raspios-buster-armhf-lite.zip" +ARG FILESYSTEM_IMAGE_CHECKSUM="ea92412af99ec145438ddec3c955aa65e72ef88d84f3307cea474da005669d39" ADD $FILESYSTEM_IMAGE_URL /filesystem.zip diff --git a/entrypoint.sh b/entrypoint.sh index 000585c..fec45c4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,6 +15,13 @@ if [ ! -e $image_path ]; then fi fi +echo "Rounding image size up to a multiple of 2G" +image_size=`du -m $image_path | cut -f1` +new_size=$(( ( ( image_size / 2048 ) + 1 ) * 2 )) +echo "from ${image_size}M to ${new_size}G" +qemu-img resize $image_path "${new_size}G" + + if [ "${target}" = "pi1" ]; then emulator=qemu-system-arm kernel="/root/qemu-rpi-kernel/kernel-qemu-4.19.50-buster" @@ -26,22 +33,15 @@ if [ "${target}" = "pi1" ]; then nic='--net nic --net user,hostfwd=tcp::5022-:22' elif [ "${target}" = "pi2" ]; then emulator=qemu-system-arm - machine=raspi2 + machine=raspi2b memory=1024m kernel_pattern=kernel7.img dtb_pattern=bcm2709-rpi-2-b.dtb extra='dwc_otg.fiq_fsm_enable=0' nic='-netdev user,id=net0,hostfwd=tcp::5022-:22 -device usb-net,netdev=net0' elif [ "${target}" = "pi3" ]; then - - echo "Rounding image size up to a multiple of 2G" - image_size=`du -m $image_path | cut -f1` - new_size=$(( ( ( image_size / 2048 ) + 1 ) * 2 )) - echo "from ${image_size}M to ${new_size}G" - qemu-img resize $image_path "${new_size}G" - emulator=qemu-system-aarch64 - machine=raspi3 + machine=raspi3b memory=1024m kernel_pattern=kernel8.img dtb_pattern=bcm2710-rpi-3-b-plus.dtb