build icon indicating copy to clipboard operation
build copied to clipboard

[Bug]: sun50i-*-fixup.scr lost in 6.16 edge kernel

Open YaoFei509 opened this issue 2 months ago • 7 comments

What happened?

Without it the bluetooth and other overlays can't work

How to reproduce?

check: /boot/dtb-6.16.8-edge-sunxi64/allwinner/overlay/sun50i-h616-fixup.scr

Branch

main (main development branch)

On which host OS are you running the build script and observing this problem?

Ubuntu 24.04 Noble

Are you building on Windows WSL2?

  • [ ] Yes, my Ubuntu/Debian/OtherOS is running on WSL2

Relevant log URL

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

YaoFei509 avatar Oct 27 '25 02:10 YaoFei509

Jira ticket: AR-2776

github-actions[bot] avatar Oct 27 '25 02:10 github-actions[bot]

in fact, lost all fixup.scr

YaoFei509 avatar Oct 29 '25 07:10 YaoFei509

so I do see this: https://github.com/armbian/build/blob/main/patch/kernel/archive/sunxi-6.16/patches.armbian/cb1-overlay.patch I don't have any unused H616 boards, and the one board I can think of is still on bullseye & 6.1.11. it'll take me a bit to get it fully updated.

tabrisnet avatar Nov 10 '25 15:11 tabrisnet

this is likely relevant:

tabris@brunnt:~/build/armbian-build/cache/sources/linux-kernel-worktree$ grep sun50i-h616-fixup.scr -r 6.1[26]__sunxi64__arm64
6.12__sunxi64__arm64/arch/arm64/boot/dts/allwinner/overlay/Makefile:    sun50i-h616-fixup.scr
6.12__sunxi64__arm64/arch/arm64/boot/dts/allwinner/overlay/.sun50i-h616-fixup.scr.cmd:savedcmd_arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-fixup.scr := mkimage -C none -A arm64 -T script -d arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-fixup.scr-cmd arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-fixup.scr
6.16__sunxi64__arm64/arch/arm64/boot/dts/allwinner/overlay/Makefile:    sun50i-h616-fixup.scr
tabris@brunnt:~/build/armbian-build/cache/sources/linux-kernel-worktree$ find 6.1[26]__sunxi64__arm64 -name 'sun50i-h616-fixup.scr' 
6.12__sunxi64__arm64/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-fixup.scr
tabris@brunnt:~/build/armbian-build/cache/sources/linux-kernel-worktree$ 

Note that although the file is mentioned in the 6.16's Makefile, it doesn't seem to have used the same machinery.

tabrisnet avatar Nov 10 '25 16:11 tabrisnet

looks like the relevant command in Makefile.lib got moved to Makefile.dtbs

tabris@brunnt:~/build/armbian-build/cache/sources/linux-kernel-worktree$ grep -A1 quiet_cmd_scr 6.1[26]__sunxi64__arm64/scripts/Makefile.*
6.12__sunxi64__arm64/scripts/Makefile.lib:quiet_cmd_scr = FIXUP IMAGE $@
6.12__sunxi64__arm64/scripts/Makefile.lib-      cmd_scr = mkimage -C none -A $(ARCH) -T script -d $< $@
--
6.16__sunxi64__arm64/scripts/Makefile.dtbs:quiet_cmd_scr = MKIMAGE $@
6.16__sunxi64__arm64/scripts/Makefile.dtbs-      cmd_scr = mkimage -C none -A $(ARCH) -T script -d $< $@

There are probably other missing/relocated pieces also. @igorpecovnik as it looks like he did the most recent changes in patch/kernel/archive/sunxi-6.16/

tabrisnet avatar Nov 10 '25 16:11 tabrisnet

restoring quiet_cmd_scr & cmd_scr to scripts/Makefile.lib did nothing [apparently] useful.

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1d581ba5df66..5a96cf9fdccb 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -364,10 +364,19 @@ quiet_cmd_lz4 = LZ4     $@
 
 quiet_cmd_lz4_with_size = LZ4     $@
       cmd_lz4_with_size = { cat $(real-prereqs) | $(LZ4) -l -9 - -; \
                   $(size_append); } > $@
 
+# Fixup script mkimage provided by Armbian
+# ---------------------------------------------------------------------------
+
+quiet_cmd_scr = FIXUP IMAGE $@
+       cmd_scr = mkimage -C none -A $(ARCH) -T script -d $< $@
+
+$(obj)/%.scr: $(src)/%.scr-cmd FORCE
+       $(call if_changed,scr)
+
 # U-Boot mkimage
 # ---------------------------------------------------------------------------
 
 MKIMAGE := $(srctree)/scripts/mkuboot.sh
 

tabrisnet avatar Nov 10 '25 18:11 tabrisnet

i haven't got to 6.16.y yet and I am not sure if i can do anything here - too many other things and EDGE is not a release priority. I am trying to get in touch with @The-going as he is maintaining Allwinner. But any help is welcome here as the task is big.

igorpecovnik avatar Nov 10 '25 22:11 igorpecovnik

This might be related to https://github.com/armbian/build/pull/9049/changes/9847b4ed24e35084d6983f40b46dc08b07f663d1 https://github.com/armbian/build/commit/9847b4ed24e35084d6983f40b46dc08b07f663d1

EvilOlaf avatar Dec 11 '25 05:12 EvilOlaf

Please test against the PR mentioned above.

EvilOlaf avatar Dec 11 '25 07:12 EvilOlaf

Nope, wasn't related and also it didn't fix itself. Tested on zero2 with 6.18. Noticed in boot log
Failed to load '/boot/dtb/allwinner/overlay/-fixup.scr'

EvilOlaf avatar Dec 11 '25 18:12 EvilOlaf

[...]
4203 bytes read in 6 ms (683.6 KiB/s)
Applying kernel provided DT fixup script (sun50i-h616-fixup.scr)
## Executing script at 45000000
15153874 bytes read in 628 ms (23 MiB/s)
[...]

😃

For once some changes in scripts/Makefile.lib seem missing and for the other uboot fails to load because overlay_prefix isn't set in the armbianEnv.txt which should be sun50i-h616 by default. So there are two concurring issues. Need to do a bit more testing there before pushing anything.

EvilOlaf avatar Dec 11 '25 18:12 EvilOlaf

Should be fixed with https://github.com/armbian/build/commit/77f096fbc8cccfa934b23d59f9574860dde54c9d

EvilOlaf avatar Dec 13 '25 06:12 EvilOlaf

wonderful!

YaoFei509 avatar Dec 16 '25 15:12 YaoFei509