diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile deleted file mode 100644 index 9881660..0000000 --- a/ci/Jenkinsfile +++ /dev/null @@ -1,70 +0,0 @@ -pipeline { - agent { - kubernetes { - yamlFile 'ci/podTemplate.yaml' - yamlMergeStrategy merge() - defaultContainer 'buildah' - } - } - - stages { - stage('Gentoo Stage 3') { - steps { - sh 'sh -e image-build/gentoo-stage3.sh' - } - } - - stage('Base') { - steps { - sh 'sh -e image-build/base.sh' - } - } - - stage('Cross') { - steps { - sh 'sh -e image-build/cross.sh' - } - } - - stage('Build') { - steps { - sh 'sh -e image-build/build.sh' - } - } - - stage('Push') { - steps { - withEnv([ - "REGISTRY_AUTH_FILE=${env.WORKSPACE_TMP}/auth.json" - ]) { - withCredentials([usernamePassword( - credentialsId: 'jenkins-packages', - usernameVariable: 'BUILDAH_USERNAME', - passwordVariable: 'BUILDAH_PASSWORD', - )]) { - sh """ - buildah login \ - --username \${BUILDAH_USERNAME} \ - --password \${BUILDAH_PASSWORD} \ - git.pyrocufflink.net - """ - } - sh 'buildah push aimee-os.org/build/base git.pyrocufflink.net/aimeeos/build/base' - sh 'buildah push aimee-os.org/build/cross-aarch64-unknown-linux-gnu git.pyrocufflink.net/aimeeos/build/cross-aarch64-unknown-linux-gnu' - sh 'buildah push aimee-os.org/build/build-aarch64-unknown-linux-gnu git.pyrocufflink.net/aimeeos/build/build-aarch64-unknown-linux-gnu' - } - } - } - - } - - post { - failure { - sh 'unshare -Ur --map-auto chown root:root -R tmp log' - dir('tmp/portage') { - archiveArtifacts '*/*/temp/*.log' - } - archiveArtifacts 'log/**/*' - } - } -} diff --git a/ci/podTemplate.yaml b/ci/podTemplate.yaml deleted file mode 100644 index ad7a4c7..0000000 --- a/ci/podTemplate.yaml +++ /dev/null @@ -1,25 +0,0 @@ -spec: - containers: - - name: buildah - image: quay.io/containers/buildah:v1 - command: - - sh - - -c - - | - trap 'kill $!; exit' TERM - rm -f ~/.config/containers/storage.conf - sleep infinity & - wait - securityContext: - runAsUser: 1000 - runAsGroup: 1000 - resources: - limits: - github.com/fuse: 1 - cpu: 6 - memory: 8G - requests: - cpu: 6 - memory: 8G - tolerations: - - key: du5t1n.me/jenkins diff --git a/lib/common.sh b/common.sh similarity index 100% rename from lib/common.sh rename to common.sh diff --git a/image-build/base.sh b/image-build/base.sh deleted file mode 100644 index dfa1191..0000000 --- a/image-build/base.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -SELF=$(readlink -f "$0") -SRCDIR=${SELF%/*/*} -. "${SRCDIR}"/lib/common.sh - -base=aimee-os.org/gentoo/stage3-amd64-nomultilib-openrc:latest -while [ $# -gt 0 ]; do - case "$1" in - -b|--base) - shift - base="$1" - ;; - *) - printf 'Unknown argument: %s\n' "$1" >&2 - exit 2 - ;; - esac -done - -set -e - -builddir=$(export TMPDIR=${TMPDIR:-${PWD}} && mktemp -d gentoo.XXXXXX) -builddir=$(readlink -f "${builddir}") - -work=$(buildah from -v "${builddir}":/mnt/gentoo:rw,Z "${base}") -buildah add "${work}" portage /etc/portage/ -buildah_run_script "${work}" "${SRCDIR}"/lib/sync.sh -buildah_run_script "${work}" "${SRCDIR}"/lib/bootstrap.sh - -cid=$(buildah from scratch) -buildah copy "${cid}" "${builddir}" / -buildah_run_script "${cid}" "${SRCDIR}"/lib/profile.sh -buildah config --cmd /bin/bash "${cid}" -buildah commit --rm --squash "${cid}" aimee-os.org/build/base - -buildah run "${work}" find /mnt/gentoo -mindepth 1 -delete -buildah rm "${work}" -rmdir "${builddir}" diff --git a/image-build/build.sh b/image-build/build.sh deleted file mode 100644 index b78396d..0000000 --- a/image-build/build.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -SELF=$(readlink -f "$0") -SRCDIR=${SELF%/*/*} -. "${SRCDIR}"/lib/common.sh - -target=aarch64-unknown-linux-gnu -while [ $# -gt 0 ]; do - case "$1" in - -t|--target) - shift - target="$1" - ;; - -b|--base) - shift - base="$1" - ;; - *) - printf 'Unknown argument: %s\n' "$1" >&2 - exit 2 - ;; - esac -done - -if [ -z "${base-}" ]; then - base=aimee-os.org/build/cross-"${target}" -fi - -set -e - -cid=$(buildah from "${base}") -buildah add "${cid}" portage /etc/portage -buildah_run_script "${cid}" "${SRCDIR}"/lib/sync.sh -buildah_run_script "${cid}" "${SRCDIR}"/lib/tools.sh -buildah commit --rm --squash "${cid}" "aimee-os.org/build/build-${target}" diff --git a/image-build/cross.sh b/image-build/cross.sh deleted file mode 100644 index a32cac8..0000000 --- a/image-build/cross.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SELF=$(readlink -f "$0") -SRCDIR=${SELF%/*/*} -. "${SRCDIR}"/lib/common.sh - -target=aarch64-unknown-linux-gnu -base=aimee-os.org/build/base -while [ $# -gt 0 ]; do - case "$1" in - -t|--target) - shift - target="$1" - ;; - -b|--base) - shift - base="$1" - ;; - *) - printf 'Unknown argument: %s\n' "$1" >&2 - exit 2 - ;; - esac - shift -done - -set -e - -cid=$(buildah from "${base}") -buildah_run_script "${cid}" "${SRCDIR}"/lib/sync.sh -buildah_run_script "${cid}" "${SRCDIR}"/lib/crossdev.sh "${target}" -buildah commit --rm "${cid}" aimee-os.org/build/cross-"${target}" diff --git a/image-build/gentoo-stage3.sh b/image-build/gentoo-stage3.sh deleted file mode 100644 index ef1573a..0000000 --- a/image-build/gentoo-stage3.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -SELF=$(readlink -f "$0") -SRCDIR=${SELF%/*/*} - -tarball=$1 - -set -e - -if [ -z "${tarball}" ]; then - tarball=$(sh "${SRCDIR}"/tools/fetch-stage3.sh "$@") -fi -stage3=${tarball%.tar.*} -version=${stage3##*-} -stage3=${stage3%-*} - -cid=$(buildah from scratch) -buildah add "${cid}" "${tarball}" -buildah config --cmd /bin/bash "${cid}" -buildah commit --rm --squash "${cid}" "aimee-os.org/gentoo/${stage3}:${version}" -buildah tag "aimee-os.org/gentoo/${stage3}:${version}" \ - "aimee-os.org/gentoo/${stage3}:latest" diff --git a/lib/bootstrap.sh b/lib/bootstrap.sh deleted file mode 100755 index e2fe3cd..0000000 --- a/lib/bootstrap.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -set -e - -mkdir -p /mnt/gentoo - -USE=build \ -emerge -kvnuUDj --rebuilt-binaries=y --root=/mnt/gentoo sys-apps/baselayout - -# Portage itself only requires Python and Bash. Actually building -# packages requires a lot more. These dependencies are implicit because -# they are listed in @system. We do not want everything from @system, -# though, so we have to explicitly install several packages. -# -# At some point, we may end up with an Aimee OS profile for Portage. -# If/when that happens, we can override @system to remove the stuff we -# don't want, like virtual/service-manager and virtual/openssh. -xargs emerge -kvnuUDj --rebuilt-binaries=y --root=/mnt/gentoo < /var/db/repos/crossdev/profiles/repo_name -echo 'masters = gentoo' > /var/db/repos/crossdev/metadata/layout.conf -chown -R portage:portage /var/db/repos/crossdev -mkdir -p /etc/portage/repos.conf -cat > /etc/portage/repos.conf/crossdev.conf < /etc/portage/package.accept-keywords/rust-cross -echo 'dev-lang/rust rust-src' \ - > /etc/portage/package.use/rust-src -case ${target%%-*} in -aarch64) - llvm_target=AArch64 - ;; -arm*) - llvm_target=ARM - ;; -*) - printf 'Unknown LLVM target: %s' "${target%%-*}" - exit 1 - ;; -esac -printf '( %s:%s:%s )\n' \ - "${llvm_target}" \ - "${target}" \ - "${target}" \ - >> /etc/portage/env/dev-lang/rust -emerge -vbknuUj cross-${target}/rust-std diff --git a/lib/profile.sh b/lib/profile.sh deleted file mode 100755 index 2c4cdfc..0000000 --- a/lib/profile.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -arch=$(uname -m) -case ${arch} in -x86_64) arch=amd64 ;; -aarch64) arch=arm64 ;; -esac - -mkdir -p /etc/portage - -eselect profile set default/linux/"${arch}"/23.0/no-multilib diff --git a/lib/tools.sh b/lib/tools.sh deleted file mode 100755 index ac4d8fa..0000000 --- a/lib/tools.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -xargs -r emerge -vnuUj --rebuilt-binaries=y < (09 Feb 2023) -# Do not build binary packages for kernel sources -sys-kernel/gentoo-sources nobuildpkg -sys-kernel/raspberrypi-sources nobuildpkg diff --git a/portage/package.use/btrfs-progs b/portage/package.use/btrfs-progs deleted file mode 100644 index eca7fed..0000000 --- a/portage/package.use/btrfs-progs +++ /dev/null @@ -1 +0,0 @@ -sys-fs/btrfs-progs -man diff --git a/portage/package.use/git b/portage/package.use/git deleted file mode 100644 index 46e62d2..0000000 --- a/portage/package.use/git +++ /dev/null @@ -1 +0,0 @@ -dev-vcs/git -perl diff --git a/portage/package.use/grub b/portage/package.use/grub deleted file mode 100644 index e032517..0000000 --- a/portage/package.use/grub +++ /dev/null @@ -1 +0,0 @@ -sys-boot/grub -* GRUB_PLATFORMS: -* diff --git a/portage/package.use/kernel b/portage/package.use/kernel deleted file mode 100644 index 5f091c9..0000000 --- a/portage/package.use/kernel +++ /dev/null @@ -1,2 +0,0 @@ -sys-kernel/gentoo-sources symlink -sys-kernel/raspberrypi-sources symlink diff --git a/portage/package.use/qemu b/portage/package.use/qemu deleted file mode 100644 index ab67f81..0000000 --- a/portage/package.use/qemu +++ /dev/null @@ -1,5 +0,0 @@ -# vim: set ft=gentoo-package-use : - -# Dustin C. Hatch (11 Dec 2024) -# Build a minimal QEMU for chrooting into the target environment -app-emulation/qemu -* QEMU_USER_TARGETS: aarch64 PYTHON_TARGETS: python3_12 diff --git a/portage/package.use/selinux b/portage/package.use/selinux deleted file mode 100644 index 14ea6e0..0000000 --- a/portage/package.use/selinux +++ /dev/null @@ -1,2 +0,0 @@ -sys-libs/libselinux python -sys-process/audit python diff --git a/portage/package.use/squashfs-tools b/portage/package.use/squashfs-tools deleted file mode 100644 index 27ddfb0..0000000 --- a/portage/package.use/squashfs-tools +++ /dev/null @@ -1 +0,0 @@ -sys-fs/squashfs-tools zstd diff --git a/portage/package.use/systemd b/portage/package.use/systemd deleted file mode 100644 index a0d6dce..0000000 --- a/portage/package.use/systemd +++ /dev/null @@ -1,6 +0,0 @@ -sys-apps/dbus systemd -sys-apps/systemd -* PYTHON_SINGLE_TARGET: python3_12 -sec-policy/selinux-base systemd -sec-policy/selinux-base-policy systemd -virtual/tmpfiles systemd -virtual/udev systemd diff --git a/lib/sync.sh b/sync.sh similarity index 100% rename from lib/sync.sh rename to sync.sh diff --git a/tools/fetch-stage3.sh b/tools/fetch-stage3.sh deleted file mode 100644 index 011f1f5..0000000 --- a/tools/fetch-stage3.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -: "${GENTOO_MIRROR:=http://mirror.leaseweb.com/gentoo}" -URLPATH=releases/amd64/autobuilds -GENTOO_KEY=13EBBDBEDE7A12775DFDB1BABB572E0E2D182910 -GENTOO_KEYSERVER=hkps://keys.gentoo.org - -stage3="${1:-amd64-nomultilib-openrc}" - -set -e - -gpg --keyserver ${GENTOO_KEYSERVER} --recv-keys ${GENTOO_KEY} -curl -fLO "${GENTOO_MIRROR}/${URLPATH}/latest-stage3-${stage3}.txt" -gpg --verify "latest-stage3-${stage3}.txt" - -tarball=$(gpg --decrypt "latest-stage3-${stage3}.txt" | awk '$1!="#"{print $1}') -if [ ! -f "${tarball##*/}" ]; then - curl -fLO "${GENTOO_MIRROR}/${URLPATH}/${tarball}" -fi -if [ ! -f "${tarball##*/}.asc" ]; then - curl -fLO "${GENTOO_MIRROR}/${URLPATH}/${tarball}.asc" -fi -gpg --verify "${tarball##*/}.asc" -echo "${tarball##*/}"