Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] rpi-kernel: update to 6.1.54.
@ 2023-09-20 11:34 classabbyamp
  2023-09-20 12:35 ` rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland) r-ricci
                   ` (42 more replies)
  0 siblings, 43 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-20 11:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4877 bytes --]

There is a new pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages update/rpi
https://github.com/void-linux/void-packages/pull/46152

rpi-kernel: update to 6.1.54.
- rpi-kernel: update to 6.1.54.
- rpi-firmware: update to 20230920.
- rpi-userland: update to 20230920.

continuation of #43600

builds for testing: https://devspace.voidlinux.org/abby/updates/rpi/

#### Testing the changes
- I tested the changes in this PR: **YES**

Still getting the DKMS/headers issue:

When building `fixdep` and `modpost` in `/etc/kernel.d/post-install/10-dkms`, it gets stuck in an infinite makefile loop:

https://github.com/void-linux/void-packages/blob/5b18878cc72b410bc076ac15218f4c5fa0c3fcbf/srcpkgs/dkms/files/kernel.d/dkms.postinst#L22-L24

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
  SYNC    include/config/auto.conf
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTLD  scripts/dtc/fdtoverlay
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  UPD     include/generated/compile.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
^Cmake[4]: *** [Makefile:1307: asm-generic] Interrupt
Interrupt
make[3]: *** [Makefile:1289: prepare0] Interrupt
make[2]: *** [Makefile:1289: prepare0] Interrupt
make[1]: *** [Makefile:1289: prepare0] Interrupt
make: *** [Makefile:1289: prepare0] Interrupt
```

However, `^C`ing out of that and re-running it succeeds, because `fixdep` and `modpost` were build before the infinite loop:

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
rpi-kernel: configured successfully.
```

And dkms works after that:

```
Building DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
Installing DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
rtl8821cu-dkms-20210916_2: installed successfully.
```

So the issue left to figure out is: why does it infinite loop?


A patch file from https://github.com/void-linux/void-packages/pull/46152.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update/rpi-46152.patch --]
[-- Type: text/x-diff, Size: 13884 bytes --]

From 505a9354803a0f426d19610e039a0d29929fd9e8 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:51 -0400
Subject: [PATCH 1/3] rpi-kernel: update to 6.1.54.

---
 srcpkgs/rpi-kernel/template | 111 ++++++++++++++++++++++++------------
 1 file changed, 76 insertions(+), 35 deletions(-)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index c49612b7c510a..5b3a3bfcbed6d 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -1,30 +1,29 @@
 # Template file for 'rpi-kernel'
 #
 # We track the latest Raspberry Pi LTS kernel as that is what is used in the
-# official Raspberry Pi OS distribution. This is currently 5.15:
+# official Raspberry Pi OS distribution. This is currently 6.1:
 #
-# https://forums.raspberrypi.com/viewtopic.php?t=322879
+# https://forums.raspberrypi.com/viewtopic.php?t=344246
 #
 # Commit hash is picked from latest tag [1], if appropriate, or from latest
-# "Merge remote-tracking branch 'stable/linux-5.x.y' into rpi-5.x.y" commit.
+# "Merge remote-tracking branch 'stable/linux-6.x.y' into rpi-6.x.y" commit.
 #
 # [1] https://github.com/raspberrypi/linux/tags
 #
 # Upstream documentation: https://www.raspberrypi.com/documentation/computers/linux_kernel.html
-
 pkgname=rpi-kernel
-version=5.15.72
+version=6.1.54
 revision=1
-_githash="3b98eb7a4aeaecd5274108dc1be7a5df94253500"
+_githash=fad58933544bb2a7b7db92847c25c79a83171fa6
 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 <mail@piraty.dev>"
-homepage="http://www.kernel.org"
 license="GPL-2.0-only"
-short_desc="Linux kernel for Raspberry Pi (${version%.*} series [git ${_githash:0:7}])"
+homepage="http://www.kernel.org"
 distfiles="https://github.com/raspberrypi/linux/archive/${_githash}.tar.gz"
-checksum=5cad1fd22f309ddd7b996df748aa21ced72f88d47fdbb8d4bfd9ef3a8a9b6ce9
+checksum=1bd02902fae49351fb16ac0d5ccc3bf4d67aa0640006dbbf8846963519b01ab8
 python_version=3
 
 _kernver="${version}_${revision}"
