From c017d6fba02b3e753d6aedb6339bada431a9845c Mon Sep 17 00:00:00 2001 From: Robin Reckmann Date: Tue, 6 Aug 2024 22:56:13 +0900 Subject: [PATCH 1/3] Fix InvalidBaseImagePlatform warning on aarch64 (#284) --- Dockerfile.agnos | 4 ---- build_system.sh | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Dockerfile.agnos b/Dockerfile.agnos index d5b9589..fe355e0 100644 --- a/Dockerfile.agnos +++ b/Dockerfile.agnos @@ -4,10 +4,6 @@ FROM scratch AS agnos-base ADD ubuntu-base-20.04.1-base-arm64.tar.gz / -# Add aarch64 and arm support -COPY --from=multiarch/qemu-user-static:x86_64-aarch64 /usr/bin/qemu-aarch64-static /usr/bin -COPY --from=multiarch/qemu-user-static:x86_64-arm /usr/bin/qemu-arm-static /usr/bin - # Build folder RUN mkdir -p /tmp/agnos diff --git a/build_system.sh b/build_system.sh index 5588614..aee039d 100755 --- a/build_system.sh +++ b/build_system.sh @@ -36,10 +36,10 @@ if [ ! -f $UBUNTU_FILE ]; then curl -C - -o $UBUNTU_FILE $UBUNTU_BASE_URL/$UBUNTU_FILE --silent --remote-time fi -# Register qemu multiarch +# Setup qemu multiarch if [ "$ARCH" = "x86_64" ]; then echo "Registering qemu-user-static" - docker run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes > /dev/null fi # Start agnos-builder docker build and create container From 8465bfc6c751e7b7517567c217a98dcb66b4de29 Mon Sep 17 00:00:00 2001 From: Robin Reckmann Date: Tue, 6 Aug 2024 22:56:47 +0900 Subject: [PATCH 2/3] Fix SecretsUsedInArgOrEnv warning (#283) --- Dockerfile.agnos | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile.agnos b/Dockerfile.agnos index fe355e0..7b7830d 100644 --- a/Dockerfile.agnos +++ b/Dockerfile.agnos @@ -10,9 +10,7 @@ RUN mkdir -p /tmp/agnos # Stop on error RUN set -xe -ENV USERNAME=comma -ENV PASSWD=comma -ENV HOST=comma +ARG USERNAME=comma # Base system setup RUN echo "resolvconf resolvconf/linkify-resolvconf boolean false" | debconf-set-selections From f2571c76fb0061a7603bdf3386b7773199e0fd23 Mon Sep 17 00:00:00 2001 From: Robin Reckmann Date: Wed, 7 Aug 2024 02:57:52 +0900 Subject: [PATCH 3/3] Replace apt-get with apt-fast (#285) * Replace apt-get with apt-fast * Some more apt-get replacements --- Dockerfile.agnos | 2 +- userspace/base_setup.sh | 16 ++++++++++------ userspace/compile-modemmanager.sh | 10 +++++----- userspace/install_extras.sh | 2 +- userspace/openpilot_dependencies.sh | 4 ++-- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Dockerfile.agnos b/Dockerfile.agnos index 7b7830d..12901a8 100644 --- a/Dockerfile.agnos +++ b/Dockerfile.agnos @@ -22,7 +22,7 @@ RUN /tmp/agnos/base_setup.sh # ################## # FROM agnos-base AS agnos-compiler -RUN apt-get update && apt-get install --no-install-recommends checkinstall +RUN apt-fast update && apt-fast install --no-install-recommends -yq checkinstall # Install openpilot dependencies, probably needed for build, # but we don't want these in the base image COPY ./userspace/openpilot_dependencies.sh /tmp/agnos/ diff --git a/userspace/base_setup.sh b/userspace/base_setup.sh index 63ac1bc..2b909ea 100755 --- a/userspace/base_setup.sh +++ b/userspace/base_setup.sh @@ -11,10 +11,14 @@ touch /AGNOS # Add armhf as supported architecture dpkg --add-architecture armhf +# Install apt-fast +apt-get update +apt-get install -yq curl sudo wget +bash -c "$(curl -sL https://git.io/vokNn)" + # Install packages export DEBIAN_FRONTEND=noninteractive -apt-get update -apt-get install -yq locales systemd adduser +apt-fast install --no-install-recommends -yq locales systemd adduser # Create privileged user useradd -G sudo -m -s /bin/bash $USERNAME @@ -46,8 +50,8 @@ echo "comma - nice -10" >> /etc/security/limits.conf locale-gen en_US.UTF-8 update-locale LANG=en_US.UTF-8 -apt-get upgrade -yq -apt-get install --no-install-recommends -yq \ +apt-fast upgrade -yq +apt-fast install --no-install-recommends -yq \ alsa-utils \ apport-retrace \ bc \ @@ -124,8 +128,8 @@ echo "comma ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers ln -sf /bin/bash /bin/sh # Install necessary libs -apt-get update -yq -apt-get install --no-install-recommends -yq \ +apt-fast update -yq +apt-fast install --no-install-recommends -yq \ libacl1:armhf \ libasan5-armhf-cross \ libatomic1-armhf-cross \ diff --git a/userspace/compile-modemmanager.sh b/userspace/compile-modemmanager.sh index 1f13c39..091cc89 100755 --- a/userspace/compile-modemmanager.sh +++ b/userspace/compile-modemmanager.sh @@ -7,16 +7,16 @@ PROVIDER_INFO_VERSION="20230416" cd /tmp -apt update -apt install -y --no-install-recommends automake autoconf build-essential cmake +apt-fast update +apt-fast install -y --no-install-recommends automake autoconf build-essential cmake # TODO: clean up these build time dependencies -apt install -y --no-install-recommends python3 python3-pip python3-setuptools python3-wheel ninja-build +apt-fast install -y --no-install-recommends python3 python3-pip python3-setuptools python3-wheel ninja-build pip3 install --user meson export PATH=$PATH:/root/.local/bin # build mobile-broadband-provider-info -apt install -y --no-install-recommends xsltproc +apt-fast install -y --no-install-recommends xsltproc git clone -b $PROVIDER_INFO_VERSION --depth 1 https://gitlab.gnome.org/GNOME/mobile-broadband-provider-info.git cd mobile-broadband-provider-info ./autogen.sh @@ -25,7 +25,7 @@ make install # build libqmi cd /tmp -apt install -y --no-install-recommends libgudev-1.0-dev gobject-introspection libgirepository1.0-dev help2man bash-completion +apt-fast install -y --no-install-recommends libgudev-1.0-dev gobject-introspection libgirepository1.0-dev help2man bash-completion git clone -b $LIBQMI_VERSION --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libqmi.git cd libqmi diff --git a/userspace/install_extras.sh b/userspace/install_extras.sh index ea5a87f..272af83 100755 --- a/userspace/install_extras.sh +++ b/userspace/install_extras.sh @@ -2,7 +2,7 @@ # for all the non-essential nice to haves -apt-get update && apt-get install -y --no-install-recommends \ +apt-fast update && apt-fast install -y --no-install-recommends \ irqtop \ ripgrep \ nfs-common diff --git a/userspace/openpilot_dependencies.sh b/userspace/openpilot_dependencies.sh index 79cf4d3..1490936 100755 --- a/userspace/openpilot_dependencies.sh +++ b/userspace/openpilot_dependencies.sh @@ -3,8 +3,8 @@ echo "Installing openpilot dependencies" # Install necessary libs -apt-get update -apt-get install --no-install-recommends -yq \ +apt-fast update +apt-fast install --no-install-recommends -yq \ autoconf \ automake \ build-essential \