From 7f545440ad60e34be87080e2be057a917ae876cf Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 30 Aug 2025 13:32:08 -0500 Subject: [PATCH] Initial commit --- .gitignore | 1 + airplaypi_defconfig.in | 27 +++++++++++++++ ci/Jenkinsfile | 77 ++++++++++++++++++++++++++++++++++++++++++ ci/podTemplate.yaml | 19 +++++++++++ 4 files changed, 124 insertions(+) create mode 100644 .gitignore create mode 100644 airplaypi_defconfig.in create mode 100644 ci/Jenkinsfile create mode 100644 ci/podTemplate.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9df48eb --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/airplaypi_defconfig diff --git a/airplaypi_defconfig.in b/airplaypi_defconfig.in new file mode 100644 index 0000000..186382a --- /dev/null +++ b/airplaypi_defconfig.in @@ -0,0 +1,27 @@ +BR2_arm=y +BR2_cortex_a53=y +BR2_ARM_FPU_NEON_VFPV4=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y +BR2_GLOBAL_PATCH_DIR="board/raspberrypi/patches" +BR2_DOWNLOAD_FORCE_CHECK_HASHES=y +BR2_INIT_SYSTEMD=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_AIMEEOS_PATH)/board/raspberrypi3/post-image.sh" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y +BR2_LINUX_KERNEL_DEFCONFIG="bcm2709" +BR2_LINUX_KERNEL_ZSTD=y +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2710-rpi-3-b broadcom/bcm2710-rpi-3-b-plus broadcom/bcm2710-rpi-cm3" +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +# BR2_PACKAGE_BUSYBOX is not set +BR2_PACKAGE_XZ=y +BR2_PACKAGE_RPI_FIRMWARE=y +BR2_PACKAGE_RPI_FIRMWARE_BOOTCODE_BIN=y +BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI=y +BR2_PACKAGE_RPI_FIRMWARE_CMDLINE_FILE="$(BR2_EXTERNAL_AIMEEOS_PATH)/board/raspberrypi3/cmdline.txt" +BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="$(BR2_EXTERNAL_AIMEEOS_PATH)/board/raspberrypi3/config.txt" +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="rpi_3_32b" +BR2_PACKAGE_HOST_KMOD_XZ=y +AIMEEOS=y +AIMEEOS_RPI=y diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile new file mode 100644 index 0000000..f3f8e58 --- /dev/null +++ b/ci/Jenkinsfile @@ -0,0 +1,77 @@ +pipeline { + parameters { + booleanParam 'CLEAN_BUILD' + string 'CUSTOM_TARGET' + } + + options { + disableConcurrentBuilds() + } + + agent { + kubernetes { + yamlFile 'ci/podTemplate.yaml' + yamlMergeStrategy merge() + workspaceVolume persistentVolumeClaimWorkspaceVolume( + claimName: 'buildroot-airplaypi' + ) + defaultContainer 'build' + } + } + + environment { + BR2_CCACHE_DIR = "${env.JENKINS_AGENT_WORKDIR}/br2-ccache" + } + + stages { + stage('Clean') { + when { + expression { + return params.CLEAN_BUILD + } + } + steps { + sh 'git clean -fdx' + } + } + + stage('Prepare') { + steps { + container('jnlp') { + sh 'if [ ! -d buildroot ]; then git clone https://gitlab.com/buildroot.org/buildroot.git -b 2025.05.x --depth 1; else git -C buildroot pull; fi' + sh 'if [ ! -d aimee-os ]; then git clone https://git.pyrocufflink.net/AimeeOS/aimee-os.git --depth 1; else git -C aimee-os pull; fi' + } + } + } + + stage('Build') { + steps { + sh '{ cat airplaypi_defconfig.in ; grep BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION buildroot/configs/raspberrypi3_defconfig; } > airplaypi_defconfig' + sh 'make -C buildroot O="${PWD}"/_build BR2_EXTERNAL="${PWD}/aimee-os" defconfig BR2_DEFCONFIG="${PWD}"/airplaypi_defconfig' + script { + if (params.CUSTOM_TARGET) { + sh "make -C _build '${CUSTOM_TARGET}'" + } + } + sh 'make -C _build' + } + post { + success { + dir('_build') { + archiveArtifacts('.config') + } + dir('_build/images') { + sh 'zstd -f firmware.img' + sh 'zstd -f sdcard.img' + archiveArtifacts([ + 'firmware.img.zst', + 'rootfs.squashfs', + 'sdcard.img.zst', + 'update.tar.zst', + ].join(',')) + } + } + } + } + } +} diff --git a/ci/podTemplate.yaml b/ci/podTemplate.yaml new file mode 100644 index 0000000..a15cc3b --- /dev/null +++ b/ci/podTemplate.yaml @@ -0,0 +1,19 @@ +spec: + containers: + - name: build + image: git.pyrocufflink.net/containerimages/buildroot + resources: + limits: &resources + cpu: 6 + memory: 12Gi + requests: *resources + volumeMounts: + - mountPath: /etc/ssh/ssh_known_hosts + name: ssh-known-hosts + subPath: ssh_known_hosts + securityContext: + fsGroupChangePolicy: OnRootMismatch + volumes: + - name: ssh-known-hosts + configMap: + name: ssh-known-hosts