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

DKMS Modules Fail to Build on aarch64 - Missing powerpc Headers #44807

Closed
Calandracas606 opened this issue Jul 3, 2023 · 9 comments · Fixed by #46332
Closed

DKMS Modules Fail to Build on aarch64 - Missing powerpc Headers #44807

Calandracas606 opened this issue Jul 3, 2023 · 9 comments · Fixed by #46332
Labels
bug Something isn't working

Comments

@Calandracas606
Copy link

Is this a new report?

Yes

System Info

Void 6.3.10_1 aarch64-musl Unknown uptodate rFF

Package(s) Affected

linux-headers-6.3_1

Does a report exist for this bug with the project's home (upstream) and/or another distro?

No response

Expected behaviour

installing a package that includes a DKMS module (eg. zfs, wireguard) builds the module successfully

Actual behaviour

DKMS Module fails to build. Log files mention missing "arch/powerpc/crypto/Kconfig"

Steps to reproduce

  1. xbps-install zfs
  2. Error
@Calandracas606 Calandracas606 added bug Something isn't working needs-testing Testing a PR or reproducing an issue needed labels Jul 3, 2023
@Calandracas606
Copy link
Author

Calandracas606 commented Jul 3, 2023

/usr/src/kernel-headers-6.3.10_1/arch/powerpc is missing on aarch64, but this directory exists on my x86_64 device

Device is a pinebookpro.
Same issue with aarch64-musl and aarch64-glibc

Linux package (mainline kernel) and Linux-headers are installed
Tested with using pinebookpro-kernel and pinebookpro-kernel-headers and this also fails

On my x86_64-glibc machine, trying to produce an aarch64 image using ./mkplatformfs in void-mklive also fails to build the zfs module with the same error.

@Calandracas606
Copy link
Author

example when installing zfs (similar errors with other DKMS modules such as Wireguard)

Added DKMS modules 'zfs-2.1.12'.                                                                                                                  
Prepare to build modules for kernel-6.3.10_1... FAILED!                                                                                           
Kernel scripts failed to build, please check /lib/modules/6.3.10_1/build/make.log                                                                 
for errors in the log file.                                                                                                                       
Building DKMS module 'zfs-2.1.12' for kernel-6.3.10_1... FAILED!                                                                                  
DKMS module 'zfs-2.1.12' failed to build, please check /var/lib/dkms                                                                              
for errors in the log file.                                                                                                                       
Regenerating initramfs images using kernel hook 20-initramfs                                                                                      
dracut-install: Failed to find module 'zfs'                                                                                                       
dracut: FAILED: /usr/lib/dracut/dracutinstall -D /var/tmp/dracut.pDCU9N/initramfs --kerneldir /lib/modules/6.3.10_1/ -m zfs                       
dracut: installkernel failed in module zfs                                                                                                        
zfs-2.1.12_1: installed successfully.                                                                                                             

contents of /lib/modules/6.3.10_1/build/make.log

make: Entering directory '/usr/src/kernel-headers-6.3.10_1'                                                                                       
  SYNC    include/config/auto.conf.cmd                                                                                                            
crypto/Kconfig:1402: can't open file "arch/powerpc/crypto/Kconfig"                                                                                
make[2]: *** [scripts/kconfig/Makefile:77: syncconfig] Error 1                                                                                    
make[1]: *** [Makefile:693: syncconfig] Error 2                                                                                                   
make: *** [Makefile:793: include/config/auto.conf.cmd] Error 2                                                                                    
make: Leaving directory '/usr/src/kernel-headers-6.3.10_1'                                                                                        

contents of /var/lib/dkms/zfs/2.1.12/build/make.log

DKMS make.log for zfs-2.1.12 for kernel 6.3.10_1 (aarch64)                                                                                        
Mon Jul 3 00:00:53 EDT 2023                                                                                                                       
make: Entering directory '/var/lib/dkms/zfs/2.1.12/build/module'                                                                                  
make: *** No targets specified and no makefile found. Stop.                                                                                       
make: Leaving directory '/var/lib/dkms/zfs/2.1.12/build/module'                                                                                   

@abenson
Copy link
Contributor

abenson commented Jul 4, 2023

similar errors with other DKMS modules such as Wireguard

As a note, wireguard-dkms shouldn't be used with any kernel after 5.5.

@r-ricci
Copy link
Contributor

r-ricci commented Jul 30, 2023

I built natively the package linux6.3 on aarch64-musl. I don't get the error related to powerpc files anymore, so it's probably something related to cross-compilation.

I still can't build zfs, but I think this is an unrelated problem:

  MODPOST /var/lib/dkms/zfs/2.1.12/build/module/Module.symvers
ERROR: modpost: GPL-incompatible module zcommon.ko uses GPL-only symbol 'kernel_neon_begin'
ERROR: modpost: GPL-incompatible module zcommon.ko uses GPL-only symbol 'kernel_neon_end'
ERROR: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'kernel_neon_end'
ERROR: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'kernel_neon_begin'
make[2]: *** [scripts/Makefile.modpost:136: /var/lib/dkms/zfs/2.1.12/build/module/Module.symvers] Error 1
make[1]: *** [Makefile:1977: modpost] Error 2
make: *** [Makefile:55: modules-Linux] Error 2
make: Leaving directory '/var/lib/dkms/zfs/2.1.12/build/module'

@r-ricci
Copy link
Contributor

r-ricci commented Aug 1, 2023

Actually the problem does not seem to be cross-compilation. This issue doesn't affect the natively built kernel package just because this one doesn't require the helper tools to be rebuilt.
If I make these changes:

--- /etc/kernel.d/post-install/10-dkms.old
+++ /etc/kernel.d/post-install/10-dkms
@@ -19,9 +19,7 @@
 
 export IGNORE_CC_MISMATCH=1
 
-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
 
 # Check available DKMS modules
 for _mod_ in /var/lib/dkms/*; do

then xbps-reconfigure -f linux6.3 fails with the error mentioned by @Calandracas606, both with a cross-compiled kernel and a native one.
I tried the same thing on a x86_64 system and it fails too (even though the missing files are not the same).

@classabbyamp classabbyamp removed the needs-testing Testing a PR or reproducing an issue needed label Aug 2, 2023
@r-ricci
Copy link
Contributor

r-ricci commented Aug 16, 2023

@sgn (you maintain the kernel package). Any idea why this could happen?

@moabeat-berlin
Copy link

I think my comment on this pull-request is related.

@classabbyamp
Copy link
Member

please test: #46332

@Calandracas606
Copy link
Author

Calandracas606 commented Sep 30, 2023

Getting a very similar Makefile error as the one described in #46152

linux6.3-6.3.13_2: 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/parser.tab.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
  UPD     include/generated/compile.h
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  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_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.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
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTLD  scripts/genksyms/genksyms
scripts/Makefile.build:41: arch/arm64/tools/Makefile: No such file or directory
make[1]: *** No rule to make target 'arch/arm64/tools/Makefile'.  Stop.
make: *** [arch/arm64/Makefile:179: archprepare] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants