Dennboy Posted January 4, 2021 Posted January 4, 2021 Armbianmonitor: http://ix.io/2KOl Dear all, I can successfully build an out-of-tree module on 5.9 and 5.10.x kernels, but have trouble running them since Armbian 20.11.6. I fixed the module.lds missing problem using the receipt from a bugreport with an extra Makefile target: PWD=$(shell pwd) VER=$(shell uname -r) KERNEL_BUILD=/lib/modules/$(VER)/build # Later if you want to package the module binary you can provide an INSTALL_ROOT # INSTALL_ROOT=/tmp/install-root MY_CFLAGS += -g -DDEBUG # for newer 5.10.x kernels with x<=4 $(KERNEL_BUILD)/scripts/module.lds: $(KERNEL_BUILD)/scripts/module.lds.S sudo sh -c "sed '$ d' $(KERNEL_BUILD)/scripts/module.lds.S > $(KERNEL_BUILD)/scripts/module.lds" pps: pps_timer.c $(MAKE) -C $(KERNEL_BUILD) M=$(PWD) modules pps_install: pps sudo $(MAKE) -C $(KERNEL_BUILD) M=$(PWD) obj_m=pps_timer.o \ INSTALL_MOD_PATH=$(INSTALL_ROOT) modules_instal When trying the module on the 5.10.x kernel, I get an error that the Exec format is not correct: $ sudo modprobe pps_timer modprobe: ERROR: could not insert 'pps_timer': Exec format error And in dmesg, I see the following line: [ 1413.944125] pps_timer: module PLT section(s) missing Did something change in the 5.10.x kernel that needs something extra in the Makefile or source for out-of-tree modules? Kind regards, Dennis
Dennboy Posted January 4, 2021 Author Posted January 4, 2021 Just retried with a very simple kernel module (added license in second attempt to get rid of kernel taint), with the same result. $ sudo modprobe ktest_module modprobe: ERROR: could not insert 'ktest_module': Exec format error $ dmesg|tail [ 24.151391] pps_timer: module PLT section(s) missing [ 33.784067] vcc3v0: disabling [ 33.784092] vcc5v0: disabling [ 33.784099] vcc-wifi: disabling [ 1413.944125] pps_timer: module PLT section(s) missing [ 7157.483985] ktest_module: module license 'unspecified' taints kernel. [ 7157.484004] Disabling lock debugging due to kernel taint [ 7157.484019] ktest_module: module PLT section(s) missing [ 7357.485416] ktest_module: module PLT section(s) missing [ 7465.032086] ktest_module: module PLT section(s) missing #include <linux/module.h> /* Needed by all modules */ #include <linux/kernel.h> /* Needed for KERN_INFO */ #include <linux/init.h> /* Needed for the macros */ #include <linux/version.h> /* Licensed under the GPL-2 or later. */ MODULE_LICENSE("GPL v2"); static int __init ktest_module_init(void) { //printk(KERN_INFO "Driver version %s\n", VERSION); printk(KERN_INFO "Buona Sera :)\n"); return 0; } static void __exit ktest_module_exit(void) { printk(KERN_INFO "Ciao!\n"); } module_init(ktest_module_init); module_exit(ktest_module_exit);
Dennboy Posted January 7, 2021 Author Posted January 7, 2021 Just retried with Armbian 20.11.7 kernel on nanopineo+2, but have the same issue on that board.
hjoe Posted January 13, 2021 Posted January 13, 2021 Hi, have the same problem with compiling the can4linux driver. Why does someone suggest to remove the last line of the linker script module.lds ? sudo sh -c "sed '$ d' it should include something for sure, may be the .plt section. #include does not work, so I added the content of ./linux-headers-5.10.4-sunxi/arch/arm/include/asm/module.lds.h Zitat SECTIONS { .plt : { BYTE(0) } .init.plt : { BYTE(0) } } now I can load the module, but is may be not correct 2
Igor Posted January 13, 2021 Posted January 13, 2021 13 minutes ago, hjoe said: Hi, have the same problem with compiling the can4linux driver. Like most of the people out there because of: https://github.com/Mange/rtl8192eu-linux-driver/issues/205#issuecomment-736366347 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=975571 It would be already fixed, but daytime job and family has advantage, there are lots of bugs: https://github.com/armbian/build/pulls https://github.com/armbian/build/issues https://armbian.atlassian.net/browse/AR ... and no help where we are asking for one: https://forum.armbian.com/forum/54-help-wanted/
Dennboy Posted January 13, 2021 Author Posted January 13, 2021 1 hour ago, hjoe said: Hi, have the same problem with compiling the can4linux driver. Why does someone suggest to remove the last line of the linker script module.lds ? sudo sh -c "sed '$ d' it should include something for sure, may be the .plt section. #include does not work, so I added the content of ./linux-headers-5.10.4-sunxi/arch/arm/include/asm/module.lds.h now I can load the module, but is may be not correct Hi @hjoe, Your fix seems to work beautifully on the orangepizero, thanks! My kernel module loads and runs beautifully. Tomorrow I'll try on nanopi neo2+ and neo3. @Igor Good luck with the family in these strange times. I hope things change for the best in the next months as more people get vacinated. Kind regards, Dennis
Igor Posted January 13, 2021 Posted January 13, 2021 38 minutes ago, Dennboy said: Good luck with the family in these strange times. Its fixing bugs for you or fixing broken RC car for my kid. 1
Dennboy Posted January 14, 2021 Author Posted January 14, 2021 Yes Igor, for sure we are thankful for all your help here! I'm glad only toys got broken Hope you can teach your kid to repair toys some day I tried with the nanopineo2 (Armbian 20.11.6 Buster), the modules build fine but the installation reports SSL errors during installation of the module, that didn't appear on the orangepizero. The module(s) can be loaded and run after depmod -a. INSTALL pps_timer.ko At main.c:160: - SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69 - SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76 sign-file: certs/signing_key.pem: No such file or directory DEPMOD 5.10.4-sunxi64 Kind regards, Dennis
hjoe Posted January 16, 2021 Posted January 16, 2021 Igor, in https://armbian.atlassian.net/browse/AR I can see you marked it as solved. Did now expect that we have new kernel-headers, but apt-get update and apt-get upgrade does not show a new one? May be it is not related but I can not get interrupt number 58 (CAN module) working. Am 13.1.2021 um 18:34 schrieb Igor: ... and no help where we are asking for one: https://forum.armbian.com/forum/54-help-wanted/ I'm sure all these tasks are above my skills, but when finished may small project, I'll have a look at it.
Dennboy Posted February 11, 2021 Author Posted February 11, 2021 Hi Igor, Thanks very much for fixing this, building out-of-tree modules now works great in Armbian 20.02.1, on 5.10.12-sunxi (opi0) and 5.10.12-rockchip64 (neo3)! Kind regards, Dennis 1
Recommended Posts