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

Kernel: Bump mainline from 6.8-rc7 to 6.8 stable, also bump UEFI-edge from 6.7 to 6.8 #6399

Merged
merged 12 commits into from
Mar 17, 2024

Conversation

ColorfulRhino
Copy link
Collaborator

@ColorfulRhino ColorfulRhino commented Mar 16, 2024

Description

  1. Bump mainline from 6.8-rc7 to 6.8 stable
  • This currently affects only rk3588-edge
  1. Bump UEFI-edge from 6.7 to 6.8
  • Kernel configs updated via ./compile.sh rewrite-kernel-config
  • Kernel patches updated via ./compile.sh rewrite-kernel-patches
  1. Fix all wireless patches

How Has This Been Tested?

  • 1) Tested with ./compile.sh build BOARD=nanopi-r6s BRANCH=edge BUILD_DESKTOP=no BUILD_MINIMAL=no BUILD_ONLY="kernel" KERNEL_CONFIGURE=no RELEASE=bookworm --> build success
  • 2) Build ./compile.sh build BOARD=uefi-arm64 BRANCH=edge BUILD_DESKTOP=no BUILD_MINIMAL=no BUILD_ONLY="kernel" KERNEL_CONFIGURE=no RELEASE=bookworm

Checklist:

  • My code follows the style guidelines of this project
  • My changes generate no new warnings

- Kernel configs updated via ./compile.sh rewrite-kernel-config
- Using ./compile.sh rewrite-kernel-patches
@ColorfulRhino ColorfulRhino added Work in progress Unfinished / work in progress Help needed We need your involvement Hardware Hardware related like kernel, U-Boot, ... labels Mar 16, 2024
@github-actions github-actions bot added the size/large PR with 250 lines or more label Mar 16, 2024
@igorpecovnik
Copy link
Member

igorpecovnik commented Mar 16, 2024

but I honestly don't know where to get these patches from.

https://github.com/lwfinger/rtl8723du/commits/master/
We make them, sometimes its fixed upstream, we submit it there ... Next one is fixing this with a patch as driver Git is not up2date:

drivers/net/wireless/rtl8723du/os_dep/usb_intf.c:153:17: error: 'struct usb_driver' has no member named 'drvwrap'

I could not find folders like /drivers/net/wireless/rtl8192eu/os_dep/ in the mainline kernel.

cache/sources/rtl8192eu is added to the kernel before compilation

@ColorfulRhino
Copy link
Collaborator Author

but I honestly don't know where to get these patches from.

https://github.com/lwfinger/rtl8723du/commits/master/ We make them, sometimes its fixed upstream, we submit it there ...

Thanks! I found the locations where the driver repos are specified, e.g.

fetch_from_repo "$GITHUB_SOURCE/lwfinger/rtl8723du" "rtl8723du" "${rtl8723duver}" "yes"

Next one is fixing this with a patch as driver Git is not up2date:

drivers/net/wireless/rtl8723du/os_dep/usb_intf.c:153:17: error: 'struct usb_driver' has no member named 'drvwrap'

The repo at https://github.com/lwfinger/rtl8723du states that THIS DRIVER IS OBSOLETE AND SHOULD BE REPLACED BY THE rtw88 DRIVERS AT https://github.com/lwfinger/rtw88.git
It's not getting updates anymore.

Wouldn't it make sense to skip this (rtl8723du) driver, as well as potentially other now obsolete drivers, for newer kernel versions? This would prevent having to patch them again after each kernel version.

After some digging around, I found out that the rtw88 driver is excluded in a few boards/families/kernels:

  • full exclusion: families/d1 (edge kernel 6.1), families/rockchip-rk3588:branch:collabora, families/sun50iw9-btt:branch:legacy
  • only partly excluded in: boards/bananapim4zero (only rtw88_8821c & rtw88_8821cu), families/jethub (only rtw88_8822cs)

So basically, rtl8723du would only be needed in a few cases and can mostly be skipped.
Or am I missing something?

@ColorfulRhino
Copy link
Collaborator Author

ColorfulRhino commented Mar 17, 2024

Went through the list of supported devices by rtw88. The following drivers could be made obsolete (i.e. only added to kernels <=6.7):

  • driver_rtl88x2cs (specifically says in its repo: USE RTW88 NOT THIS DRIVER), for all boards except jethub I guess?
  • RTW8723DS
  • RTW8723DU

