GobiSerial and GobiNet installation error (EM7455 with arm64 4.9.224 system )

222/5000

I am using Sierra LTE EM7455 modem.
I am getting the error that Gobi drivers could not be installed on my Amlogic system.
My system is Ubuntu Arm64 XFCE 4.9.224
LTE module is connected to my device from m2 port, but it doesn’t work because drivers cannot be loaded.!
SierraLinuxQMIdriversS2.42N2.63

khadas@Khadas:~/sierra/GobiSerial$ su
Password:
root@Khadas:/home/khadas/sierra/GobiSerial# make
rm -rf *.o ~ core .depend ..cmd *.ko .mod.c .tmp_versions Module. modules.order .cache.mk *.o.ur-safe
make -C /lib/modules/4.9.224/build M=/home/khadas/sierra/GobiSerial modules
make[1]: Entering directory ‘/usr/src/linux-headers-4.9.224’
CC [M] /home/khadas/sierra/GobiSerial/GobiSerial.o
In file included from ./include/linux/irqflags.h:15:0,
from ./include/linux/spinlock.h:53,
from ./include/linux/wait.h:8,
from ./include/linux/fs.h:5,
from ./include/linux/tty.h:4,
from /home/khadas/sierra/GobiSerial/GobiSerial.c:75:
./arch/arm64/include/asm/irqflags.h:24:10: fatal error: …/drivers/amlogic/debug/irqflags_debug_arm64.h: No such file or directory
#include <…/drivers/amlogic/debug/irqflags_debug_arm64.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:340: recipe for target ‘/home/khadas/sierra/GobiSerial/GobiSerial.o’ failed
make[2]: *** [/home/khadas/sierra/GobiSerial/GobiSerial.o] Error 1
Makefile:1653: recipe for target ‘module/home/khadas/sierra/GobiSerial’ failed
make[1]: *** [module/home/khadas/sierra/GobiSerial] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-4.9.224’
Makefile:25: recipe for target ‘all’ failed
make: *** [all] Error 2
root@Khadas:/home/khadas/sierra/GobiSerial#

Screenshot_2020-10-06_17-42-55|690x365

Please ensure that you have installed the headers for you kernel and then run the compilation.
sudo apt install linux-headers-$(uname -r)

I did the installation. I tried again. I think it happened.

khadas@Khadas:~ sudo apt install linux-headers-(uname -r)
[sudo] password for khadas:
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package linux-headers-4.9.224
E: Couldn’t find any package by glob ‘linux-headers-4.9.224’
E: Couldn’t find any package by regex ‘linux-headers-4.9.224’
khadas@Khadas:~$

I’m doing everything in the directive again. I hope it makes it easier to find the error.

 khadas@Khadas:~$ sudo apt-get install build-essential make gcc 
[sudo] password for khadas: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
make is already the newest version (4.1-9.1ubuntu1).
gcc is already the newest version (4:7.4.0-1ubuntu2.3).
The following package was automatically installed and is no longer required:
  libllvm8
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
khadas@Khadas:~$ 

second stage

khadas@Khadas:~$ uname -r
4.9.224
khadas@Khadas:~$ sudo apt-get install linux-headers-amlogic-4.9 
[sudo] password for khadas: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-amlogic-4.9 is already the newest version (0.9).
The following package was automatically installed and is no longer required:
  libllvm8
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
khadas@Khadas:~$ 

thirt stage

khadas@Khadas:~$ sudo apt-get install linux-headers-amlogic-mainline 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libllvm8
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  bison flex libbison-dev libfl-dev libfl2
Suggested packages:
  bison-doc flex-doc
The following NEW packages will be installed:
  bison flex libbison-dev libfl-dev libfl2 linux-headers-amlogic-mainline
