Cannot compile gpioASR module for latest Armbian_5.89.1 (5.1.12), no modpost

Started by winfried, July 11, 2019, 02:54:59 PM

Previous topic - Next topic

winfried

For a robotic Xylophone player I wrote a kerneldriver gpio-asr [1]
The module compiled well under stretch image 4.19.38-sunxi [2],
but on a fresh install with  Armbian_5.68.1 it does not (kernel 5.1.12) [3]

It throws an error see [4]:


/bin/sh: 1: scripts/mod/modpost: not found


On previous version the linux-next-headers installed by armbian-config worked fine [5].
I followed my instructions in [1] on both on a fresh install.

It seems that the headers scripts get not fully compiled [6] like before [7] and modpost is not compiled in the headers.

Are the new kernel headers broken or do I need correct the Makefile be adjusted ?
Do I need extra packages installed ?

Any hints would be nice.

mfG
Winfried Ritsch


[1]  https://git.iem.at/ritsch/gpio-asr

[2] Armbian 5.84.1 Olinuxino Debian GNU/Linux 9 (stretch) 4.19.38-sunxi

[3] Armbian_5.89.1_Olinuxino-a20_Debian_stretch_next_5.1.12

[4] Compile error:


algo@iapetos0:~/IapetosPlayer/libs/gpioASR/driver$ make     
cc -o test/test-gpio-asr test/test-gpio-asr.c
make -C /lib/modules/5.1.12-sunxi/build M=/home/algo/IapetosPlayer/libs/gpioASR/driver modules
make[1]: Entering directory '/usr/src/linux-headers-5.1.12-sunxi'
  CC [M]  /home/algo/IapetosPlayer/libs/gpioASR/driver/gpio-asr.o
  Building modules, stage 2.
  MODPOST 1 modules
/bin/sh: 1: scripts/mod/modpost: not found
scripts/Makefile.modpost:91: recipe for target '__modpost' failed
make[2]: *** [__modpost] Error 127
Makefile:1574: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.1.12-sunxi'
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 2



[5] Compiled fine:

make
cc -o test/test-gpio-asr test/test-gpio-asr.c
make -C /lib/modules/4.19.38-sunxi/build M=/home/algo/gpioASR/driver modules
make[1]: Entering directory '/usr/src/linux-headers-4.19.38-sunxi'
  CC [M]  /home/algo/gpioASR/driver/gpio-asr.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/algo/gpioASR/driver/gpio-asr.mod.o
  LD [M]  /home/algo/gpioASR/driver/gpio-asr.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.19.38-sunxi'

[6] new headers:


/usr/src/linux-headers-5.1.12-sunxi$ make V=1 scripts
make -f ./scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f ./scripts/Makefile.build obj=scripts/dtc
make -f ./scripts/Makefile.build obj=scripts


[7] old headers



sudo make V=1 scripts
make -f ./scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f ./scripts/Makefile.asm-generic \
            src=uapi/asm obj=arch/arm/include/generated/uapi/asm
make -f ./scripts/Makefile.asm-generic \
            src=asm obj=arch/arm/include/generated/asm
make -f ./scripts/Makefile.build obj=scripts
make -f ./scripts/Makefile.build obj=scripts/dtc need-builtin=
make -f ./scripts/Makefile.build obj=scripts/mod need-builtin=
set -e; mkdir -p scripts/mod/;  (set -e; echo "#ifndef __DEVICETABLE_OFFSETS_H__"; echo "#define __DEVICETABLE_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne        's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}' < scripts/mod/devicetable-offsets.s; echo ""; echo "#endif" ) > scripts/mod/devicetable-offsets.h.tmp; if [ -r scripts/mod/devicetable-offsets.h ] && cmp -s scripts/mod/devicetable-offsets.h scripts/mod/devicetable-offsets.h.tmp; then rm -f scripts/mod/devicetable-offsets.h.tmp; else : '  UPD     scripts/mod/devicetable-offsets.h'; mv -f scripts/mod/devicetable-offsets.h.tmp scripts/mod/devicetable-offsets.h; fi
make -f ./scripts/Makefile.build obj=scripts/selinux need-builtin=
make -f ./scripts/Makefile.build obj=scripts/selinux/genheaders need-builtin=
make -f ./scripts/Makefile.build obj=scripts/selinux/mdp need-builtin=
---- Atelier Algorythmics --- [url="http://algo.mur.at/"]http://algo.mur.at/[/url] ----

winfried

I found a temporary solution,

in kernel headers   /usr/src/linux-headers-5.1.12-sunxi I compiled modpost manually:

sudo make M=scripts/mod

I can now compile my module, but it is not a fix, it means header scripts, or compilation of header scripts on package install, is broken.

mfg
winfried

PS.: also reported on armbian forum on a similiar problem without fix.
---- Atelier Algorythmics --- [url="http://algo.mur.at/"]http://algo.mur.at/[/url] ----