This would save hassles of potentially needing new patches with new kernel versions and also save a little bit of time on kernel building.

Also add commit dates to make life prettier and easier

The following drivers have been updated with fixes for 6.8
- driver_rtl8811CU_rtl8821C
- driver_rtl88x2bu
- driver_rtl8811_rtl8812_rtl8814_rtl8821

The following drivers have been updated without specific 6.8 patches:
- driver_rtl8189ES (patches for 6.7, deleted two upstreamed patches)
- driver_rtl8189FS (patches for 6.7, deleted four upstreamed patches)
@rpardini
Copy link
Member

@ColorfulRhino welcome to the delights of those ancient vendor network drivers. It's hell. It's also intricate, some boards will work better with the old/deprecated driver, there's a very complex relationship between the driver and the firmware, and general sadness since the network drivers patching is done separately from the other patches and later integrated into the Python patching. The first kernels to be bumped to a new version usually show these problems, although as you've seen some family use different stuff, etc.

@ColorfulRhino
Copy link
Collaborator Author

welcome to the delights of those ancient vendor network drivers. It's hell. It's also intricate, some boards will work better with the old/deprecated driver, there's a very complex relationship between the driver and the firmware, and general sadness

Oh no, what have I gotten myself into... 😂 I just wanted to quickly bump the kernel 🫠
Originally I was trying to bump rockchip64 to 6.8, but noped out of there when I saw the amout of patches which didn't work with 6.8 out of the box. This network driver stuff is at least equally bad though 😂

…d RTL88x2cs in favor of mainline RTW88 for kernel >=6.8

- RTW8723DS, RTW8723DU is unsupported/deprecated/obsolete by the author since kernel 6.7 in favor of RTW88, so deprecate it for kernel >=6.8
- RTL88x2cs specifically says in its repo: "USE RTW88 NOT THIS DRIVER", so deprecate in favor of RTW88, except for meson64 family
- move random RTL88x2cs hook specific for meson64 family in drivers_network.sh to their family config
@ColorfulRhino
Copy link
Collaborator Author

ColorfulRhino commented Mar 17, 2024

Resolved all wireless network driver hassles 🥳
And also did some cleanups and housekeeping in the process.

The build is now stuck at a later stage (at or after [💲|🌱] Packaging linux-headers [ arm64 linux-uefi-arm64-edge ]):