@@ -72,22 +71,74 @@ do_configure() {
 	esac
 
 	defconfig="arch/${_arch}/configs/${target}"
-	echo "CONFIG_CONNECTOR=y" >> "$defconfig"
-	echo "CONFIG_PROC_EVENTS=y" >> "$defconfig"
-
-	# HID Controllers
-	echo "CONFIG_HID_STEAM=y" >> "$defconfig"
-
-	# Disable GCC plugins
-	echo "# CONFIG_GCC_PLUGINS is not set" >> "$defconfig"
-
-	# LXD 4.2+ support
-	echo "CONFIG_BRIDGE_VLAN_FILTERING=y" >> "$defconfig"
-
-	make ${makejobs} ${_cross} ARCH=${_arch} ${target}
-
-	# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
-	vsed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
+	cp "$defconfig" .config
+
+	cat <<-! > "foo"
+	CONFIG_CONNECTOR=y
+	CONFIG_HID_STEAM=y
+	CONFIG_PROC_EVENTS=y
+	CONFIG_GCC_PLUGINS=n
+	CONFIG_BRIDGE_VLAN_FILTERING=y
+	CONFIG_FUNCTION_TRACER=n
+	CONFIG_STACK_TRACER=n
+	CONFIG_ATM=n
+	CONFIG_SLAB_FREELIST_RANDOM=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_SLAB_FREELIST_HARDENED=y
+	CONFIG_PACKET=m
+	CONFIG_NF_CT_PROTO_DCCP=y
+	CONFIG_NF_CT_PROTO_SCTP=y
+	CONFIG_NF_CT_PROTO_UDPLITE=y
+	CONFIG_BATMAN_ADV=n
+	CONFIG_INPUT_LEDS=m
+	CONFIG_SQUASHFS_LZ4=y
+	CONFIG_STRICT_DEVMEM=y
+	CONFIG_IO_STRICT_DEVMEM=y
+	CONFIG_ENCRYPTED_KEYS=m
+	CONFIG_KEY_DH_OPERATIONS=y
+	CONFIG_HARDENED_USERCOPY=y
+	CONFIG_LOCALVERSION="_${revision}"
+	CONFIG_IP_PNP=n
+	CONFIG_USB_DWC2=m
+	CONFIG_USB_ETH=m
+	CONFIG_RTC_HCTOSYS=y
+	CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+	CONFIG_RTC_DRV_DS1307=y
+	CONFIG_I2C_BCM2835=y
+	CONFIG_MEMCG=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_CGROUP_DEVICE=y
+	CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
+	CONFIG_PSI=y
+	CONFIG_ZSTD_COMPRESS=y
+	CONFIG_LZ4_COMPRESS=y
+	CONFIG_CRYPTO_RNG=y
+	CONFIG_CRYPTO_RNG_DEFAULT=y
+	!
+
+	while read -r line; do
+		# skip comments
+		case "$line" in
+			"#"*) continue;;
+		esac
+		local option=${line%%=*} str=
+		local cmd=$(echo $line | cut -d= -f2)
+		case "$cmd" in
+			y) cmd="enable";;
+			n) cmd="disable";;
+			m) cmd="module";;
+			'"'*) cmd="set-str"; str="${line#*=}";;
+			[0-9]*) cmd="set-val"; str="${line#*=}";;
+			'') continue ;;
+			*) msg_error "Command $cmd not accepted\n" ;;
+		esac
+		msg_normal "config: $cmd: $option $str\n"
+		./scripts/config \
+			--file .config \
+			"--$cmd" "$option" "${str//\"/}"
+	done < foo
+
+	make ${makejobs} ${_cross} ARCH=${_arch} olddefconfig
 }
 
 do_build() {
@@ -190,16 +241,6 @@ do_install() {
 	mkdir -p ${hdrdest}/net/mac80211/
 	cp net/mac80211/*.h ${hdrdest}/net/mac80211
 
-	# Remove unneeded architectures
-	# (save the correct one + Kconfig and delete all others)
-	mkdir -p arch-backup
-	cp -r ${hdrdest}/arch/${_arch} ${hdrdest}/arch/Kconfig arch-backup/
-	rm -rf ${hdrdest}/arch
-	mv arch-backup ${hdrdest}/arch
-	# Keep arch/x86/ras/Kconfig as it is needed by drivers/ras/Kconfig
-	mkdir -p ${hdrdest}/arch/x86/ras
-	cp -a arch/x86/ras/Kconfig ${hdrdest}/arch/x86/ras/Kconfig
-
 	# 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

From 1cb774d5bb09be8f22a3d4e92a23424bb0f802b7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:53 -0400
Subject: [PATCH 2/3] rpi-firmware: update to 20230920.

---
 srcpkgs/rpi-firmware/template | 118 ++++++++++++++++------------------
 1 file changed, 57 insertions(+), 61 deletions(-)

diff --git a/srcpkgs/rpi-firmware/template b/srcpkgs/rpi-firmware/template
index 5086abfa19fec..fd2c1c3ca679c 100644
--- a/srcpkgs/rpi-firmware/template
+++ b/srcpkgs/rpi-firmware/template
@@ -1,82 +1,78 @@
 # Template file for 'rpi-firmware'
-_githash="62efc6a69d4e717bf2833c649d622c8298a37e9c"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-firmware
-version=20220823
-revision=2
+version=20230920
+revision=1
+_rpi_fw=de26b2d7f77404dbe0598d8c52b7ae14a78877b1
+_rpi_bt=9556b08ace2a1735127894642cc8ea6529c04c90
+_rpi_brcm=2c3a8701193ba23d0ef85cdf0d0c9e47baf03dfc
+create_wrksrc=yes
 archs="armv6l* armv7l* aarch64*"
-provides="linux-firmware-broadcom-${version}_${revision}"
-replaces="linux-firmware-broadcom>=0"
-short_desc="Firmware files for the Raspberry Pi (git ${_gitshort})"
+short_desc="Firmware files for the Raspberry Pi"
 maintainer="Piraty <mail@piraty.dev>"
 license="BSD-3-Clause, custom:Cypress"
 homepage="https://github.com/raspberrypi/firmware"
-distfiles="https://github.com/raspberrypi/firmware/archive/${_githash}.tar.gz"
-checksum=3fc5ab7155bde7221245f439971217558300dcbc988ade861cfef4e737de9909
+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://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/LICENCE.cypress>LICENCE.cypress"
+checksum="6d929aa677e6d71485093786877e0bdd3a9a579f55562ac8fca8d33280426d12
+ 9156d90116b921d2e7938b52fad84fbe1d96df622a66c5db09569c735832387a
+ c096ad4a5c3f06ed7d69eba246bf89ada9acba64a5b6f51b1e9c12f99bb1e1a7
+ 51c45e77ddad91a19e96dc8fb75295b2087c279940df2634b23baf71b6dea42c
+ 338c2c6631131f516bfc7e64ef0872bd0402e1f98ef9d0c900eef0c814d90a25
+ fb9f4ec2df5301bd35f416384e103c012c5983024c49aa72fbbaf90177512caa
+ 55071227c94d86369d04f9aff3bbfd4197a78a53dc350295123e1a8b048bba8f
+ 338c2c6631131f516bfc7e64ef0872bd0402e1f98ef9d0c900eef0c814d90a25
+ 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"
+
+provides="linux-firmware-broadcom-${version}_${revision}"
+replaces="linux-firmware-broadcom>=0"
 
 conf_files="/boot/cmdline.txt /boot/config.txt"
 nostrip=yes
 
 do_install() {
-	rm -f boot/*.img
-	rm -rf boot/overlays
-	rm -f boot/*.dtb
-	rm -f boot/COPYING.linux
-
-	vlicense boot/LICENCE.broadcom
-	rm -f boot/LICENCE.broadcom
+	# bootloader
+	vlicense "firmware-${_rpi_fw}/boot/LICENCE.broadcom"
+	rm -rf "firmware-${_rpi_fw}/boot/"*.img \
+		"firmware-${_rpi_fw}/boot/overlays" \
+		"firmware-${_rpi_fw}/boot/"*.dtb \
+		"firmware-${_rpi_fw}/boot/COPYING.linux" \
+		"firmware-${_rpi_fw}/boot/LICENCE.broadcom"
 
 	vmkdir boot
-	cp -R boot/* ${DESTDIR}/boot
+	vcopy "firmware-${_rpi_fw}/boot/*" boot
 
 	# Install configuration files.
-	vinstall ${FILESDIR}/cmdline.txt 644 boot
-	vinstall ${FILESDIR}/config.txt 644 boot
+	vinstall "${FILESDIR}/cmdline.txt" 644 boot
+	vinstall "${FILESDIR}/config.txt" 644 boot
 
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/LICENCE.cypress
-	vlicense LICENCE.cypress
+	# firmware
+	# we can use either the -standard or -minimal 43455 file so use standard by default
+	ln -sfv cyfmac43455-sdio-standard.bin "firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/cypress/cyfmac43455-sdio.bin"
+	vlicense "${XBPS_SRCDISTDIR}/${pkgname}-${version}/LICENCE.cypress"
 
-	# Firmware for rpi3 b and zero wifi chip
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43430-sdio.${f}
-		vinstall brcmfmac43430-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
+	# add original Pi Foundation firmware files
+	# install deref's symlinks and copies a whole file, which makes rpi use duplicated variants specifically from downstream firmware
+	install -Dm644 \
+		"firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/brcm/"brcmfmac*raspberrypi* \
+		-t "${DESTDIR}/usr/lib/firmware/brcm"
 
-	# Firmware for rpi3 b and zero bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430A1.hcd
-	vinstall BCM43430A1.hcd 0644 usr/lib/firmware/brcm
+	# but 43436/43436s/43456 is not in linux-firmware, so copy it normally
+	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
 
-	# Firmware for rpi3 b+ wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43455-sdio.${f}
-		vinstall brcmfmac43455-sdio.${f} 0644 usr/lib/firmware/brcm
+	for file in "${XBPS_SRCDISTDIR}/${pkgname}-${version}/"*.hcd; do
+		vinstall "$file" 0644 usr/lib/firmware/brcm
 	done
-
-	# Firmware for rpi3 b+ bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C0.hcd
-	vinstall BCM4345C0.hcd 0644 usr/lib/firmware/brcm
-
-	# Firmware for rpi zero 2w wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436-sdio.${f}
-		vinstall brcmfmac43436-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436s-sdio.${f}
-		vinstall brcmfmac43436s-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43456-sdio.${f}
-		vinstall brcmfmac43456-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C5.hcd
-	vinstall BCM4345C5.hcd 0644 usr/lib/firmware/brcm
-
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430B0.hcd
-	vinstall BCM43430B0.hcd 0644 usr/lib/firmware/brcm
 }

From 9661239d699c9937b95ca209926c17bba95f3239 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:54 -0400
Subject: [PATCH 3/3] rpi-userland: update to 20230920.

---
 srcpkgs/rpi-userland/template | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/rpi-userland/template b/srcpkgs/rpi-userland/template
index 4f1ea38c9e3a6..25fc587bfb55d 100644
--- a/srcpkgs/rpi-userland/template
+++ b/srcpkgs/rpi-userland/template
@@ -1,19 +1,17 @@
 # Template file for 'rpi-userland'
-_githash="97bc8180ad682b004ea224d1db7b8e108eda4397"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-userland
-version=20210623
+version=20230920
 revision=1
+_githash="44a3953fd13d5f0b9b0cd120b904aa7db370244e"
 build_style=cmake
-hostmakedepends="pkg-config"
 configure_args="-DCMAKE_INSTALL_RPATH=\$ORIGIN/../lib"
-short_desc="Raspberry Pi GPU userland libraries and utilities (git ${_gitshort})"
+hostmakedepends="pkg-config"
+short_desc="Raspberry Pi GPU userland libraries and utilities"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/raspberrypi/userland"
 distfiles="https://github.com/raspberrypi/userland/archive/${_githash}.tar.gz"
-checksum=d67def03931215f41b741aed5a3a1bc2bd62fa33f5cc14692e9a4d65f2e0ea27
+checksum=981c376a110f78fe579a72e218888646ccd5d71ab82d04bb1a8d7be1487b45f0
 
 LDFLAGS="-Wl,--no-as-needed"
 archs="armv6l* armv7l* aarch64*"

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
@ 2023-09-20 12:35 ` r-ricci
  2023-09-20 13:36 ` tsjk
                   ` (41 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: r-ricci @ 2023-09-20 12:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

New comment by r-ricci on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1727637004

Comment:
`rpi-kernel` isn't the only place where the removal of headers for other architectures is causing problems with DKMS, as I pointed out in <https://github.com/void-linux/void-packages/issues/44807#issuecomment-1661246227>.
Regular kernel packages should be patched as well.

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
  2023-09-20 12:35 ` rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland) r-ricci
@ 2023-09-20 13:36 ` tsjk
  2023-09-20 13:37 ` tsjk
                   ` (40 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: tsjk @ 2023-09-20 13:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 657 bytes --]

New comment by tsjk on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1727749596

Comment:
As far as I gather `/lib/modules/${VERSION}/build` is a link to the headers. Those too are decimated, and I for one would attempt to not decimate first.
While I do appreciate attempts to weed out unnecessary files to save resources, especially on small systems such as these, I think these decimations need better documentation so users and maintainers grasp file certain things are not packaged.
I remember previously needing to point out that a set of dropped headers were needed for compilation of wlan modules...

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
  2023-09-20 12:35 ` rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland) r-ricci
  2023-09-20 13:36 ` tsjk
@ 2023-09-20 13:37 ` tsjk
  2023-09-20 16:41 ` classabbyamp
                   ` (39 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: tsjk @ 2023-09-20 13:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 656 bytes --]

New comment by tsjk on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1727749596

Comment:
As far as I gather `/lib/modules/${VERSION}/build` is a link to the headers. Those too are decimated, and I for one would attempt to not decimate first.
While I do appreciate attempts to weed out unnecessary files to save resources, especially on small systems such as these, I think these decimations need better documentation so users and maintainers grasp why certain things are not packaged.
I remember previously needing to point out that a set of dropped headers were needed for compilation of wlan modules...

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (2 preceding siblings ...)
  2023-09-20 13:37 ` tsjk
@ 2023-09-20 16:41 ` classabbyamp
  2023-09-23 19:03 ` moabeat-berlin
                   ` (38 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-20 16:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1728094473

Comment:
> `rpi-kernel` isn't the only place where the removal of headers for other architectures is causing problems with DKMS, as I pointed out in <https://github.com/void-linux/void-packages/issues/44807#issuecomment-1661246227>.
> Regular kernel packages should be patched as well.

I'm aware, Leah was looking into the others

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (3 preceding siblings ...)
  2023-09-20 16:41 ` classabbyamp
@ 2023-09-23 19:03 ` moabeat-berlin
  2023-09-23 19:12 ` classabbyamp
                   ` (37 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: moabeat-berlin @ 2023-09-23 19:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2640 bytes --]

New comment by moabeat-berlin on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732388822

Comment:
I think I might have a potential solution for this. With a lot of tracing, I was able to make `make prepare` work in `/usr/src/rpi-kernel-headers-6.1.54_1`. Some more missing files had to be added from the kernel sources. In particular these ones:

```
./Kbuild
./kernel/time/timeconst.bc
./kernel/bounds.s
./lib/vdso/Makefile
./lib/vdso/gettimeofday.c
./arch/x86/entry/syscalls/syscall_32.tbl
```

The infinite loop was fixed by adding `Kbuild` in the kernel root. Then some other errors showed up. Also the package `bc` is now required to for `make prepare`.

An accordingly modified `template` for `rpi-kernel` can be found in my repo here: https://github.com/moabeat-berlin/void-packages/blob/rpi-kernel-test/srcpkgs/rpi-kernel/template

After building and installing the packages, dkms works fine:

```
$ sudo xbps-install -R repo/rpi-kernel-test -f rpi-kernel rpi-kernel-headers

Name               Action    Version           New version            Download size
rpi-kernel         reinstall 6.1.54_1          6.1.54_1               - 
rpi-kernel-headers reinstall 6.1.54_1          6.1.54_1               - 

Size required on disk:          76MB
Space available on disk:        23GB

Do you want to continue? [Y/n] 

[*] Verifying package integrity
rpi-kernel-6.1.54_1: verifying SHA256 hash...
rpi-kernel-headers-6.1.54_1: verifying SHA256 hash...

[*] Collecting package files
rpi-kernel-6.1.54_1: collecting files...
rpi-kernel-headers-6.1.54_1: collecting files...

[*] Unpacking packages
rpi-kernel-6.1.54_1: unpacking ...
rpi-kernel-headers-6.1.54_1: unpacking ...

[*] Configuring unpacked packages
rpi-kernel-6.1.54_1: configuring ...
Executing post-install kernel hook: 10-dkms ...
Available DKMS module: zfs-2.1.12.
Building DKMS module: zfs-2.1.12... done.
Installing DKMS module: zfs-2.1.12... done.
rpi-kernel-6.1.54_1: installed successfully.
rpi-kernel-headers-6.1.54_1: configuring ...
rpi-kernel-headers-6.1.54_1: installed successfully.

0 downloaded, 2 installed, 0 updated, 2 configured, 0 removed.
```

I'm not sure if my approach is correct. I also checked how other's distribution packages are handling that. In the Raspberry Pi OS Debian package, the binaries are already included. Instead of adding multiple different files scattered across the kernel sources, that would be maybe the better approach. However, I didn't find out yet how you can also cross-compile them to deliver them in the package.



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (4 preceding siblings ...)
  2023-09-23 19:03 ` moabeat-berlin
@ 2023-09-23 19:12 ` classabbyamp
  2023-09-23 19:28 ` moabeat-berlin
                   ` (36 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-23 19:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732390533

Comment:
> In the Raspberry Pi OS Debian package, the binaries are already included. Instead of adding multiple different files scattered across the kernel sources, that would be maybe the better approach. However, I didn't find out yet how you can also cross-compile them to deliver them in the package.

yes, rpios builds it natively so that works. it's not supported to build those tools for the target so to do so would require patching

will try adding those files later (after the weekend) 

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (5 preceding siblings ...)
  2023-09-23 19:12 ` classabbyamp
@ 2023-09-23 19:28 ` moabeat-berlin
  2023-09-23 19:29 ` moabeat-berlin
                   ` (35 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: moabeat-berlin @ 2023-09-23 19:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

New comment by moabeat-berlin on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732393065

Comment:
Indeed, it's not supported to build them for the target. I found [this old post](https://patchwork.kernel.org/project/linux-kbuild/patch/1376046432-12588-1-git-send-email-broonie@kernel.org/) int the kernel archives from 2013, where someone wanted to enable this. However, it got rejected. :disappointed: 

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (6 preceding siblings ...)
  2023-09-23 19:28 ` moabeat-berlin
@ 2023-09-23 19:29 ` moabeat-berlin
  2023-09-23 23:11 ` [PR PATCH] [Updated] " classabbyamp
                   ` (34 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: moabeat-berlin @ 2023-09-23 19:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]

New comment by moabeat-berlin on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732393065

Comment:
Indeed, it's not supported to build them for the target. I found [this old post](https://patchwork.kernel.org/project/linux-kbuild/patch/1376046432-12588-1-git-send-email-broonie@kernel.org/) in the kernel archives from 2013, where someone wanted to enable this. However, it got rejected. :disappointed: 

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PR PATCH] [Updated] rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (7 preceding siblings ...)
  2023-09-23 19:29 ` moabeat-berlin
@ 2023-09-23 23:11 ` classabbyamp
  2023-09-23 23:12 ` classabbyamp
                   ` (33 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-23 23:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5063 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages update/rpi
https://github.com/void-linux/void-packages/pull/46152

rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
- rpi-kernel: update to 6.1.54.
- rpi-firmware: update to 20230920.
- rpi-userland: update to 20230920.

continuation of #43600, made a new PR to clean things up

builds for testing: https://devspace.voidlinux.org/abby/updates/rpi/

#### Testing the changes
- I tested the changes in this PR: **YES**

Still getting the DKMS/headers issue:

When building `fixdep` and `modpost` in `/etc/kernel.d/post-install/10-dkms`, it gets stuck in an infinite makefile loop:

https://github.com/void-linux/void-packages/blob/5b18878cc72b410bc076ac15218f4c5fa0c3fcbf/srcpkgs/dkms/files/kernel.d/dkms.postinst#L22-L24

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
  SYNC    include/config/auto.conf
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTLD  scripts/dtc/fdtoverlay
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  UPD     include/generated/compile.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
^Cmake[4]: *** [Makefile:1307: asm-generic] Interrupt
Interrupt
make[3]: *** [Makefile:1289: prepare0] Interrupt
make[2]: *** [Makefile:1289: prepare0] Interrupt
make[1]: *** [Makefile:1289: prepare0] Interrupt
make: *** [Makefile:1289: prepare0] Interrupt
```

However, `^C`ing out of that and re-running it succeeds, because `fixdep` and `modpost` were build before the infinite loop:

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
rpi-kernel: configured successfully.
```

And dkms works after that:

```
Building DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
Installing DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
rtl8821cu-dkms-20210916_2: installed successfully.
```

So the issue left to figure out is: why does it infinite loop?


A patch file from https://github.com/void-linux/void-packages/pull/46152.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update/rpi-46152.patch --]
[-- Type: text/x-diff, Size: 15147 bytes --]

From 505a9354803a0f426d19610e039a0d29929fd9e8 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:51 -0400
Subject: [PATCH 1/4] rpi-kernel: update to 6.1.54.

---
 srcpkgs/rpi-kernel/template | 111 ++++++++++++++++++++++++------------
 1 file changed, 76 insertions(+), 35 deletions(-)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index c49612b7c510a..5b3a3bfcbed6d 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -1,30 +1,29 @@
 # Template file for 'rpi-kernel'
 #
 # We track the latest Raspberry Pi LTS kernel as that is what is used in the
-# official Raspberry Pi OS distribution. This is currently 5.15:
+# official Raspberry Pi OS distribution. This is currently 6.1:
 #
-# https://forums.raspberrypi.com/viewtopic.php?t=322879
+# https://forums.raspberrypi.com/viewtopic.php?t=344246
 #
 # Commit hash is picked from latest tag [1], if appropriate, or from latest
-# "Merge remote-tracking branch 'stable/linux-5.x.y' into rpi-5.x.y" commit.
+# "Merge remote-tracking branch 'stable/linux-6.x.y' into rpi-6.x.y" commit.
 #
 # [1] https://github.com/raspberrypi/linux/tags
 #
 # Upstream documentation: https://www.raspberrypi.com/documentation/computers/linux_kernel.html
-
 pkgname=rpi-kernel
-version=5.15.72
+version=6.1.54
 revision=1
-_githash="3b98eb7a4aeaecd5274108dc1be7a5df94253500"
+_githash=fad58933544bb2a7b7db92847c25c79a83171fa6
 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 <mail@piraty.dev>"
-homepage="http://www.kernel.org"
 license="GPL-2.0-only"
-short_desc="Linux kernel for Raspberry Pi (${version%.*} series [git ${_githash:0:7}])"
+homepage="http://www.kernel.org"
 distfiles="https://github.com/raspberrypi/linux/archive/${_githash}.tar.gz"
-checksum=5cad1fd22f309ddd7b996df748aa21ced72f88d47fdbb8d4bfd9ef3a8a9b6ce9
+checksum=1bd02902fae49351fb16ac0d5ccc3bf4d67aa0640006dbbf8846963519b01ab8
 python_version=3
 
 _kernver="${version}_${revision}"
@@ -72,22 +71,74 @@ do_configure() {
 	esac
 
 	defconfig="arch/${_arch}/configs/${target}"
-	echo "CONFIG_CONNECTOR=y" >> "$defconfig"
-	echo "CONFIG_PROC_EVENTS=y" >> "$defconfig"
-
-	# HID Controllers
-	echo "CONFIG_HID_STEAM=y" >> "$defconfig"
-
-	# Disable GCC plugins
-	echo "# CONFIG_GCC_PLUGINS is not set" >> "$defconfig"
-
-	# LXD 4.2+ support
-	echo "CONFIG_BRIDGE_VLAN_FILTERING=y" >> "$defconfig"
-
-	make ${makejobs} ${_cross} ARCH=${_arch} ${target}
-
-	# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
-	vsed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
+	cp "$defconfig" .config
+
+	cat <<-! > "foo"
+	CONFIG_CONNECTOR=y
+	CONFIG_HID_STEAM=y
+	CONFIG_PROC_EVENTS=y
+	CONFIG_GCC_PLUGINS=n
+	CONFIG_BRIDGE_VLAN_FILTERING=y
+	CONFIG_FUNCTION_TRACER=n
+	CONFIG_STACK_TRACER=n
+	CONFIG_ATM=n
+	CONFIG_SLAB_FREELIST_RANDOM=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_SLAB_FREELIST_HARDENED=y
+	CONFIG_PACKET=m
+	CONFIG_NF_CT_PROTO_DCCP=y
+	CONFIG_NF_CT_PROTO_SCTP=y
+	CONFIG_NF_CT_PROTO_UDPLITE=y
+	CONFIG_BATMAN_ADV=n
+	CONFIG_INPUT_LEDS=m
+	CONFIG_SQUASHFS_LZ4=y
+	CONFIG_STRICT_DEVMEM=y
+	CONFIG_IO_STRICT_DEVMEM=y
+	CONFIG_ENCRYPTED_KEYS=m
+	CONFIG_KEY_DH_OPERATIONS=y
+	CONFIG_HARDENED_USERCOPY=y
+	CONFIG_LOCALVERSION="_${revision}"
+	CONFIG_IP_PNP=n
+	CONFIG_USB_DWC2=m
+	CONFIG_USB_ETH=m
+	CONFIG_RTC_HCTOSYS=y
+	CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+	CONFIG_RTC_DRV_DS1307=y
+	CONFIG_I2C_BCM2835=y
+	CONFIG_MEMCG=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_CGROUP_DEVICE=y
+	CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
+	CONFIG_PSI=y
+	CONFIG_ZSTD_COMPRESS=y
+	CONFIG_LZ4_COMPRESS=y
+	CONFIG_CRYPTO_RNG=y
+	CONFIG_CRYPTO_RNG_DEFAULT=y
+	!
+
+	while read -r line; do
+		# skip comments
+		case "$line" in
+			"#"*) continue;;
+		esac
+		local option=${line%%=*} str=
+		local cmd=$(echo $line | cut -d= -f2)
+		case "$cmd" in
+			y) cmd="enable";;
+			n) cmd="disable";;
+			m) cmd="module";;
+			'"'*) cmd="set-str"; str="${line#*=}";;
+			[0-9]*) cmd="set-val"; str="${line#*=}";;
+			'') continue ;;
+			*) msg_error "Command $cmd not accepted\n" ;;
+		esac
+		msg_normal "config: $cmd: $option $str\n"
+		./scripts/config \
+			--file .config \
+			"--$cmd" "$option" "${str//\"/}"
+	done < foo
+
+	make ${makejobs} ${_cross} ARCH=${_arch} olddefconfig
 }
 
 do_build() {
@@ -190,16 +241,6 @@ do_install() {
 	mkdir -p ${hdrdest}/net/mac80211/
 	cp net/mac80211/*.h ${hdrdest}/net/mac80211
 
-	# Remove unneeded architectures
-	# (save the correct one + Kconfig and delete all others)
-	mkdir -p arch-backup
-	cp -r ${hdrdest}/arch/${_arch} ${hdrdest}/arch/Kconfig arch-backup/
-	rm -rf ${hdrdest}/arch
-	mv arch-backup ${hdrdest}/arch
-	# Keep arch/x86/ras/Kconfig as it is needed by drivers/ras/Kconfig
-	mkdir -p ${hdrdest}/arch/x86/ras
-	cp -a arch/x86/ras/Kconfig ${hdrdest}/arch/x86/ras/Kconfig
-
 	# 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

From 1cb774d5bb09be8f22a3d4e92a23424bb0f802b7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:53 -0400
Subject: [PATCH 2/4] rpi-firmware: update to 20230920.

---
 srcpkgs/rpi-firmware/template | 118 ++++++++++++++++------------------
 1 file changed, 57 insertions(+), 61 deletions(-)

diff --git a/srcpkgs/rpi-firmware/template b/srcpkgs/rpi-firmware/template
index 5086abfa19fec..fd2c1c3ca679c 100644
--- a/srcpkgs/rpi-firmware/template
+++ b/srcpkgs/rpi-firmware/template
@@ -1,82 +1,78 @@
 # Template file for 'rpi-firmware'
-_githash="62efc6a69d4e717bf2833c649d622c8298a37e9c"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-firmware
-version=20220823
-revision=2
+version=20230920
+revision=1
+_rpi_fw=de26b2d7f77404dbe0598d8c52b7ae14a78877b1
+_rpi_bt=9556b08ace2a1735127894642cc8ea6529c04c90
+_rpi_brcm=2c3a8701193ba23d0ef85cdf0d0c9e47baf03dfc
+create_wrksrc=yes
 archs="armv6l* armv7l* aarch64*"
-provides="linux-firmware-broadcom-${version}_${revision}"
-replaces="linux-firmware-broadcom>=0"
-short_desc="Firmware files for the Raspberry Pi (git ${_gitshort})"
+short_desc="Firmware files for the Raspberry Pi"
 maintainer="Piraty <mail@piraty.dev>"
 license="BSD-3-Clause, custom:Cypress"
 homepage="https://github.com/raspberrypi/firmware"
-distfiles="https://github.com/raspberrypi/firmware/archive/${_githash}.tar.gz"
-checksum=3fc5ab7155bde7221245f439971217558300dcbc988ade861cfef4e737de9909
+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://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/LICENCE.cypress>LICENCE.cypress"
+checksum="6d929aa677e6d71485093786877e0bdd3a9a579f55562ac8fca8d33280426d12
+ 9156d90116b921d2e7938b52fad84fbe1d96df622a66c5db09569c735832387a
+ c096ad4a5c3f06ed7d69eba246bf89ada9acba64a5b6f51b1e9c12f99bb1e1a7
+ 51c45e77ddad91a19e96dc8fb75295b2087c279940df2634b23baf71b6dea42c
+ 338c2c6631131f516bfc7e64ef0872bd0402e1f98ef9d0c900eef0c814d90a25
+ fb9f4ec2df5301bd35f416384e103c012c5983024c49aa72fbbaf90177512caa
+ 55071227c94d86369d04f9aff3bbfd4197a78a53dc350295123e1a8b048bba8f
+ 338c2c6631131f516bfc7e64ef0872bd0402e1f98ef9d0c900eef0c814d90a25
+ 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"
+
+provides="linux-firmware-broadcom-${version}_${revision}"
+replaces="linux-firmware-broadcom>=0"
 
 conf_files="/boot/cmdline.txt /boot/config.txt"
 nostrip=yes
 
 do_install() {
-	rm -f boot/*.img
-	rm -rf boot/overlays
-	rm -f boot/*.dtb
-	rm -f boot/COPYING.linux
-
-	vlicense boot/LICENCE.broadcom
-	rm -f boot/LICENCE.broadcom
+	# bootloader
+	vlicense "firmware-${_rpi_fw}/boot/LICENCE.broadcom"
+	rm -rf "firmware-${_rpi_fw}/boot/"*.img \
+		"firmware-${_rpi_fw}/boot/overlays" \
+		"firmware-${_rpi_fw}/boot/"*.dtb \
+		"firmware-${_rpi_fw}/boot/COPYING.linux" \
+		"firmware-${_rpi_fw}/boot/LICENCE.broadcom"
 
 	vmkdir boot
-	cp -R boot/* ${DESTDIR}/boot
+	vcopy "firmware-${_rpi_fw}/boot/*" boot
 
 	# Install configuration files.
-	vinstall ${FILESDIR}/cmdline.txt 644 boot
-	vinstall ${FILESDIR}/config.txt 644 boot
+	vinstall "${FILESDIR}/cmdline.txt" 644 boot
+	vinstall "${FILESDIR}/config.txt" 644 boot
 
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/LICENCE.cypress
-	vlicense LICENCE.cypress
+	# firmware
+	# we can use either the -standard or -minimal 43455 file so use standard by default
+	ln -sfv cyfmac43455-sdio-standard.bin "firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/cypress/cyfmac43455-sdio.bin"
+	vlicense "${XBPS_SRCDISTDIR}/${pkgname}-${version}/LICENCE.cypress"
 
-	# Firmware for rpi3 b and zero wifi chip
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43430-sdio.${f}
-		vinstall brcmfmac43430-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
+	# add original Pi Foundation firmware files
+	# install deref's symlinks and copies a whole file, which makes rpi use duplicated variants specifically from downstream firmware
+	install -Dm644 \
+		"firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/brcm/"brcmfmac*raspberrypi* \
+		-t "${DESTDIR}/usr/lib/firmware/brcm"
 
-	# Firmware for rpi3 b and zero bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430A1.hcd
-	vinstall BCM43430A1.hcd 0644 usr/lib/firmware/brcm
+	# but 43436/43436s/43456 is not in linux-firmware, so copy it normally
+	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
 
-	# Firmware for rpi3 b+ wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43455-sdio.${f}
-		vinstall brcmfmac43455-sdio.${f} 0644 usr/lib/firmware/brcm
+	for file in "${XBPS_SRCDISTDIR}/${pkgname}-${version}/"*.hcd; do
+		vinstall "$file" 0644 usr/lib/firmware/brcm
 	done
-
-	# Firmware for rpi3 b+ bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C0.hcd
-	vinstall BCM4345C0.hcd 0644 usr/lib/firmware/brcm
-
-	# Firmware for rpi zero 2w wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436-sdio.${f}
-		vinstall brcmfmac43436-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436s-sdio.${f}
-		vinstall brcmfmac43436s-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43456-sdio.${f}
-		vinstall brcmfmac43456-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C5.hcd
-	vinstall BCM4345C5.hcd 0644 usr/lib/firmware/brcm
-
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430B0.hcd
-	vinstall BCM43430B0.hcd 0644 usr/lib/firmware/brcm
 }

From 9661239d699c9937b95ca209926c17bba95f3239 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:54 -0400
Subject: [PATCH 3/4] rpi-userland: update to 20230920.

---
 srcpkgs/rpi-userland/template | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/rpi-userland/template b/srcpkgs/rpi-userland/template
index 4f1ea38c9e3a6..25fc587bfb55d 100644
--- a/srcpkgs/rpi-userland/template
+++ b/srcpkgs/rpi-userland/template
@@ -1,19 +1,17 @@
 # Template file for 'rpi-userland'
-_githash="97bc8180ad682b004ea224d1db7b8e108eda4397"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-userland
-version=20210623
+version=20230920
 revision=1
+_githash="44a3953fd13d5f0b9b0cd120b904aa7db370244e"
 build_style=cmake
-hostmakedepends="pkg-config"
 configure_args="-DCMAKE_INSTALL_RPATH=\$ORIGIN/../lib"
-short_desc="Raspberry Pi GPU userland libraries and utilities (git ${_gitshort})"
+hostmakedepends="pkg-config"
+short_desc="Raspberry Pi GPU userland libraries and utilities"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/raspberrypi/userland"
 distfiles="https://github.com/raspberrypi/userland/archive/${_githash}.tar.gz"
-checksum=d67def03931215f41b741aed5a3a1bc2bd62fa33f5cc14692e9a4d65f2e0ea27
+checksum=981c376a110f78fe579a72e218888646ccd5d71ab82d04bb1a8d7be1487b45f0
 
 LDFLAGS="-Wl,--no-as-needed"
 archs="armv6l* armv7l* aarch64*"

From fe5db64f751747de03496161e8c501bc9f82a363 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 23 Sep 2023 19:11:45 -0400
Subject: [PATCH 4/4] fixup! rpi-kernel: update to 6.1.54.

---
 srcpkgs/rpi-kernel/template | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index 5b3a3bfcbed6d..25bc455082785 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -177,6 +177,7 @@ do_install() {
 	cd ${wrksrc}
 	# 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
 	for file in $(find . -name Kconfig\*); do
@@ -217,6 +218,10 @@ do_install() {
 	if [ -d "arch/${_arch}/tools" ]; then
 		cp -a 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"
 
 	# copy arch includes for external modules
 	mkdir -p ${hdrdest}/arch/${_arch}

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PR PATCH] [Updated] rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (8 preceding siblings ...)
  2023-09-23 23:11 ` [PR PATCH] [Updated] " classabbyamp
@ 2023-09-23 23:12 ` classabbyamp
  2023-09-23 23:13 ` classabbyamp
                   ` (32 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-23 23:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5063 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages update/rpi
https://github.com/void-linux/void-packages/pull/46152

rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
- rpi-kernel: update to 6.1.54.
- rpi-firmware: update to 20230920.
- rpi-userland: update to 20230920.

continuation of #43600, made a new PR to clean things up

builds for testing: https://devspace.voidlinux.org/abby/updates/rpi/

#### Testing the changes
- I tested the changes in this PR: **YES**

Still getting the DKMS/headers issue:

When building `fixdep` and `modpost` in `/etc/kernel.d/post-install/10-dkms`, it gets stuck in an infinite makefile loop:

https://github.com/void-linux/void-packages/blob/5b18878cc72b410bc076ac15218f4c5fa0c3fcbf/srcpkgs/dkms/files/kernel.d/dkms.postinst#L22-L24

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
  SYNC    include/config/auto.conf
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTLD  scripts/dtc/fdtoverlay
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  UPD     include/generated/compile.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
^Cmake[4]: *** [Makefile:1307: asm-generic] Interrupt
Interrupt
make[3]: *** [Makefile:1289: prepare0] Interrupt
make[2]: *** [Makefile:1289: prepare0] Interrupt
make[1]: *** [Makefile:1289: prepare0] Interrupt
make: *** [Makefile:1289: prepare0] Interrupt
```

However, `^C`ing out of that and re-running it succeeds, because `fixdep` and `modpost` were build before the infinite loop:

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
rpi-kernel: configured successfully.
```

And dkms works after that:

```
Building DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
Installing DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
rtl8821cu-dkms-20210916_2: installed successfully.
```

So the issue left to figure out is: why does it infinite loop?


A patch file from https://github.com/void-linux/void-packages/pull/46152.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update/rpi-46152.patch --]
[-- Type: text/x-diff, Size: 15147 bytes --]

From b09595b9fcee1b51f898e5e4dc87ece106e02835 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:51 -0400
Subject: [PATCH 1/4] rpi-kernel: update to 6.1.54.

---
 srcpkgs/rpi-kernel/template | 111 ++++++++++++++++++++++++------------
 1 file changed, 76 insertions(+), 35 deletions(-)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index c49612b7c510a..5b3a3bfcbed6d 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -1,30 +1,29 @@
 # Template file for 'rpi-kernel'
 #
 # We track the latest Raspberry Pi LTS kernel as that is what is used in the
-# official Raspberry Pi OS distribution. This is currently 5.15:
+# official Raspberry Pi OS distribution. This is currently 6.1:
 #
-# https://forums.raspberrypi.com/viewtopic.php?t=322879
+# https://forums.raspberrypi.com/viewtopic.php?t=344246
 #
 # Commit hash is picked from latest tag [1], if appropriate, or from latest
-# "Merge remote-tracking branch 'stable/linux-5.x.y' into rpi-5.x.y" commit.
+# "Merge remote-tracking branch 'stable/linux-6.x.y' into rpi-6.x.y" commit.
 #
 # [1] https://github.com/raspberrypi/linux/tags
 #
 # Upstream documentation: https://www.raspberrypi.com/documentation/computers/linux_kernel.html
-
 pkgname=rpi-kernel
-version=5.15.72
+version=6.1.54
 revision=1
-_githash="3b98eb7a4aeaecd5274108dc1be7a5df94253500"
+_githash=fad58933544bb2a7b7db92847c25c79a83171fa6
 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 <mail@piraty.dev>"
-homepage="http://www.kernel.org"
 license="GPL-2.0-only"
-short_desc="Linux kernel for Raspberry Pi (${version%.*} series [git ${_githash:0:7}])"
+homepage="http://www.kernel.org"
 distfiles="https://github.com/raspberrypi/linux/archive/${_githash}.tar.gz"
-checksum=5cad1fd22f309ddd7b996df748aa21ced72f88d47fdbb8d4bfd9ef3a8a9b6ce9
+checksum=1bd02902fae49351fb16ac0d5ccc3bf4d67aa0640006dbbf8846963519b01ab8
 python_version=3
 
 _kernver="${version}_${revision}"
@@ -72,22 +71,74 @@ do_configure() {
 	esac
 
 	defconfig="arch/${_arch}/configs/${target}"
-	echo "CONFIG_CONNECTOR=y" >> "$defconfig"
-	echo "CONFIG_PROC_EVENTS=y" >> "$defconfig"
-
-	# HID Controllers
-	echo "CONFIG_HID_STEAM=y" >> "$defconfig"
-
-	# Disable GCC plugins
-	echo "# CONFIG_GCC_PLUGINS is not set" >> "$defconfig"
-
-	# LXD 4.2+ support
-	echo "CONFIG_BRIDGE_VLAN_FILTERING=y" >> "$defconfig"
-
-	make ${makejobs} ${_cross} ARCH=${_arch} ${target}
-
-	# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
-	vsed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
+	cp "$defconfig" .config
+
+	cat <<-! > "foo"
+	CONFIG_CONNECTOR=y
+	CONFIG_HID_STEAM=y
+	CONFIG_PROC_EVENTS=y
+	CONFIG_GCC_PLUGINS=n
+	CONFIG_BRIDGE_VLAN_FILTERING=y
+	CONFIG_FUNCTION_TRACER=n
+	CONFIG_STACK_TRACER=n
+	CONFIG_ATM=n
+	CONFIG_SLAB_FREELIST_RANDOM=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_SLAB_FREELIST_HARDENED=y
+	CONFIG_PACKET=m
+	CONFIG_NF_CT_PROTO_DCCP=y
+	CONFIG_NF_CT_PROTO_SCTP=y
+	CONFIG_NF_CT_PROTO_UDPLITE=y
+	CONFIG_BATMAN_ADV=n
+	CONFIG_INPUT_LEDS=m
+	CONFIG_SQUASHFS_LZ4=y
+	CONFIG_STRICT_DEVMEM=y
+	CONFIG_IO_STRICT_DEVMEM=y
+	CONFIG_ENCRYPTED_KEYS=m
+	CONFIG_KEY_DH_OPERATIONS=y
+	CONFIG_HARDENED_USERCOPY=y
+	CONFIG_LOCALVERSION="_${revision}"
+	CONFIG_IP_PNP=n
+	CONFIG_USB_DWC2=m
+	CONFIG_USB_ETH=m
+	CONFIG_RTC_HCTOSYS=y
+	CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+	CONFIG_RTC_DRV_DS1307=y
+	CONFIG_I2C_BCM2835=y
+	CONFIG_MEMCG=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_CGROUP_DEVICE=y
+	CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
+	CONFIG_PSI=y
+	CONFIG_ZSTD_COMPRESS=y
+	CONFIG_LZ4_COMPRESS=y
+	CONFIG_CRYPTO_RNG=y
+	CONFIG_CRYPTO_RNG_DEFAULT=y
+	!
+
+	while read -r line; do
+		# skip comments
+		case "$line" in
+			"#"*) continue;;
+		esac
+		local option=${line%%=*} str=
+		local cmd=$(echo $line | cut -d= -f2)
+		case "$cmd" in
+			y) cmd="enable";;
+			n) cmd="disable";;
+			m) cmd="module";;
+			'"'*) cmd="set-str"; str="${line#*=}";;
+			[0-9]*) cmd="set-val"; str="${line#*=}";;
+			'') continue ;;
+			*) msg_error "Command $cmd not accepted\n" ;;
+		esac
+		msg_normal "config: $cmd: $option $str\n"
+		./scripts/config \
+			--file .config \
+			"--$cmd" "$option" "${str//\"/}"
+	done < foo
+
+	make ${makejobs} ${_cross} ARCH=${_arch} olddefconfig
 }
 
 do_build() {
@@ -190,16 +241,6 @@ do_install() {
 	mkdir -p ${hdrdest}/net/mac80211/
 	cp net/mac80211/*.h ${hdrdest}/net/mac80211
 
-	# Remove unneeded architectures
-	# (save the correct one + Kconfig and delete all others)
-	mkdir -p arch-backup
-	cp -r ${hdrdest}/arch/${_arch} ${hdrdest}/arch/Kconfig arch-backup/
-	rm -rf ${hdrdest}/arch
-	mv arch-backup ${hdrdest}/arch
-	# Keep arch/x86/ras/Kconfig as it is needed by drivers/ras/Kconfig
-	mkdir -p ${hdrdest}/arch/x86/ras
-	cp -a arch/x86/ras/Kconfig ${hdrdest}/arch/x86/ras/Kconfig
-
 	# 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

From 3bcfc04bf613b2f140b5968ac549d9a3a575a31a Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:53 -0400
Subject: [PATCH 2/4] rpi-firmware: update to 20230920.

---
 srcpkgs/rpi-firmware/template | 118 ++++++++++++++++------------------
 1 file changed, 57 insertions(+), 61 deletions(-)

diff --git a/srcpkgs/rpi-firmware/template b/srcpkgs/rpi-firmware/template
index 5086abfa19fec..fd2c1c3ca679c 100644
--- a/srcpkgs/rpi-firmware/template
+++ b/srcpkgs/rpi-firmware/template
@@ -1,82 +1,78 @@
 # Template file for 'rpi-firmware'
-_githash="62efc6a69d4e717bf2833c649d622c8298a37e9c"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-firmware
-version=20220823
-revision=2
+version=20230920
+revision=1
+_rpi_fw=de26b2d7f77404dbe0598d8c52b7ae14a78877b1
+_rpi_bt=9556b08ace2a1735127894642cc8ea6529c04c90
+_rpi_brcm=2c3a8701193ba23d0ef85cdf0d0c9e47baf03dfc
+create_wrksrc=yes
 archs="armv6l* armv7l* aarch64*"
-provides="linux-firmware-broadcom-${version}_${revision}"
-replaces="linux-firmware-broadcom>=0"
-short_desc="Firmware files for the Raspberry Pi (git ${_gitshort})"
+short_desc="Firmware files for the Raspberry Pi"
 maintainer="Piraty <mail@piraty.dev>"
 license="BSD-3-Clause, custom:Cypress"
 homepage="https://github.com/raspberrypi/firmware"
-distfiles="https://github.com/raspberrypi/firmware/archive/${_githash}.tar.gz"
-checksum=3fc5ab7155bde7221245f439971217558300dcbc988ade861cfef4e737de9909
+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://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/LICENCE.cypress>LICENCE.cypress"
+checksum="6d929aa677e6d71485093786877e0bdd3a9a579f55562ac8fca8d33280426d12
+ 9156d90116b921d2e7938b52fad84fbe1d96df622a66c5db09569c735832387a
+ c096ad4a5c3f06ed7d69eba246bf89ada9acba64a5b6f51b1e9c12f99bb1e1a7
+ 51c45e77ddad91a19e96dc8fb75295b2087c279940df2634b23baf71b6dea42c
+ 338c2c6631131f516bfc7e64ef0872bd0402e1f98ef9d0c900eef0c814d90a25
+ fb9f4ec2df5301bd35f416384e103c012c5983024c49aa72fbbaf90177512caa
+ 55071227c94d86369d04f9aff3bbfd4197a78a53dc350295123e1a8b048bba8f
+ 338c2c6631131f516bfc7e64ef0872bd0402e1f98ef9d0c900eef0c814d90a25
+ 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"
+
+provides="linux-firmware-broadcom-${version}_${revision}"
+replaces="linux-firmware-broadcom>=0"
 
 conf_files="/boot/cmdline.txt /boot/config.txt"
 nostrip=yes
 
 do_install() {
-	rm -f boot/*.img
-	rm -rf boot/overlays
-	rm -f boot/*.dtb
-	rm -f boot/COPYING.linux
-
-	vlicense boot/LICENCE.broadcom
-	rm -f boot/LICENCE.broadcom
+	# bootloader
+	vlicense "firmware-${_rpi_fw}/boot/LICENCE.broadcom"
+	rm -rf "firmware-${_rpi_fw}/boot/"*.img \
+		"firmware-${_rpi_fw}/boot/overlays" \
+		"firmware-${_rpi_fw}/boot/"*.dtb \
+		"firmware-${_rpi_fw}/boot/COPYING.linux" \
+		"firmware-${_rpi_fw}/boot/LICENCE.broadcom"
 
 	vmkdir boot
-	cp -R boot/* ${DESTDIR}/boot
+	vcopy "firmware-${_rpi_fw}/boot/*" boot
 
 	# Install configuration files.
-	vinstall ${FILESDIR}/cmdline.txt 644 boot
-	vinstall ${FILESDIR}/config.txt 644 boot
+	vinstall "${FILESDIR}/cmdline.txt" 644 boot
+	vinstall "${FILESDIR}/config.txt" 644 boot
 
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/LICENCE.cypress
-	vlicense LICENCE.cypress
+	# firmware
+	# we can use either the -standard or -minimal 43455 file so use standard by default
+	ln -sfv cyfmac43455-sdio-standard.bin "firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/cypress/cyfmac43455-sdio.bin"
+	vlicense "${XBPS_SRCDISTDIR}/${pkgname}-${version}/LICENCE.cypress"
 
-	# Firmware for rpi3 b and zero wifi chip
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43430-sdio.${f}
-		vinstall brcmfmac43430-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
+	# add original Pi Foundation firmware files
+	# install deref's symlinks and copies a whole file, which makes rpi use duplicated variants specifically from downstream firmware
+	install -Dm644 \
+		"firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/brcm/"brcmfmac*raspberrypi* \
+		-t "${DESTDIR}/usr/lib/firmware/brcm"
 
-	# Firmware for rpi3 b and zero bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430A1.hcd
-	vinstall BCM43430A1.hcd 0644 usr/lib/firmware/brcm
+	# but 43436/43436s/43456 is not in linux-firmware, so copy it normally
+	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
 
-	# Firmware for rpi3 b+ wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43455-sdio.${f}
-		vinstall brcmfmac43455-sdio.${f} 0644 usr/lib/firmware/brcm
+	for file in "${XBPS_SRCDISTDIR}/${pkgname}-${version}/"*.hcd; do
+		vinstall "$file" 0644 usr/lib/firmware/brcm
 	done
-
-	# Firmware for rpi3 b+ bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C0.hcd
-	vinstall BCM4345C0.hcd 0644 usr/lib/firmware/brcm
-
-	# Firmware for rpi zero 2w wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436-sdio.${f}
-		vinstall brcmfmac43436-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436s-sdio.${f}
-		vinstall brcmfmac43436s-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43456-sdio.${f}
-		vinstall brcmfmac43456-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C5.hcd
-	vinstall BCM4345C5.hcd 0644 usr/lib/firmware/brcm
-
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430B0.hcd
-	vinstall BCM43430B0.hcd 0644 usr/lib/firmware/brcm
 }

From 28172f437924d1b32892cf97b132c72949671ad9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:54 -0400
Subject: [PATCH 3/4] rpi-userland: update to 20230920.

---
 srcpkgs/rpi-userland/template | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/rpi-userland/template b/srcpkgs/rpi-userland/template
index 4f1ea38c9e3a6..25fc587bfb55d 100644
--- a/srcpkgs/rpi-userland/template
+++ b/srcpkgs/rpi-userland/template
@@ -1,19 +1,17 @@
 # Template file for 'rpi-userland'
-_githash="97bc8180ad682b004ea224d1db7b8e108eda4397"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-userland
-version=20210623
+version=20230920
 revision=1
+_githash="44a3953fd13d5f0b9b0cd120b904aa7db370244e"
 build_style=cmake
-hostmakedepends="pkg-config"
 configure_args="-DCMAKE_INSTALL_RPATH=\$ORIGIN/../lib"
-short_desc="Raspberry Pi GPU userland libraries and utilities (git ${_gitshort})"
+hostmakedepends="pkg-config"
+short_desc="Raspberry Pi GPU userland libraries and utilities"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/raspberrypi/userland"
 distfiles="https://github.com/raspberrypi/userland/archive/${_githash}.tar.gz"
-checksum=d67def03931215f41b741aed5a3a1bc2bd62fa33f5cc14692e9a4d65f2e0ea27
+checksum=981c376a110f78fe579a72e218888646ccd5d71ab82d04bb1a8d7be1487b45f0
 
 LDFLAGS="-Wl,--no-as-needed"
 archs="armv6l* armv7l* aarch64*"

From cc1243709af08fa98f5adb68628dff6c2b91c085 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 23 Sep 2023 19:11:45 -0400
Subject: [PATCH 4/4] fixup! rpi-kernel: update to 6.1.54.

---
 srcpkgs/rpi-kernel/template | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index 5b3a3bfcbed6d..25bc455082785 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -177,6 +177,7 @@ do_install() {
 	cd ${wrksrc}
 	# 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
 	for file in $(find . -name Kconfig\*); do
@@ -217,6 +218,10 @@ do_install() {
 	if [ -d "arch/${_arch}/tools" ]; then
 		cp -a 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"
 
 	# copy arch includes for external modules
 	mkdir -p ${hdrdest}/arch/${_arch}

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (9 preceding siblings ...)
  2023-09-23 23:12 ` classabbyamp
@ 2023-09-23 23:13 ` classabbyamp
  2023-09-23 23:15 ` classabbyamp
                   ` (31 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-23 23:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732429728

Comment:
I was able to get it to work with fewer files added (see cc12437), why did you need to add the vdso stuff?

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (10 preceding siblings ...)
  2023-09-23 23:13 ` classabbyamp
@ 2023-09-23 23:15 ` classabbyamp
  2023-09-23 23:28 ` moabeat-berlin
                   ` (30 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-23 23:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732429728

Comment:
I was able to get it to work with fewer files added (see cc12437), why did you need to add the vdso stuff?

also, will post builds for all to test tomorrow

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (11 preceding siblings ...)
  2023-09-23 23:15 ` classabbyamp
@ 2023-09-23 23:28 ` moabeat-berlin
  2023-09-23 23:29 ` moabeat-berlin
                   ` (29 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: moabeat-berlin @ 2023-09-23 23:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2881 bytes --]

New comment by moabeat-berlin on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732431954

Comment:
It just didn't work for me without them. If `lib/vdso/Makefile` is not present, the result is this:

```
berry-void# make prepare           
  SYNC    include/config/auto.conf
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTLD  scripts/dtc/fdtoverlay
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  UPD     include/generated/compile.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  CALL    scripts/checksyscalls.sh
  CHKSHA1 include/linux/atomic/atomic-arch-fallback.h
  CHKSHA1 include/linux/atomic/atomic-instrumented.h
  CHKSHA1 include/linux/atomic/atomic-long.h
arch/arm64/kernel/vdso/Makefile:12: lib/vdso/Makefile: No such file or directory
make[1]: *** No rule to make target 'lib/vdso/Makefile'.  Stop.
make: *** [arch/arm64/Makefile:199: vdso_prepare] Error 2
```

Subsequently, `gettimeofday.c` is required. I'm running it on an RPi4B with aarch64. Maybe running a 32-Bit architecture it's not required? [In the template vdso seems to get handled separately for aarch64](https://github.com/classabbyamp/void-packages/blob/update/rpi/srcpkgs/rpi-kernel/template#L233).

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (12 preceding siblings ...)
  2023-09-23 23:28 ` moabeat-berlin
@ 2023-09-23 23:29 ` moabeat-berlin
  2023-09-23 23:59 ` classabbyamp
                   ` (28 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: moabeat-berlin @ 2023-09-23 23:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2871 bytes --]

New comment by moabeat-berlin on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732431954

Comment:
It just didn't work for me without them. If `lib/vdso/Makefile` is not present, the result is this:

```
# make prepare           
  SYNC    include/config/auto.conf
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTLD  scripts/dtc/fdtoverlay
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  UPD     include/generated/compile.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  CALL    scripts/checksyscalls.sh
  CHKSHA1 include/linux/atomic/atomic-arch-fallback.h
  CHKSHA1 include/linux/atomic/atomic-instrumented.h
  CHKSHA1 include/linux/atomic/atomic-long.h
arch/arm64/kernel/vdso/Makefile:12: lib/vdso/Makefile: No such file or directory
make[1]: *** No rule to make target 'lib/vdso/Makefile'.  Stop.
make: *** [arch/arm64/Makefile:199: vdso_prepare] Error 2
```

Subsequently, `gettimeofday.c` is required. I'm running it on an RPi4B with aarch64. Maybe running a 32-Bit architecture it's not required? [In the template vdso seems to get handled separately for aarch64](https://github.com/classabbyamp/void-packages/blob/update/rpi/srcpkgs/rpi-kernel/template#L233).

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (13 preceding siblings ...)
  2023-09-23 23:29 ` moabeat-berlin
@ 2023-09-23 23:59 ` classabbyamp
  2023-09-24  0:20 ` moabeat-berlin
                   ` (27 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-23 23:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732435730

Comment:
I was testing on aarch64-musl (rpi4), also was running `make prepare0` not prepare

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (14 preceding siblings ...)
  2023-09-23 23:59 ` classabbyamp
@ 2023-09-24  0:20 ` moabeat-berlin
  2023-09-24  0:21 ` moabeat-berlin
                   ` (26 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: moabeat-berlin @ 2023-09-24  0:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 887 bytes --]

New comment by moabeat-berlin on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732440086

Comment:
Right, `make prepare0` seems to be sufficient for `/etc/kernel.d/post-install/10-dkms` and also for installing a dkms package after the kernel and headers have already been installed before seems to work. Since `vdso_prepare` is only a prerequisite for the `prepare` target, they seem to be not required.

```
grep -r "^prepare:" .
./Makefile:prepare: prepare0
./Makefile:prepare: headers
./Makefile:prepare: tools/objtool
./Makefile:prepare: tools/bpf/resolve_btfids
./Makefile:prepare: CC_VERSION_TEXT := $(CC_VERSION_TEXT)
./Makefile:prepare:
./arch/arm64/Makefile:prepare: stack_protector_prepare
./arch/arm64/Makefile:prepare: vdso_prepare <-- here
./Kbuild:prepare: $(offsets-file) missing-syscalls $(atomic-checks)
```

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (15 preceding siblings ...)
  2023-09-24  0:20 ` moabeat-berlin
@ 2023-09-24  0:21 ` moabeat-berlin
  2023-09-24 17:53 ` tsjk
                   ` (25 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: moabeat-berlin @ 2023-09-24  0:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 883 bytes --]

New comment by moabeat-berlin on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732440086

Comment:
Right, `make prepare0` seems to be sufficient for `/etc/kernel.d/post-install/10-dkms` and also installing a dkms package after the kernel and headers have already been installed before seems to work. Since `vdso_prepare` is only a prerequisite for the `prepare` target, they seem to be not required.

```
grep -r "^prepare:" .
./Makefile:prepare: prepare0
./Makefile:prepare: headers
./Makefile:prepare: tools/objtool
./Makefile:prepare: tools/bpf/resolve_btfids
./Makefile:prepare: CC_VERSION_TEXT := $(CC_VERSION_TEXT)
./Makefile:prepare:
./arch/arm64/Makefile:prepare: stack_protector_prepare
./arch/arm64/Makefile:prepare: vdso_prepare <-- here
./Kbuild:prepare: $(offsets-file) missing-syscalls $(atomic-checks)
```

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (16 preceding siblings ...)
  2023-09-24  0:21 ` moabeat-berlin
@ 2023-09-24 17:53 ` tsjk
  2023-09-24 17:54 ` tsjk
                   ` (24 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: tsjk @ 2023-09-24 17:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

New comment by tsjk on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732630838

Comment:
I built 6.1.54_1, and installed it on my 1B. While dkms didn't fail, the driver compilation did. I think it's unrelated, as it was trying to compile rtl8192cu from https://github.com/pvaret/rtl8192cu-fixes. That likely doesn't build for v6.1 anymore.
I have another 1B that is now building rtl88XXau as part of the 10-dkms  post-install kernel hook. Hasn't died yet - which is promising.

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (17 preceding siblings ...)
  2023-09-24 17:53 ` tsjk
@ 2023-09-24 17:54 ` tsjk
  2023-09-24 17:54 ` tsjk
                   ` (23 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: tsjk @ 2023-09-24 17:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 535 bytes --]

New comment by tsjk on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732630838

Comment:
I built 6.1.54_1, and installed it on one of my 1Bs. While dkms didn't fail, the driver compilation did. I think it's unrelated, as it was trying to compile rtl8192cu from https://github.com/pvaret/rtl8192cu-fixes. That likely doesn't build for v6.1 anymore.
I have another 1B that is now building rtl88XXau as part of the 10-dkms  post-install kernel hook. Hasn't died yet - which is promising.

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (18 preceding siblings ...)
  2023-09-24 17:54 ` tsjk
@ 2023-09-24 17:54 ` tsjk
  2023-09-24 19:53 ` tsjk
                   ` (22 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: tsjk @ 2023-09-24 17:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

New comment by tsjk on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732630838

Comment:
I built 6.1.54_1, and installed it on one of my 1Bs. While dkms itself didn't fail, the driver compilation did. I think it's unrelated, as it was trying to compile rtl8192cu from https://github.com/pvaret/rtl8192cu-fixes. That likely doesn't build for v6.1 anymore.
I have another 1B that is now building rtl88XXau as part of the 10-dkms  post-install kernel hook. Hasn't died yet - which is promising.

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (19 preceding siblings ...)
  2023-09-24 17:54 ` tsjk
@ 2023-09-24 19:53 ` tsjk
  2023-09-25  6:33 ` [PR PATCH] [Updated] " classabbyamp
                   ` (21 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: tsjk @ 2023-09-24 19:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

New comment by tsjk on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732630838

Comment:
I built 6.1.54_1, and installed it on one of my 1Bs. While dkms itself didn't fail, the driver compilation did. I think it's unrelated, as it was trying to compile rtl8192cu from https://github.com/pvaret/rtl8192cu-fixes. That likely doesn't build for v6.1 anymore.
I have another 1B that is now building rtl88XXau as part of the 10-dkms  post-install kernel hook. Hasn't died yet - which is promising.

**EDIT**: It built successfully. I think this might work.

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PR PATCH] [Updated] rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (20 preceding siblings ...)
  2023-09-24 19:53 ` tsjk
@ 2023-09-25  6:33 ` classabbyamp
  2023-09-25  6:40 ` classabbyamp
                   ` (20 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-25  6:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5063 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages update/rpi
https://github.com/void-linux/void-packages/pull/46152

rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
- rpi-kernel: update to 6.1.54.
- rpi-firmware: update to 20230920.
- rpi-userland: update to 20230920.

continuation of #43600, made a new PR to clean things up

builds for testing: https://devspace.voidlinux.org/abby/updates/rpi/

#### Testing the changes
- I tested the changes in this PR: **YES**

Still getting the DKMS/headers issue:

When building `fixdep` and `modpost` in `/etc/kernel.d/post-install/10-dkms`, it gets stuck in an infinite makefile loop:

https://github.com/void-linux/void-packages/blob/5b18878cc72b410bc076ac15218f4c5fa0c3fcbf/srcpkgs/dkms/files/kernel.d/dkms.postinst#L22-L24

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
  SYNC    include/config/auto.conf
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTLD  scripts/dtc/fdtoverlay
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  UPD     include/generated/compile.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
^Cmake[4]: *** [Makefile:1307: asm-generic] Interrupt
Interrupt
make[3]: *** [Makefile:1289: prepare0] Interrupt
make[2]: *** [Makefile:1289: prepare0] Interrupt
make[1]: *** [Makefile:1289: prepare0] Interrupt
make: *** [Makefile:1289: prepare0] Interrupt
```

However, `^C`ing out of that and re-running it succeeds, because `fixdep` and `modpost` were build before the infinite loop:

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
rpi-kernel: configured successfully.
```

And dkms works after that:

```
Building DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
Installing DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
rtl8821cu-dkms-20210916_2: installed successfully.
```

So the issue left to figure out is: why does it infinite loop?


A patch file from https://github.com/void-linux/void-packages/pull/46152.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update/rpi-46152.patch --]
[-- Type: text/x-diff, Size: 20432 bytes --]

From 40f5166bf72e43317084b8f2a7198bc0a6b4adbf Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:51 -0400
Subject: [PATCH 1/3] rpi-kernel: update to 6.1.54.

---
 srcpkgs/rpi-kernel/template | 216 ++++++++++++++++++++++--------------
 1 file changed, 130 insertions(+), 86 deletions(-)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index c49612b7c510a..2fa1bb54b683e 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -1,30 +1,29 @@
 # Template file for 'rpi-kernel'
 #
 # We track the latest Raspberry Pi LTS kernel as that is what is used in the
-# official Raspberry Pi OS distribution. This is currently 5.15:
+# official Raspberry Pi OS distribution. This is currently 6.1:
 #
-# https://forums.raspberrypi.com/viewtopic.php?t=322879
+# https://forums.raspberrypi.com/viewtopic.php?t=344246
 #
 # Commit hash is picked from latest tag [1], if appropriate, or from latest
-# "Merge remote-tracking branch 'stable/linux-5.x.y' into rpi-5.x.y" commit.
+# "Merge remote-tracking branch 'stable/linux-6.x.y' into rpi-6.x.y" commit.
 #
 # [1] https://github.com/raspberrypi/linux/tags
 #
 # Upstream documentation: https://www.raspberrypi.com/documentation/computers/linux_kernel.html
-
 pkgname=rpi-kernel
-version=5.15.72
+version=6.1.54
 revision=1
-_githash="3b98eb7a4aeaecd5274108dc1be7a5df94253500"
+_githash=fad58933544bb2a7b7db92847c25c79a83171fa6
 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 <mail@piraty.dev>"
-homepage="http://www.kernel.org"
 license="GPL-2.0-only"
-short_desc="Linux kernel for Raspberry Pi (${version%.*} series [git ${_githash:0:7}])"
+homepage="http://www.kernel.org"
 distfiles="https://github.com/raspberrypi/linux/archive/${_githash}.tar.gz"
-checksum=5cad1fd22f309ddd7b996df748aa21ced72f88d47fdbb8d4bfd9ef3a8a9b6ce9
+checksum=1bd02902fae49351fb16ac0d5ccc3bf4d67aa0640006dbbf8846963519b01ab8
 python_version=3
 
 _kernver="${version}_${revision}"
@@ -45,18 +44,17 @@ mutable_files="
  /usr/lib/modules/${_kernver}/modules.alias.bin
  /usr/lib/modules/${_kernver}/modules.devname"
 
-_arch=
-_image_target=
-_image_name=
 case "$XBPS_TARGET_MACHINE" in
 	armv6l*) _arch=arm; _image_target=zImage; _image_name=kernel.img ;;
 	armv7l*) _arch=arm; _image_target=zImage; _image_name=kernel7.img ;;
 	aarch64*) _arch=arm64; _image_target=Image.gz; _image_name=kernel8.img ;;
+	*) broken="No Raspberry Pi exists for this arch" ;;
 esac
 
-_cross=
 if [ "$CROSS_BUILD" ]; then
 	_cross="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
+else
+	_cross=
 fi
 
 do_configure() {
@@ -72,27 +70,79 @@ do_configure() {
 	esac
 
 	defconfig="arch/${_arch}/configs/${target}"
-	echo "CONFIG_CONNECTOR=y" >> "$defconfig"
-	echo "CONFIG_PROC_EVENTS=y" >> "$defconfig"
-
-	# HID Controllers
-	echo "CONFIG_HID_STEAM=y" >> "$defconfig"
-
-	# Disable GCC plugins
-	echo "# CONFIG_GCC_PLUGINS is not set" >> "$defconfig"
-
-	# LXD 4.2+ support
-	echo "CONFIG_BRIDGE_VLAN_FILTERING=y" >> "$defconfig"
-
-	make ${makejobs} ${_cross} ARCH=${_arch} ${target}
-
-	# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
-	vsed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
+	cp "$defconfig" .config
+
+	cat <<-! > "foo"
+	CONFIG_CONNECTOR=y
+	CONFIG_HID_STEAM=y
+	CONFIG_PROC_EVENTS=y
+	CONFIG_GCC_PLUGINS=n
+	CONFIG_BRIDGE_VLAN_FILTERING=y
+	CONFIG_FUNCTION_TRACER=n
+	CONFIG_STACK_TRACER=n
+	CONFIG_ATM=n
+	CONFIG_SLAB_FREELIST_RANDOM=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_SLAB_FREELIST_HARDENED=y
+	CONFIG_PACKET=m
+	CONFIG_NF_CT_PROTO_DCCP=y
+	CONFIG_NF_CT_PROTO_SCTP=y
+	CONFIG_NF_CT_PROTO_UDPLITE=y
+	CONFIG_BATMAN_ADV=n
+	CONFIG_INPUT_LEDS=m
+	CONFIG_SQUASHFS_LZ4=y
+	CONFIG_STRICT_DEVMEM=y
+	CONFIG_IO_STRICT_DEVMEM=y
+	CONFIG_ENCRYPTED_KEYS=m
+	CONFIG_KEY_DH_OPERATIONS=y
+	CONFIG_HARDENED_USERCOPY=y
+	CONFIG_LOCALVERSION="_${revision}"
+	CONFIG_IP_PNP=n
+	CONFIG_USB_DWC2=m
+	CONFIG_USB_ETH=m
+	CONFIG_RTC_HCTOSYS=y
+	CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+	CONFIG_RTC_DRV_DS1307=y
+	CONFIG_I2C_BCM2835=y
+	CONFIG_MEMCG=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_CGROUP_DEVICE=y
+	CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
+	CONFIG_PSI=y
+	CONFIG_ZSTD_COMPRESS=y
+	CONFIG_LZ4_COMPRESS=y
+	CONFIG_CRYPTO_RNG=y
+	CONFIG_CRYPTO_RNG_DEFAULT=y
+	!
+
+	while read -r line; do
+		# skip comments
+		case "$line" in
+			"#"*) continue;;
+		esac
+		local option=${line%%=*} str=
+		local cmd="$(echo "$line" | cut -d= -f2)"
+		case "$cmd" in
+			y) cmd="enable";;
+			n) cmd="disable";;
+			m) cmd="module";;
+			'"'*) cmd="set-str"; str="${line#*=}";;
+			[0-9]*) cmd="set-val"; str="${line#*=}";;
+			'') continue ;;
+			*) msg_error "Command $cmd not accepted\n" ;;
+		esac
+		msg_normal "config: $cmd: $option $str\n"
+		./scripts/config \
+			--file .config \
+			"--$cmd" "$option" "${str//\"/}"
+	done < foo
+
+	make "${makejobs}" "${_cross}" ARCH="${_arch}" olddefconfig
 }
 
 do_build() {
-	make ${makejobs} ${_cross} ARCH=${_arch} prepare
-	make ${makejobs} ${_cross} ARCH=${_arch} ${_image_target} modules dtbs
+	make "${makejobs}" "${_cross}" ARCH="${_arch}" prepare
+	make "${makejobs}" "${_cross}" ARCH="${_arch}" "${_image_target}" modules dtbs
 }
 
 do_install() {
@@ -102,110 +152,104 @@ do_install() {
 	vsed -i -e '2iexit 0' scripts/depmod.sh
 
 	# Install kernel, firmware and modules
-	make ${makejobs} ARCH=${_arch} INSTALL_MOD_PATH=${DESTDIR} modules_install
+	make "${makejobs}" ARCH="${_arch}" INSTALL_MOD_PATH="${DESTDIR}" modules_install
 
 	# Install device tree blobs
-	make ${makejobs} ARCH=${_arch} INSTALL_DTBS_PATH=${DESTDIR}/boot dtbs_install
+	make "${makejobs}" "ARCH=${_arch}" 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
+		mv "${DESTDIR}"/boot/broadcom/*dtb "${DESTDIR}/boot"
 	fi
 
 	# Install kernel image
-	vinstall arch/${_arch}/boot/${_image_target} 644 boot ${_image_name}
+	vinstall "arch/${_arch}/boot/${_image_target}" 644 boot "${_image_name}"
 
 	# Switch to /usr.
 	vmkdir usr
-	mv ${DESTDIR}/lib ${DESTDIR}/usr
+	mv "${DESTDIR}/lib" "${DESTDIR}/usr"
 
-	cd ${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/${sourcepkg}-headers-${_kernver}" build
+	popd
 
-	cd ${wrksrc}
 	# Install required headers to build external modules
-	install -Dm644 Makefile ${hdrdest}/Makefile
-	install -Dm644 kernel/Makefile ${hdrdest}/kernel/Makefile
-	install -Dm644 .config ${hdrdest}/.config
-	for file in $(find . -name Kconfig\*); do
-		mkdir -p ${hdrdest}/$(dirname $file)
-		install -Dm644 $file ${hdrdest}/${file}
-	done
-	for file in $(find arch/${_arch} scripts -name module.lds -o -name Kbuild.platforms -o -name Platform); do
-		mkdir -p ${hdrdest}/$(dirname $file)
-		install -Dm644 $file ${hdrdest}/${file}
-	done
-	mkdir -p ${hdrdest}/include
+	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"
 
 	# 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 \
 		math-emu media net pcmcia scsi sound trace uapi vdso video xen; do
-		[ -d include/$i ] && cp -a include/$i ${hdrdest}/include
+		[ -d include/$i ] && cp -a "include/$i" "${hdrdest}/include"
 	done
 
-	cd ${wrksrc}
 	# 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 "${makejobs}" ARCH="${_arch}" _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
+	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"
 	if [ -d "arch/${_arch}/tools" ]; then
-		cp -a arch/${_arch}/tools ${hdrdest}/arch/${_arch}
+		cp -a "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"
 
 	# copy arch includes for external modules
-	mkdir -p ${hdrdest}/arch/${_arch}
-	cp -a arch/${_arch}/include ${hdrdest}/arch/${_arch}
+	mkdir -p "${hdrdest}/arch/${_arch}"
+	cp -a "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
+	mkdir -p "${hdrdest}/arch/${_arch}/kernel"
+	cp "arch/${_arch}/Makefile" "${hdrdest}/arch/${_arch}"
+	cp "arch/${_arch}/kernel/asm-offsets.s" "${hdrdest}/arch/${_arch}/kernel"
 	if [ "$_arch" = "arm64" ] ; then
-		cp -a arch/${_arch}/kernel/vdso ${hdrdest}/arch/${_arch}/kernel/
+		cp -a "arch/${_arch}/kernel/vdso" "${hdrdest}/arch/${_arch}/kernel/"
 	fi
 
 	# Add md headers
-	mkdir -p ${hdrdest}/drivers/md
-	cp drivers/md/*.h ${hdrdest}/drivers/md
+	mkdir -p "${hdrdest}/drivers/md"
+	cp drivers/md/*.h "${hdrdest}/drivers/md"
 
 	# Add inotify.h
-	mkdir -p ${hdrdest}/include/linux
-	cp include/linux/inotify.h ${hdrdest}/include/linux
+	mkdir -p "${hdrdest}/include/linux"
+	cp include/linux/inotify.h "${hdrdest}/include/linux"
 
 	# Add wireless headers
-	mkdir -p ${hdrdest}/net/mac80211/
-	cp net/mac80211/*.h ${hdrdest}/net/mac80211
-
-	# Remove unneeded architectures
-	# (save the correct one + Kconfig and delete all others)
-	mkdir -p arch-backup
-	cp -r ${hdrdest}/arch/${_arch} ${hdrdest}/arch/Kconfig arch-backup/
-	rm -rf ${hdrdest}/arch
-	mv arch-backup ${hdrdest}/arch
-	# Keep arch/x86/ras/Kconfig as it is needed by drivers/ras/Kconfig
-	mkdir -p ${hdrdest}/arch/x86/ras
-	cp -a arch/x86/ras/Kconfig ${hdrdest}/arch/x86/ras/Kconfig
+	mkdir -p "${hdrdest}/net/mac80211/"
+	cp 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
+	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}"
 }
 
 subpackages="rpi-kernel-headers"

From bd20743ca8247cb8d45d0b7c85f88702d49f9f83 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:53 -0400
Subject: [PATCH 2/3] rpi-firmware: update to 20230920.

---
 srcpkgs/rpi-firmware/template | 118 ++++++++++++++++------------------
 1 file changed, 57 insertions(+), 61 deletions(-)

diff --git a/srcpkgs/rpi-firmware/template b/srcpkgs/rpi-firmware/template
index 5086abfa19fec..0a2efa3b80db0 100644
--- a/srcpkgs/rpi-firmware/template
+++ b/srcpkgs/rpi-firmware/template
@@ -1,82 +1,78 @@
 # Template file for 'rpi-firmware'
-_githash="62efc6a69d4e717bf2833c649d622c8298a37e9c"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-firmware
-version=20220823
-revision=2
+version=20230925
+revision=1
+_rpi_fw=6b37a457122714aa14b2c7df0926455173fd04f1
+_rpi_bt=9556b08ace2a1735127894642cc8ea6529c04c90
+_rpi_brcm=2c3a8701193ba23d0ef85cdf0d0c9e47baf03dfc
+create_wrksrc=yes
 archs="armv6l* armv7l* aarch64*"
-provides="linux-firmware-broadcom-${version}_${revision}"
-replaces="linux-firmware-broadcom>=0"
-short_desc="Firmware files for the Raspberry Pi (git ${_gitshort})"
+short_desc="Firmware files for the Raspberry Pi"
 maintainer="Piraty <mail@piraty.dev>"
 license="BSD-3-Clause, custom:Cypress"
 homepage="https://github.com/raspberrypi/firmware"
-distfiles="https://github.com/raspberrypi/firmware/archive/${_githash}.tar.gz"
-checksum=3fc5ab7155bde7221245f439971217558300dcbc988ade861cfef4e737de9909
+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://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
+ 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"
+
+provides="linux-firmware-broadcom-${version}_${revision}"
+replaces="linux-firmware-broadcom>=0"
 
 conf_files="/boot/cmdline.txt /boot/config.txt"
 nostrip=yes
 
 do_install() {
-	rm -f boot/*.img
-	rm -rf boot/overlays
-	rm -f boot/*.dtb
-	rm -f boot/COPYING.linux
-
-	vlicense boot/LICENCE.broadcom
-	rm -f boot/LICENCE.broadcom
+	# bootloader
+	vlicense "firmware-${_rpi_fw}/boot/LICENCE.broadcom"
+	rm -rf "firmware-${_rpi_fw}/boot/"*.img \
+		"firmware-${_rpi_fw}/boot/overlays" \
+		"firmware-${_rpi_fw}/boot/"*.dtb \
+		"firmware-${_rpi_fw}/boot/COPYING.linux" \
+		"firmware-${_rpi_fw}/boot/LICENCE.broadcom"
 
 	vmkdir boot
-	cp -R boot/* ${DESTDIR}/boot
+	vcopy "firmware-${_rpi_fw}/boot/*" boot
 
 	# Install configuration files.
-	vinstall ${FILESDIR}/cmdline.txt 644 boot
-	vinstall ${FILESDIR}/config.txt 644 boot
+	vinstall "${FILESDIR}/cmdline.txt" 644 boot
+	vinstall "${FILESDIR}/config.txt" 644 boot
 
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/LICENCE.cypress
-	vlicense LICENCE.cypress
+	# firmware
+	# we can use either the -standard or -minimal 43455 file so use standard by default
+	ln -sfv cyfmac43455-sdio-standard.bin "firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/cypress/cyfmac43455-sdio.bin"
+	vlicense "${XBPS_SRCDISTDIR}/${pkgname}-${version}/LICENCE.cypress"
 
-	# Firmware for rpi3 b and zero wifi chip
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43430-sdio.${f}
-		vinstall brcmfmac43430-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
+	# add original Pi Foundation firmware files
+	# install deref's symlinks and copies a whole file, which makes rpi use duplicated variants specifically from downstream firmware
+	install -Dm644 \
+		"firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/brcm/"brcmfmac*raspberrypi* \
+		-t "${DESTDIR}/usr/lib/firmware/brcm"
 
-	# Firmware for rpi3 b and zero bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430A1.hcd
-	vinstall BCM43430A1.hcd 0644 usr/lib/firmware/brcm
+	# but 43436/43436s/43456 is not in linux-firmware, so copy it normally
+	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
 
-	# Firmware for rpi3 b+ wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43455-sdio.${f}
-		vinstall brcmfmac43455-sdio.${f} 0644 usr/lib/firmware/brcm
+	for file in "${XBPS_SRCDISTDIR}/${pkgname}-${version}/"*.hcd; do
+		vinstall "$file" 0644 usr/lib/firmware/brcm
 	done
-
-	# Firmware for rpi3 b+ bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C0.hcd
-	vinstall BCM4345C0.hcd 0644 usr/lib/firmware/brcm
-
-	# Firmware for rpi zero 2w wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436-sdio.${f}
-		vinstall brcmfmac43436-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436s-sdio.${f}
-		vinstall brcmfmac43436s-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43456-sdio.${f}
-		vinstall brcmfmac43456-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C5.hcd
-	vinstall BCM4345C5.hcd 0644 usr/lib/firmware/brcm
-
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430B0.hcd
-	vinstall BCM43430B0.hcd 0644 usr/lib/firmware/brcm
 }

From e2969f9b472b361e60735d623ee953739fb4cdbb Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:54 -0400
Subject: [PATCH 3/3] rpi-userland: update to 20230920.

---
 srcpkgs/rpi-userland/template | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/rpi-userland/template b/srcpkgs/rpi-userland/template
index 4f1ea38c9e3a6..25fc587bfb55d 100644
--- a/srcpkgs/rpi-userland/template
+++ b/srcpkgs/rpi-userland/template
@@ -1,19 +1,17 @@
 # Template file for 'rpi-userland'
-_githash="97bc8180ad682b004ea224d1db7b8e108eda4397"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-userland
-version=20210623
+version=20230920
 revision=1
+_githash="44a3953fd13d5f0b9b0cd120b904aa7db370244e"
 build_style=cmake
-hostmakedepends="pkg-config"
 configure_args="-DCMAKE_INSTALL_RPATH=\$ORIGIN/../lib"
-short_desc="Raspberry Pi GPU userland libraries and utilities (git ${_gitshort})"
+hostmakedepends="pkg-config"
+short_desc="Raspberry Pi GPU userland libraries and utilities"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/raspberrypi/userland"
 distfiles="https://github.com/raspberrypi/userland/archive/${_githash}.tar.gz"
-checksum=d67def03931215f41b741aed5a3a1bc2bd62fa33f5cc14692e9a4d65f2e0ea27
+checksum=981c376a110f78fe579a72e218888646ccd5d71ab82d04bb1a8d7be1487b45f0
 
 LDFLAGS="-Wl,--no-as-needed"
 archs="armv6l* armv7l* aarch64*"

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PR PATCH] [Updated] rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (21 preceding siblings ...)
  2023-09-25  6:33 ` [PR PATCH] [Updated] " classabbyamp
@ 2023-09-25  6:40 ` classabbyamp
  2023-09-25  8:44 ` tsjk
                   ` (19 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-25  6:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5063 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages update/rpi
https://github.com/void-linux/void-packages/pull/46152

rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
- rpi-kernel: update to 6.1.54.
- rpi-firmware: update to 20230920.
- rpi-userland: update to 20230920.

continuation of #43600, made a new PR to clean things up

builds for testing: https://devspace.voidlinux.org/abby/updates/rpi/

#### Testing the changes
- I tested the changes in this PR: **YES**

Still getting the DKMS/headers issue:

When building `fixdep` and `modpost` in `/etc/kernel.d/post-install/10-dkms`, it gets stuck in an infinite makefile loop:

https://github.com/void-linux/void-packages/blob/5b18878cc72b410bc076ac15218f4c5fa0c3fcbf/srcpkgs/dkms/files/kernel.d/dkms.postinst#L22-L24

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
  SYNC    include/config/auto.conf
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTLD  scripts/dtc/fdtoverlay
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  UPD     include/generated/compile.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
^Cmake[4]: *** [Makefile:1307: asm-generic] Interrupt
Interrupt
make[3]: *** [Makefile:1289: prepare0] Interrupt
make[2]: *** [Makefile:1289: prepare0] Interrupt
make[1]: *** [Makefile:1289: prepare0] Interrupt
make: *** [Makefile:1289: prepare0] Interrupt
```

However, `^C`ing out of that and re-running it succeeds, because `fixdep` and `modpost` were build before the infinite loop:

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
rpi-kernel: configured successfully.
```

And dkms works after that:

```
Building DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
Installing DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
rtl8821cu-dkms-20210916_2: installed successfully.
```

So the issue left to figure out is: why does it infinite loop?


A patch file from https://github.com/void-linux/void-packages/pull/46152.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update/rpi-46152.patch --]
[-- Type: text/x-diff, Size: 20432 bytes --]

From 40f5166bf72e43317084b8f2a7198bc0a6b4adbf Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:51 -0400
Subject: [PATCH 1/3] rpi-kernel: update to 6.1.54.

---
 srcpkgs/rpi-kernel/template | 216 ++++++++++++++++++++++--------------
 1 file changed, 130 insertions(+), 86 deletions(-)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index c49612b7c510a..2fa1bb54b683e 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -1,30 +1,29 @@
 # Template file for 'rpi-kernel'
 #
 # We track the latest Raspberry Pi LTS kernel as that is what is used in the
-# official Raspberry Pi OS distribution. This is currently 5.15:
+# official Raspberry Pi OS distribution. This is currently 6.1:
 #
-# https://forums.raspberrypi.com/viewtopic.php?t=322879
+# https://forums.raspberrypi.com/viewtopic.php?t=344246
 #
 # Commit hash is picked from latest tag [1], if appropriate, or from latest
-# "Merge remote-tracking branch 'stable/linux-5.x.y' into rpi-5.x.y" commit.
+# "Merge remote-tracking branch 'stable/linux-6.x.y' into rpi-6.x.y" commit.
 #
 # [1] https://github.com/raspberrypi/linux/tags
 #
 # Upstream documentation: https://www.raspberrypi.com/documentation/computers/linux_kernel.html
-
 pkgname=rpi-kernel
-version=5.15.72
+version=6.1.54
 revision=1
-_githash="3b98eb7a4aeaecd5274108dc1be7a5df94253500"
+_githash=fad58933544bb2a7b7db92847c25c79a83171fa6
 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 <mail@piraty.dev>"
-homepage="http://www.kernel.org"
 license="GPL-2.0-only"
-short_desc="Linux kernel for Raspberry Pi (${version%.*} series [git ${_githash:0:7}])"
+homepage="http://www.kernel.org"
 distfiles="https://github.com/raspberrypi/linux/archive/${_githash}.tar.gz"
-checksum=5cad1fd22f309ddd7b996df748aa21ced72f88d47fdbb8d4bfd9ef3a8a9b6ce9
+checksum=1bd02902fae49351fb16ac0d5ccc3bf4d67aa0640006dbbf8846963519b01ab8
 python_version=3
 
 _kernver="${version}_${revision}"
@@ -45,18 +44,17 @@ mutable_files="
  /usr/lib/modules/${_kernver}/modules.alias.bin
  /usr/lib/modules/${_kernver}/modules.devname"
 
-_arch=
-_image_target=
-_image_name=
 case "$XBPS_TARGET_MACHINE" in
 	armv6l*) _arch=arm; _image_target=zImage; _image_name=kernel.img ;;
 	armv7l*) _arch=arm; _image_target=zImage; _image_name=kernel7.img ;;
 	aarch64*) _arch=arm64; _image_target=Image.gz; _image_name=kernel8.img ;;
+	*) broken="No Raspberry Pi exists for this arch" ;;
 esac
 
-_cross=
 if [ "$CROSS_BUILD" ]; then
 	_cross="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
+else
+	_cross=
 fi
 
 do_configure() {
@@ -72,27 +70,79 @@ do_configure() {
 	esac
 
 	defconfig="arch/${_arch}/configs/${target}"
-	echo "CONFIG_CONNECTOR=y" >> "$defconfig"
-	echo "CONFIG_PROC_EVENTS=y" >> "$defconfig"
-
-	# HID Controllers
-	echo "CONFIG_HID_STEAM=y" >> "$defconfig"
-
-	# Disable GCC plugins
-	echo "# CONFIG_GCC_PLUGINS is not set" >> "$defconfig"
-
-	# LXD 4.2+ support
-	echo "CONFIG_BRIDGE_VLAN_FILTERING=y" >> "$defconfig"
-
-	make ${makejobs} ${_cross} ARCH=${_arch} ${target}
-
-	# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
-	vsed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
+	cp "$defconfig" .config
+
+	cat <<-! > "foo"
+	CONFIG_CONNECTOR=y
+	CONFIG_HID_STEAM=y
+	CONFIG_PROC_EVENTS=y
+	CONFIG_GCC_PLUGINS=n
+	CONFIG_BRIDGE_VLAN_FILTERING=y
+	CONFIG_FUNCTION_TRACER=n
+	CONFIG_STACK_TRACER=n
+	CONFIG_ATM=n
+	CONFIG_SLAB_FREELIST_RANDOM=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_SLAB_FREELIST_HARDENED=y
+	CONFIG_PACKET=m
+	CONFIG_NF_CT_PROTO_DCCP=y
+	CONFIG_NF_CT_PROTO_SCTP=y
+	CONFIG_NF_CT_PROTO_UDPLITE=y
+	CONFIG_BATMAN_ADV=n
+	CONFIG_INPUT_LEDS=m
+	CONFIG_SQUASHFS_LZ4=y
+	CONFIG_STRICT_DEVMEM=y
+	CONFIG_IO_STRICT_DEVMEM=y
+	CONFIG_ENCRYPTED_KEYS=m
+	CONFIG_KEY_DH_OPERATIONS=y
+	CONFIG_HARDENED_USERCOPY=y
+	CONFIG_LOCALVERSION="_${revision}"
+	CONFIG_IP_PNP=n
+	CONFIG_USB_DWC2=m
+	CONFIG_USB_ETH=m
+	CONFIG_RTC_HCTOSYS=y
+	CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+	CONFIG_RTC_DRV_DS1307=y
+	CONFIG_I2C_BCM2835=y
+	CONFIG_MEMCG=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_CGROUP_DEVICE=y
+	CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
+	CONFIG_PSI=y
+	CONFIG_ZSTD_COMPRESS=y
+	CONFIG_LZ4_COMPRESS=y
+	CONFIG_CRYPTO_RNG=y
+	CONFIG_CRYPTO_RNG_DEFAULT=y
+	!
+
+	while read -r line; do
+		# skip comments
+		case "$line" in
+			"#"*) continue;;
+		esac
+		local option=${line%%=*} str=
+		local cmd="$(echo "$line" | cut -d= -f2)"
+		case "$cmd" in
+			y) cmd="enable";;
+			n) cmd="disable";;
+			m) cmd="module";;
+			'"'*) cmd="set-str"; str="${line#*=}";;
+			[0-9]*) cmd="set-val"; str="${line#*=}";;
+			'') continue ;;
+			*) msg_error "Command $cmd not accepted\n" ;;
+		esac
+		msg_normal "config: $cmd: $option $str\n"
+		./scripts/config \
+			--file .config \
+			"--$cmd" "$option" "${str//\"/}"
+	done < foo
+
+	make "${makejobs}" "${_cross}" ARCH="${_arch}" olddefconfig
 }
 
 do_build() {
-	make ${makejobs} ${_cross} ARCH=${_arch} prepare
-	make ${makejobs} ${_cross} ARCH=${_arch} ${_image_target} modules dtbs
+	make "${makejobs}" "${_cross}" ARCH="${_arch}" prepare
+	make "${makejobs}" "${_cross}" ARCH="${_arch}" "${_image_target}" modules dtbs
 }
 
 do_install() {
@@ -102,110 +152,104 @@ do_install() {
 	vsed -i -e '2iexit 0' scripts/depmod.sh
 
 	# Install kernel, firmware and modules
-	make ${makejobs} ARCH=${_arch} INSTALL_MOD_PATH=${DESTDIR} modules_install
+	make "${makejobs}" ARCH="${_arch}" INSTALL_MOD_PATH="${DESTDIR}" modules_install
 
 	# Install device tree blobs
-	make ${makejobs} ARCH=${_arch} INSTALL_DTBS_PATH=${DESTDIR}/boot dtbs_install
+	make "${makejobs}" "ARCH=${_arch}" 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
+		mv "${DESTDIR}"/boot/broadcom/*dtb "${DESTDIR}/boot"
 	fi
 
 	# Install kernel image
-	vinstall arch/${_arch}/boot/${_image_target} 644 boot ${_image_name}
+	vinstall "arch/${_arch}/boot/${_image_target}" 644 boot "${_image_name}"
 
 	# Switch to /usr.
 	vmkdir usr
-	mv ${DESTDIR}/lib ${DESTDIR}/usr
+	mv "${DESTDIR}/lib" "${DESTDIR}/usr"
 
-	cd ${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/${sourcepkg}-headers-${_kernver}" build
+	popd
 
-	cd ${wrksrc}
 	# Install required headers to build external modules
-	install -Dm644 Makefile ${hdrdest}/Makefile
-	install -Dm644 kernel/Makefile ${hdrdest}/kernel/Makefile
-	install -Dm644 .config ${hdrdest}/.config
-	for file in $(find . -name Kconfig\*); do
-		mkdir -p ${hdrdest}/$(dirname $file)
-		install -Dm644 $file ${hdrdest}/${file}
-	done
-	for file in $(find arch/${_arch} scripts -name module.lds -o -name Kbuild.platforms -o -name Platform); do
-		mkdir -p ${hdrdest}/$(dirname $file)
-		install -Dm644 $file ${hdrdest}/${file}
-	done
-	mkdir -p ${hdrdest}/include
+	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"
 
 	# 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 \
 		math-emu media net pcmcia scsi sound trace uapi vdso video xen; do
-		[ -d include/$i ] && cp -a include/$i ${hdrdest}/include
+		[ -d include/$i ] && cp -a "include/$i" "${hdrdest}/include"
 	done
 
-	cd ${wrksrc}
 	# 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 "${makejobs}" ARCH="${_arch}" _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
+	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"
 	if [ -d "arch/${_arch}/tools" ]; then
-		cp -a arch/${_arch}/tools ${hdrdest}/arch/${_arch}
+		cp -a "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"
 
 	# copy arch includes for external modules
-	mkdir -p ${hdrdest}/arch/${_arch}
-	cp -a arch/${_arch}/include ${hdrdest}/arch/${_arch}
+	mkdir -p "${hdrdest}/arch/${_arch}"
+	cp -a "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
+	mkdir -p "${hdrdest}/arch/${_arch}/kernel"
+	cp "arch/${_arch}/Makefile" "${hdrdest}/arch/${_arch}"
+	cp "arch/${_arch}/kernel/asm-offsets.s" "${hdrdest}/arch/${_arch}/kernel"
 	if [ "$_arch" = "arm64" ] ; then
-		cp -a arch/${_arch}/kernel/vdso ${hdrdest}/arch/${_arch}/kernel/
+		cp -a "arch/${_arch}/kernel/vdso" "${hdrdest}/arch/${_arch}/kernel/"
 	fi
 
 	# Add md headers
-	mkdir -p ${hdrdest}/drivers/md
-	cp drivers/md/*.h ${hdrdest}/drivers/md
+	mkdir -p "${hdrdest}/drivers/md"
+	cp drivers/md/*.h "${hdrdest}/drivers/md"
 
 	# Add inotify.h
-	mkdir -p ${hdrdest}/include/linux
-	cp include/linux/inotify.h ${hdrdest}/include/linux
+	mkdir -p "${hdrdest}/include/linux"
+	cp include/linux/inotify.h "${hdrdest}/include/linux"
 
 	# Add wireless headers
-	mkdir -p ${hdrdest}/net/mac80211/
-	cp net/mac80211/*.h ${hdrdest}/net/mac80211
-
-	# Remove unneeded architectures
-	# (save the correct one + Kconfig and delete all others)
-	mkdir -p arch-backup
-	cp -r ${hdrdest}/arch/${_arch} ${hdrdest}/arch/Kconfig arch-backup/
-	rm -rf ${hdrdest}/arch
-	mv arch-backup ${hdrdest}/arch
-	# Keep arch/x86/ras/Kconfig as it is needed by drivers/ras/Kconfig
-	mkdir -p ${hdrdest}/arch/x86/ras
-	cp -a arch/x86/ras/Kconfig ${hdrdest}/arch/x86/ras/Kconfig
+	mkdir -p "${hdrdest}/net/mac80211/"
+	cp 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
+	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}"
 }
 
 subpackages="rpi-kernel-headers"

From 33c958be54d8aef5989299db9f96edce647087a3 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:53 -0400
Subject: [PATCH 2/3] rpi-firmware: update to 20230925.

---
 srcpkgs/rpi-firmware/template | 118 ++++++++++++++++------------------
 1 file changed, 57 insertions(+), 61 deletions(-)

diff --git a/srcpkgs/rpi-firmware/template b/srcpkgs/rpi-firmware/template
index 5086abfa19fec..0a2efa3b80db0 100644
--- a/srcpkgs/rpi-firmware/template
+++ b/srcpkgs/rpi-firmware/template
@@ -1,82 +1,78 @@
 # Template file for 'rpi-firmware'
-_githash="62efc6a69d4e717bf2833c649d622c8298a37e9c"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-firmware
-version=20220823
-revision=2
+version=20230925
+revision=1
+_rpi_fw=6b37a457122714aa14b2c7df0926455173fd04f1
+_rpi_bt=9556b08ace2a1735127894642cc8ea6529c04c90
+_rpi_brcm=2c3a8701193ba23d0ef85cdf0d0c9e47baf03dfc
+create_wrksrc=yes
 archs="armv6l* armv7l* aarch64*"
-provides="linux-firmware-broadcom-${version}_${revision}"
-replaces="linux-firmware-broadcom>=0"
-short_desc="Firmware files for the Raspberry Pi (git ${_gitshort})"
+short_desc="Firmware files for the Raspberry Pi"
 maintainer="Piraty <mail@piraty.dev>"
 license="BSD-3-Clause, custom:Cypress"
 homepage="https://github.com/raspberrypi/firmware"
-distfiles="https://github.com/raspberrypi/firmware/archive/${_githash}.tar.gz"
-checksum=3fc5ab7155bde7221245f439971217558300dcbc988ade861cfef4e737de9909
+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://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
+ 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"
+
+provides="linux-firmware-broadcom-${version}_${revision}"
+replaces="linux-firmware-broadcom>=0"
 
 conf_files="/boot/cmdline.txt /boot/config.txt"
 nostrip=yes
 
 do_install() {
-	rm -f boot/*.img
-	rm -rf boot/overlays
-	rm -f boot/*.dtb
-	rm -f boot/COPYING.linux
-
-	vlicense boot/LICENCE.broadcom
-	rm -f boot/LICENCE.broadcom
+	# bootloader
+	vlicense "firmware-${_rpi_fw}/boot/LICENCE.broadcom"
+	rm -rf "firmware-${_rpi_fw}/boot/"*.img \
+		"firmware-${_rpi_fw}/boot/overlays" \
+		"firmware-${_rpi_fw}/boot/"*.dtb \
+		"firmware-${_rpi_fw}/boot/COPYING.linux" \
+		"firmware-${_rpi_fw}/boot/LICENCE.broadcom"
 
 	vmkdir boot
-	cp -R boot/* ${DESTDIR}/boot
+	vcopy "firmware-${_rpi_fw}/boot/*" boot
 
 	# Install configuration files.
-	vinstall ${FILESDIR}/cmdline.txt 644 boot
-	vinstall ${FILESDIR}/config.txt 644 boot
+	vinstall "${FILESDIR}/cmdline.txt" 644 boot
+	vinstall "${FILESDIR}/config.txt" 644 boot
 
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/LICENCE.cypress
-	vlicense LICENCE.cypress
+	# firmware
+	# we can use either the -standard or -minimal 43455 file so use standard by default
+	ln -sfv cyfmac43455-sdio-standard.bin "firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/cypress/cyfmac43455-sdio.bin"
+	vlicense "${XBPS_SRCDISTDIR}/${pkgname}-${version}/LICENCE.cypress"
 
-	# Firmware for rpi3 b and zero wifi chip
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43430-sdio.${f}
-		vinstall brcmfmac43430-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
+	# add original Pi Foundation firmware files
+	# install deref's symlinks and copies a whole file, which makes rpi use duplicated variants specifically from downstream firmware
+	install -Dm644 \
+		"firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/brcm/"brcmfmac*raspberrypi* \
+		-t "${DESTDIR}/usr/lib/firmware/brcm"
 
-	# Firmware for rpi3 b and zero bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430A1.hcd
-	vinstall BCM43430A1.hcd 0644 usr/lib/firmware/brcm
+	# but 43436/43436s/43456 is not in linux-firmware, so copy it normally
+	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
 
-	# Firmware for rpi3 b+ wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43455-sdio.${f}
-		vinstall brcmfmac43455-sdio.${f} 0644 usr/lib/firmware/brcm
+	for file in "${XBPS_SRCDISTDIR}/${pkgname}-${version}/"*.hcd; do
+		vinstall "$file" 0644 usr/lib/firmware/brcm
 	done
-
-	# Firmware for rpi3 b+ bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C0.hcd
-	vinstall BCM4345C0.hcd 0644 usr/lib/firmware/brcm
-
-	# Firmware for rpi zero 2w wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436-sdio.${f}
-		vinstall brcmfmac43436-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436s-sdio.${f}
-		vinstall brcmfmac43436s-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43456-sdio.${f}
-		vinstall brcmfmac43456-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C5.hcd
-	vinstall BCM4345C5.hcd 0644 usr/lib/firmware/brcm
-
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430B0.hcd
-	vinstall BCM43430B0.hcd 0644 usr/lib/firmware/brcm
 }

From 10094c49ef6e58cf657dc625bdd281830ff95f60 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:54 -0400
Subject: [PATCH 3/3] rpi-userland: update to 20230920.

---
 srcpkgs/rpi-userland/template | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/rpi-userland/template b/srcpkgs/rpi-userland/template
index 4f1ea38c9e3a6..25fc587bfb55d 100644
--- a/srcpkgs/rpi-userland/template
+++ b/srcpkgs/rpi-userland/template
@@ -1,19 +1,17 @@
 # Template file for 'rpi-userland'
-_githash="97bc8180ad682b004ea224d1db7b8e108eda4397"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-userland
-version=20210623
+version=20230920
 revision=1
+_githash="44a3953fd13d5f0b9b0cd120b904aa7db370244e"
 build_style=cmake
-hostmakedepends="pkg-config"
 configure_args="-DCMAKE_INSTALL_RPATH=\$ORIGIN/../lib"
-short_desc="Raspberry Pi GPU userland libraries and utilities (git ${_gitshort})"
+hostmakedepends="pkg-config"
+short_desc="Raspberry Pi GPU userland libraries and utilities"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/raspberrypi/userland"
 distfiles="https://github.com/raspberrypi/userland/archive/${_githash}.tar.gz"
-checksum=d67def03931215f41b741aed5a3a1bc2bd62fa33f5cc14692e9a4d65f2e0ea27
+checksum=981c376a110f78fe579a72e218888646ccd5d71ab82d04bb1a8d7be1487b45f0
 
 LDFLAGS="-Wl,--no-as-needed"
 archs="armv6l* armv7l* aarch64*"

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (22 preceding siblings ...)
  2023-09-25  6:40 ` classabbyamp
@ 2023-09-25  8:44 ` tsjk
  2023-09-25  8:45 ` tsjk
                   ` (18 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: tsjk @ 2023-09-25  8:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 675 bytes --]

New comment by tsjk on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732630838

Comment:
I built 6.1.54_1, and installed it on one of my 1Bs. While dkms itself didn't fail, the driver compilation did. I think it's unrelated, as it was trying to compile rtl8192cu from https://github.com/pvaret/rtl8192cu-fixes. That likely doesn't build for v6.1 anymore.
I have another 1B that is now building rtl88XXau as part of the 10-dkms  post-install kernel hook. Hasn't died yet - which is promising.

**EDIT**: I have upgrade my "Raspberry Pi Model B Rev 2"s. Some have dkms modules, others not. They all seem to work as expected.

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (23 preceding siblings ...)
  2023-09-25  8:44 ` tsjk
@ 2023-09-25  8:45 ` tsjk
  2023-09-29 18:29 ` classabbyamp
                   ` (17 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: tsjk @ 2023-09-25  8:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 676 bytes --]

New comment by tsjk on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732630838

Comment:
I built 6.1.54_1, and installed it on one of my 1Bs. While dkms itself didn't fail, the driver compilation did. I think it's unrelated, as it was trying to compile rtl8192cu from https://github.com/pvaret/rtl8192cu-fixes. That likely doesn't build for v6.1 anymore.
I have another 1B that is now building rtl88XXau as part of the 10-dkms  post-install kernel hook. Hasn't died yet - which is promising.

**EDIT**: I have upgraded my "Raspberry Pi Model B Rev 2"s. Some have dkms modules, others not. They all seem to work as expected.

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (24 preceding siblings ...)
  2023-09-25  8:45 ` tsjk
@ 2023-09-29 18:29 ` classabbyamp
  2023-09-29 18:29 ` classabbyamp
                   ` (16 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 18:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741322520

Comment:
- [ ] 1B
- [ ] 1A+
- [ ] 2B
- [ ] 3B
- [ ] 0
- [ ] 02W
- [ ] 4B

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (25 preceding siblings ...)
  2023-09-29 18:29 ` classabbyamp
@ 2023-09-29 18:29 ` classabbyamp
  2023-09-29 18:29 ` classabbyamp
                   ` (15 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 18:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741322520

Comment:
- [ ] 1B
- [ ] 1A+
- [ ] 2B
- [ ] 3B
- [ ] 0
- [ ] 02W
- [x] 4B

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (26 preceding siblings ...)
  2023-09-29 18:29 ` classabbyamp
@ 2023-09-29 18:29 ` classabbyamp
  2023-09-29 18:29 ` classabbyamp
                   ` (14 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 18:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741322520

Comment:
- [ ] 1B
- [ ] 1A+
- [ ] 2B
- [x] 3B
- [ ] 0
- [ ] 02W
- [x] 4B

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (27 preceding siblings ...)
  2023-09-29 18:29 ` classabbyamp
@ 2023-09-29 18:29 ` classabbyamp
  2023-09-29 18:37 ` tsjk
                   ` (13 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 18:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741322520

Comment:
- [ ] 1B
- [ ] 1A+
- [x] 2B
- [x] 3B
- [ ] 0
- [ ] 02W
- [x] 4B

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (28 preceding siblings ...)
  2023-09-29 18:29 ` classabbyamp
@ 2023-09-29 18:37 ` tsjk
  2023-09-29 18:40 ` classabbyamp
                   ` (12 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: tsjk @ 2023-09-29 18:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

New comment by tsjk on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741330572

Comment:
> * [x]  1B
> * [ ]  1A+
> * [x]  2B
> * [x]  3B
> * [ ]  0
> * [ ]  02W
> * [x]  4B



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (29 preceding siblings ...)
  2023-09-29 18:37 ` tsjk
@ 2023-09-29 18:40 ` classabbyamp
  2023-09-29 18:41 ` tsjk
                   ` (11 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 18:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 187 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741333911

Comment:
i'm showing my own testing, not in total

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (30 preceding siblings ...)
  2023-09-29 18:40 ` classabbyamp
@ 2023-09-29 18:41 ` tsjk
  2023-09-29 19:01 ` classabbyamp
                   ` (10 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: tsjk @ 2023-09-29 18:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 201 bytes --]

New comment by tsjk on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741334604

Comment:
> i'm showing my own testing, not in total

Ah. Sorry, mate.

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (31 preceding siblings ...)
  2023-09-29 18:41 ` tsjk
@ 2023-09-29 19:01 ` classabbyamp
  2023-09-29 19:01 ` classabbyamp
                   ` (9 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 19:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741322520

Comment:
- [x] 1B
- [ ] 1A+
- [x] 2B
- [x] 3B
- [ ] 0
- [ ] 02W
- [x] 4B

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (32 preceding siblings ...)
  2023-09-29 19:01 ` classabbyamp
@ 2023-09-29 19:01 ` classabbyamp
  2023-09-29 19:01 ` classabbyamp
                   ` (8 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 19:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741322520

Comment:
- [x] 1B
- [x] 1A+
- [x] 2B
- [x] 3B
- [ ] 0
- [ ] 02W
- [x] 4B

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (33 preceding siblings ...)
  2023-09-29 19:01 ` classabbyamp
@ 2023-09-29 19:01 ` classabbyamp
  2023-09-29 19:05 ` classabbyamp
                   ` (7 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 19:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741322520

Comment:
- [x] 1B
- [x] 1A+
- [x] 2B
- [x] 3B
- [x] 0
- [ ] 02W
- [x] 4B

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (34 preceding siblings ...)
  2023-09-29 19:01 ` classabbyamp
@ 2023-09-29 19:05 ` classabbyamp
  2023-09-29 19:37 ` [PR PATCH] [Updated] " classabbyamp
                   ` (6 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 19:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741322520

Comment:
- [x] 1B
- [x] 1A+
- [x] 2B
- [x] 3B
- [x] 0
- [x] 02W
- [x] 4B

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PR PATCH] [Updated] rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (35 preceding siblings ...)
  2023-09-29 19:05 ` classabbyamp
@ 2023-09-29 19:37 ` classabbyamp
  2023-09-29 20:57 ` moabeat-berlin
                   ` (5 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 19:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5063 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages update/rpi
https://github.com/void-linux/void-packages/pull/46152

rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
- rpi-kernel: update to 6.1.54.
- rpi-firmware: update to 20230920.
- rpi-userland: update to 20230920.

continuation of #43600, made a new PR to clean things up

builds for testing: https://devspace.voidlinux.org/abby/updates/rpi/

#### Testing the changes
- I tested the changes in this PR: **YES**

Still getting the DKMS/headers issue:

When building `fixdep` and `modpost` in `/etc/kernel.d/post-install/10-dkms`, it gets stuck in an infinite makefile loop:

https://github.com/void-linux/void-packages/blob/5b18878cc72b410bc076ac15218f4c5fa0c3fcbf/srcpkgs/dkms/files/kernel.d/dkms.postinst#L22-L24

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
  SYNC    include/config/auto.conf
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTLD  scripts/dtc/fdtoverlay
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  UPD     include/generated/compile.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
^Cmake[4]: *** [Makefile:1307: asm-generic] Interrupt
Interrupt
make[3]: *** [Makefile:1289: prepare0] Interrupt
make[2]: *** [Makefile:1289: prepare0] Interrupt
make[1]: *** [Makefile:1289: prepare0] Interrupt
make: *** [Makefile:1289: prepare0] Interrupt
```

However, `^C`ing out of that and re-running it succeeds, because `fixdep` and `modpost` were build before the infinite loop:

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
rpi-kernel: configured successfully.
```

And dkms works after that:

```
Building DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
Installing DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
rtl8821cu-dkms-20210916_2: installed successfully.
```

So the issue left to figure out is: why does it infinite loop?


A patch file from https://github.com/void-linux/void-packages/pull/46152.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update/rpi-46152.patch --]
[-- Type: text/x-diff, Size: 20432 bytes --]

From 47e3400c3e6fe53932740848b6e14830bf0f71e6 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:51 -0400
Subject: [PATCH 1/3] rpi-kernel: update to 6.1.54.

---
 srcpkgs/rpi-kernel/template | 216 ++++++++++++++++++++++--------------
 1 file changed, 130 insertions(+), 86 deletions(-)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index c49612b7c510a..2fa1bb54b683e 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -1,30 +1,29 @@
 # Template file for 'rpi-kernel'
 #
 # We track the latest Raspberry Pi LTS kernel as that is what is used in the
-# official Raspberry Pi OS distribution. This is currently 5.15:
+# official Raspberry Pi OS distribution. This is currently 6.1:
 #
-# https://forums.raspberrypi.com/viewtopic.php?t=322879
+# https://forums.raspberrypi.com/viewtopic.php?t=344246
 #
 # Commit hash is picked from latest tag [1], if appropriate, or from latest
-# "Merge remote-tracking branch 'stable/linux-5.x.y' into rpi-5.x.y" commit.
+# "Merge remote-tracking branch 'stable/linux-6.x.y' into rpi-6.x.y" commit.
 #
 # [1] https://github.com/raspberrypi/linux/tags
 #
 # Upstream documentation: https://www.raspberrypi.com/documentation/computers/linux_kernel.html
-
 pkgname=rpi-kernel
-version=5.15.72
+version=6.1.54
 revision=1
-_githash="3b98eb7a4aeaecd5274108dc1be7a5df94253500"
+_githash=fad58933544bb2a7b7db92847c25c79a83171fa6
 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 <mail@piraty.dev>"
-homepage="http://www.kernel.org"
 license="GPL-2.0-only"
-short_desc="Linux kernel for Raspberry Pi (${version%.*} series [git ${_githash:0:7}])"
+homepage="http://www.kernel.org"
 distfiles="https://github.com/raspberrypi/linux/archive/${_githash}.tar.gz"
-checksum=5cad1fd22f309ddd7b996df748aa21ced72f88d47fdbb8d4bfd9ef3a8a9b6ce9
+checksum=1bd02902fae49351fb16ac0d5ccc3bf4d67aa0640006dbbf8846963519b01ab8
 python_version=3
 
 _kernver="${version}_${revision}"
@@ -45,18 +44,17 @@ mutable_files="
  /usr/lib/modules/${_kernver}/modules.alias.bin
  /usr/lib/modules/${_kernver}/modules.devname"
 
-_arch=
-_image_target=
-_image_name=
 case "$XBPS_TARGET_MACHINE" in
 	armv6l*) _arch=arm; _image_target=zImage; _image_name=kernel.img ;;
 	armv7l*) _arch=arm; _image_target=zImage; _image_name=kernel7.img ;;
 	aarch64*) _arch=arm64; _image_target=Image.gz; _image_name=kernel8.img ;;
+	*) broken="No Raspberry Pi exists for this arch" ;;
 esac
 
-_cross=
 if [ "$CROSS_BUILD" ]; then
 	_cross="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
+else
+	_cross=
 fi
 
 do_configure() {
@@ -72,27 +70,79 @@ do_configure() {
 	esac
 
 	defconfig="arch/${_arch}/configs/${target}"
-	echo "CONFIG_CONNECTOR=y" >> "$defconfig"
-	echo "CONFIG_PROC_EVENTS=y" >> "$defconfig"
-
-	# HID Controllers
-	echo "CONFIG_HID_STEAM=y" >> "$defconfig"
-
-	# Disable GCC plugins
-	echo "# CONFIG_GCC_PLUGINS is not set" >> "$defconfig"
-
-	# LXD 4.2+ support
-	echo "CONFIG_BRIDGE_VLAN_FILTERING=y" >> "$defconfig"
-
-	make ${makejobs} ${_cross} ARCH=${_arch} ${target}
-
-	# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
-	vsed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
+	cp "$defconfig" .config
+
+	cat <<-! > "foo"
+	CONFIG_CONNECTOR=y
+	CONFIG_HID_STEAM=y
+	CONFIG_PROC_EVENTS=y
+	CONFIG_GCC_PLUGINS=n
+	CONFIG_BRIDGE_VLAN_FILTERING=y
+	CONFIG_FUNCTION_TRACER=n
+	CONFIG_STACK_TRACER=n
+	CONFIG_ATM=n
+	CONFIG_SLAB_FREELIST_RANDOM=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_SLAB_FREELIST_HARDENED=y
+	CONFIG_PACKET=m
+	CONFIG_NF_CT_PROTO_DCCP=y
+	CONFIG_NF_CT_PROTO_SCTP=y
+	CONFIG_NF_CT_PROTO_UDPLITE=y
+	CONFIG_BATMAN_ADV=n
+	CONFIG_INPUT_LEDS=m
+	CONFIG_SQUASHFS_LZ4=y
+	CONFIG_STRICT_DEVMEM=y
+	CONFIG_IO_STRICT_DEVMEM=y
+	CONFIG_ENCRYPTED_KEYS=m
+	CONFIG_KEY_DH_OPERATIONS=y
+	CONFIG_HARDENED_USERCOPY=y
+	CONFIG_LOCALVERSION="_${revision}"
+	CONFIG_IP_PNP=n
+	CONFIG_USB_DWC2=m
+	CONFIG_USB_ETH=m
+	CONFIG_RTC_HCTOSYS=y
+	CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+	CONFIG_RTC_DRV_DS1307=y
+	CONFIG_I2C_BCM2835=y
+	CONFIG_MEMCG=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_CGROUP_DEVICE=y
+	CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
+	CONFIG_PSI=y
+	CONFIG_ZSTD_COMPRESS=y
+	CONFIG_LZ4_COMPRESS=y
+	CONFIG_CRYPTO_RNG=y
+	CONFIG_CRYPTO_RNG_DEFAULT=y
+	!
+
+	while read -r line; do
+		# skip comments
+		case "$line" in
+			"#"*) continue;;
+		esac
+		local option=${line%%=*} str=
+		local cmd="$(echo "$line" | cut -d= -f2)"
+		case "$cmd" in
+			y) cmd="enable";;
+			n) cmd="disable";;
+			m) cmd="module";;
+			'"'*) cmd="set-str"; str="${line#*=}";;
+			[0-9]*) cmd="set-val"; str="${line#*=}";;
+			'') continue ;;
+			*) msg_error "Command $cmd not accepted\n" ;;
+		esac
+		msg_normal "config: $cmd: $option $str\n"
+		./scripts/config \
+			--file .config \
+			"--$cmd" "$option" "${str//\"/}"
+	done < foo
+
+	make "${makejobs}" "${_cross}" ARCH="${_arch}" olddefconfig
 }
 
 do_build() {
-	make ${makejobs} ${_cross} ARCH=${_arch} prepare
-	make ${makejobs} ${_cross} ARCH=${_arch} ${_image_target} modules dtbs
+	make "${makejobs}" "${_cross}" ARCH="${_arch}" prepare
+	make "${makejobs}" "${_cross}" ARCH="${_arch}" "${_image_target}" modules dtbs
 }
 
 do_install() {
@@ -102,110 +152,104 @@ do_install() {
 	vsed -i -e '2iexit 0' scripts/depmod.sh
 
 	# Install kernel, firmware and modules
-	make ${makejobs} ARCH=${_arch} INSTALL_MOD_PATH=${DESTDIR} modules_install
+	make "${makejobs}" ARCH="${_arch}" INSTALL_MOD_PATH="${DESTDIR}" modules_install
 
 	# Install device tree blobs
-	make ${makejobs} ARCH=${_arch} INSTALL_DTBS_PATH=${DESTDIR}/boot dtbs_install
+	make "${makejobs}" "ARCH=${_arch}" 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
+		mv "${DESTDIR}"/boot/broadcom/*dtb "${DESTDIR}/boot"
 	fi
 
 	# Install kernel image
-	vinstall arch/${_arch}/boot/${_image_target} 644 boot ${_image_name}
+	vinstall "arch/${_arch}/boot/${_image_target}" 644 boot "${_image_name}"
 
 	# Switch to /usr.
 	vmkdir usr
-	mv ${DESTDIR}/lib ${DESTDIR}/usr
+	mv "${DESTDIR}/lib" "${DESTDIR}/usr"
 
-	cd ${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/${sourcepkg}-headers-${_kernver}" build
+	popd
 
-	cd ${wrksrc}
 	# Install required headers to build external modules
-	install -Dm644 Makefile ${hdrdest}/Makefile
-	install -Dm644 kernel/Makefile ${hdrdest}/kernel/Makefile
-	install -Dm644 .config ${hdrdest}/.config
-	for file in $(find . -name Kconfig\*); do
-		mkdir -p ${hdrdest}/$(dirname $file)
-		install -Dm644 $file ${hdrdest}/${file}
-	done
-	for file in $(find arch/${_arch} scripts -name module.lds -o -name Kbuild.platforms -o -name Platform); do
-		mkdir -p ${hdrdest}/$(dirname $file)
-		install -Dm644 $file ${hdrdest}/${file}
-	done
-	mkdir -p ${hdrdest}/include
+	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"
 
 	# 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 \
 		math-emu media net pcmcia scsi sound trace uapi vdso video xen; do
-		[ -d include/$i ] && cp -a include/$i ${hdrdest}/include
+		[ -d include/$i ] && cp -a "include/$i" "${hdrdest}/include"
 	done
 
-	cd ${wrksrc}
 	# 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 "${makejobs}" ARCH="${_arch}" _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
+	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"
 	if [ -d "arch/${_arch}/tools" ]; then
-		cp -a arch/${_arch}/tools ${hdrdest}/arch/${_arch}
+		cp -a "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"
 
 	# copy arch includes for external modules
-	mkdir -p ${hdrdest}/arch/${_arch}
-	cp -a arch/${_arch}/include ${hdrdest}/arch/${_arch}
+	mkdir -p "${hdrdest}/arch/${_arch}"
+	cp -a "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
+	mkdir -p "${hdrdest}/arch/${_arch}/kernel"
+	cp "arch/${_arch}/Makefile" "${hdrdest}/arch/${_arch}"
+	cp "arch/${_arch}/kernel/asm-offsets.s" "${hdrdest}/arch/${_arch}/kernel"
 	if [ "$_arch" = "arm64" ] ; then
-		cp -a arch/${_arch}/kernel/vdso ${hdrdest}/arch/${_arch}/kernel/
+		cp -a "arch/${_arch}/kernel/vdso" "${hdrdest}/arch/${_arch}/kernel/"
 	fi
 
 	# Add md headers
-	mkdir -p ${hdrdest}/drivers/md
-	cp drivers/md/*.h ${hdrdest}/drivers/md
+	mkdir -p "${hdrdest}/drivers/md"
+	cp drivers/md/*.h "${hdrdest}/drivers/md"
 
 	# Add inotify.h
-	mkdir -p ${hdrdest}/include/linux
-	cp include/linux/inotify.h ${hdrdest}/include/linux
+	mkdir -p "${hdrdest}/include/linux"
+	cp include/linux/inotify.h "${hdrdest}/include/linux"
 
 	# Add wireless headers
-	mkdir -p ${hdrdest}/net/mac80211/
-	cp net/mac80211/*.h ${hdrdest}/net/mac80211
-
-	# Remove unneeded architectures
-	# (save the correct one + Kconfig and delete all others)
-	mkdir -p arch-backup
-	cp -r ${hdrdest}/arch/${_arch} ${hdrdest}/arch/Kconfig arch-backup/
-	rm -rf ${hdrdest}/arch
-	mv arch-backup ${hdrdest}/arch
-	# Keep arch/x86/ras/Kconfig as it is needed by drivers/ras/Kconfig
-	mkdir -p ${hdrdest}/arch/x86/ras
-	cp -a arch/x86/ras/Kconfig ${hdrdest}/arch/x86/ras/Kconfig
+	mkdir -p "${hdrdest}/net/mac80211/"
+	cp 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
+	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}"
 }
 
 subpackages="rpi-kernel-headers"

From 4aafebfc3fec6928f7c67204490703719e9fcb8e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:53 -0400
Subject: [PATCH 2/3] rpi-firmware: update to 20230925.

---
 srcpkgs/rpi-firmware/template | 118 ++++++++++++++++------------------
 1 file changed, 57 insertions(+), 61 deletions(-)

diff --git a/srcpkgs/rpi-firmware/template b/srcpkgs/rpi-firmware/template
index 5086abfa19fec..0a2efa3b80db0 100644
--- a/srcpkgs/rpi-firmware/template
+++ b/srcpkgs/rpi-firmware/template
@@ -1,82 +1,78 @@
 # Template file for 'rpi-firmware'
-_githash="62efc6a69d4e717bf2833c649d622c8298a37e9c"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-firmware
-version=20220823
-revision=2
+version=20230925
+revision=1
+_rpi_fw=6b37a457122714aa14b2c7df0926455173fd04f1
+_rpi_bt=9556b08ace2a1735127894642cc8ea6529c04c90
+_rpi_brcm=2c3a8701193ba23d0ef85cdf0d0c9e47baf03dfc
+create_wrksrc=yes
 archs="armv6l* armv7l* aarch64*"
-provides="linux-firmware-broadcom-${version}_${revision}"
-replaces="linux-firmware-broadcom>=0"
-short_desc="Firmware files for the Raspberry Pi (git ${_gitshort})"
+short_desc="Firmware files for the Raspberry Pi"
 maintainer="Piraty <mail@piraty.dev>"
 license="BSD-3-Clause, custom:Cypress"
 homepage="https://github.com/raspberrypi/firmware"
-distfiles="https://github.com/raspberrypi/firmware/archive/${_githash}.tar.gz"
-checksum=3fc5ab7155bde7221245f439971217558300dcbc988ade861cfef4e737de9909
+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://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
+ 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"
+
+provides="linux-firmware-broadcom-${version}_${revision}"
+replaces="linux-firmware-broadcom>=0"
 
 conf_files="/boot/cmdline.txt /boot/config.txt"
 nostrip=yes
 
 do_install() {
-	rm -f boot/*.img
-	rm -rf boot/overlays
-	rm -f boot/*.dtb
-	rm -f boot/COPYING.linux
-
-	vlicense boot/LICENCE.broadcom
-	rm -f boot/LICENCE.broadcom
+	# bootloader
+	vlicense "firmware-${_rpi_fw}/boot/LICENCE.broadcom"
+	rm -rf "firmware-${_rpi_fw}/boot/"*.img \
+		"firmware-${_rpi_fw}/boot/overlays" \
+		"firmware-${_rpi_fw}/boot/"*.dtb \
+		"firmware-${_rpi_fw}/boot/COPYING.linux" \
+		"firmware-${_rpi_fw}/boot/LICENCE.broadcom"
 
 	vmkdir boot
-	cp -R boot/* ${DESTDIR}/boot
+	vcopy "firmware-${_rpi_fw}/boot/*" boot
 
 	# Install configuration files.
-	vinstall ${FILESDIR}/cmdline.txt 644 boot
-	vinstall ${FILESDIR}/config.txt 644 boot
+	vinstall "${FILESDIR}/cmdline.txt" 644 boot
+	vinstall "${FILESDIR}/config.txt" 644 boot
 
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/LICENCE.cypress
-	vlicense LICENCE.cypress
+	# firmware
+	# we can use either the -standard or -minimal 43455 file so use standard by default
+	ln -sfv cyfmac43455-sdio-standard.bin "firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/cypress/cyfmac43455-sdio.bin"
+	vlicense "${XBPS_SRCDISTDIR}/${pkgname}-${version}/LICENCE.cypress"
 
-	# Firmware for rpi3 b and zero wifi chip
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43430-sdio.${f}
-		vinstall brcmfmac43430-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
+	# add original Pi Foundation firmware files
+	# install deref's symlinks and copies a whole file, which makes rpi use duplicated variants specifically from downstream firmware
+	install -Dm644 \
+		"firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/brcm/"brcmfmac*raspberrypi* \
+		-t "${DESTDIR}/usr/lib/firmware/brcm"
 
-	# Firmware for rpi3 b and zero bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430A1.hcd
-	vinstall BCM43430A1.hcd 0644 usr/lib/firmware/brcm
+	# but 43436/43436s/43456 is not in linux-firmware, so copy it normally
+	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
 
-	# Firmware for rpi3 b+ wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43455-sdio.${f}
-		vinstall brcmfmac43455-sdio.${f} 0644 usr/lib/firmware/brcm
+	for file in "${XBPS_SRCDISTDIR}/${pkgname}-${version}/"*.hcd; do
+		vinstall "$file" 0644 usr/lib/firmware/brcm
 	done
-
-	# Firmware for rpi3 b+ bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C0.hcd
-	vinstall BCM4345C0.hcd 0644 usr/lib/firmware/brcm
-
-	# Firmware for rpi zero 2w wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436-sdio.${f}
-		vinstall brcmfmac43436-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436s-sdio.${f}
-		vinstall brcmfmac43436s-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43456-sdio.${f}
-		vinstall brcmfmac43456-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C5.hcd
-	vinstall BCM4345C5.hcd 0644 usr/lib/firmware/brcm
-
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430B0.hcd
-	vinstall BCM43430B0.hcd 0644 usr/lib/firmware/brcm
 }

From 6a2bd7d26b9d7504761ca45d394b4c77d46f9a4d Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:54 -0400
Subject: [PATCH 3/3] rpi-userland: update to 20230920.

---
 srcpkgs/rpi-userland/template | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/rpi-userland/template b/srcpkgs/rpi-userland/template
index 4f1ea38c9e3a6..25fc587bfb55d 100644
--- a/srcpkgs/rpi-userland/template
+++ b/srcpkgs/rpi-userland/template
@@ -1,19 +1,17 @@
 # Template file for 'rpi-userland'
-_githash="97bc8180ad682b004ea224d1db7b8e108eda4397"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-userland
-version=20210623
+version=20230920
 revision=1
+_githash="44a3953fd13d5f0b9b0cd120b904aa7db370244e"
 build_style=cmake
-hostmakedepends="pkg-config"
 configure_args="-DCMAKE_INSTALL_RPATH=\$ORIGIN/../lib"
-short_desc="Raspberry Pi GPU userland libraries and utilities (git ${_gitshort})"
+hostmakedepends="pkg-config"
+short_desc="Raspberry Pi GPU userland libraries and utilities"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/raspberrypi/userland"
 distfiles="https://github.com/raspberrypi/userland/archive/${_githash}.tar.gz"
-checksum=d67def03931215f41b741aed5a3a1bc2bd62fa33f5cc14692e9a4d65f2e0ea27
+checksum=981c376a110f78fe579a72e218888646ccd5d71ab82d04bb1a8d7be1487b45f0
 
 LDFLAGS="-Wl,--no-as-needed"
 archs="armv6l* armv7l* aarch64*"

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (36 preceding siblings ...)
  2023-09-29 19:37 ` [PR PATCH] [Updated] " classabbyamp
@ 2023-09-29 20:57 ` moabeat-berlin
  2023-09-29 21:09 ` classabbyamp
                   ` (4 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: moabeat-berlin @ 2023-09-29 20:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]

New comment by moabeat-berlin on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741479613

Comment:
On a clean install, dkms fails with the missing "bc" command (and package). Maybe we should add this as a dependency somewhere? Most probably to the "rpi-kernel-headers" package, as a successful `make prepare0` depends on it. [I mentioned this earlier](https://github.com/void-linux/void-packages/pull/46152#issuecomment-1732388822).

And some other observation: `xbps-remove rpi-kernel-headers` leaves the generated files of `make prepare0` in `/usr/src/rpi-kernel-headers-6.1.54_1` behind. Maybe we would like to delete them on uninstall?

Beside these findings, 400 and 02W (both musl) are working fine. Also building dkms modules works, e.g. with package "rtl8821cu-dkms". However, building "zfs" made the 02W unresponsive at some stage of the process. Maybe it's just too big for the machine to get it compiled with the small amount of RAM it has. Adding swap also did not fix it. Only other option I can think of would be to buid it with `-j2` instead of `-j$(nproc)` to reduce RAM consumption.

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (37 preceding siblings ...)
  2023-09-29 20:57 ` moabeat-berlin
@ 2023-09-29 21:09 ` classabbyamp
  2023-09-29 21:18 ` classabbyamp
                   ` (3 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 21:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 192 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741491911

Comment:
probably in the deps of dkms, not the headers

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (38 preceding siblings ...)
  2023-09-29 21:09 ` classabbyamp
@ 2023-09-29 21:18 ` classabbyamp
  2023-09-29 21:24 ` [PR PATCH] [Updated] " classabbyamp
                   ` (2 subsequent siblings)
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 21:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741491911

Comment:
probably in the deps of dkms, not the headers. will address the dkms stuff separately

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PR PATCH] [Updated] rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (39 preceding siblings ...)
  2023-09-29 21:18 ` classabbyamp
@ 2023-09-29 21:24 ` classabbyamp
  2023-09-29 22:01 ` rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland, rpi-eeprom) classabbyamp
  2023-09-30  2:41 ` [PR PATCH] [Merged]: " classabbyamp
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 21:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5063 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages update/rpi
https://github.com/void-linux/void-packages/pull/46152

rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland)
- rpi-kernel: update to 6.1.54.
- rpi-firmware: update to 20230920.
- rpi-userland: update to 20230920.

continuation of #43600, made a new PR to clean things up

builds for testing: https://devspace.voidlinux.org/abby/updates/rpi/

#### Testing the changes
- I tested the changes in this PR: **YES**

Still getting the DKMS/headers issue:

When building `fixdep` and `modpost` in `/etc/kernel.d/post-install/10-dkms`, it gets stuck in an infinite makefile loop:

https://github.com/void-linux/void-packages/blob/5b18878cc72b410bc076ac15218f4c5fa0c3fcbf/srcpkgs/dkms/files/kernel.d/dkms.postinst#L22-L24

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
  SYNC    include/config/auto.conf
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTLD  scripts/dtc/fdtoverlay
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  UPD     include/generated/compile.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
^Cmake[4]: *** [Makefile:1307: asm-generic] Interrupt
Interrupt
make[3]: *** [Makefile:1289: prepare0] Interrupt
make[2]: *** [Makefile:1289: prepare0] Interrupt
make[1]: *** [Makefile:1289: prepare0] Interrupt
make: *** [Makefile:1289: prepare0] Interrupt
```

However, `^C`ing out of that and re-running it succeeds, because `fixdep` and `modpost` were build before the infinite loop:

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
rpi-kernel: configured successfully.
```

And dkms works after that:

```
Building DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
Installing DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
rtl8821cu-dkms-20210916_2: installed successfully.
```

So the issue left to figure out is: why does it infinite loop?


A patch file from https://github.com/void-linux/void-packages/pull/46152.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update/rpi-46152.patch --]
[-- Type: text/x-diff, Size: 22093 bytes --]

From 47e3400c3e6fe53932740848b6e14830bf0f71e6 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:51 -0400
Subject: [PATCH 1/4] rpi-kernel: update to 6.1.54.

---
 srcpkgs/rpi-kernel/template | 216 ++++++++++++++++++++++--------------
 1 file changed, 130 insertions(+), 86 deletions(-)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index c49612b7c510a..2fa1bb54b683e 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -1,30 +1,29 @@
 # Template file for 'rpi-kernel'
 #
 # We track the latest Raspberry Pi LTS kernel as that is what is used in the
-# official Raspberry Pi OS distribution. This is currently 5.15:
+# official Raspberry Pi OS distribution. This is currently 6.1:
 #
-# https://forums.raspberrypi.com/viewtopic.php?t=322879
+# https://forums.raspberrypi.com/viewtopic.php?t=344246
 #
 # Commit hash is picked from latest tag [1], if appropriate, or from latest
-# "Merge remote-tracking branch 'stable/linux-5.x.y' into rpi-5.x.y" commit.
+# "Merge remote-tracking branch 'stable/linux-6.x.y' into rpi-6.x.y" commit.
 #
 # [1] https://github.com/raspberrypi/linux/tags
 #
 # Upstream documentation: https://www.raspberrypi.com/documentation/computers/linux_kernel.html
-
 pkgname=rpi-kernel
-version=5.15.72
+version=6.1.54
 revision=1
-_githash="3b98eb7a4aeaecd5274108dc1be7a5df94253500"
+_githash=fad58933544bb2a7b7db92847c25c79a83171fa6
 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 <mail@piraty.dev>"
-homepage="http://www.kernel.org"
 license="GPL-2.0-only"
-short_desc="Linux kernel for Raspberry Pi (${version%.*} series [git ${_githash:0:7}])"
+homepage="http://www.kernel.org"
 distfiles="https://github.com/raspberrypi/linux/archive/${_githash}.tar.gz"
-checksum=5cad1fd22f309ddd7b996df748aa21ced72f88d47fdbb8d4bfd9ef3a8a9b6ce9
+checksum=1bd02902fae49351fb16ac0d5ccc3bf4d67aa0640006dbbf8846963519b01ab8
 python_version=3
 
 _kernver="${version}_${revision}"
@@ -45,18 +44,17 @@ mutable_files="
  /usr/lib/modules/${_kernver}/modules.alias.bin
  /usr/lib/modules/${_kernver}/modules.devname"
 
-_arch=
-_image_target=
-_image_name=
 case "$XBPS_TARGET_MACHINE" in
 	armv6l*) _arch=arm; _image_target=zImage; _image_name=kernel.img ;;
 	armv7l*) _arch=arm; _image_target=zImage; _image_name=kernel7.img ;;
 	aarch64*) _arch=arm64; _image_target=Image.gz; _image_name=kernel8.img ;;
+	*) broken="No Raspberry Pi exists for this arch" ;;
 esac
 
-_cross=
 if [ "$CROSS_BUILD" ]; then
 	_cross="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
+else
+	_cross=
 fi
 
 do_configure() {
@@ -72,27 +70,79 @@ do_configure() {
 	esac
 
 	defconfig="arch/${_arch}/configs/${target}"
-	echo "CONFIG_CONNECTOR=y" >> "$defconfig"
-	echo "CONFIG_PROC_EVENTS=y" >> "$defconfig"
-
-	# HID Controllers
-	echo "CONFIG_HID_STEAM=y" >> "$defconfig"
-
-	# Disable GCC plugins
-	echo "# CONFIG_GCC_PLUGINS is not set" >> "$defconfig"
-
-	# LXD 4.2+ support
-	echo "CONFIG_BRIDGE_VLAN_FILTERING=y" >> "$defconfig"
-
-	make ${makejobs} ${_cross} ARCH=${_arch} ${target}
-
-	# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
-	vsed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
+	cp "$defconfig" .config
+
+	cat <<-! > "foo"
+	CONFIG_CONNECTOR=y
+	CONFIG_HID_STEAM=y
+	CONFIG_PROC_EVENTS=y
+	CONFIG_GCC_PLUGINS=n
+	CONFIG_BRIDGE_VLAN_FILTERING=y
+	CONFIG_FUNCTION_TRACER=n
+	CONFIG_STACK_TRACER=n
+	CONFIG_ATM=n
+	CONFIG_SLAB_FREELIST_RANDOM=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_SLAB_FREELIST_HARDENED=y
+	CONFIG_PACKET=m
+	CONFIG_NF_CT_PROTO_DCCP=y
+	CONFIG_NF_CT_PROTO_SCTP=y
+	CONFIG_NF_CT_PROTO_UDPLITE=y
+	CONFIG_BATMAN_ADV=n
+	CONFIG_INPUT_LEDS=m
+	CONFIG_SQUASHFS_LZ4=y
+	CONFIG_STRICT_DEVMEM=y
+	CONFIG_IO_STRICT_DEVMEM=y
+	CONFIG_ENCRYPTED_KEYS=m
+	CONFIG_KEY_DH_OPERATIONS=y
+	CONFIG_HARDENED_USERCOPY=y
+	CONFIG_LOCALVERSION="_${revision}"
+	CONFIG_IP_PNP=n
+	CONFIG_USB_DWC2=m
+	CONFIG_USB_ETH=m
+	CONFIG_RTC_HCTOSYS=y
+	CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+	CONFIG_RTC_DRV_DS1307=y
+	CONFIG_I2C_BCM2835=y
+	CONFIG_MEMCG=y
+	CONFIG_CGROUP_PIDS=y
+	CONFIG_CGROUP_DEVICE=y
+	CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
+	CONFIG_PSI=y
+	CONFIG_ZSTD_COMPRESS=y
+	CONFIG_LZ4_COMPRESS=y
+	CONFIG_CRYPTO_RNG=y
+	CONFIG_CRYPTO_RNG_DEFAULT=y
+	!
+
+	while read -r line; do
+		# skip comments
+		case "$line" in
+			"#"*) continue;;
+		esac
+		local option=${line%%=*} str=
+		local cmd="$(echo "$line" | cut -d= -f2)"
+		case "$cmd" in
+			y) cmd="enable";;
+			n) cmd="disable";;
+			m) cmd="module";;
+			'"'*) cmd="set-str"; str="${line#*=}";;
+			[0-9]*) cmd="set-val"; str="${line#*=}";;
+			'') continue ;;
+			*) msg_error "Command $cmd not accepted\n" ;;
+		esac
+		msg_normal "config: $cmd: $option $str\n"
+		./scripts/config \
+			--file .config \
+			"--$cmd" "$option" "${str//\"/}"
+	done < foo
+
+	make "${makejobs}" "${_cross}" ARCH="${_arch}" olddefconfig
 }
 
 do_build() {
-	make ${makejobs} ${_cross} ARCH=${_arch} prepare
-	make ${makejobs} ${_cross} ARCH=${_arch} ${_image_target} modules dtbs
+	make "${makejobs}" "${_cross}" ARCH="${_arch}" prepare
+	make "${makejobs}" "${_cross}" ARCH="${_arch}" "${_image_target}" modules dtbs
 }
 
 do_install() {
@@ -102,110 +152,104 @@ do_install() {
 	vsed -i -e '2iexit 0' scripts/depmod.sh
 
 	# Install kernel, firmware and modules
-	make ${makejobs} ARCH=${_arch} INSTALL_MOD_PATH=${DESTDIR} modules_install
+	make "${makejobs}" ARCH="${_arch}" INSTALL_MOD_PATH="${DESTDIR}" modules_install
 
 	# Install device tree blobs
-	make ${makejobs} ARCH=${_arch} INSTALL_DTBS_PATH=${DESTDIR}/boot dtbs_install
+	make "${makejobs}" "ARCH=${_arch}" 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
+		mv "${DESTDIR}"/boot/broadcom/*dtb "${DESTDIR}/boot"
 	fi
 
 	# Install kernel image
-	vinstall arch/${_arch}/boot/${_image_target} 644 boot ${_image_name}
+	vinstall "arch/${_arch}/boot/${_image_target}" 644 boot "${_image_name}"
 
 	# Switch to /usr.
 	vmkdir usr
-	mv ${DESTDIR}/lib ${DESTDIR}/usr
+	mv "${DESTDIR}/lib" "${DESTDIR}/usr"
 
-	cd ${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/${sourcepkg}-headers-${_kernver}" build
+	popd
 
-	cd ${wrksrc}
 	# Install required headers to build external modules
-	install -Dm644 Makefile ${hdrdest}/Makefile
-	install -Dm644 kernel/Makefile ${hdrdest}/kernel/Makefile
-	install -Dm644 .config ${hdrdest}/.config
-	for file in $(find . -name Kconfig\*); do
-		mkdir -p ${hdrdest}/$(dirname $file)
-		install -Dm644 $file ${hdrdest}/${file}
-	done
-	for file in $(find arch/${_arch} scripts -name module.lds -o -name Kbuild.platforms -o -name Platform); do
-		mkdir -p ${hdrdest}/$(dirname $file)
-		install -Dm644 $file ${hdrdest}/${file}
-	done
-	mkdir -p ${hdrdest}/include
+	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"
 
 	# 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 \
 		math-emu media net pcmcia scsi sound trace uapi vdso video xen; do
-		[ -d include/$i ] && cp -a include/$i ${hdrdest}/include
+		[ -d include/$i ] && cp -a "include/$i" "${hdrdest}/include"
 	done
 
-	cd ${wrksrc}
 	# 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 "${makejobs}" ARCH="${_arch}" _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
+	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"
 	if [ -d "arch/${_arch}/tools" ]; then
-		cp -a arch/${_arch}/tools ${hdrdest}/arch/${_arch}
+		cp -a "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"
 
 	# copy arch includes for external modules
-	mkdir -p ${hdrdest}/arch/${_arch}
-	cp -a arch/${_arch}/include ${hdrdest}/arch/${_arch}
+	mkdir -p "${hdrdest}/arch/${_arch}"
+	cp -a "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
+	mkdir -p "${hdrdest}/arch/${_arch}/kernel"
+	cp "arch/${_arch}/Makefile" "${hdrdest}/arch/${_arch}"
+	cp "arch/${_arch}/kernel/asm-offsets.s" "${hdrdest}/arch/${_arch}/kernel"
 	if [ "$_arch" = "arm64" ] ; then
-		cp -a arch/${_arch}/kernel/vdso ${hdrdest}/arch/${_arch}/kernel/
+		cp -a "arch/${_arch}/kernel/vdso" "${hdrdest}/arch/${_arch}/kernel/"
 	fi
 
 	# Add md headers
-	mkdir -p ${hdrdest}/drivers/md
-	cp drivers/md/*.h ${hdrdest}/drivers/md
+	mkdir -p "${hdrdest}/drivers/md"
+	cp drivers/md/*.h "${hdrdest}/drivers/md"
 
 	# Add inotify.h
-	mkdir -p ${hdrdest}/include/linux
-	cp include/linux/inotify.h ${hdrdest}/include/linux
+	mkdir -p "${hdrdest}/include/linux"
+	cp include/linux/inotify.h "${hdrdest}/include/linux"
 
 	# Add wireless headers
-	mkdir -p ${hdrdest}/net/mac80211/
-	cp net/mac80211/*.h ${hdrdest}/net/mac80211
-
-	# Remove unneeded architectures
-	# (save the correct one + Kconfig and delete all others)
-	mkdir -p arch-backup
-	cp -r ${hdrdest}/arch/${_arch} ${hdrdest}/arch/Kconfig arch-backup/
-	rm -rf ${hdrdest}/arch
-	mv arch-backup ${hdrdest}/arch
-	# Keep arch/x86/ras/Kconfig as it is needed by drivers/ras/Kconfig
-	mkdir -p ${hdrdest}/arch/x86/ras
-	cp -a arch/x86/ras/Kconfig ${hdrdest}/arch/x86/ras/Kconfig
+	mkdir -p "${hdrdest}/net/mac80211/"
+	cp 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
+	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}"
 }
 
 subpackages="rpi-kernel-headers"

From 4aafebfc3fec6928f7c67204490703719e9fcb8e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:53 -0400
Subject: [PATCH 2/4] rpi-firmware: update to 20230925.

---
 srcpkgs/rpi-firmware/template | 118 ++++++++++++++++------------------
 1 file changed, 57 insertions(+), 61 deletions(-)

diff --git a/srcpkgs/rpi-firmware/template b/srcpkgs/rpi-firmware/template
index 5086abfa19fec..0a2efa3b80db0 100644
--- a/srcpkgs/rpi-firmware/template
+++ b/srcpkgs/rpi-firmware/template
@@ -1,82 +1,78 @@
 # Template file for 'rpi-firmware'
-_githash="62efc6a69d4e717bf2833c649d622c8298a37e9c"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-firmware
-version=20220823
-revision=2
+version=20230925
+revision=1
+_rpi_fw=6b37a457122714aa14b2c7df0926455173fd04f1
+_rpi_bt=9556b08ace2a1735127894642cc8ea6529c04c90
+_rpi_brcm=2c3a8701193ba23d0ef85cdf0d0c9e47baf03dfc
+create_wrksrc=yes
 archs="armv6l* armv7l* aarch64*"
-provides="linux-firmware-broadcom-${version}_${revision}"
-replaces="linux-firmware-broadcom>=0"
-short_desc="Firmware files for the Raspberry Pi (git ${_gitshort})"
+short_desc="Firmware files for the Raspberry Pi"
 maintainer="Piraty <mail@piraty.dev>"
 license="BSD-3-Clause, custom:Cypress"
 homepage="https://github.com/raspberrypi/firmware"
-distfiles="https://github.com/raspberrypi/firmware/archive/${_githash}.tar.gz"
-checksum=3fc5ab7155bde7221245f439971217558300dcbc988ade861cfef4e737de9909
+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://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
+ 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"
+
+provides="linux-firmware-broadcom-${version}_${revision}"
+replaces="linux-firmware-broadcom>=0"
 
 conf_files="/boot/cmdline.txt /boot/config.txt"
 nostrip=yes
 
 do_install() {
-	rm -f boot/*.img
-	rm -rf boot/overlays
-	rm -f boot/*.dtb
-	rm -f boot/COPYING.linux
-
-	vlicense boot/LICENCE.broadcom
-	rm -f boot/LICENCE.broadcom
+	# bootloader
+	vlicense "firmware-${_rpi_fw}/boot/LICENCE.broadcom"
+	rm -rf "firmware-${_rpi_fw}/boot/"*.img \
+		"firmware-${_rpi_fw}/boot/overlays" \
+		"firmware-${_rpi_fw}/boot/"*.dtb \
+		"firmware-${_rpi_fw}/boot/COPYING.linux" \
+		"firmware-${_rpi_fw}/boot/LICENCE.broadcom"
 
 	vmkdir boot
-	cp -R boot/* ${DESTDIR}/boot
+	vcopy "firmware-${_rpi_fw}/boot/*" boot
 
 	# Install configuration files.
-	vinstall ${FILESDIR}/cmdline.txt 644 boot
-	vinstall ${FILESDIR}/config.txt 644 boot
+	vinstall "${FILESDIR}/cmdline.txt" 644 boot
+	vinstall "${FILESDIR}/config.txt" 644 boot
 
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/LICENCE.cypress
-	vlicense LICENCE.cypress
+	# firmware
+	# we can use either the -standard or -minimal 43455 file so use standard by default
+	ln -sfv cyfmac43455-sdio-standard.bin "firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/cypress/cyfmac43455-sdio.bin"
+	vlicense "${XBPS_SRCDISTDIR}/${pkgname}-${version}/LICENCE.cypress"
 
-	# Firmware for rpi3 b and zero wifi chip
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43430-sdio.${f}
-		vinstall brcmfmac43430-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
+	# add original Pi Foundation firmware files
+	# install deref's symlinks and copies a whole file, which makes rpi use duplicated variants specifically from downstream firmware
+	install -Dm644 \
+		"firmware-nonfree-${_rpi_brcm}/debian/config/brcm80211/brcm/"brcmfmac*raspberrypi* \
+		-t "${DESTDIR}/usr/lib/firmware/brcm"
 
-	# Firmware for rpi3 b and zero bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430A1.hcd
-	vinstall BCM43430A1.hcd 0644 usr/lib/firmware/brcm
+	# but 43436/43436s/43456 is not in linux-firmware, so copy it normally
+	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
 
-	# Firmware for rpi3 b+ wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43455-sdio.${f}
-		vinstall brcmfmac43455-sdio.${f} 0644 usr/lib/firmware/brcm
+	for file in "${XBPS_SRCDISTDIR}/${pkgname}-${version}/"*.hcd; do
+		vinstall "$file" 0644 usr/lib/firmware/brcm
 	done
-
-	# Firmware for rpi3 b+ bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C0.hcd
-	vinstall BCM4345C0.hcd 0644 usr/lib/firmware/brcm
-
-	# Firmware for rpi zero 2w wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436-sdio.${f}
-		vinstall brcmfmac43436-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-	for f in bin txt; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43436s-sdio.${f}
-		vinstall brcmfmac43436s-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 wifi chip
-	for f in bin txt clm_blob; do
-		$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/buster/brcm/brcmfmac43456-sdio.${f}
-		vinstall brcmfmac43456-sdio.${f} 0644 usr/lib/firmware/brcm
-	done
-
-	# Firmware for rpi4/rpi400 bluetooth chip
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM4345C5.hcd
-	vinstall BCM4345C5.hcd 0644 usr/lib/firmware/brcm
-
-	$XBPS_FETCH_CMD https://raw.githubusercontent.com/RPi-Distro/bluez-firmware/master/broadcom/BCM43430B0.hcd
-	vinstall BCM43430B0.hcd 0644 usr/lib/firmware/brcm
 }

From 6a2bd7d26b9d7504761ca45d394b4c77d46f9a4d Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 20 Sep 2023 02:37:54 -0400
Subject: [PATCH 3/4] rpi-userland: update to 20230920.

---
 srcpkgs/rpi-userland/template | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/rpi-userland/template b/srcpkgs/rpi-userland/template
index 4f1ea38c9e3a6..25fc587bfb55d 100644
--- a/srcpkgs/rpi-userland/template
+++ b/srcpkgs/rpi-userland/template
@@ -1,19 +1,17 @@
 # Template file for 'rpi-userland'
-_githash="97bc8180ad682b004ea224d1db7b8e108eda4397"
-_gitshort="${_githash:0:7}"
-
 pkgname=rpi-userland
-version=20210623
+version=20230920
 revision=1
+_githash="44a3953fd13d5f0b9b0cd120b904aa7db370244e"
 build_style=cmake
-hostmakedepends="pkg-config"
 configure_args="-DCMAKE_INSTALL_RPATH=\$ORIGIN/../lib"
-short_desc="Raspberry Pi GPU userland libraries and utilities (git ${_gitshort})"
+hostmakedepends="pkg-config"
+short_desc="Raspberry Pi GPU userland libraries and utilities"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/raspberrypi/userland"
 distfiles="https://github.com/raspberrypi/userland/archive/${_githash}.tar.gz"
-checksum=d67def03931215f41b741aed5a3a1bc2bd62fa33f5cc14692e9a4d65f2e0ea27
+checksum=981c376a110f78fe579a72e218888646ccd5d71ab82d04bb1a8d7be1487b45f0
 
 LDFLAGS="-Wl,--no-as-needed"
 archs="armv6l* armv7l* aarch64*"

From 2307a8cce942dd8941c08ff35a10e364789b180d Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 29 Sep 2023 17:24:20 -0400
Subject: [PATCH 4/4] rpi-eeprom: update to 2023.09.29.

---
 srcpkgs/rpi-eeprom/template | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/rpi-eeprom/template b/srcpkgs/rpi-eeprom/template
index 8bccfe7930339..fb017a50966cd 100644
--- a/srcpkgs/rpi-eeprom/template
+++ b/srcpkgs/rpi-eeprom/template
@@ -1,8 +1,8 @@
 # Template file for 'rpi-eeprom'
 pkgname=rpi-eeprom
-version=2022.05.20
+version=2023.09.29
 revision=1
-_githash="1c758a0904630da2ea905118bdf34fe2d8a6bb5e"
+_githash="4f2d676b4e2a9c2d9ee1ab42015ce711fde97afa"
 archs="armv7* aarch64*"
 conf_files="/etc/default/rpi-eeprom-update"
 depends="binutils pciutils python3 rpi-firmware rpi-userland"
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 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=ab4e20ef187f1583265c0face1d7d1597df2dc5d0fef697b459794924542388a
+checksum="189c5d37f3102247cec72619e3cb357d027ec526fa3c7373d3107bd6c9e30e29"
 python_version=3
 repository=nonfree
 
@@ -22,7 +22,8 @@ do_install() {
 	vinstall rpi-eeprom-update-default 644 etc/default rpi-eeprom-update
 
 	vmkdir usr/lib/firmware/raspberrypi/bootloader
-	vcopy firmware/* 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/
 
 	vlicense LICENSE
 }

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland, rpi-eeprom)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (40 preceding siblings ...)
  2023-09-29 21:24 ` [PR PATCH] [Updated] " classabbyamp
@ 2023-09-29 22:01 ` classabbyamp
  2023-09-30  2:41 ` [PR PATCH] [Merged]: " classabbyamp
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-29 22:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/46152#issuecomment-1741491911

Comment:
probably in the deps of dkms, not the headers. will address the dkms stuff separately (#46332)

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PR PATCH] [Merged]: rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland, rpi-eeprom)
  2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
                   ` (41 preceding siblings ...)
  2023-09-29 22:01 ` rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland, rpi-eeprom) classabbyamp
@ 2023-09-30  2:41 ` classabbyamp
  42 siblings, 0 replies; 44+ messages in thread
From: classabbyamp @ 2023-09-30  2:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4906 bytes --]

There's a merged pull request on the void-packages repository

rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland, rpi-eeprom)
https://github.com/void-linux/void-packages/pull/46152

Description:
- rpi-kernel: update to 6.1.54.
- rpi-firmware: update to 20230920.
- rpi-userland: update to 20230920.

continuation of #43600, made a new PR to clean things up

builds for testing: https://devspace.voidlinux.org/abby/updates/rpi/

#### Testing the changes
- I tested the changes in this PR: **YES**

Still getting the DKMS/headers issue:

When building `fixdep` and `modpost` in `/etc/kernel.d/post-install/10-dkms`, it gets stuck in an infinite makefile loop:

https://github.com/void-linux/void-packages/blob/5b18878cc72b410bc076ac15218f4c5fa0c3fcbf/srcpkgs/dkms/files/kernel.d/dkms.postinst#L22-L24

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
  SYNC    include/config/auto.conf
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTLD  scripts/dtc/fdtoverlay
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  UPD     include/generated/compile.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
scripts/Makefile.build:425: warning: overriding recipe for target 'built-in.a'
Makefile:1259: warning: ignoring old recipe for target 'built-in.a'
scripts/Makefile.build:440: warning: overriding recipe for target 'modules.order'
Makefile:1923: warning: ignoring old recipe for target 'modules.order'
^Cmake[4]: *** [Makefile:1307: asm-generic] Interrupt
Interrupt
make[3]: *** [Makefile:1289: prepare0] Interrupt
make[2]: *** [Makefile:1289: prepare0] Interrupt
make[1]: *** [Makefile:1289: prepare0] Interrupt
make: *** [Makefile:1289: prepare0] Interrupt
```

However, `^C`ing out of that and re-running it succeeds, because `fixdep` and `modpost` were build before the infinite loop:

```
# xbps-reconfigure -f rpi-kernel
rpi-kernel: configuring ...
Executing post-install kernel hook: 10-dkms ...
rpi-kernel: configured successfully.
```

And dkms works after that:

```
Building DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
Installing DKMS module 'rtl8821cu-5.12.0.4' for kernel-6.1.54_1... done.
rtl8821cu-dkms-20210916_2: installed successfully.
```

So the issue left to figure out is: why does it infinite loop?


^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2023-09-30  2:41 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-20 11:34 [PR PATCH] rpi-kernel: update to 6.1.54 classabbyamp
2023-09-20 12:35 ` rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland) r-ricci
2023-09-20 13:36 ` tsjk
2023-09-20 13:37 ` tsjk
2023-09-20 16:41 ` classabbyamp
2023-09-23 19:03 ` moabeat-berlin
2023-09-23 19:12 ` classabbyamp
2023-09-23 19:28 ` moabeat-berlin
2023-09-23 19:29 ` moabeat-berlin
2023-09-23 23:11 ` [PR PATCH] [Updated] " classabbyamp
2023-09-23 23:12 ` classabbyamp
2023-09-23 23:13 ` classabbyamp
2023-09-23 23:15 ` classabbyamp
2023-09-23 23:28 ` moabeat-berlin
2023-09-23 23:29 ` moabeat-berlin
2023-09-23 23:59 ` classabbyamp
2023-09-24  0:20 ` moabeat-berlin
2023-09-24  0:21 ` moabeat-berlin
2023-09-24 17:53 ` tsjk
2023-09-24 17:54 ` tsjk
2023-09-24 17:54 ` tsjk
2023-09-24 19:53 ` tsjk
2023-09-25  6:33 ` [PR PATCH] [Updated] " classabbyamp
2023-09-25  6:40 ` classabbyamp
2023-09-25  8:44 ` tsjk
2023-09-25  8:45 ` tsjk
2023-09-29 18:29 ` classabbyamp
2023-09-29 18:29 ` classabbyamp
2023-09-29 18:29 ` classabbyamp
2023-09-29 18:29 ` classabbyamp
2023-09-29 18:37 ` tsjk
2023-09-29 18:40 ` classabbyamp
2023-09-29 18:41 ` tsjk
2023-09-29 19:01 ` classabbyamp
2023-09-29 19:01 ` classabbyamp
2023-09-29 19:01 ` classabbyamp
2023-09-29 19:05 ` classabbyamp
2023-09-29 19:37 ` [PR PATCH] [Updated] " classabbyamp
2023-09-29 20:57 ` moabeat-berlin
2023-09-29 21:09 ` classabbyamp
2023-09-29 21:18 ` classabbyamp
2023-09-29 21:24 ` [PR PATCH] [Updated] " classabbyamp
2023-09-29 22:01 ` rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland, rpi-eeprom) classabbyamp
2023-09-30  2:41 ` [PR PATCH] [Merged]: " classabbyamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).