From a0f51ceffa5bca8f106e82ef5b449bdb9ae62e79 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 17 Nov 2023 13:48:03 -0500 Subject: [PATCH 1/4] rpi-kernel: update to 6.1.69, adopt. - add rpi5 support and optimised kernel - add support for BTRFS root - add /proc/config.gz by default --- .../rpi-kernel/patches/irqsoff-tracer.patch | 91 +++++++ srcpkgs/rpi-kernel/template | 225 +++++++++++------- srcpkgs/rpi-kernel/update | 2 + srcpkgs/rpi5-kernel | 1 + srcpkgs/rpi5-kernel-headers | 1 + 5 files changed, 239 insertions(+), 81 deletions(-) create mode 100644 srcpkgs/rpi-kernel/patches/irqsoff-tracer.patch create mode 100644 srcpkgs/rpi-kernel/update create mode 120000 srcpkgs/rpi5-kernel create mode 120000 srcpkgs/rpi5-kernel-headers diff --git a/srcpkgs/rpi-kernel/patches/irqsoff-tracer.patch b/srcpkgs/rpi-kernel/patches/irqsoff-tracer.patch new file mode 100644 index 0000000000000..09501632fd8dc --- /dev/null +++ b/srcpkgs/rpi-kernel/patches/irqsoff-tracer.patch @@ -0,0 +1,91 @@ +From 342c7ee49e862edc30c893f141f55b9211b7a43b Mon Sep 17 00:00:00 2001 +From: Yangyu Chen +Date: Mon, 18 Dec 2023 23:26:59 +0800 +Subject: [PATCH] configs: rpi: Disable CONFIG_IRQSOFF_TRACER by default + +This configuration hindered performance by ~74% measured from RPI 4B +from ~680Mbps to ~390Mbps when benchmarking wireguard locally using +netns and iperf3. Remove it by default for better performance. + +Signed-off-by: Yangyu Chen +--- + arch/arm/configs/bcm2709_defconfig | 1 - + arch/arm/configs/bcm2711_defconfig | 1 - + arch/arm/configs/bcmrpi_defconfig | 1 - + arch/arm64/configs/bcm2711_defconfig | 1 - + arch/arm64/configs/bcm2712_defconfig | 1 - + arch/arm64/configs/bcmrpi3_defconfig | 1 - + 6 files changed, 6 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 980e70d0178fa..c8aa65e82d8bb 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1586,7 +1586,6 @@ CONFIG_DETECT_HUNG_TASK=y + CONFIG_LATENCYTOP=y + CONFIG_FUNCTION_PROFILER=y + CONFIG_STACK_TRACER=y +-CONFIG_IRQSOFF_TRACER=y + CONFIG_SCHED_TRACER=y + CONFIG_BLK_DEV_IO_TRACE=y + # CONFIG_UPROBE_EVENTS is not set +diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig +index 806c6d81590a6..2578d23b1886e 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -1613,7 +1613,6 @@ CONFIG_DETECT_HUNG_TASK=y + CONFIG_LATENCYTOP=y + CONFIG_FUNCTION_PROFILER=y + CONFIG_STACK_TRACER=y +-CONFIG_IRQSOFF_TRACER=y + CONFIG_SCHED_TRACER=y + CONFIG_BLK_DEV_IO_TRACE=y + # CONFIG_UPROBE_EVENTS is not set +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index fad465fe4c70e..a2519b5abb6d6 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1580,7 +1580,6 @@ CONFIG_DETECT_HUNG_TASK=y + CONFIG_LATENCYTOP=y + CONFIG_FUNCTION_PROFILER=y + CONFIG_STACK_TRACER=y +-CONFIG_IRQSOFF_TRACER=y + CONFIG_SCHED_TRACER=y + CONFIG_BLK_DEV_IO_TRACE=y + # CONFIG_UPROBE_EVENTS is not set +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index 819c442e5acfe..afbd8ef3e8d3b 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -1675,7 +1675,6 @@ CONFIG_DETECT_HUNG_TASK=y + CONFIG_LATENCYTOP=y + CONFIG_FUNCTION_PROFILER=y + CONFIG_STACK_TRACER=y +-CONFIG_IRQSOFF_TRACER=y + CONFIG_SCHED_TRACER=y + CONFIG_BLK_DEV_IO_TRACE=y + # CONFIG_UPROBE_EVENTS is not set +diff --git a/arch/arm64/configs/bcm2712_defconfig b/arch/arm64/configs/bcm2712_defconfig +index 15a0aa6c77137..76effcbc199b5 100644 +--- a/arch/arm64/configs/bcm2712_defconfig ++++ b/arch/arm64/configs/bcm2712_defconfig +@@ -1678,7 +1678,6 @@ CONFIG_DETECT_HUNG_TASK=y + CONFIG_LATENCYTOP=y + CONFIG_FUNCTION_PROFILER=y + CONFIG_STACK_TRACER=y +-CONFIG_IRQSOFF_TRACER=y + CONFIG_SCHED_TRACER=y + CONFIG_BLK_DEV_IO_TRACE=y + # CONFIG_UPROBE_EVENTS is not set +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index d3d879d03ff45..6fca561ba4084 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -1561,7 +1561,6 @@ CONFIG_DETECT_HUNG_TASK=y + CONFIG_LATENCYTOP=y + CONFIG_FUNCTION_PROFILER=y + CONFIG_STACK_TRACER=y +-CONFIG_IRQSOFF_TRACER=y + CONFIG_SCHED_TRACER=y + CONFIG_BLK_DEV_IO_TRACE=y + # CONFIG_UPROBE_EVENTS is not set diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template index 2fa1bb54b683e..704cc1f6646ce 100644 --- a/srcpkgs/rpi-kernel/template +++ b/srcpkgs/rpi-kernel/template @@ -12,19 +12,21 @@ # # Upstream documentation: https://www.raspberrypi.com/documentation/computers/linux_kernel.html pkgname=rpi-kernel -version=6.1.54 +version=6.1.69 revision=1 -_githash=fad58933544bb2a7b7db92847c25c79a83171fa6 +_githash=aabc6f6d0b13ac177f9b383e59a542ddb6c32e59 archs="armv6l* armv7l* aarch64*" hostmakedepends="perl kmod uboot-mkimage openssl-devel bc bison flex xz" makedepends="ncurses-devel" short_desc="Linux kernel for Raspberry Pi (${version%.*} series)" -maintainer="Piraty " +maintainer="classabbyamp " license="GPL-2.0-only" homepage="http://www.kernel.org" distfiles="https://github.com/raspberrypi/linux/archive/${_githash}.tar.gz" -checksum=1bd02902fae49351fb16ac0d5ccc3bf4d67aa0640006dbbf8846963519b01ab8 +checksum=31a39457e4f3075bf7a1113aae17f9a17241b425aa194639c886bc639cf1da5d python_version=3 +provides="rpi-kernel-${version}_${revision}" +replaces="rpi5-kernel>=0" _kernver="${version}_${revision}" @@ -51,28 +53,20 @@ case "$XBPS_TARGET_MACHINE" in *) broken="No Raspberry Pi exists for this arch" ;; esac +make_build_args=("-j$XBPS_MAKEJOBS" "ARCH=$_arch") +make_install_args=("-j$XBPS_MAKEJOBS" "ARCH=$_arch") + if [ "$CROSS_BUILD" ]; then - _cross="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-" -else - _cross= + make_build_args+=("CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-") fi -do_configure() { - local target defconfig - - case "$XBPS_TARGET_MACHINE" in - # for zero, 1 - armv6l*) target=bcmrpi_defconfig ;; - # for 2 - armv7l*) target=bcm2709_defconfig ;; - # for 3, 4, zero 2 - aarch64*) target=bcm2711_defconfig ;; - esac +_configure() { + local target="$1" defconfig defconfig="arch/${_arch}/configs/${target}" cp "$defconfig" .config - cat <<-! > "foo" + cat <<-! > void.config CONFIG_CONNECTOR=y CONFIG_HID_STEAM=y CONFIG_PROC_EVENTS=y @@ -113,15 +107,21 @@ do_configure() { CONFIG_LZ4_COMPRESS=y CONFIG_CRYPTO_RNG=y CONFIG_CRYPTO_RNG_DEFAULT=y + CONFIG_BTRFS_FS=y + CONFIG_BTRFS_POSIX_ACL=y + CONFIG_IKCONFIG=y + CONFIG_IKCONFIG_PROC=y + CONFIG_LEDS_TRIGGER_ACTIVITY=m ! while read -r line; do + local option="" str="" cmd="" # skip comments case "$line" in "#"*) continue;; esac - local option=${line%%=*} str= - local cmd="$(echo "$line" | cut -d= -f2)" + option="${line%%=*}" + cmd="$(echo "$line" | cut -d= -f2)" case "$cmd" in y) cmd="enable";; n) cmd="disable";; @@ -135,31 +135,27 @@ do_configure() { ./scripts/config \ --file .config \ "--$cmd" "$option" "${str//\"/}" - done < foo + done < void.config - make "${makejobs}" "${_cross}" ARCH="${_arch}" olddefconfig + make "${make_build_args[@]}" olddefconfig } -do_build() { - make "${makejobs}" "${_cross}" ARCH="${_arch}" prepare - make "${makejobs}" "${_cross}" ARCH="${_arch}" "${_image_target}" modules dtbs -} - -do_install() { - local hdrdest="${DESTDIR}/usr/src/${sourcepkg}-headers-${_kernver}" +_install() { + local _pkg="$1" _destdir="$2" + local hdrdest="usr/src/${_pkg}-headers-${_kernver}" # Run depmod after compressing modules. vsed -i -e '2iexit 0' scripts/depmod.sh # Install kernel, firmware and modules - make "${makejobs}" ARCH="${_arch}" INSTALL_MOD_PATH="${DESTDIR}" modules_install + make "${make_install_args[@]}" INSTALL_MOD_PATH="${_destdir}" modules_install # Install device tree blobs - make "${makejobs}" "ARCH=${_arch}" INSTALL_DTBS_PATH="${DESTDIR}/boot" dtbs_install + make "${make_install_args[@]}" INSTALL_DTBS_PATH="${_destdir}/boot" dtbs_install # move dtbs that ended up in /boot/broadcom - if [ -d "${DESTDIR}/boot/broadcom" ]; then - mv "${DESTDIR}"/boot/broadcom/*dtb "${DESTDIR}/boot" + if [ -d "${_destdir}/boot/broadcom" ]; then + mv "${_destdir}"/boot/broadcom/*dtb "${_destdir}/boot" fi # Install kernel image @@ -167,96 +163,118 @@ do_install() { # Switch to /usr. vmkdir usr - mv "${DESTDIR}/lib" "${DESTDIR}/usr" + mv "${_destdir}/lib" "${_destdir}/usr" - pushd "${DESTDIR}/usr/lib/modules/${_kernver}" + pushd "${_destdir}/usr/lib/modules/${_kernver}" rm -f source build - ln -sf "../../../src/${sourcepkg}-headers-${_kernver}" build + ln -sf "../../../src/${_pkg}-headers-${_kernver}" build popd # Install required headers to build external modules - install -Dm644 Makefile "${hdrdest}/Makefile" - install -Dm644 Kbuild "${hdrdest}/Kbuild" - install -Dm644 kernel/Makefile "${hdrdest}/kernel/Makefile" - install -Dm644 .config "${hdrdest}/.config" - while read -r file; do - mkdir -p "${hdrdest}/$(dirname "$file")" - install -Dm644 "$file" "${hdrdest}/${file}" - done < <(find . -name 'Kconfig*') - while read -r file; do - mkdir -p "${hdrdest}/$(dirname $file)" - install -Dm644 "$file" "${hdrdest}/${file}" - done < <(find "arch/${_arch}" scripts -name module.lds -o -name Kbuild.platforms -o -name Platform) - mkdir -p "${hdrdest}/include" + vinstall Makefile 644 "${hdrdest}" + vinstall Kbuild 644 "${hdrdest}" + vinstall kernel/Makefile 644 "${hdrdest}/kernel" + vinstall .config 644 "${hdrdest}" + find . -name 'Kconfig*' | \ + while read -r file; do + vinstall "$file" 644 "${hdrdest}/$(dirname "$file")" + done + find "arch/${_arch}" scripts -name module.lds -o -name Kbuild.platforms -o -name Platform | \ + while read -r file; do + vinstall "$file" 644 "${hdrdest}/$(dirname "$file")" + done + vmkdir "${hdrdest}/include" # Remove firmware stuff provided by the "linux-firmware" pkg. - rm -rf "${DESTDIR}/usr/lib/firmware" + rm -rf "${_destdir}/usr/lib/firmware" - for i in acpi asm-generic clocksource config crypto drm dt-bindings generated linux \ + for d in acpi asm-generic clocksource config crypto drm dt-bindings generated linux \ math-emu media net pcmcia scsi sound trace uapi vdso video xen; do - [ -d include/$i ] && cp -a "include/$i" "${hdrdest}/include" + [ -d include/$d ] && vcopy "include/$d" "${hdrdest}/include" done # Remove helper binaries built for host, # if generated files from the scripts/ directory need to be included, # they need to be copied to ${hdrdest} before this step if [ "$CROSS_BUILD" ]; then - make "${makejobs}" ARCH="${_arch}" _mrproper_scripts + make "${make_install_args[@]}" _mrproper_scripts # remove host specific objects as well find scripts -name '*.o' -delete fi # Copy files necessary for later builds. - cp Module.symvers "${hdrdest}" - cp -a scripts "${hdrdest}" - mkdir -p "${hdrdest}/security/selinux" - cp -a security/selinux/include "${hdrdest}/security/selinux" - mkdir -p "${hdrdest}/tools/include" - cp -a tools/include/tools "${hdrdest}/tools/include" + vinstall Module.symvers 644 "${hdrdest}" + vcopy scripts "${hdrdest}" + vmkdir "${hdrdest}/security/selinux" + vcopy security/selinux/include "${hdrdest}/security/selinux" + vmkdir "${hdrdest}/tools/include" + vcopy tools/include/tools "${hdrdest}/tools/include" if [ -d "arch/${_arch}/tools" ]; then - cp -a "arch/${_arch}/tools" "${hdrdest}/arch/${_arch}" + vcopy "arch/${_arch}/tools" "${hdrdest}/arch/${_arch}" fi - cp -a kernel/time/timeconst.bc "${hdrdest}/kernel/time" - cp -a kernel/bounds.c "${hdrdest}/kernel" - mkdir -p "${hdrdest}/arch/x86/entry/syscalls" - cp -a arch/x86/entry/syscalls/syscall_32.tbl "${hdrdest}/arch/x86/entry/syscalls" + vinstall kernel/time/timeconst.bc 644 "${hdrdest}/kernel/time" + vinstall kernel/bounds.c 644 "${hdrdest}/kernel" + vinstall arch/x86/entry/syscalls/syscall_32.tbl 644 "${hdrdest}/arch/x86/entry/syscalls" # copy arch includes for external modules - mkdir -p "${hdrdest}/arch/${_arch}" - cp -a "arch/${_arch}/include" "${hdrdest}/arch/${_arch}" + vmkdir "${hdrdest}/arch/${_arch}" + vcopy "arch/${_arch}/include" "${hdrdest}/arch/${_arch}" mkdir -p "${hdrdest}/arch/${_arch}/kernel" - cp "arch/${_arch}/Makefile" "${hdrdest}/arch/${_arch}" - cp "arch/${_arch}/kernel/asm-offsets.s" "${hdrdest}/arch/${_arch}/kernel" + vinstall "arch/${_arch}/Makefile" 644 "${hdrdest}/arch/${_arch}" + vinstall "arch/${_arch}/kernel/asm-offsets.s" 644 "${hdrdest}/arch/${_arch}/kernel" if [ "$_arch" = "arm64" ] ; then - cp -a "arch/${_arch}/kernel/vdso" "${hdrdest}/arch/${_arch}/kernel/" + vcopy "arch/${_arch}/kernel/vdso" "${hdrdest}/arch/${_arch}/kernel/" fi # Add md headers - mkdir -p "${hdrdest}/drivers/md" - cp drivers/md/*.h "${hdrdest}/drivers/md" + vmkdir "${hdrdest}/drivers/md" + vcopy drivers/md/*.h "${hdrdest}/drivers/md" # Add inotify.h - mkdir -p "${hdrdest}/include/linux" - cp include/linux/inotify.h "${hdrdest}/include/linux" + vinstall include/linux/inotify.h 644 "${hdrdest}/include/linux" # Add wireless headers - mkdir -p "${hdrdest}/net/mac80211/" - cp net/mac80211/*.h "${hdrdest}/net/mac80211" + vmkdir "${hdrdest}/net/mac80211/" + vcopy net/mac80211/*.h "${hdrdest}/net/mac80211" # Compress all modules with xz to save a few MBs. - msg_normal "$pkgver: compressing kernel modules with gzip, please wait...\n" - find "${DESTDIR}" -name '*.ko' | xargs -n1 -P0 gzip -9 + msg_normal "$_pkg-$version: compressing kernel modules with gzip, please wait...\n" + find "${_destdir}" -name '*.ko' | xargs -n1 -P0 gzip -9 # ... and run depmod again. - depmod -b "${DESTDIR}/usr" -F System.map "${_kernver}" + depmod -b "${_destdir}/usr" -F System.map "${_kernver}" +} + +do_configure() { + local target + + case "$XBPS_TARGET_MACHINE" in + # for zero, 1 + armv6l*) target=bcmrpi_defconfig ;; + # for 2 + armv7l*) target=bcm2709_defconfig ;; + # for 3, 4, zero 2, 5 + aarch64*) target=bcm2711_defconfig ;; + esac + + _configure "$target" +} + +do_build() { + make "${make_build_args[@]}" prepare + make "${make_build_args[@]}" "${_image_target}" modules dtbs +} + +do_install() { + _install "$pkgname" "$DESTDIR" } subpackages="rpi-kernel-headers" case "$XBPS_TARGET_MACHINE" in armv7l*) subpackages+=" rpi2-kernel rpi2-kernel-headers" ;; - aarch64*) subpackages+=" rpi3-kernel rpi3-kernel-headers rpi4-kernel rpi4-kernel-headers" ;; + aarch64*) subpackages+=" rpi3-kernel rpi3-kernel-headers rpi4-kernel rpi4-kernel-headers rpi5-kernel rpi5-kernel-headers" ;; esac rpi-kernel-headers_package() { @@ -264,9 +282,54 @@ rpi-kernel-headers_package() { noverifyrdeps=yes noshlibprovides=yes short_desc="${short_desc/kernel/kernel headers}" + provides="rpi-kernel-headers-${version}_${revision}" + replaces="rpi5-kernel-headers>=0" pkg_install() { vmove usr/src - vmove usr/lib/modules/${_kernver}/build + vmove "usr/lib/modules/${_kernver}/build" + } +} + +_rpi5_short_desc="Linux kernel for Raspberry Pi 5 (${version%.*} series)" + +rpi5-kernel_package() { + nodebug=yes + nostrip=yes + noverifyrdeps=yes + noshlibprovides=yes + python_version=3 + triggers="kernel-hooks" + # These files could be modified when an external module is built. + mutable_files=" + /usr/lib/modules/${_kernver}/modules.dep + /usr/lib/modules/${_kernver}/modules.dep.bin + /usr/lib/modules/${_kernver}/modules.symbols + /usr/lib/modules/${_kernver}/modules.symbols.bin + /usr/lib/modules/${_kernver}/modules.alias + /usr/lib/modules/${_kernver}/modules.alias.bin + /usr/lib/modules/${_kernver}/modules.devname" + short_desc="$_rpi5_short_desc" + provides="rpi-kernel-${version}_${revision}" + replaces="rpi-kernel>=0" + pkg_install() { + _configure "bcm2712_defconfig" + make "${make_build_args[@]}" prepare + make "${make_build_args[@]}" "${_image_target}" modules dtbs + _install "rpi5-kernel" "$PKGDESTDIR" + } +} + +rpi5-kernel-headers_package() { + nostrip=yes + noverifyrdeps=yes + noshlibprovides=yes + short_desc="${_rpi5_short_desc/kernel/kernel headers}" + provides="rpi-kernel-headers-${version}_${revision}" + replaces="rpi-kernel-headers>=0" + pkg_install() { + mv "${PKGDESTDIR}/../rpi5-kernel-${version}/usr/src" "${PKGDESTDIR}"/usr/src + vmkdir "usr/lib/modules/${_kernver}" + mv "${PKGDESTDIR}/../rpi5-kernel-${version}/usr/lib/modules/${_kernver}/build" "${PKGDESTDIR}/usr/lib/modules/${_kernver}/build" } } diff --git a/srcpkgs/rpi-kernel/update b/srcpkgs/rpi-kernel/update new file mode 100644 index 0000000000000..60c7b646ca64e --- /dev/null +++ b/srcpkgs/rpi-kernel/update @@ -0,0 +1,2 @@ +site="https://github.com/raspberrypi/linux/commits/rpi-6.1.y/" +pattern=">Linux \K[\d.]+(?=)" diff --git a/srcpkgs/rpi5-kernel b/srcpkgs/rpi5-kernel new file mode 120000 index 0000000000000..3b4ec073331b8 --- /dev/null +++ b/srcpkgs/rpi5-kernel @@ -0,0 +1 @@ +rpi-kernel \ No newline at end of file diff --git a/srcpkgs/rpi5-kernel-headers b/srcpkgs/rpi5-kernel-headers new file mode 120000 index 0000000000000..3b4ec073331b8 --- /dev/null +++ b/srcpkgs/rpi5-kernel-headers @@ -0,0 +1 @@ +rpi-kernel \ No newline at end of file From 7ab3a26d90d32722a1f2895ae91f6edf6bda15b0 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 17 Nov 2023 13:50:05 -0500 Subject: [PATCH 2/4] rpi-firmware: update to 20231221, adopt. add rpi5-specific firmware --- srcpkgs/rpi-firmware/template | 42 +++++++++++++---------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/srcpkgs/rpi-firmware/template b/srcpkgs/rpi-firmware/template index 0a2efa3b80db0..4838c305ed34b 100644 --- a/srcpkgs/rpi-firmware/template +++ b/srcpkgs/rpi-firmware/template @@ -1,39 +1,27 @@ # Template file for 'rpi-firmware' pkgname=rpi-firmware -version=20230925 +version=20231221 revision=1 -_rpi_fw=6b37a457122714aa14b2c7df0926455173fd04f1 -_rpi_bt=9556b08ace2a1735127894642cc8ea6529c04c90 -_rpi_brcm=2c3a8701193ba23d0ef85cdf0d0c9e47baf03dfc +_rpi_fw=0da53ed7928f20b5f4e9e36a3a63fb80b700d908 +_rpi_brcm=88aa085bfa1a4650e1ccd88896f8343c22a24055 +_rpi_bt=d9d4741caba7314d6500f588b1eaa5ab387a4ff5 create_wrksrc=yes -archs="armv6l* armv7l* aarch64*" +archs="aarch64* armv6l* armv7l*" short_desc="Firmware files for the Raspberry Pi" -maintainer="Piraty " +maintainer="classabbyamp " license="BSD-3-Clause, custom:Cypress" homepage="https://github.com/raspberrypi/firmware" distfiles=" https://github.com/raspberrypi/firmware/archive/${_rpi_fw}.tar.gz https://github.com/RPi-Distro/firmware-nonfree/archive/${_rpi_brcm}.tar.gz - https://github.com/RPi-Distro/bluez-firmware/raw/${_rpi_bt}/broadcom/BCM43430A1.hcd - https://github.com/RPi-Distro/bluez-firmware/raw/${_rpi_bt}/broadcom/BCM4345C0.hcd - https://github.com/RPi-Distro/bluez-firmware/raw/${_rpi_bt}/broadcom/BCM43430B0.hcd - https://github.com/RPi-Distro/bluez-firmware/raw/${_rpi_bt}/broadcom/BCM4345C5.hcd - https://github.com/RPi-Distro/bluez-firmware/raw/${_rpi_bt}/synaptics/SYN43430A1.hcd>BCM43430A1.raspberrypi,model-zero-2-w.hcd - https://github.com/RPi-Distro/bluez-firmware/raw/${_rpi_bt}/synaptics/SYN43430B0.hcd>BCM43430B0.raspberrypi,model-zero-2-w.hcd + https://github.com/RPi-Distro/bluez-firmware/archive/${_rpi_bt}.tar.gz https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/LICENCE.cypress>LICENCE.cypress" -checksum="913986b1be22b8dc30a3e6a9b5a28316b1bbee7bec90040ddefff0d7512560f4 - 9156d90116b921d2e7938b52fad84fbe1d96df622a66c5db09569c735832387a - c096ad4a5c3f06ed7d69eba246bf89ada9acba64a5b6f51b1e9c12f99bb1e1a7 - 51c45e77ddad91a19e96dc8fb75295b2087c279940df2634b23baf71b6dea42c - 338c2c6631131f516bfc7e64ef0872bd0402e1f98ef9d0c900eef0c814d90a25 - fb9f4ec2df5301bd35f416384e103c012c5983024c49aa72fbbaf90177512caa - 55071227c94d86369d04f9aff3bbfd4197a78a53dc350295123e1a8b048bba8f - 338c2c6631131f516bfc7e64ef0872bd0402e1f98ef9d0c900eef0c814d90a25 +checksum="c9288ecc2d314f12517b05378634d4fd73408245100e0cfae4c11ccaa84fcadd + bb3d8fed40546e03e29d9e635745433f8083391e62d6ff151c895b892776964a + ae076a08ece89624b0449ea2495b0dfe2ea1223f683f5b57f2b89966e6a093d6 ae0db6cc4db33941148df0f67de53e76a77b1b5a46b3165edb7040aa2750015f" -skip_extraction="BCM43430A1.hcd BCM4345C0.hcd BCM43430B0.hcd BCM4345C5.hcd - BCM43430A1.raspberrypi,model-zero-2-w.hcd BCM43430B0.raspberrypi,model-zero-2-w.hcd - LICENCE.cypress" +skip_extraction="LICENCE.cypress" provides="linux-firmware-broadcom-${version}_${revision}" replaces="linux-firmware-broadcom>=0" @@ -72,7 +60,9 @@ do_install() { vcopy "firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/brcm/brcmfmac43456"* usr/lib/firmware/brcm vcopy "firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/brcm/brcmfmac43436"* usr/lib/firmware/brcm - for file in "${XBPS_SRCDISTDIR}/${pkgname}-${version}/"*.hcd; do - vinstall "$file" 0644 usr/lib/firmware/brcm - done + vcopy "bluez-firmware-${_rpi_bt}/debian/firmware/broadcom/"*.hcd usr/lib/firmware/brcm + + vmkdir usr/lib/firmware/synaptics + vcopy "bluez-firmware-${_rpi_bt}/debian/firmware/synaptics/"*.hcd usr/lib/firmware/synaptics + vlicense "bluez-firmware-${_rpi_bt}/debian/firmware/synaptics/LICENSE.synaptics" } From 00b9653ca42d49bebc8882e69c8cc14486ba7915 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 17 Nov 2023 13:50:48 -0500 Subject: [PATCH 3/4] New package: rpi-utils-20231221 replaces rpi-userland: https://github.com/raspberrypi/userland/blob/master/README.md --- .../rpi-utils/patches/no-overlaycheck.patch | 14 +++++++++++++ srcpkgs/rpi-utils/template | 20 +++++++++++++++++++ srcpkgs/rpi-utils/update | 1 + 3 files changed, 35 insertions(+) create mode 100644 srcpkgs/rpi-utils/patches/no-overlaycheck.patch create mode 100644 srcpkgs/rpi-utils/template create mode 100644 srcpkgs/rpi-utils/update diff --git a/srcpkgs/rpi-utils/patches/no-overlaycheck.patch b/srcpkgs/rpi-utils/patches/no-overlaycheck.patch new file mode 100644 index 0000000000000..3e64958e238d2 --- /dev/null +++ b/srcpkgs/rpi-utils/patches/no-overlaycheck.patch @@ -0,0 +1,14 @@ +This program is not very useful as a downstream, it seems to be only intended +for internal QA. It also has a lot of weird things like hardcoding the prefixed +cpp to use and putting a text file in /usr/bin. + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,7 +5,6 @@ + # List of subsidiary CMakeLists + add_subdirectory(dtmerge) + add_subdirectory(otpset) +-add_subdirectory(overlaycheck) + add_subdirectory(ovmerge) + add_subdirectory(pinctrl) + add_subdirectory(raspinfo) diff --git a/srcpkgs/rpi-utils/template b/srcpkgs/rpi-utils/template new file mode 100644 index 0000000000000..4ba633ed47ab6 --- /dev/null +++ b/srcpkgs/rpi-utils/template @@ -0,0 +1,20 @@ +# Template file for 'rpi-utils' +pkgname=rpi-utils +version=20231221 +revision=1 +_commit=2cc103f4531a005cadaa8a9d09d6c85523c166bb +archs="armv6l* armv7l* aarch64*" +build_style=cmake +makedepends="dtc-devel" +depends="python3 perl bash" +short_desc="Collection of utilities for Raspberry Pi" +maintainer="classabbyamp " +license="BSD-3-Clause" +homepage="https://github.com/raspberrypi/utils" +distfiles="https://github.com/raspberrypi/utils/archive/${_commit}.tar.gz" +checksum=32e128d437052c66c744f24d75b0835a80a98627e33c48a37172a457024d9275 +python_version=3 + +post_install() { + vlicense LICENCE +} diff --git a/srcpkgs/rpi-utils/update b/srcpkgs/rpi-utils/update new file mode 100644 index 0000000000000..0d9505a5537ba --- /dev/null +++ b/srcpkgs/rpi-utils/update @@ -0,0 +1 @@ +disabled="just following master" From 982911cc1c4c546e7e985dc102386384662fea00 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 17 Nov 2023 13:51:52 -0500 Subject: [PATCH 4/4] rpi-eeprom: update to 2023.12.14. - install manpages (like is done in the debian rules) - adds rpi5 firmware --- srcpkgs/rpi-eeprom/template | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/srcpkgs/rpi-eeprom/template b/srcpkgs/rpi-eeprom/template index fb017a50966cd..38fba116a9486 100644 --- a/srcpkgs/rpi-eeprom/template +++ b/srcpkgs/rpi-eeprom/template @@ -1,17 +1,18 @@ # Template file for 'rpi-eeprom' pkgname=rpi-eeprom -version=2023.09.29 +version=2023.12.14 revision=1 -_githash="4f2d676b4e2a9c2d9ee1ab42015ce711fde97afa" -archs="armv7* aarch64*" +_githash=72cedfe5eea64bb8509b7d0fec68f5df5dd22f9e +archs="armv7l* aarch64*" conf_files="/etc/default/rpi-eeprom-update" -depends="binutils pciutils python3 rpi-firmware rpi-userland" -short_desc="Bootloader and VL805 USB controller EEPROM update tool for RPi4" +hostmakedepends="help2man python3" +depends="binutils pciutils python3 rpi-firmware rpi-utils" +short_desc="Bootloader and VL805 USB controller EEPROM update tool for RPi4/5" maintainer="Leah Neukirchen " license="BSD-3-Clause, custom:Proprietary" homepage="https://github.com/raspberrypi/rpi-eeprom/" distfiles="https://github.com/raspberrypi/rpi-eeprom/archive/${_githash}.tar.gz" -checksum="189c5d37f3102247cec72619e3cb357d027ec526fa3c7373d3107bd6c9e30e29" +checksum=542365a644b3d8e987bda8e0a7dc9d4c9c234ab97b11fa902798a21a08743c30 python_version=3 repository=nonfree @@ -21,9 +22,21 @@ do_install() { vbin rpi-eeprom-digest vinstall rpi-eeprom-update-default 644 etc/default rpi-eeprom-update - vmkdir usr/lib/firmware/raspberrypi/bootloader - # need to figure out how to package both pi4 (2711) and pi5 (2712) fw - vcopy firmware-2711/* usr/lib/firmware/raspberrypi/bootloader/ + # from https://github.com/raspberrypi/rpi-eeprom/blob/debian/bookworm/debian/rules + help2man -N --version-string="${version}" --help-option="-h" \ + --name="Checks whether the Raspberry Pi bootloader EEPROM is up-to-date and updates the EEPROM" \ + --output=rpi-eeprom-update.1 ./rpi-eeprom-update + vman rpi-eeprom-update.1 + + help2man -N --version-string="${version}" --help-option="-h" \ + --name="Bootloader EEPROM configuration tool for the Raspberry Pi 4/5" \ + --output=rpi-eeprom-config.1 ./rpi-eeprom-config + vman rpi-eeprom-config.1 + + for soc in 2711 2712; do + vmkdir usr/lib/firmware/raspberrypi/bootloader-"$soc" + vcopy firmware-"$soc"/* usr/lib/firmware/raspberrypi/bootloader-"$soc"/ + done vlicense LICENSE }