From b5dd4d37dbf0169100e934ea402ead06e9bad85a Mon Sep 17 00:00:00 2001 From: gugolple Date: Fri, 5 Dec 2025 14:33:04 +0100 Subject: [PATCH] Fixed errors detected when trying to build with Docker Dockerfile: Due to many incompatibilities, changed version from SID to Trixie. Removed "python3-distuitls" due to no longer being available. Makefile: Git clones with full depth due to commits being further back in history. Upgraded from apt-key to basic keyring format. - Should be updated to only be applicable source. scripts/setup_rootfs.sh Propagated keyring changes to also be applicated to the running system. --- scripts/Dockerfile | 4 ++-- scripts/Makefile | 17 +++++++++++------ scripts/setup_rootfs.sh | 3 ++- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/Dockerfile b/scripts/Dockerfile index 35d0404..21275f7 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:sid as builder +FROM debian:trixie as builder ARG DEBIAN_FRONTEND=noninteractive @@ -14,8 +14,8 @@ RUN apt-get update \ git gperf kmod libexpat-dev \ libgmp-dev libmpc-dev libmpfr-dev libssl-dev \ libtool mmdebstrap openssl parted \ - patchutils python3 python3-dev python3-distutils \ python3-setuptools swig gnupg \ + patchutils python3 python3-dev \ systemd-container texinfo zlib1g-dev wget arch-test \ linux-image-generic genimage joe mc zip \ fakeroot git kernel-wedge quilt ccache flex bison \ diff --git a/scripts/Makefile b/scripts/Makefile index 37e02c4..482a9ba 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -38,7 +38,7 @@ NPROCS := $(shell nproc) $(BUILDDIR)/linux-prepare-checkout-stamp: @echo "$(COLOUR_GREEN)Checking out Kernel for $(BOARD)$(END_COLOUR)" @mkdir -p $(BUILDDIR) - @git clone -b sg200x-dev --depth 7 https://github.com/sophgo/linux_5.10.git /build/kernel + @git clone -b sg200x-dev https://github.com/sophgo/linux_5.10.git $(BUILDDIR)/kernel @cd $(BUILDDIR)/kernel && git checkout 8b8fbf8 @touch $@ @@ -79,7 +79,7 @@ linux-clean: $(BUILDDIR)/uboot-prepare-checkout-stamp: @echo "$(COLOUR_GREEN)Checking out U-Boot for $(BOARD)$(END_COLOUR)" @mkdir -p $(BUILDDIR) - @git clone --depth 1 https://github.com/sophgo/u-boot-2021.10.git $(BUILDDIR)/u-boot + @git clone https://github.com/sophgo/u-boot-2021.10.git $(BUILDDIR)/u-boot @cd $(BUILDDIR)/u-boot && git checkout 4a21b6b @touch $@ @@ -122,7 +122,7 @@ uboot-clean: $(BUILDDIR)/opensbi-prepare-checkout-stamp: @echo "$(COLOUR_GREEN)Checking out OpenSBI for $(BOARD)$(END_COLOUR)" @mkdir -p $(BUILDDIR) - @git clone -b sg200x-dev --depth 4 https://github.com/sophgo/opensbi.git $(BUILDDIR)/opensbi + @git clone -b sg200x-dev https://github.com/sophgo/opensbi.git $(BUILDDIR)/opensbi @cd $(BUILDDIR)/opensbi && git checkout 216793f # git clone https://github.com/riscv-software-src/opensbi.git $(BUILDDIR)/opensbi # @cd $(BUILDDIR)/opensbi && git checkout a2b255b @@ -151,7 +151,7 @@ opensbi-clean: $(BUILDDIR)/fsbl-prepare-checkout-stamp: @echo "$(COLOUR_GREEN)Checking out FSBL for $(BOARD)$(END_COLOUR)" @mkdir -p $(BUILDDIR) - @git clone -b sg200x-dev --depth 1 https://github.com/sophgo/fsbl.git $(BUILDDIR)/fsbl + @git clone -b sg200x-dev https://github.com/sophgo/fsbl.git $(BUILDDIR)/fsbl @cd $(BUILDDIR)/fsbl && git checkout 15a84c5 @touch $@ @@ -198,8 +198,12 @@ $(BUILDDIR)/image-prepare-stamp: @-rm $(addon-targets) @mkdir -p /rootfs/ @curl -v -L https://sophgo.my-ho.st:8443/public-key.asc -o $(BUILDDIR)/public-key.asc - @apt-key add $(BUILDDIR)/public-key.asc - @mmdebstrap -v --architectures=riscv64 --include="$(_PACKAGES)" sid "/rootfs/" "deb http://deb.debian.org/debian/ sid main" "deb https://sophgo.my-ho.st:8443/ debian sophgo" + @rm -f /etc/apt/trusted.gpg.d/fishwaldo.gpg + @gpg --no-default-keyring --keyring $(BUILDDIR)/temp-keyring.gpg --import $(BUILDDIR)/public-key.asc + @gpg --no-default-keyring --keyring $(BUILDDIR)/temp-keyring.gpg --export --output /etc/apt/trusted.gpg.d/fishwaldo.gpg + @gpg --no-default-keyring --keyring $(BUILDDIR)/temp-keyring.gpg --export --output $(BUILDDIR)/fishwaldo.gpg + @rm $(BUILDDIR)/temp-keyring.gpg + @mmdebstrap -v --architectures=riscv64 --include="$(_PACKAGES)" sid "$(BUILDDIR)/bootstrap" "deb http://deb.debian.org/debian/ sid main" "deb https://sophgo.my-ho.st:8443/ debian sophgo" @touch $@ $(BUILDDIR)/image-addons-stamp: $(BUILDDIR)/image-prepare-stamp $(BUILDDIR)/fsbl-package-stamp $(BUILDDIR)/linux-compile-stamp $(addon-targets) @@ -214,6 +218,7 @@ $(BUILDDIR)/image-addons-stamp: $(BUILDDIR)/image-prepare-stamp $(BUILDDIR)/fsbl $(BUILDDIR)/image-customize-stamp: $(BUILDDIR)/image-addons-stamp $(BUILDDIR)/linux-compile-stamp $(BUILDDIR)/fsbl-package-stamp @echo "$(COLOUR_GREEN)Customizing Image for $(BOARD)$(END_COLOUR)" @mkdir -p /rootfs/tmp/install/ + @cp $(BUILDDIR)/fishwaldo.gpg /rootfs/tmp/install/ @echo $(BOARD) > /rootfs/tmp/install/hostname @echo $(BOARD) > /rootfs/tmp/install/board @echo $(STORAGE_TYPE) > /rootfs/tmp/install/storage diff --git a/scripts/setup_rootfs.sh b/scripts/setup_rootfs.sh index 96ca5bf..70205aa 100755 --- a/scripts/setup_rootfs.sh +++ b/scripts/setup_rootfs.sh @@ -144,7 +144,8 @@ fi rm -rf /etc/apt/sources.list.d/multistrap-debian.list -apt-key add /tmp/install/public-key.asc +#apt-key add /tmp/install/public-key.asc +cp /tmp/install/fishwaldo.gpg /etc/apt/trusted.gpg.d/fishwaldo.gpg cat > /etc/apt/sources.list <