diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17fe09d..2f4eea6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,9 @@ jobs: - os: raspberrypizero2w arch: aarch64 artifact: vanilla-raspberrypizero2w-image.zip + - os: orangepi_zero2w + arch: aarch64 + artifact: vanilla-orangepi_zero2w-image.zip - os: orangepi_zero3 arch: aarch64 artifact: vanilla-orangepi_zero3-image.zip @@ -76,7 +79,7 @@ jobs: tar czf ${{ matrix.platform.artifact }} -C "${{ github.workspace }}/build" . - name: Archive (Windows/macOS/Raspberry Pi/Nintendo Switch) - if: ${{ matrix.platform.os == 'windows' || matrix.platform.os == 'macos' || matrix.platform.os == 'raspberrypi0w' || matrix.platform.os == 'raspberrypizero2w' || matrix.platform.os == 'nintendoswitch' || matrix.platform.os == 'orangepi_zero3' }} + if: ${{ matrix.platform.os == 'windows' || matrix.platform.os == 'macos' || matrix.platform.os == 'raspberrypi0w' || matrix.platform.os == 'raspberrypizero2w' || matrix.platform.os == 'nintendoswitch' || matrix.platform.os == 'orangepi_zero3' || matrix.platform.os == 'orangepi_zero2w' }} run: | cd build zip -r ../${{ matrix.platform.artifact }} . diff --git a/buildroot/board/orangepizero3/linux-orangepi-zero3-extra.config b/buildroot/board/orangepizero3/linux-orangepi-zero3-extra.config new file mode 100644 index 0000000..6452665 --- /dev/null +++ b/buildroot/board/orangepizero3/linux-orangepi-zero3-extra.config @@ -0,0 +1,9 @@ +# Extra kernel config fragment for the Orange Pi Zero 3 (H618) vendor kernel. +# +# The vendor's drivers/net/phy/sunxi-ephy.c is compiled into libphy +# unconditionally and hardcodes `#if 1` in place of the original +# CONFIG_MFD_ACX00 / CONFIG_ARCH_SUN50IW9 guards, so it always references +# ac200_enable() and sun50i_ephy_calibrate_value() from drivers/mfd/sunxi-ac200.c. +# Those symbols only exist when MFD_AC200 is built, so vmlinux fails to link +# without it. The stock linux_sunxi64_defconfig omits MFD_AC200. +CONFIG_MFD_AC200=y diff --git a/buildroot/configs/vanilla_orangepi_zero2w_defconfig b/buildroot/configs/vanilla_orangepi_zero2w_defconfig new file mode 100644 index 0000000..b962633 --- /dev/null +++ b/buildroot/configs/vanilla_orangepi_zero2w_defconfig @@ -0,0 +1,72 @@ +BR2_aarch64=y +BR2_ARM_FPU_VFPV4=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y +BR2_GCC_VERSION_13_X=y +BR2_TOOLCHAIN_BUILDROOT_CXX=y +BR2_GLOBAL_PATCH_DIR="board/orangepi/orangepi-zero2w/patches $(BR2_EXTERNAL_VANILLA_PATH)/board/orangepizero3/patches" +BR2_TARGET_GENERIC_ISSUE="Welcome to Orangepi Zero2W" +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y +# BR2_TARGET_GENERIC_GETTY is not set +BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_VANILLA_PATH)/board/orangepizero3/rootfs/" +BR2_ROOTFS_POST_BUILD_SCRIPT="board/orangepi/common/post-build.sh $(BR2_EXTERNAL_VANILLA_PATH)/board/orangepizero3/post_build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BINARIES_DIR)/genimage.cfg" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_GIT=y +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/orangepi-xunlong/linux-orangepi.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="orange-pi-6.1-sun50iw9" +BR2_LINUX_KERNEL_DEFCONFIG="linux_sunxi64" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_VANILLA_PATH)/board/orangepizero3/linux-orangepi-zero3-extra.config" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun50i-h618-orangepi-zero2w" +BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y +BR2_LINUX_KERNEL_INSTALL_TARGET=y +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +BR2_PACKAGE_MESA3D=y +BR2_PACKAGE_MESA3D_LLVM=y +BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_PANFROST=y +BR2_PACKAGE_MESA3D_OPENGL_EGL=y +BR2_PACKAGE_MESA3D_OPENGL_ES=y +BR2_PACKAGE_LINUX_FIRMWARE=y +BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT2XX=y +BR2_PACKAGE_LINUX_FIRMWARE_RTL_RTW88=y +BR2_PACKAGE_ALSA_LIB=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="1000M" +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.11" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="sun50i_h616" +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_GIT=y +BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/orangepi-xunlong/u-boot-orangepi.git" +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="v2024.01" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="orangepi_zero2w" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y +BR2_TARGET_UBOOT_NEEDS_GNUTLS=y +BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y +BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" +BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_UBOOT_TOOLS=y +BR2_PACKAGE_OPI_FFMPEG=y +BR2_PACKAGE_OPI_FFMPEG_GPL=y +# BR2_PACKAGE_OPI_FFMPEG_FFMPEG is not set +BR2_PACKAGE_OPI_FFMPEG_SWSCALE=y +BR2_PACKAGE_OPI_FFMPEG_ENCODERS="png" +BR2_PACKAGE_OPI_FFMPEG_DECODERS="h264" +BR2_PACKAGE_OPI_FFMPEG_MUXERS="mp4 image2" +BR2_PACKAGE_OPI_FFMPEG_DEMUXERS="" +BR2_PACKAGE_OPI_FFMPEG_PARSERS="" +BR2_PACKAGE_OPI_FFMPEG_BSFS="" +BR2_PACKAGE_OPI_FFMPEG_PROTOCOLS="" +BR2_PACKAGE_OPI_FFMPEG_FILTERS="" +# BR2_PACKAGE_OPI_FFMPEG_INDEVS is not set +# BR2_PACKAGE_OPI_FFMPEG_OUTDEVS is not set +BR2_PACKAGE_VANILLA=y diff --git a/buildroot/configs/vanilla_orangepi_zero3_defconfig b/buildroot/configs/vanilla_orangepi_zero3_defconfig index c195bc2..bbd1a59 100644 --- a/buildroot/configs/vanilla_orangepi_zero3_defconfig +++ b/buildroot/configs/vanilla_orangepi_zero3_defconfig @@ -17,17 +17,15 @@ BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/orangepi-xunlong/linux-orangepi.git" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="orange-pi-6.1-sun50iw9" BR2_LINUX_KERNEL_DEFCONFIG="linux_sunxi64" -BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="/home/matt/src/brout/opizero3/linux-orangepi-zero3-extra.config" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_VANILLA_PATH)/board/orangepizero3/linux-orangepi-zero3-extra.config" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun50i-h618-orangepi-zero3" BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y -BR2_PACKAGE_KMSCUBE=y BR2_PACKAGE_MESA3D=y BR2_PACKAGE_MESA3D_LLVM=y BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_PANFROST=y -BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y BR2_PACKAGE_MESA3D_OPENGL_EGL=y BR2_PACKAGE_MESA3D_OPENGL_ES=y BR2_PACKAGE_LINUX_FIRMWARE=y diff --git a/docker/orangepi_zero2w/Dockerfile b/docker/orangepi_zero2w/Dockerfile new file mode 100644 index 0000000..ed3e697 --- /dev/null +++ b/docker/orangepi_zero2w/Dockerfile @@ -0,0 +1,50 @@ +FROM docker.io/debian:trixie + +ARG ARCH=x86_64 +ENV ARCH=${ARCH} + +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=Etc/UTC + +RUN apt -y update && \ + apt -y install which \ + sed \ + make \ + binutils \ + build-essential \ + diffutils \ + gcc \ + g++ \ + bash \ + patch \ + gzip \ + bzip2 \ + perl \ + tar \ + cpio \ + unzip \ + rsync \ + file \ + bc \ + findutils \ + gawk \ + wget \ + git && \ + apt-get clean && \ + apt-get autoremove --yes && \ + rm -rf /var/lib/{apt,dpkg,cache,log}/ + +RUN git clone --depth 1 --branch 2025.11-rc2 https://github.com/buildroot/buildroot.git /buildroot + +ENV FORCE_UNSAFE_CONFIGURE=1 + +# Build everything except for Vanilla +COPY buildroot /vanilla/buildroot +RUN make -C /buildroot O=/build BR2_EXTERNAL=/vanilla/buildroot vanilla_orangepi_zero2w_defconfig && \ + /buildroot/utils/config --file /build/.config -d BR2_PACKAGE_VANILLA && \ + make -C /buildroot O=/build && \ + /buildroot/utils/config --file /build/.config -e BR2_PACKAGE_VANILLA && \ + /buildroot/utils/config --file /build/.config -e BR2_PACKAGE_VANILLA_USE_LOCAL && \ + /buildroot/utils/config --file /build/.config --set-str BR2_PACKAGE_VANILLA_LOCAL_PATH /vanilla + +ENTRYPOINT [ "/vanilla/docker/orangepi_zero2w/build.sh" ] diff --git a/docker/orangepi_zero2w/build.sh b/docker/orangepi_zero2w/build.sh new file mode 100755 index 0000000..fb13db2 --- /dev/null +++ b/docker/orangepi_zero2w/build.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +make -C /buildroot O=/build + +cd /build/images +mv /build/images/sdcard.img /install/