Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sunxi/sunxi64: bump edge to 6.12 via copy #7577

Merged
merged 12 commits into from
Dec 30, 2024

Conversation

The-going
Copy link
Contributor

@The-going The-going commented Dec 13, 2024

Description

  • Add megous patches
  • Add all Armbian patches from archive/sunxi-6.11
  • rebase & re-extract patches for v6.12.4
  • sorting armbian patches, Switch EDGE to v6.12.4
  • Add patches to the armbian series
  • update the config, add CONFIG_STACK_TRACER=y

How Has This Been Tested?

  • Test build sunxi64 and work on bananpim64
  • Test build sunxi and work on bananpim3

A kernel with patches already applied:
main-sunxi-6.12

@github-actions github-actions bot added size/large PR with 250 lines or more Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Dec 13, 2024
@pyavitz
Copy link
Collaborator

pyavitz commented Dec 13, 2024

This PR is missing my recent PR: #7568

@pyavitz
Copy link
Collaborator

pyavitz commented Dec 14, 2024

Fails to build kernel debs

[🌱] shellcheck found no problems in package scripts [ shellchecked 2 scripts in 'linux-dtb-edge-sunxi64' ]
[🌱] Building package, this might take a while.. [ linux-dtb-edge-sunxi64_6.12.4-S61ba-D0531-P1629-Cead4H5c21-HK01ba-Vc222-B59f0-R448a_arm64.deb ]
[🔨]   dpkg-deb: building package 'linux-dtb-edge-sunxi64' in '/home/patrick/build/armbian/output/packages-hashed/global/linux-dtb-edge-sunxi64_6.12.4-S61ba-D0531-P1629-Cead4H5c21-HK01ba-Vc222-B59f0-R448a_arm64.deb'.
[🌱] Packaging linux-headers [ sunxi64 linux-sunxi64-edge ]
[🔨]   '/home/patrick/build/armbian/.tmp/work-d1d68cd8-bf28-4c3d-a24e-bf4bb7dd0f12/deb-k-linux-headers-edge-sunxi64-9Nj9c/lib/modules/6.12.4-edge-sunxi64/build' -> '/usr/src/linux-headers-6.12.4-edge-sunxi64'
[🔨]   '/home/patrick/build/armbian/cache/sources/linux-kernel-worktree/6.12__sunxi64__arm64/.config' -> '/home/patrick/build/armbian/.tmp/work-d1d68cd8-bf28-4c3d-a24e-bf4bb7dd0f12/deb-k-linux-headers-edge-sunxi64-9Nj9c/usr/src/linux-headers-6.12.4-edge-sunxi64/.config'
[💥] Error 2 occurred in main shell [ at /home/patrick/build/armbian/lib/functions/logging/runners.sh:211
    run_host_command_logged_raw() --> lib/functions/logging/runners.sh:211
        run_host_command_logged() --> lib/functions/logging/runners.sh:193
   kernel_package_callback_linux_headers() --> lib/functions/compilation/kernel-debs.sh:450
              create_kernel_deb() --> lib/functions/compilation/kernel-debs.sh:131
   prepare_kernel_packaging_debs() --> lib/functions/compilation/kernel-debs.sh:84
                 kernel_package() --> lib/functions/compilation/kernel.sh:248
                  do_with_hooks() --> lib/functions/general/extensions.sh:567
                do_with_logging() --> lib/functions/logging/section-logging.sh:81
   kernel_prepare_build_and_package() --> lib/functions/compilation/kernel.sh:171
                 compile_kernel() --> lib/functions/compilation/kernel.sh:100
   artifact_kernel_build_from_sources() --> lib/functions/artifacts/artifact-kernel.sh:240
    artifact_build_from_sources() --> lib/functions/artifacts/artifacts-obtain.sh:34
       obtain_complete_artifact() --> lib/functions/artifacts/artifacts-obtain.sh:280
       build_artifact_for_image() --> lib/functions/artifacts/artifacts-obtain.sh:392
    main_default_build_packages() --> lib/functions/main/build-packages.sh:106
   full_build_packages_rootfs_and_image() --> lib/functions/main/default-build.sh:31
          do_with_default_build() --> lib/functions/main/default-build.sh:42
         cli_standard_build_run() --> lib/functions/cli/cli-build.sh:25
        armbian_cli_run_command() --> lib/functions/cli/utils-cli.sh:136
                 cli_entrypoint() --> lib/functions/cli/entrypoint.sh:176
                           main() --> compile.sh:50
 ]
