I tried to run it in my start.sh file. Can I somehow build this using:
GitHub - balena-os/kernel-module-build: Example project for building an OOT kernel module in balena
-
watchdog « drivers - linux-yocto-4.12 - Linux 4.12 Embedded Kernel
-
Test executed on the standard image from balen.io shell main:
root@5435ab0:/usr/src/app# modprobe i2c-i801 root@5435ab0:/usr/src/app# modprobe i2c-smbus root@5435ab0:/usr/src/app# modprobe iTCO-wdt modprobe: FATAL: Module iTCO-wdt not found in directory/lib/modules/4.12.12-yocto-standard
Tried to build with the balena kernel sample:
I created a folder called iTCO-wdt and placed the iTCO-wdt.c,``iTCO_vendor.h
, iTCO_vendor_support.c
file inside there with the Makefile:
KERNEL_TREE_PATH?=/lib/modules/$(shell uname -r)/build
EXTRA_CFLAGS="-DDEBUG"
obj-m+=iTCO_wdt.o
all: iTCO_wdt.ko
iTCO_wdt.ko: iTCO_wdt.c
make -C $(KERNEL_TREE_PATH) M=$(PWD) modules
clean:
make -C $(KERNEL_TREE_PATH) M=$(PWD) clean
.PHONY: all clean
and calling
RUN ./build.sh %%RESIN_MACHINE_NAME%% ‘2.13.6+rev2.dev’ iTCO-wdt
in my dockerfile.
2018-11-21 22:35:58 (68.2 MB/s) - ‘kernel_modules_headers.tar.gz’ saved [10331481/10331481]
[main]
[main] make: Entering directory '/tmp/tmp.BPRxUQjNfP'
[main] CC [M] /usr/src/app/iTCO-wdt_intel-nuc_2.13.6+rev2.dev/iTCO_wdt.o
[main] /bin/sh: 1: scripts/basic/fixdep: not found
[main]
[main] scripts/Makefile.build:308: recipe for target '/usr/src/app/iTCO-wdt_intel-nuc_2.13.6+rev2.dev/iTCO_wdt.o' failed
[main] make[1]: *** [/usr/src/app/iTCO-wdt_intel-nuc_2.13.6+rev2.dev/iTCO_wdt.o] Error 127
[main]
[main] Makefile:1515: recipe for target '_module_/usr/src/app/iTCO-wdt_intel-nuc_2.13.6+rev2.dev' failed
[main] make: Leaving directory '/tmp/tmp.BPRxUQjNfP'
[main] make: *** [_module_/usr/src/app/iTCO-wdt_intel-nuc_2.13.6+rev2.dev] Error 2
I saw some threads similar with fixdep issues:
kernel_modules_headers/scripts/basic$ file fixdep
fixdep: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=31dcb0219bb5a2f2113663344ca3543804d082ee, not stripped