From 025bf8be342a4811d3abce124447a4f1b0241ddc 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 | 2 + airplaypi_defconfig.in | 28 ++++++++++ ci/Jenkinsfile | 115 +++++++++++++++++++++++++++++++++++++++++ ci/defconfig.sh | 11 ++++ ci/podTemplate.yaml | 19 +++++++ 5 files changed, 175 insertions(+) create mode 100644 .gitignore create mode 100644 airplaypi_defconfig.in create mode 100644 ci/Jenkinsfile create mode 100644 ci/defconfig.sh create mode 100644 ci/podTemplate.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9352653 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/_build +/airplaypi_defconfig diff --git a/airplaypi_defconfig.in b/airplaypi_defconfig.in new file mode 100644 index 0000000..3842af4 --- /dev/null +++ b/airplaypi_defconfig.in @@ -0,0 +1,28 @@ +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_TARGET_GENERIC_HOSTNAME="airplaypi" +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_CONFIG_FILE="$(BR2_EXTERNAL_AIMEEOS_PATH)/board/raspberrypi3/config.txt" +BR2_PACKAGE_RPI_FIRMWARE_CMDLINE_FILE="$(BR2_EXTERNAL_AIMEEOS_PATH)/board/raspberrypi3/cmdline.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..d3c9534 --- /dev/null +++ b/ci/Jenkinsfile @@ -0,0 +1,115 @@ +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 { + checkout( + poll: false, + scm: scmGit( + branches: [[name: 'refs/tags/2025.05.1']], + browser: gitLab('https://gitlab.com/buildroot.org/buildroot/'), + extensions: [ + [ + $class: 'RelativeTargetDirectory', + relativeTargetDir: 'buildroot', + ], + cloneOption( + shallow: true, + depth: 1, + ), + ], + userRemoteConfigs: [[ + url: 'https://gitlab.com/buildroot.org/buildroot.git', + ]], + ) + ) + checkout( + poll: false, + scm: scmGit( + branches: [[name: 'refs/heads/master']], + browser: [ + $class: 'GiteaBrowser', + repoUrl: 'https://git.pyrocufflink.net/AimeeOS/aimee-os' + ], + extensions: [ + [ + $class: 'RelativeTargetDirectory', + relativeTargetDir: 'aimee-os', + ], + cloneOption( + shallow: true, + depth: 1, + ), + ], + userRemoteConfigs: [[ + url: 'https://git.pyrocufflink.net/AimeeOS/aimee-os.git', + ]], + ) + ) + } + } + + stage('Build') { + steps { + sh '. ci/defconfig.sh' + 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.zstd', + ].join(',')) + } + } + } + } + } +} diff --git a/ci/defconfig.sh b/ci/defconfig.sh new file mode 100644 index 0000000..ba4d085 --- /dev/null +++ b/ci/defconfig.sh @@ -0,0 +1,11 @@ +#!/bin/sh +{ + cat airplaypi_defconfig.in + grep BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION buildroot/configs/raspberrypi3_defconfig +} > airplaypi_defconfig +make \ + -C buildroot \ + O="${PWD}"/_build \ + BR2_EXTERNAL="${PWD}/aimee-os" \ + defconfig \ + BR2_DEFCONFIG="${PWD}"/airplaypi_defconfig 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