[💥] Cleaning up [ please wait for cleanups to finish ]
[🌿] ANSI log file built; inspect it by running: [ less -RS output/logs/log-build-d1d68cd8-bf28-4c3d-a24e-bf4bb7dd0f12.log.ans ]
[🌿] Share log manually (or SHARE_LOG=yes): [ curl --data-binary @output/logs/log-build-d1d68cd8-bf28-4c3d-a24e-bf4bb7dd0f12.log.ans https://paste.armbian.com/log ]

@The-going
Copy link
Contributor Author

Fails to build kernel debs

I don't have anything doing at all.
Just changes the version from the package cache!

I'm deleting the cache for kernel packages.
The assembly takes place in a new way using only the compiler cache.

[🌱] Runtime [ 1:57 min ]
[✨] Repeat Build Options [ ./compile.sh test kernel ]
[🌱] Cleaning up [ please wait for cleanups to finish ]
$ ls output/debs/
extra
linux-dtb-edge-sunxi64_25.02.0-trunk_arm64__6.12.4-S61ba-D0531-P1629-Cead4H5c21-HK01ba-Vc222-B59f0-R448a.deb
linux-headers-edge-sunxi64_25.02.0-trunk_arm64__6.12.4-S61ba-D0531-P1629-Cead4H5c21-HK01ba-Vc222-B59f0-R448a.deb
linux-image-edge-sunxi64_25.02.0-trunk_arm64__6.12.4-S61ba-D0531-P1629-Cead4H5c21-HK01ba-Vc222-B59f0-R448a.deb
linux-libc-dev-edge-sunxi64_25.02.0-trunk_arm64__6.12.4-S61ba-D0531-P1629-Cead4H5c21-HK01ba-Vc222-B59f0-R448a.deb

@pyavitz
Copy link
Collaborator

pyavitz commented Dec 15, 2024

Doesn't happen when I build 6.11.y.

@The-going
Copy link
Contributor Author

Fails to build kernel debs

Patrick, please tell me how I can reproduce it.

@The-going
Copy link
Contributor Author

The-going commented Dec 15, 2024

I reproduced the build error.
If I run the build of only the core for the selected board, then everything completes successfully.

[🌱] Runtime [ 2:37 min ]
[✨] Repeat Build Options [ ./compile.sh test kernel ]

If I collect only DTB, then the assembly is successful, but the package packer fails and writes this error:

leo@armbuild:~/armbian$ ./compile.sh test kernel-dtb
....
[🔨]     DTC     arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-bananapi-m4-spi1-cs0-cs1-spidev.dtbo
[🔨]     DTC     arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4-zero.dtb
[🔨]     DTC     arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-bananapi-m4-spi1-cs0-spidev.dtbo
[🔨]     DTC     arch/arm64/boot/dts/allwinner/sun50i-h618-longanpi-3h.dtb
[🔨]     DTC     arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-bananapi-m4-spi1-cs1-spidev.dtbo
.....
[🌱] Kernel built in [ 3 seconds - 6.12.4-sunxi64 ]
[🚸] Kernel DTB-only for development [ Installing DTBs ]
[🌱] Building kernel [ sunxi64 linux-sunxi64-edge dtbs_install ]
....
[🔨]     INSTALL /home/leo/armbian/.tmp/work-0f1e310a-31d7-42e6-80d1-39084cca819f/kernel_dest_install_dir-aeXYW/dtbs/allwinner/sun50i-h618-bananapi-m4-zero.dtb
[🔨]     INSTALL /home/leo/armbian/.tmp/work-0f1e310a-31d7-42e6-80d1-39084cca819f/kernel_dest_install_dir-aeXYW/dtbs/allwinner/sun50i-h618-orangepi-zero2w.dtb
[🔨]     INSTALL /home/leo/armbian/.tmp/work-0f1e310a-31d7-42e6-80d1-39084cca819f/kernel_dest_install_dir-aeXYW/dtbs/allwinner/sun50i-h618-orangepi-zero3.dtb
.....
[🌱] Kernel built in [ 0 seconds - 6.12.4-sunxi64 ]
[🚸] Kernel DTB-only for development [ Copying preprocessed version of sun50i-h618-bananapi-m4-zero.dtb ]
[💥] error! [ Failed to parse BOOT_FDT_FILE: sun50i-h618-bananapi-m4-zero.dtb  ]
[💥] Exiting with error 43 [ at /home/leo/armbian/lib/functions/logging/traps.sh:1
                exit_with_error() --> lib/functions/logging/traps.sh:1
          kernel_dtb_only_build() --> lib/functions/compilation/kernel.sh:196
   kernel_prepare_build_and_package() --> lib/functions/compilation/kernel.sh:164
                 compile_kernel() --> lib/functions/compilation/kernel.sh:100
   artifact_kernel_build_from_sources() --> lib/functions/artifacts/artifact-kernel.sh:240
    artifact_build_from_sources() --> lib/functions/artifacts/artifacts-obtain.sh:34
       obtain_complete_artifact() --> lib/functions/artifacts/artifacts-obtain.sh:280
          do_with_default_build() --> lib/functions/main/default-build.sh:42
               cli_artifact_run() --> lib/functions/cli/cli-artifact.sh:70
        armbian_cli_run_command() --> lib/functions/cli/utils-cli.sh:136
                 cli_entrypoint() --> lib/functions/cli/entrypoint.sh:176
                           main() --> compile.sh:50
 ]
[💥] Cleaning up [ please wait for cleanups to finish ]

We can see that the assembly of the target files was successful.
They exist.

P.S. Incorrect logic in function kernel_dtb_only_build here:
lib/functions/compilation/kernel.sh#L190-L197

@rpardini I can see what we're doing in this function, but I don't really understand why.
May I hear some explanations from you.

@The-going
Copy link
Contributor Author

The error occurs if a variable is initialized:
BOOT_FDT_FILE=filename.dtb
And this applies to all 32-bit families.

If you write as:
BOOT_FDT_FILE=vendorname/filename.dtb
then the algorithm will work, but even in this case it is not correct.
We analyze the string from the configuration, and then look for the real file.

@pyavitz
Copy link
Collaborator

pyavitz commented Dec 15, 2024

The error occurs if a variable is initialized: BOOT_FDT_FILE=filename.dtb And this applies to all 32-bit families.

If you write as: BOOT_FDT_FILE=vendorname/filename.dtb then the algorithm will work, but even in this case it is not correct. We analyze the string from the configuration, and then look for the real file.

Didn't you recently remove the vendor name from the bananapim4zero.conf file along with 2 other confs? I'm still unsure why this is only affecting the 6.12.y builds.

@The-going
Copy link
Contributor Author

The-going commented Dec 15, 2024

The error occurs if a variable is initialized: BOOT_FDT_FILE=filename.dtb And this applies to all 32-bit families.
If you write as: BOOT_FDT_FILE=vendorname/filename.dtb then the algorithm will work, but even in this case it is not correct. We analyze the string from the configuration, and then look for the real file.

Didn't you recently remove the vendor name from the bananapim4zero.conf file along with 2 other confs? I'm still unsure why this is only affecting the 6.12.y builds.

Perhaps the branch where you built for 6.11 should be rebased as:
git pull --rebase=true

build for 6.11:

.....
[🌱] Kernel built in [ 1 seconds - 6.11.9-sunxi64 ]
[🚸] Kernel DTB-only for development [ Copying preprocessed version of sun50i-h618-bananapi-m4-zero.dtb ]
[💥] error! [ Failed to parse BOOT_FDT_FILE: sun50i-h618-bananapi-m4-zero.dtb  ]
[💥] Exiting with error 43 [ at /home/leo/armbian/lib/functions/logging/traps.sh:1
                exit_with_error() --> lib/functions/logging/traps.sh:1
          kernel_dtb_only_build() --> lib/functions/compilation/kernel.sh:196
.....

Similarly

@pyavitz
Copy link
Collaborator

pyavitz commented Dec 15, 2024

The error occurs if a variable is initialized: BOOT_FDT_FILE=filename.dtb And this applies to all 32-bit families.
If you write as: BOOT_FDT_FILE=vendorname/filename.dtb then the algorithm will work, but even in this case it is not correct. We analyze the string from the configuration, and then look for the real file.

Didn't you recently remove the vendor name from the bananapim4zero.conf file along with 2 other confs? I'm still unsure why this is only affecting the 6.12.y builds.

Perhaps the branch where you built for 6.11 should be rebased as: git pull --rebase=true

build for 6.11:

.....
[🌱] Kernel built in [ 1 seconds - 6.11.9-sunxi64 ]
[🚸] Kernel DTB-only for development [ Copying preprocessed version of sun50i-h618-bananapi-m4-zero.dtb ]
[💥] error! [ Failed to parse BOOT_FDT_FILE: sun50i-h618-bananapi-m4-zero.dtb  ]
[💥] Exiting with error 43 [ at /home/leo/armbian/lib/functions/logging/traps.sh:1
                exit_with_error() --> lib/functions/logging/traps.sh:1
          kernel_dtb_only_build() --> lib/functions/compilation/kernel.sh:196
.....

Similarly

When I tested it yesterday I pulled shallow directly from armbian/build: main. Anyway, it's obviously broke.

@pyavitz
Copy link
Collaborator

pyavitz commented Dec 15, 2024

My error is diff than the one you are showing, I thinks.

--> (174) COMMAND: cp -rp /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/kernel_dest_install_dir-RgF6E/dtbs /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-dtb-edge-sunxi64-Kd7jn/boot/dtb-6.12.4-edge-sunxi64
--> (174) COMMAND: cat /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-dtb-edge-sunxi64-Kd7jn/DEBIAN/preinst
--> (174) COMMAND: cat /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-dtb-edge-sunxi64-Kd7jn/DEBIAN/postinst
--> (174) COMMAND: chown -R root:root /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-dtb-edge-sunxi64-Kd7jn
--> (174) COMMAND: chmod -R go-w /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-dtb-edge-sunxi64-Kd7jn
--> (174) COMMAND: chmod -R a+rX /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-dtb-edge-sunxi64-Kd7jn
--> (174) COMMAND: chmod -R ug-s /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-dtb-edge-sunxi64-Kd7jn
--> (174) INFO: shellcheck found no problems in package scripts [ shellchecked 2 scripts in 'linux-dtb-edge-sunxi64' ]
--> (174) INFO: Building package, this might take a while.. [ linux-dtb-edge-sunxi64_6.12.4-S61ba-D0531-P7649-Cead4H5c21-HK01ba-Vc222-B59f0-R448a_arm64.deb ]
--> (174) COMMAND: dpkg-deb -b -Znone /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-dtb-edge-sunxi64-Kd7jn /home/patrick/build/armbian-build/output/packages-hashed/global/linux-dtb-edge-sunxi64_6.12.4-S61ba-D0531-P7649-Cead4H5c21-HK01ba-Vc222-B59f0-R448a_arm64.deb
   dpkg-deb: building package 'linux-dtb-edge-sunxi64' in '/home/patrick/build/armbian-build/output/packages-hashed/global/linux-dtb-edge-sunxi64_6.12.4-S61ba-D0531-P7649-Cead4H5c21-HK01ba-Vc222-B59f0-R448a_arm64.deb'.
--> (174) INFO: Packaging linux-headers [ sunxi64 linux-sunxi64-edge ]
--> (174) COMMAND: ln -v -s /usr/src/linux-headers-6.12.4-edge-sunxi64 /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-headers-edge-sunxi64-lZoJQ/lib/modules/6.12.4-edge-sunxi64/build
   '/home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-headers-edge-sunxi64-lZoJQ/lib/modules/6.12.4-edge-sunxi64/build' -> '/usr/src/linux-headers-6.12.4-edge-sunxi64'
--> (174) COMMAND: cp -vp /home/patrick/build/armbian-build/cache/sources/linux-kernel-worktree/6.12__sunxi64__arm64/.config /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-headers-edge-sunxi64-lZoJQ/usr/src/linux-headers-6.12.4-edge-sunxi64/.config
   '/home/patrick/build/armbian-build/cache/sources/linux-kernel-worktree/6.12__sunxi64__arm64/.config' -> '/home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-headers-edge-sunxi64-lZoJQ/usr/src/linux-headers-6.12.4-edge-sunxi64/.config'
--> (177) COMMAND: mkdir -p /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-headers-edge-sunxi64-lZoJQ/usr/src/linux-headers-6.12.4-edge-sunxi64/tools/vm
--> (177) COMMAND: mkdir -p /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-headers-edge-sunxi64-lZoJQ/usr/src/linux-headers-6.12.4-edge-sunxi64/tools/counter/include/linux
--> (177) COMMAND: cd /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-headers-edge-sunxi64-lZoJQ/usr/src/linux-headers-6.12.4-edge-sunxi64 && make ARCH=arm64 M=scripts clean &> /dev/null
--> (177) COMMAND: cd /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-headers-edge-sunxi64-lZoJQ/usr/src/linux-headers-6.12.4-edge-sunxi64/tools && make ARCH=arm64 clean &> /dev/null
--> (179) ERROR: Error 2 occurred in main shell [ at /home/patrick/build/armbian-build/lib/functions/logging/runners.sh:211
       run_host_command_logged_raw() --> lib/functions/logging/runners.sh:211
           run_host_command_logged() --> lib/functions/logging/runners.sh:193
      kernel_package_callback_linux_headers() --> lib/functions/compilation/kernel-debs.sh:450
                 create_kernel_deb() --> lib/functions/compilation/kernel-debs.sh:131
      prepare_kernel_packaging_debs() --> lib/functions/compilation/kernel-debs.sh:84
                    kernel_package() --> lib/functions/compilation/kernel.sh:248
                     do_with_hooks() --> lib/functions/general/extensions.sh:567
                   do_with_logging() --> lib/functions/logging/section-logging.sh:81
      kernel_prepare_build_and_package() --> lib/functions/compilation/kernel.sh:171
                    compile_kernel() --> lib/functions/compilation/kernel.sh:100
      artifact_kernel_build_from_sources() --> lib/functions/artifacts/artifact-kernel.sh:240
       artifact_build_from_sources() --> lib/functions/artifacts/artifacts-obtain.sh:34
          obtain_complete_artifact() --> lib/functions/artifacts/artifacts-obtain.sh:280
          build_artifact_for_image() --> lib/functions/artifacts/artifacts-obtain.sh:392
       main_default_build_packages() --> lib/functions/main/build-packages.sh:106
      full_build_packages_rootfs_and_image() --> lib/functions/main/default-build.sh:31
             do_with_default_build() --> lib/functions/main/default-build.sh:42
            cli_standard_build_run() --> lib/functions/cli/cli-build.sh:25
           armbian_cli_run_command() --> lib/functions/cli/utils-cli.sh:136
                    cli_entrypoint() --> lib/functions/cli/entrypoint.sh:176
                              main() --> compile.sh:50
    ]
   -->--> command failed with error code 2 after 2 seconds
--> (179) WARNING: stacktrace for failed command [ exit code 2:/usr/bin/env bash -e -o pipefail -c cd /home/patrick/build/armbian-build/.tmp/work-378e199c-6284-48d4-9a9a-51390db3c186/deb-k-linux-headers-edge-sunxi64-lZoJQ/usr/src/linux-headers-6.12.4-edge-sunxi64/tools && make ARCH=arm64 clean &> /dev/null
           run_host_command_logged() --> lib/functions/logging/runners.sh:193
      kernel_package_callback_linux_headers() --> lib/functions/compilation/kernel-debs.sh:450
                 create_kernel_deb() --> lib/functions/compilation/kernel-debs.sh:131
      prepare_kernel_packaging_debs() --> lib/functions/compilation/kernel-debs.sh:84
                    kernel_package() --> lib/functions/compilation/kernel.sh:248
                     do_with_hooks() --> lib/functions/general/extensions.sh:567
                   do_with_logging() --> lib/functions/logging/section-logging.sh:81
      kernel_prepare_build_and_package() --> lib/functions/compilation/kernel.sh:171
                    compile_kernel() --> lib/functions/compilation/kernel.sh:100
      artifact_kernel_build_from_sources() --> lib/functions/artifacts/artifact-kernel.sh:240
       artifact_build_from_sources() --> lib/functions/artifacts/artifacts-obtain.sh:34
          obtain_complete_artifact() --> lib/functions/artifacts/artifacts-obtain.sh:280
          build_artifact_for_image() --> lib/functions/artifacts/artifacts-obtain.sh:392
       main_default_build_packages() --> lib/functions/main/build-packages.sh:106
      full_build_packages_rootfs_and_image() --> lib/functions/main/default-build.sh:31
             do_with_default_build() --> lib/functions/main/default-build.sh:42
            cli_standard_build_run() --> lib/functions/cli/cli-build.sh:25
           armbian_cli_run_command() --> lib/functions/cli/utils-cli.sh:136
                    cli_entrypoint() --> lib/functions/cli/entrypoint.sh:176
                              main() --> compile.sh:50 ]
--> (179) ERROR: Cleaning up [ please wait for cleanups to finish ]
------------------------------------------------------------------------------------------------------------

@The-going
Copy link
Contributor Author

The-going commented Dec 15, 2024

My error is diff than the one you are showing, I thinks.

Patrick, please tell me how I can reproduce it.

@pyavitz
Copy link
Collaborator

pyavitz commented Dec 15, 2024

My error is diff than the one you are showing, I thinks.

Patrick, please tell me how I can reproduce it.

All i did was

git clone --depth=1 https://github.com/The-going/armbian-build.git -b main-sunxi-6.12 armbian
cd armbian
./compile.sh BOARD=bananapim4zero KERNEL_GIT=shallow

and went through the motions.

I mean if it's just me, than I don't know? But I can say for sure it doesn't happen when building 6.6.y and 6.11.y.

@The-going
Copy link
Contributor Author

I introduced the CLI kernel-dtb as a convenience for quickly packaging a linux-dtb .deb. For extra convenience, if doing it for a specific board

If that's the only goal, then it's probably possible to change it for all architectures.
I'll try to do it early next year.

This is a very good feature.
I'm sorry, but some of the checks in the algorithm misled me.

@The-going
Copy link
Contributor Author

Seems that is not true and somehow the allwinner/ is missing?

It depends on the u-boot code, which searches for the target DTB in a path that does not contain a vendor folder.
This is hard-coded in u-boot.
For this reason, we are forced to fix the kernel Makefile to return the outdated behavior for 32-bit boards.

But armbian can take into account different paths and do it in the boot.cmd boot script.
I haven't checked the u-boot code for other 32-bit families yet. This part of the job is in perspective.

@rpardini
Copy link
Member

we are forced to fix the kernel Makefile to return the outdated behavior for 32-bit boards

Interesting, that explains a lot. @paolosabatino does that also apply for rk32?

@The-going
Copy link
Contributor Author

does that also apply for rk32?

general-add-overlay-compilation-support.patch

@The-going
Copy link
Contributor Author

I'm going on New Year's holidays and will be available after January 15th.
Happy New Year!

@paolosabatino
Copy link
Contributor

paolosabatino commented Dec 28, 2024

@rpardini yes, the issue is present on 32 bit rockchips too, see this comment.

As I understand correctly, on 64 bit architectures the device tree binaries are in /boot/dtb/<vendor>/:

root@rk3318-box:~# ls -lah /boot/dtb/rockchip/ | tail -n 5
-rw-r--r-- 1 root root 141K Nov 11 22:13 rk3588-nanopc-t6.dtb
-rw-r--r-- 1 root root 136K Nov 11 22:13 rk3588-rock-5b.dtb
-rw-r--r-- 1 root root 124K Nov 11 22:13 rk3588s-indiedroid-nova.dtb
-rw-r--r-- 1 root root 112K Nov 11 22:13 rk3588s-khadas-edge2.dtb
-rw-r--r-- 1 root root 124K Nov 11 22:13 rk3588s-rock-5a.dtb

instead 32 bit architectures device tree binaries are in /boot/dtb/:

root@nas:~# ls -lah /boot/dtb/ | tail -n 5
-rwxr-xr-x 1 root root  54K Mar 25  2024 rk3288-vyasa.dtb
-rwxr-xr-x 1 root root  58K Mar 25  2024 rk3288-xt-q8l-v10.dtb
-rwxr-xr-x 1 root root  27K Mar 25  2024 rv1108-elgin-r1.dtb
-rwxr-xr-x 1 root root  27K Mar 25  2024 rv1108-evb.dtb
-rwxr-xr-x 1 root root  34K Mar 25  2024 rv1126-edgeble-neu2-io.dtb

The "very convoluted" makefile rules are there to remove the vendor from the paths; if I remember correctly, not removing the vendor from the dtbs pathname would cause 32bit architectures to break because the dtbs would be in the 64-bit style paths (eg: /boot/dtb/<vendor/ instead of /boot/dtb/), and clearly it would prevent the devices from booting at all.

As @The-going is saying to accomodate such a change, I guess boot.cmd has to modified and redeployed along the dtb deb package to avoid existing systems breakage.

The very same patch is used in both rockchip and rockchip64 families though

@rpardini
Copy link
Member

Thanks, it's clear now. For now, let's keep this scheme (stripping vendor folder from 32-bit stuff) and I will just adapt kernel-dtb to work with that, or at least not-explode.

For the (somewhat distant) future, adding the proper <vendor>/ prefix will require large amount of changes in everything from .cmd's to u-boot to Makefile un-hackings, and will pose a challenge for users upgrading (as probably their armbianEnv.txt will lag behind) but will need to be done. 2026? :-D

Thanks all for the inputs here.

@rpardini
Copy link
Member

@rpardini
Copy link
Member

Well, I cherry picked this PR. It builds fine.

I couldn't reproduce the alledged "make clean" VMLINUX_BTF problem in any way:

  • I dropped the ...tools-disable-sched_ext_clean.patch from rockchip64 kernel and it still built and packaged no problem (rockpro64)
  • I reverted the commit adding VMLINUX_BTF to the make clean invocation, and it still built and packaged no problem (bananapim4zero)

I tried on both x86 and arm64 build hosts. Thus none of this makes any sense to me. Maybe something changed upstream since @The-going found it?

I'd simply drop the commit with the VMLINUX_BTF change and merge this so we can see how it does in CI, etc.

@rpardini rpardini changed the title sunxi 6.12: Add all patches sunxi/sunxi64: bump edge to 6.12 via copy Dec 28, 2024
@rpardini
Copy link
Member

@amazingfate helped me find the underlying cause. See #7604 (comment)
tl-dr: the VMLINUX_BTF problem arises when the build host is not running a BTF kernel. What a life.

The-going and others added 12 commits December 30, 2024 14:19
First of all, we make changes to the core functions and
only then we change the device tree
Here, a folder named patches.addon must exist in order for
users to add new patches. These patches will be applied but
they are awaiting more careful consideration.

Let's just sort the sequence a little bit.
It will be useful for us to receive the trace stack from users.
Add the missing fixes from armbian#7568 and re-extracted the patches.
…ools.

In order for the cleanup to be correct for tools, we need to pass
the VMLINUX_BTF variable, which contains the real path to the vmlinux
file we just compiled.

The vmlinux file itself is not involved in cleaning,
but the Makefile checks for its presence and cleaning
is aborted if it is not found.
@rpardini
Copy link
Member

See #7625 indeed for the discussion; simply not-calling make clean in tools results in binaries being shipped in linux-headers, and if cross-compiling, for the wrong architecture.

After considering all the factors at play here, I think @The-going 's proposed solution (passing a fake VMLINUX_BTF= var to make clean in tools) is the best one. I'll resolve this and approve the PR.

Thank you all so much for the learnings here and sorry for the back and forth's.

@rpardini rpardini merged commit 8d4c6d1 into armbian:main Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking change Can potentially break core functionality Framework Framework components Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/large PR with 250 lines or more
Development

Successfully merging this pull request may close these issues.

7 participants