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

remove patches disabling sched_ext clean in tools for 6.12 and later kernels #7625

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

amazingfate
Copy link
Contributor

Description

We have severial patches to fix make clean under kernel tools dir. But tools binary is not shipped by linux-headers package.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

  • ./compile.sh kernel BOARD=rock-3a BRANCH=edge DEB_COMPRESS=xz KERNEL_CONFIGURE=no KERNEL_GIT=shallow

Checklist:

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@amazingfate amazingfate requested review from a team and igorpecovnik as code owners December 30, 2024 03:47
@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Framework Framework components Patches Patches related to kernel, U-Boot, ... labels Dec 30, 2024
@amazingfate amazingfate requested a review from rpardini December 30, 2024 07:39
@rpardini
Copy link
Member

Hello, thanks for the effort here @amazingfate

I cherry picked this and built a CI run, which builds all kernels on x86 (similar to how Igor/Armbian.com does it).

Without calling make clean on tools/, we leak a bunch of binary files into the linux-headers package, and for the wrong architecture if we're cross compiling.

This is how I evaluated it, using a NanoPC T6 (arm64). Keep in mind the kernel was built on x86.

  1. Install linux-headers-edge-rockchip64
  2. Run dpkg -L linux-headers-edge-rockchip64 | xargs file | grep -v -e "C source" -e "ASCII text" -e "directory" -e "Perl script" -e "empty" -e "\ text" -e "symbolic link"

These are the results before this PR:

/usr/share/doc/linux-headers-edge-rockchip64/changelog.gz:                                                        gzip compressed data, was "changelog", last modified: Sat Dec 28 22:28:33 2024, max compression, from Unix, original size modulo 2^32 330
/usr/src/linux-headers-6.13.0-rc4-edge-rockchip64/arch/sparc/include/asm/visasm.h:                  SAS 7+
/usr/src/linux-headers-6.13.0-rc4-edge-rockchip64/include/dt-bindings/power/meson-axg-power.h:                             SAS 7+
/usr/src/linux-headers-6.13.0-rc4-edge-rockchip64/include/dt-bindings/power/meson-g12a-power.h:                            SAS 7+
/usr/src/linux-headers-6.13.0-rc4-edge-rockchip64/include/dt-bindings/power/meson-gxbb-power.h:                            SAS 7+
/usr/src/linux-headers-6.13.0-rc4-edge-rockchip64/include/dt-bindings/power/meson-sm1-power.h:                             SAS 7+
/usr/src/linux-headers-6.13.0-rc4-edge-rockchip64/tools/bootconfig/samples/bad-nonprintable.bconf:                                          data
/usr/src/linux-headers-6.13.0-rc4-edge-rockchip64/tools/objtool/Documentation/objtool.txt:                                                    Apache Avro version 116

These are the results after this PR:

/usr/share/doc/linux-headers-edge-rockchip64/changelog.gz:                                                        gzip compressed data, was "changelog", last modified: Mon Dec 30 12:04:12 2024, max compression, from Unix, original size modulo 2^32 330
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/arch/sparc/include/asm/visasm.h:                  SAS 7+
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/include/dt-bindings/power/meson-axg-power.h:                             SAS 7+
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/include/dt-bindings/power/meson-g12a-power.h:                            SAS 7+
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/include/dt-bindings/power/meson-gxbb-power.h:                            SAS 7+
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/include/dt-bindings/power/meson-sm1-power.h:                             SAS 7+
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bootconfig/samples/bad-nonprintable.bconf:                            data
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/ctype.o:                                           ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/fixdep:                                            ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=5695ac75618059efe5cfff1910416f5bbbb2ebaa, for GNU/Linux 3.2.0, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/libbpf.a:                                   current ar archive
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/bpf.o:                           ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/bpf_prog_linfo.o:                ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/btf.o:                           ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/btf_dump.o:                      ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/btf_iter.o:                      ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/btf_relocate.o:                  ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/elf.o:                           ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/features.o:                      ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/fixdep:                          ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=5695ac75618059efe5cfff1910416f5bbbb2ebaa, for GNU/Linux 3.2.0, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/gen_loader.o:                    ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/hashmap.o:                       ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf-in.o:                     ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf.o:                        ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf_errno.o:                  ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf_probes.o:                 ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/linker.o:                        ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/netlink.o:                       ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/nlattr.o:                        ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/relo_core.o:                     ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/ringbuf.o:                       ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/str_error.o:                     ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/strset.o:                        ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/usdt.o:                          ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libbpf/staticobjs/zip.o:                           ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libsubcmd/exec-cmd.o:                              ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libsubcmd/fixdep:                                  ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=5695ac75618059efe5cfff1910416f5bbbb2ebaa, for GNU/Linux 3.2.0, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libsubcmd/help.o:                                  ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libsubcmd/libsubcmd-in.o:                          ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libsubcmd/libsubcmd.a:                             current ar archive
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libsubcmd/pager.o:                                 ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libsubcmd/parse-options.o:                         ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libsubcmd/run-command.o:                           ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libsubcmd/sigchain.o:                              ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/libsubcmd/subcmd-config.o:                         ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/main.o:                                            ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/rbtree.o:                                          ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/resolve_btfids:                                    ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=dde501b44c064391e013043794f1128d29be4dd6, for GNU/Linux 3.2.0, with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/resolve_btfids-in.o:                               ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/str_error_r.o:                                     ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/string.o:                                          ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bpf/resolve_btfids/zalloc.o:                                          ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/objtool/Documentation/objtool.txt:                                                    Apache Avro version 116