(Can't post to paste.armbian.com because the debug output is too large I guess 413 Request Entity Too Large)

[💲|🐛] Creating fake tools/vm/Makefile [ 6.3+ hackfix ]
[💲|🐛] Creating fake counter/include/linux [ 6.5-rc1 hackfix ]
[💲|🔨]     CLEAN   scripts/basic
[💲|🔨]     CLEAN   scripts/dtc
[💲|🔨]     CLEAN   scripts/genksyms
[💲|🔨]     CLEAN   scripts/kconfig
[💲|🔨]     CLEAN   scripts/mod
[💲|🔨]     CLEAN   scripts/selinux/genheaders
[💲|🔨]     CLEAN   scripts/selinux/mdp
[💲|🔨]     CLEAN   scripts
[💲|🔨]     DESCEND power/acpi
[💲|🔨]     DESCEND tools/acpidbg
[💲|🔨]     RMOBJ    tools/acpidbg/
[💲|🔨]     RM       acpidbg
[💲|🔨]     RMINC    include
[💲|🔨]     DESCEND tools/acpidump
[💲|🔨]     RMOBJ    tools/acpidump/
[💲|🔨]     RM       acpidump
[💲|🔨]     RMINC    include
[💲|🔨]     DESCEND tools/ec
[💲|🔨]     RMOBJ    tools/ec/
[💲|🔨]     RM       ec
[💲|🔨]     RMINC    include
[💲|🔨]     DESCEND tools/pfrut
[💲|🔨]     RMOBJ    tools/pfrut/
[💲|🔨]     RM       pfrut
[💲|🔨]     RMINC    include
[💲|🔨]     DESCEND cgroup
[💲|🔨]   make[1]: *** No rule to make target 'clean'.  Stop.
[💲|🔨]   make: *** [Makefile:173: cgroup_clean] Error 2

Build command used: ./compile.sh build BOARD=uefi-arm64 BRANCH=edge BUILD_DESKTOP=no BUILD_MINIMAL=no BUILD_ONLY="kernel" KERNEL_CONFIGURE=no RELEASE=bookworm DEBUG=yes

EDIT:
The build is failing at

run_host_command_logged cd "${headers_target_dir}/tools" "&&" make "ARCH=${SRC_ARCH}" clean "${make_bitbucket}"

stacktrace:

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:445
              create_kernel_deb() --> lib/functions/compilation/kernel-debs.sh:126
   prepare_kernel_packaging_debs() --> lib/functions/compilation/kernel-debs.sh:84
                 kernel_package() --> lib/functions/compilation/kernel.sh:227
                  do_with_hooks() --> lib/functions/general/extensions.sh:557
                do_with_logging() --> lib/functions/logging/section-logging.sh:81
   kernel_prepare_build_and_package() --> lib/functions/compilation/kernel.sh:161
                 compile_kernel() --> lib/functions/compilation/kernel.sh:91
   artifact_kernel_build_from_sources() --> lib/functions/artifacts/artifact-kernel.sh:238
    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:108
   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

…y for better visibility and ease of use (e.g. when checking which driver commits should be updated)
@ColorfulRhino
Copy link
Collaborator Author

ColorfulRhino commented Mar 17, 2024

Building BOARD=nanopi-r6s (with edge kernel 6.8.1) works fine by the way. Only BOARD=uefi-arm64 has the above mentioned error.

EDIT:
Okay I figured it out, it's this patch in rk3588-edge that is solving the issue:
patch/kernel/rockchip-rk3588-edge/0033-tools-Makefile-delete-missing-cgroup_clean.patch

But I guess this will be a problem in every 6.8 kernel, or am I missing something?
If so, is there a way to apply this patch to all 6.8 kernels instead of having to copy paste it into each board family's patch folder separately?

@igorpecovnik
Copy link
Member

But I guess this will be a problem in every 6.8 kernel, or am I missing something?

I don't think we have a good mechanism for this, so copy ... Probably it will be fixed upstream soon and patch will be gone anyway.

@ColorfulRhino
Copy link
Collaborator Author

It's building successfully now! Yay 🥳
Seems to be good to go now, finally. Was a lot more work than anticipated 😅

Probably it will be fixed upstream soon and patch will be gone anyway.

True.

@ColorfulRhino ColorfulRhino marked this pull request as ready for review March 17, 2024 18:46
@ColorfulRhino ColorfulRhino requested review from igorpecovnik, lanefu and a team as code owners March 17, 2024 18:46
@ColorfulRhino ColorfulRhino added Needs review Seeking for review and removed Work in progress Unfinished / work in progress Help needed We need your involvement labels Mar 17, 2024
Copy link
Member

@igorpecovnik igorpecovnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, lets's merge this.

@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge 05 Milestone: Second quarter release and removed Needs review Seeking for review labels Mar 17, 2024
@ColorfulRhino
Copy link
Collaborator Author

@viraniac Some of your wireless fix-compilation-with-6.7-kernel patches were removed in this PR since a 6.7 fix has been upstreamed (like https://github.com/armbian/build/blob/5285470bd074ea66c093e428ef2759dfa16e07e0/patch/misc/wireless-rtl8812au-fix-compilation-with-6.7-kernel.patch)
Your patch seems to have some additional stuff added which may not be directly related to the compilation fix. You may need to have a look if you need to add some new patches for this, if that was meaningful stuff.

@ColorfulRhino ColorfulRhino merged commit 16e2c6a into armbian:main Mar 17, 2024
@adeepn
Copy link
Member

adeepn commented Jun 7, 2024

sorry, i miss this thread.

families/jethub (only rtw88_8822cs)

Please do not touch anything else related to JetHub devices without my approval. All such changes must go through my review only.

  • driver_rtl88x2cs (specifically says in its repo: USE RTW88 NOT THIS DRIVER), for all boards except jethub I guess?

This repository is maintained by myself and my colleagues. The comment appeared when we switched to the rtw88 driver. After we switched back to rtl88x2cs, I decided to keep the comment as motivation for development and to identify issues in rtw88.
However, in production, we use the rtl88x2cs driver and maintain it as necessary.
Do not believe everything you read on the internet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
05 Milestone: Second quarter release Hardware Hardware related like kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/large PR with 250 lines or more
Development

Successfully merging this pull request may close these issues.

4 participants