0 upgraded, 6 newly installed, 0 to remove and 6 not upgraded.
Need to get 12.0 MB of archives.
After this operation, 77.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ports.ubuntu.com bionic/main arm64 flex arm64 2.6.4-6 [302 kB]
Get:2 http://ports.ubuntu.com bionic/main arm64 libbison-dev arm64 2:3.0.4.dfsg-1build1 [339 kB]
Get:3 http://ports.ubuntu.com bionic/main arm64 bison arm64 2:3.0.4.dfsg-1build1 [230 kB]
Get:4 http://ports.ubuntu.com bionic/main arm64 libfl2 arm64 2.6.4-6 [11.3 kB]
Get:5 http://ports.ubuntu.com bionic/main arm64 libfl-dev arm64 2.6.4-6 [6,232 B]
Get:6 https://dl.khadas.com/repos/vim3 bionic/main arm64 linux-headers-amlogic-mainline arm64 0.9 [11.1 MB]
Fetched 12.0 MB in 8s (1,457 kB/s)                                                                                                                                             
Selecting previously unselected package flex.
(Reading database ... 110713 files and directories currently installed.)
Preparing to unpack .../0-flex_2.6.4-6_arm64.deb ...
Unpacking flex (2.6.4-6) ...
Selecting previously unselected package libbison-dev:arm64.
Preparing to unpack .../1-libbison-dev_2%3a3.0.4.dfsg-1build1_arm64.deb ...
Unpacking libbison-dev:arm64 (2:3.0.4.dfsg-1build1) ...
Selecting previously unselected package bison.
Preparing to unpack .../2-bison_2%3a3.0.4.dfsg-1build1_arm64.deb ...
Unpacking bison (2:3.0.4.dfsg-1build1) ...
Selecting previously unselected package libfl2:arm64.
Preparing to unpack .../3-libfl2_2.6.4-6_arm64.deb ...
Unpacking libfl2:arm64 (2.6.4-6) ...
Selecting previously unselected package libfl-dev:arm64.
Preparing to unpack .../4-libfl-dev_2.6.4-6_arm64.deb ...
Unpacking libfl-dev:arm64 (2.6.4-6) ...
Selecting previously unselected package linux-headers-amlogic-mainline.
Preparing to unpack .../5-linux-headers-amlogic-mainline_0.9_arm64.deb ...
Unpacking linux-headers-amlogic-mainline (0.9) ...
Setting up flex (2.6.4-6) ...
Setting up libbison-dev:arm64 (2:3.0.4.dfsg-1build1) ...
Setting up libfl2:arm64 (2.6.4-6) ...
Setting up bison (2:3.0.4.dfsg-1build1) ...
update-alternatives: using /usr/bin/bison.yacc to provide /usr/bin/yacc (yacc) in auto mode
Setting up libfl-dev:arm64 (2.6.4-6) ...
Setting up linux-headers-amlogic-mainline (0.9) ...
Compiling headers - please wait ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
khadas@Khadas:~$

fourty stage

khadas@Khadas:~$ cd sierra/
khadas@Khadas:~/sierra$ cd GobiSerial/
khadas@Khadas:~/sierra/GobiSerial$ ls
GobiSerial.c  Makefile  Readme.txt
khadas@Khadas:~/sierra/GobiSerial$ sudo make
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module.* modules.order .cache.mk *.o.ur-safe
make -C /lib/modules/4.9.224/build M=/home/khadas/sierra/GobiSerial modules
make[1]: Entering directory '/usr/src/linux-headers-4.9.224'
  CC [M]  /home/khadas/sierra/GobiSerial/GobiSerial.o
/home/khadas/sierra/GobiSerial/GobiSerial.c:242:2: error: #warning "Assuming disc_mutex is locked external to the module" [-Werror=cpp]
 #warning "Assuming disc_mutex is locked external to the module"
  ^~~~~~~
cc1: all warnings being treated as errors
scripts/Makefile.build:340: recipe for target '/home/khadas/sierra/GobiSerial/GobiSerial.o' failed
make[2]: *** [/home/khadas/sierra/GobiSerial/GobiSerial.o] Error 1
Makefile:1653: recipe for target '_module_/home/khadas/sierra/GobiSerial' failed
make[1]: *** [_module_/home/khadas/sierra/GobiSerial] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.9.224'
Makefile:25: recipe for target 'all' failed
make: *** [all] Error 2

can it be related to

root@Khadas:/usr/src# sudo apt-get install linux-headers-`uname -r`
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-headers-4.9.224
E: Couldn't find any package by glob 'linux-headers-4.9.224'
E: Couldn't find any package by regex 'linux-headers-4.9.224'
root@Khadas:/usr/src#

I reinstalled the system / formatted the emmc / did not update any. and my header command is wrong again.

khadas@Khadas:~$ sudo apt-get install linux-headers-`uname -r`
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-headers-4.9.206
E: Couldn't find any package by glob 'linux-headers-4.9.206'
E: Couldn't find any package by regex 'linux-headers-4.9.206'
khadas@Khadas:~$