From fdf3c9e4bf6c0791431451dbdd5206b5b60befbac4f6177e382542b3a0da9d9f Mon Sep 17 00:00:00 2001 From: kira Date: Wed, 26 Aug 2026 21:56:59 +0200 Subject: [PATCH] Remove PGP keys recive in Dokerfile. And add auto PGP keys sacn and rec in build.sh --- tools/artix-dinit-dev-env/Dockerfile | 7 ++----- tools/artix-dinit-dev-env/build.sh | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/tools/artix-dinit-dev-env/Dockerfile b/tools/artix-dinit-dev-env/Dockerfile index bcc5717..d88a7a3 100644 --- a/tools/artix-dinit-dev-env/Dockerfile +++ b/tools/artix-dinit-dev-env/Dockerfile @@ -12,15 +12,11 @@ RUN pacman-key --init \ RUN pacman -Suyy --noconfirm # Install necessary build tools -RUN pacman -Suy --noconfirm base-devel git wget sudo make pacman-contrib binutils rust rust-bindgen rust-src libgcc graphviz imagemagick python python-sphinx python-yaml texlive-latexextra - +RUN pacman -Suy --noconfirm base-devel git wget sudo make pacman-contrib binutils rust rust-bindgen rust-src libgcc graphviz imagemagick python python-sphinx python-yaml texlive-latexextra llvm # Clean pacman cache RUN pacman -Scc -# Recieve Linus and Greg keys for linux kernel sources -RUN gpg --recv-keys 647F28654894E3BD457199BE38DBBDC86092693E ABAF11C65A2970B130ABE3C479BE3E4300411886 - # Config to use 16 thread for building RUN printf 'MAKEFLAGS="-j16"\n' > /etc/makepkg.conf.d/j16.conf @@ -32,6 +28,7 @@ RUN useradd -m builduser \ && passwd -d builduser \ && printf 'builduser ALL=(ALL) ALL\n' >> /etc/sudoers + # Set working directory WORKDIR /home/builduser diff --git a/tools/artix-dinit-dev-env/build.sh b/tools/artix-dinit-dev-env/build.sh index a85d465..2f73e33 100755 --- a/tools/artix-dinit-dev-env/build.sh +++ b/tools/artix-dinit-dev-env/build.sh @@ -2,6 +2,24 @@ echo "Package src dir: $1" echo "Package bin dir: $2" -docker run --interactive --tty --rm --volume $1:/pkgsrc:z --volume $2:/artifact:z artix-build-env bash -c "sudo pacman -Sy --noconfirm && cp -r /pkgsrc/* ./ && makepkg -Ccsf --noconfirm && cp *.pkg.tar.zst /artifact/" + +keys_dir="$1/keys/pgp" + +pgp_keys="" + +# Check if pgp dir exist and it is not symlink +if [ -d "$keys_dir" ] && [ ! -L "$keys_dir" ]; then + echo "PGP keys dir exist: $keys_dir" + pgp_keys="gpg --recv-keys " + for f in "$dir"/*; do + filename="${f##*/}" + echo "Located PGP key: $filename" + pgp_keys="$pgp_keys ${filename%.*}" + done + pgp_keys="${pgp_keys# }" # strip leading space instead +fi + + +docker run --interactive --tty --rm --volume $1:/pkgsrc:z --volume $2:/artifact:z artix-build-env bash -c "$pgp_keys && sudo pacman -Sy --noconfirm && cp -r /pkgsrc/* ./ && makepkg -Ccsf --noconfirm && cp *.pkg.tar.zst /artifact/"