diff --git a/avatar2.Dockerfile b/avatar2.Dockerfile index 8c27c1bd24..a799c0d993 100644 --- a/avatar2.Dockerfile +++ b/avatar2.Dockerfile @@ -30,11 +30,11 @@ ARG QEMU_TARGETS="arm-softmmu,mips-softmmu" RUN sed -i '/deb-src .*-security main restricted/s/^#//g' /etc/apt/sources.list RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get build-dep -y qemu && \ - apt-get install -y git + apt-get install -y git ninja-build RUN git clone https://github.com/avatartwo/avatar-qemu /root/avatar-qemu/ RUN cd /root/avatar-qemu/ && \ - git checkout dev/qemu-5.1 + git checkout dev/qemu-6.2 RUN mkdir -p /root/avatar-qemu/build && cd /root/avatar-qemu/build && \ ../configure \ --disable-sdl \ diff --git a/generate_dockerfile.py b/generate_dockerfile.py index 23be117d10..9d7b4813db 100644 --- a/generate_dockerfile.py +++ b/generate_dockerfile.py @@ -53,11 +53,11 @@ RUN sed -i '/deb-src .*-security main restricted/s/^#//g' /etc/apt/sources.list RUN apt-get update && \\ DEBIAN_FRONTEND=noninteractive apt-get build-dep -y qemu && \\ - apt-get install -y git + apt-get install -y git ninja-build RUN git clone https://github.com/avatartwo/avatar-qemu /root/avatar-qemu/ RUN cd /root/avatar-qemu/ && \\ - git checkout dev/qemu-5.1 + git checkout dev/qemu-6.2 RUN mkdir -p /root/avatar-qemu/build && cd /root/avatar-qemu/build && \\ ../configure \\ --disable-sdl \\ diff --git a/targets/build_panda.sh b/targets/build_panda.sh index f5ab29e31d..b8f8becde6 100755 --- a/targets/build_panda.sh +++ b/targets/build_panda.sh @@ -1,51 +1,39 @@ #!/bin/bash -source /etc/os-release +# Usage ./build_panda.sh [architectures] +# example: ./build_panda.sh arm-softmmu,mips-softmmu +# -repo="deb-src http://archive.ubuntu.com/ubuntu/ $UBUNTU_CODENAME-security main restricted" -apt_src="/etc/apt/sources.list" +TARGET_LIST="arm-softmmu,mips-softmmu,i386-softmmu" PANDA_NPROC=${PANDA_NPROC:-$(nproc)} -set -e -if [[ "$ID" == "ubuntu" ]] +set -ex + +source /etc/os-release +if [[ "$ID" != "ubuntu" ]] then - if ! grep -q '^deb-src .*'$UBUNTU_CODENAME'-security main restricted' $apt_src; - then - echo "[WARNING] This script is about to add '$repo' to $apt_src" - read -p "Do you want to continue? (Yes/No) " cont - case $cont in - Yes|yes|Y|y ) - sudo bash -c "echo '$repo' >> $apt_src" - echo "Continuing installation..." - ;; - * ) echo "Aborting..." - exit -1 - ;; - esac - fi - - # Use the panda install_ubuntu.sh script - cd `dirname "$BASH_SOURCE"`/src/ - git submodule update --init avatar-panda - - cd .. - src/avatar-panda/panda/scripts/install_ubuntu.sh --disable-sdl --target-list=arm-softmmu - - mkdir -p build/ - mv src/avatar-panda/build/ build/panda/ - -else - echo "[Warning] Attempting to run installation on a non-ubuntu system." - echo "You may have to install dependencies manually" - - cd `dirname "$BASH_SOURCE"`/src/ - git submodule update --init avatar-panda - - cd avatar-panda - git submodule update --init dtc - - mkdir -p ../../build/panda/panda - cd ../../build/panda/panda - ../../../src/avatar-panda/configure --disable-sdl --target-list=arm-softmmu - make -j ${PANDA_NPROC} + echo "[ERROR] This script only supports Ubuntu systems" + exit -1 fi + + +if [[ $# -ge 1 ]] +then + TARGET_LIST="$1" +fi +echo "Building for targets: $TARGET_LIST" +echo "" + + +# Use the panda install_ubuntu.sh script +cd `dirname "$BASH_SOURCE"`/src/ +#git submodule update --init avatar-panda + +cd avatar-panda +./panda/scripts/install_ubuntu.sh \ + --disable-sdl \ + --target-list=$TARGET_LIST + +echo "" +echo "Export the following env variable:" +echo "export AVATAR2_PANDA_EXECUTABLE=$PWD/arm-softmmu/panda-system-arm" diff --git a/targets/build_qemu.sh b/targets/build_qemu.sh index 41136a3451..fa415da59d 100755 --- a/targets/build_qemu.sh +++ b/targets/build_qemu.sh @@ -2,23 +2,29 @@ # Usage ./build_qemu.sh [architectures] # example: ./build_qemu.sh arm-softmmu,mips-softmmu # - source /etc/os-release -repo="deb-src http://archive.ubuntu.com/ubuntu/ $UBUNTU_CODENAME-security main restricted" -apt_src="/etc/apt/sources.list" -QEMU_NPROC=$(QEMU_NPROC:-$(nproc)) TARGET_LIST="arm-softmmu,mips-softmmu" +REPO="deb-src http://archive.ubuntu.com/ubuntu/ $UBUNTU_CODENAME-security main restricted" +APT_SRC="/etc/apt/sources.list" +QEMU_NPROC=${QEMU_NPROC:-$(nproc)} + + +set -ex if [[ "$ID" == "ubuntu" ]] then - if ! grep -q '^deb-src .*'$UBUNTU_CODENAME'-security main restricted' $apt_src; + if [ $EUID -ne 0 ]; then + SUDO=sudo + fi + + if ! grep -q '^deb-src .*'$UBUNTU_CODENAME'-security main restricted' $APT_SRC; then - echo "[WARNING] This script is about to add '$repo' to $apt_src" + echo "[WARNING] This script is about to add '$REPO' to $APT_SRC" read -p "Do you want to continue? (Yes/No) " cont case $cont in Yes|yes|Y|y ) - sudo bash -c "echo '$repo' >> $apt_src" + $SUDO bash -c "echo '$REPO' >> $APT_SRC" echo "Continuing installation..." ;; * ) echo "Aborting..." @@ -26,8 +32,10 @@ then ;; esac fi - sudo apt-get update - sudo apt-get build-dep -y qemu + + $SUDO apt-get update + DEBIAN_FRONTEND=noninteractive $SUDO apt-get build-dep -y qemu + $SUDO apt-get install -y git ninja-build else echo "[Warning] Attempting to run installation on a non-ubuntu system." echo "You may have to install dependencies manually" @@ -47,11 +55,14 @@ git submodule update --init avatar-qemu cd avatar-qemu git submodule update --init dtc -mkdir -p ../../build/qemu/ -cd ../../build/qemu -../../src/avatar-qemu/configure \ +mkdir -p build +cd build +../configure \ --disable-sdl \ --target-list=$TARGET_LIST make -j $QEMU_NPROC +echo "" +echo "Export the following env variable:" +echo "export AVATAR2_PANDA_EXECUTABLE=$PWD/arm-softmmu/qemu-system-arm" diff --git a/targets/src/avatar-panda b/targets/src/avatar-panda index 1b26d2ba21..5fb8a5098d 160000 --- a/targets/src/avatar-panda +++ b/targets/src/avatar-panda @@ -1 +1 @@ -Subproject commit 1b26d2ba21412f91af8aab7faea0109bc5d34941 +Subproject commit 5fb8a5098d0647a13e5e7d39d20ff9f04242572d diff --git a/targets/src/avatar-qemu b/targets/src/avatar-qemu index ee8fcc7449..d774496465 160000 --- a/targets/src/avatar-qemu +++ b/targets/src/avatar-qemu @@ -1 +1 @@ -Subproject commit ee8fcc744994520465054ac54d35dc446438bb25 +Subproject commit d774496465cc77949be27d0a425264ef6eeaf05d