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

rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland, rpi-eeprom) #46152

Merged
merged 4 commits into from
Sep 30, 2023

Conversation

classabbyamp
Copy link
Member

@classabbyamp classabbyamp commented Sep 20, 2023

  • 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:

if [ ! -f /lib/modules/${VERSION}/build/scripts/basic/fixdep ] || [ ! -f /lib/modules/${VERSION}/build/scripts/mod/modpost ]; then
yes "" | make -j $(nproc) -C /lib/modules/${VERSION}/build prepare0
fi

# 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, ^Cing 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?

@classabbyamp classabbyamp changed the title rpi-kernel: update to 6.1.54. rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland) Sep 20, 2023
@r-ricci
Copy link
Contributor

r-ricci commented Sep 20, 2023

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 #44807 (comment).
Regular kernel packages should be patched as well.

@tsjk
Copy link

tsjk commented Sep 20, 2023

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...

@classabbyamp
Copy link
Member Author

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 #44807 (comment).
Regular kernel packages should be patched as well.

I'm aware, Leah was looking into the others

@moabeat-berlin
Copy link

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.

@classabbyamp
Copy link
Member Author

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)

@moabeat-berlin
Copy link

moabeat-berlin commented Sep 23, 2023

Indeed, it's not supported to build them for the target. I found this old post in the kernel archives from 2013, where someone wanted to enable this. However, it got rejected. 😞

@classabbyamp
Copy link
Member Author

classabbyamp commented Sep 23, 2023

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

@moabeat-berlin
Copy link

moabeat-berlin commented Sep 23, 2023

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.

@classabbyamp
Copy link
Member Author

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

@moabeat-berlin
Copy link

moabeat-berlin commented Sep 24, 2023

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)

@tsjk
Copy link

tsjk commented Sep 24, 2023

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.

@classabbyamp
Copy link
Member Author

classabbyamp commented Sep 29, 2023

  • 1B
  • 1A+
  • 2B
  • 3B
  • 0
  • 02W
  • 4B

@tsjk
Copy link

tsjk commented Sep 29, 2023

  • 1B
  • 1A+
  • 2B
  • 3B
  • 0
  • 02W
  • 4B

@classabbyamp
Copy link
Member Author

i'm showing my own testing, not in total

@tsjk
Copy link

tsjk commented Sep 29, 2023

i'm showing my own testing, not in total

Ah. Sorry, mate.

@moabeat-berlin
Copy link

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.

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.

@classabbyamp
Copy link
Member Author

classabbyamp commented Sep 29, 2023

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

@classabbyamp classabbyamp changed the title rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland) rpi-kernel: update to 6.1.54 (and rpi-firmware, rpi-userland, rpi-eeprom) Sep 29, 2023
@classabbyamp classabbyamp merged commit c19fead into void-linux:master Sep 30, 2023
7 of 8 checks passed
@classabbyamp classabbyamp deleted the update/rpi branch September 30, 2023 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants