Skip to content

Commit

Permalink
Update default version for targets qemu and panda
Browse files Browse the repository at this point in the history
  • Loading branch information
rawsample committed Feb 10, 2022
1 parent ed63095 commit 9d37b9e
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 62 deletions.
4 changes: 2 additions & 2 deletions avatar2.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions generate_dockerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \\
Expand Down
76 changes: 32 additions & 44 deletions targets/build_panda.sh
Original file line number Diff line number Diff line change
@@ -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"
35 changes: 23 additions & 12 deletions targets/build_qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,40 @@
# 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..."
exit -1
;;
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"
Expand All @@ -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"
2 changes: 1 addition & 1 deletion targets/src/avatar-panda
Submodule avatar-panda updated 426 files
2 changes: 1 addition & 1 deletion targets/src/avatar-qemu
Submodule avatar-qemu updated 6591 files

0 comments on commit 9d37b9e

Please sign in to comment.