A similar listing is produced if you build with DEBUG=yes.

With this, I do think we need to keep using make clean in tools/; I don't love all the hackfix (and we would need to add a 3rd hackfix for the VMLINUX_BTF vs btf-enabled-host-kernel fiasco).

@rpardini
Copy link
Member

After quite a bit of consideration, I think the easiest here is really what @The-going suggested in 5ba9c50 (#7577) (pass a fake VMLINUX_BTF= var to make clean in tools).

@rpardini
Copy link
Member

I've resolved and approved #7577 -- when that lands, we can adapt this PR to only drop the patches and not drop the make clean, and all should be good.

@amazingfate
Copy link
Contributor Author

I'm building under an arm64 machine and there is no binary files leaked:
$ dpkg -L linux-headers-edge-rockchip64 | xargs file | grep -v -e "C source" -e "ASCII text" -e "directory" -e "Perl script" -e "empty" -e "\ text" -e "symbolic link"
/usr/share/doc/linux-headers-edge-rockchip64/changelog.gz: gzip compressed data, was "changelog", last modified: Mon Dec 30 10:40:09 2024, max compression, from Unix, original size modulo 2^32 332
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/arch/sparc/include/asm/visasm.h: SAS 7+
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/include/dt-bindings/power/meson-axg-power.h: SAS 7+
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/include/dt-bindings/power/meson-g12a-power.h: SAS 7+
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/include/dt-bindings/power/meson-gxbb-power.h: SAS 7+
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/include/dt-bindings/power/meson-sm1-power.h: SAS 7+
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/bootconfig/samples/bad-nonprintable.bconf: data
/usr/src/linux-headers-6.13.0-rc5-edge-rockchip64/tools/objtool/Documentation/objtool.txt: Apache Avro version 116
Maybe cross building is different.

@rpardini
Copy link
Member

Maybe cross building is different.

Yes. cross-building is the reason this whole thing (separate linux-headers packaging) exists.

@rpardini
Copy link
Member

Also, see this commit torvalds/linux@f1d8766 -- Mr. Yamada explains it better and using Debian examples -- we have a variation but the concept is the same. Hopefully after 6.12.y is commonplace we can revisit this whole subject.

@rpardini
Copy link
Member

Maybe cross building is different.

Correction: It's not about cross-building, instead, it's again about BTF (& CO-RE) enablement of the kernel (only then you'll getresolve_btfids, etc).

I will propose a PR very soon enabling BTF/CO-RE for all kernels so we can be aligned with the rest of the distros.

@rpardini rpardini changed the title not run make clean under kernel tools remove patches disabling sched_ext clean in tools for 6.12 and later kernels Dec 30, 2024
Copy link
Member

@rpardini rpardini left a comment

Choose a reason for hiding this comment

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

Took the liberty here, hope you don't mind.

@rpardini rpardini merged commit 6cdf1e8 into armbian:main Dec 30, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Framework components Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/medium PR with more then 50 and less then 250 lines
Development

Successfully merging this pull request may close these issues.

2 participants