Coder Social home page Coder Social logo

Ubuntu 18 about lg4l HOT 27 CLOSED

cmoh avatar cmoh commented on July 28, 2024
Ubuntu 18

from lg4l.

Comments (27)

CMoH avatar CMoH commented on July 28, 2024

You need to be root when installing the kernel module: sudo make install. Try this first

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

I did that too, and thought the error whas the same. When i do that the SSL errors stays
sudo make install
make -C /lib/modules/4.15.0-43-generic/build M=/tmp/lg4l modules_install
make[1]: Map '/usr/src/linux-headers-4.15.0-43-generic' wordt binnengegaan
INSTALL /tmp/lg4l/hid-g110.ko
At main.c:160:

  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    INSTALL /tmp/lg4l/hid-g13.ko
    At main.c:160:
  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    INSTALL /tmp/lg4l/hid-g15.ko
    At main.c:160:
  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    INSTALL /tmp/lg4l/hid-g15v2.ko
    At main.c:160:
  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    INSTALL /tmp/lg4l/hid-g19.ko
    At main.c:160:
  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    INSTALL /tmp/lg4l/hid-gcore.ko
    At main.c:160:
  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    INSTALL /tmp/lg4l/hid-gfb.ko
    At main.c:160:
  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    DEPMOD 4.15.0-43-generic
    make[1]: Map '/usr/src/linux-headers-4.15.0-43-generic' wordt verlaten

and when i do a modprobe hid-g110
modprobe: FATAL: Module hid-g110 not found in directory /lib/modules/4.15.0-43-generic
i got the next error.

from lg4l.

CMoH avatar CMoH commented on July 28, 2024

This might be related to secure boot, and the way Ubuntu chose to configure it during their kernel build. Check out this discussion here: andikleen/simple-pt#8

Here's where the modules are on my machine - see if you have something there too:

ls /lib/modules/4.14.83-gentoo/extra/
hid-g110.ko  hid-g13.ko  hid-g15.ko  hid-g19.ko  hid-gcore.ko  hid-gfb.ko

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

Oke i did the steps again from the link. The first time is misses something.

Still there is a error:
modprobe hid-g110 or sudo modprobe hid-g110
modprobe: FATAL: Module hid-g110 not found in directory /lib/modules/4.15.0-43-generic

The files are in deed in:
ls -la /lib/modules/4.15.0-43-generic/extra
total 160
drwxr-xr-x 2 root root 4096 jan 5 09:44 .
drwxr-xr-x 7 root root 4096 jan 5 09:51 ..
-rw-r--r-- 1 root root 19824 jan 5 10:00 hid-g110.ko
-rw-r--r-- 1 root root 21280 jan 5 10:00 hid-g13.ko
-rw-r--r-- 1 root root 21056 jan 5 10:00 hid-g15.ko
-rw-r--r-- 1 root root 20640 jan 5 10:00 hid-g15v2.ko
-rw-r--r-- 1 root root 23176 jan 5 10:00 hid-g19.ko
-rw-r--r-- 1 root root 13032 jan 5 10:00 hid-gcore.ko
-rw-r--r-- 1 root root 17192 jan 5 10:00 hid-gfb.ko

I run now a dual boot between Ubuntu and Windows. In the VM box running Ubuntu i can do a sudo modprobe g110, but not run ./rebind
ls: cannot access '/sys/bus/hid/drivers/hid-generic': No such file or directory
ls: cannot access '/sys/bus/hid/drivers/hid-generic': No such file or directory
ls: cannot access '/sys/bus/hid/drivers/hid-generic': No such file or directory
ls: cannot access '/sys/bus/hid/drivers/hid-generic': No such file or directory
ls: cannot access '/sys/bus/hid/drivers/hid-generic': No such file or directory
I can't manual create the dir hid-generic and copy the files.
$sudo mkdir hid-generic
$mkdir: cannot create directory ‘hid-generic’: Operation not permitted

from lg4l.

CMoH avatar CMoH commented on July 28, 2024

Try sudo modprobe hid-generic

from lg4l.

CMoH avatar CMoH commented on July 28, 2024

Files in /sys are created by kernel code, such as drivers etc so you cannot create new folders there. Some existing files can be written to though, since they represent changeable settings inside the kernel/driver.

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

Hello CMoH,

I needed to re install Ubuntu en now i stuck whit a new error messages that i din't have before:
sudo make
make -C /lib/modules/4.15.0-43-generic/build M=/home/hmobron/lg4l
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-43-generic'
CC [M] /home/hmobron/lg4l/hid-gcore.o
cc1: error: code model kernel does not support PIC mode
scripts/Makefile.build:339: recipe for target '/home/hmobron/lg4l/hid-gcore.o' failed
make[2]: *** [/home/hmobron/lg4l/hid-gcore.o] Error 1
Makefile:1551: recipe for target 'module/home/hmobron/lg4l' failed
make[1]: *** [module/home/hmobron/lg4l] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-43-generic'
Makefile:15: recipe for target 'default' failed
make: *** [default] Error 2

A sugestion whas made add askUbuntu to add EXTRA_CFLAGS += $(CFLAGS_EXTRA) -fno-pie add the MakeFile, but it is not there.

from lg4l.

CMoH avatar CMoH commented on July 28, 2024

To be honest, one of the reasons I am not using Ubuntu is the fact that I don't have to deal with this kind of problems :)

In a working scenario you'd build the kernel from sources using a particular compiler (gcc) version, and build this external module using that result. This ensures everything matches (linux headers, kernel binaries, the gcc version and settings, such as PIC/PIE settings, etc).

However, with Ubuntu one has to trust that they maintain a perfect match between their binary packages (kernel) and the packages providing us with a kernel build environment (linux headers, linux build config in /lib/modules, gcc etc). Your error seems to point to such a mismatch. But I don't really know.

Do you get the same error if you follow this guide? https://www.cyberciti.biz/tips/build-linux-kernel-module-against-installed-kernel-source-tree.html

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

Hello CmoH,

Yes i do. The strange thing is when i do a
sudo apt-get install kernel-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package kernel-headers-4.15.0-43-generic
E: Couldn't find any package by glob 'kernel-headers-4.15.0-43-generic'
E: Couldn't find any package by regex 'kernel-headers-4.15.0-43-generic'
ls -l /usr/src/linux-headers-$(uname -r)
total 1532
drwxr-xr-x 3 root root 4096 jan 8 11:30 arch
lrwxrwxrwx 1 root root 32 dec 6 14:52 block -> ../linux-headers-4.15.0-43/block
lrwxrwxrwx 1 root root 32 dec 6 14:52 certs -> ../linux-headers-4.15.0-43/certs
lrwxrwxrwx 1 root root 33 dec 6 14:52 crypto -> ../linux-headers-4.15.0-43/crypto
lrwxrwxrwx 1 root root 40 dec 6 14:52 Documentation -> ../linux-headers-4.15.0-43/Documentation
lrwxrwxrwx 1 root root 34 dec 6 14:52 drivers -> ../linux-headers-4.15.0-43/drivers
lrwxrwxrwx 1 root root 35 dec 6 14:52 firmware -> ../linux-headers-4.15.0-43/firmware
lrwxrwxrwx 1 root root 29 dec 6 14:52 fs -> ../linux-headers-4.15.0-43/fs
drwxr-xr-x 4 root root 4096 jan 8 11:30 include
lrwxrwxrwx 1 root root 31 dec 6 14:52 init -> ../linux-headers-4.15.0-43/init
lrwxrwxrwx 1 root root 30 dec 6 14:52 ipc -> ../linux-headers-4.15.0-43/ipc
lrwxrwxrwx 1 root root 33 dec 6 14:52 Kbuild -> ../linux-headers-4.15.0-43/Kbuild
lrwxrwxrwx 1 root root 34 dec 6 14:52 Kconfig -> ../linux-headers-4.15.0-43/Kconfig
drwxr-xr-x 2 root root 4096 jan 8 11:30 kernel
lrwxrwxrwx 1 root root 30 dec 6 14:52 lib -> ../linux-headers-4.15.0-43/lib
lrwxrwxrwx 1 root root 35 dec 6 14:52 Makefile -> ../linux-headers-4.15.0-43/Makefile
lrwxrwxrwx 1 root root 29 dec 6 14:52 mm -> ../linux-headers-4.15.0-43/mm
-rw-r--r-- 1 root root 1538167 dec 6 14:52 Module.symvers
lrwxrwxrwx 1 root root 30 dec 6 14:52 net -> ../linux-headers-4.15.0-43/net
lrwxrwxrwx 1 root root 34 dec 6 14:52 samples -> ../linux-headers-4.15.0-43/samples
drwxr-xr-x 6 root root 12288 jan 8 11:30 scripts
lrwxrwxrwx 1 root root 35 dec 6 14:52 security -> ../linux-headers-4.15.0-43/security
lrwxrwxrwx 1 root root 32 dec 6 14:52 sound -> ../linux-headers-4.15.0-43/sound
lrwxrwxrwx 1 root root 30 dec 6 14:52 spl -> ../linux-headers-4.15.0-43/spl
drwxr-xr-x 3 root root 4096 jan 8 11:30 tools
lrwxrwxrwx 1 root root 33 dec 6 14:52 ubuntu -> ../linux-headers-4.15.0-43/ubuntu
lrwxrwxrwx 1 root root 30 dec 6 14:52 usr -> ../linux-headers-4.15.0-43/usr
lrwxrwxrwx 1 root root 31 dec 6 14:52 virt -> ../linux-headers-4.15.0-43/virt
lrwxrwxrwx 1 root root 30 dec 6 14:52 zfs -> ../linux-headers-4.15.0-43/zfs

It looks like a gcc thing. I can't rememeber installed before and it is not on the VMbox when i do gcc --version. When i remove it i got afther make
/bin/sh: 1: gcc: not found

I have installed apt-get install build-essential

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

I did some massif reading about the issue and did some test. Even installed gcc 4.8 but that trows other errors.

Is this a solution? http://mattfife.com/?p=3199 and if yes how do i apply the patch.

from lg4l.

CMoH avatar CMoH commented on July 28, 2024

Linux headers usually "match" the kernel, but only the major/minor versions (i.e. 1.14 matches all 1.14.x kernels).

Patch files (or diff files) are not that much. Basically if the first character on a line is a + sign, then this line needs to be added. If it's a - sign, that line needs to be removed.

So you can simply copy/paste the lines starting with the + (such as +KBUILD_CFLAGS += $(call cc-option, -fno-pie)) and next remove the plus signs at the beginning. Place those lines just below the # kbuild part comment in the makefile, and tell me how it goes.

Actually, the end result should look like this:

KBUILD_CFLAGS += $(call cc-option, -fno-pie)
KBUILD_CFLAGS += $(call cc-option, -no-pie)
KBUILD_AFLAGS += $(call cc-option, -fno-pie)
KBUILD_CPPFLAGS += $(call cc-option, -fno-pie)

obj-m := hid-gcore.o hid-gfb.o hid-g110.o hid-g13.o hid-g15.o hid-g15v2.o hid-g19.o 

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

sudo make
[sudo] password for hmobron:
make -C /lib/modules/4.15.0-43-generic/build M=/home/hmobron/lg4l
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-43-generic'
/home/hmobron/lg4l/Makefile:7: *** Recursive variable 'KBUILD_CPPFLAGS' references itself (eventually). Stop.

Comment out: KBUILD_CPPFLAGS += $(call cc-option, -fno-pie)

sudo make
make -C /lib/modules/4.15.0-43-generic/build M=/home/hmobron/lg4l
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-43-generic'
scripts/Makefile.lib:10: *** Recursive variable 'KBUILD_CFLAGS' references itself (eventually). Stop.
Makefile:1551: recipe for target 'module/home/hmobron/lg4l' failed
make[1]: *** [module/home/hmobron/lg4l] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-43-generic'
Makefile:19: recipe for target 'default' failed
make: *** [default] Error 2

I changed += to := and that result in
sudo make
make -C /lib/modules/4.15.0-43-generic/build M=/home/hmobron/lg4l
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-43-generic'
CC [M] /home/hmobron/lg4l/hid-gcore.o
In file included from ./include/linux/mmdebug.h:5:0,
from ./include/linux/gfp.h:5,
from ./include/linux/slab.h:15,
from ./include/linux/hid.h:30,
from /home/hmobron/lg4l/hid-gcore.c:17:
./include/linux/bug.h:5:10: fatal error: asm/bug.h: No such file or directory
#include <asm/bug.h>
^~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:339: recipe for target '/home/hmobron/lg4l/hid-gcore.o' failed
make[2]: *** [/home/hmobron/lg4l/hid-gcore.o] Error 1
Makefile:1551: recipe for target 'module/home/hmobron/lg4l' failed
make[1]: *** [module/home/hmobron/lg4l] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-43-generic'
Makefile:19: recipe for target 'default' failed
make: *** [default] Error 2

How can two installations so different.

from lg4l.

CMoH avatar CMoH commented on July 28, 2024

Try to replace KBUILD_CFLAGS += (and similar) with EXTRA_CFLAGS +=, or maybe with EXTRA_CFLAGS = (instead of +=)

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

EXTRA_CFLAGS = $(call cc-option, -fno-pie)
EXTRA_CFLAGS = $(call cc-option, -no-pie)
KBUILD_AFLAGS = $(call cc-option, -fno-pie)
KBUILD_CPPFLAGS := $(call cc-option, -fno-pie)

sudo make
make -C /lib/modules/4.15.0-43-generic/build M=/home/hmobron/lg4l
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-43-generic'
CC [M] /home/hmobron/lg4l/hid-gcore.o
In file included from ./include/linux/mmdebug.h:5:0,
from ./include/linux/gfp.h:5,
from ./include/linux/slab.h:15,
from ./include/linux/hid.h:30,
from /home/hmobron/lg4l/hid-gcore.c:17:
./include/linux/bug.h:5:10: fatal error: asm/bug.h: No such file or directory
#include <asm/bug.h>
^~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:339: recipe for target '/home/hmobron/lg4l/hid-gcore.o' failed
make[2]: *** [/home/hmobron/lg4l/hid-gcore.o] Error 1
Makefile:1551: recipe for target 'module/home/hmobron/lg4l' failed
make[1]: *** [module/home/hmobron/lg4l] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-43-generic'
Makefile:19: recipe for target 'default' failed
make: *** [default] Error 2

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

Oke, a made a new fresh install (again :))
Before the git clone I installed from the instructions here: https://smallbusiness.chron.com/compile-modules-ubuntu-52622.html
Now i have kernel 4.15.0.29 and before 4.15.0.34 so i was hoping that it worked. Wrong same errors.

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

CMoD,

I am totally sorry man. Is mis read your line: To be honest, one of the reasons I am not using Ubuntu is the fact that I don't have to deal with this kind of problems :)

I was sticking to Ubuntu because i thought you wrote it was good.

I am well-known whit Centos, my internet server is running on it. I choses for my home computer Ubuntu because my raspberry.

Whats you advice?

from lg4l.

CMoH avatar CMoH commented on July 28, 2024

Heh - sorry about that. I am using Gentoo, where the kernel is configured and built by me. I think Arch also has good support for developers.

Well, I would try to build it using Ubuntu's kernel dev manual: i.e. make it into a deb using their kernel build tools, and install the deb. Maybe even distribute it for other Ubuntu users. Ubuntu's developer docs seem quite in disarray, but perhaps you'll have a better luck than me to find docs on how their kernel maintainers build external modules (e.g. nvidia drivers).

from lg4l.

wangmice avatar wangmice commented on July 28, 2024

download the source of ubuntu, there is a fold named certs ,copy the files to the /usr/src/linux-headers-uname -r/certs

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

Hallo CMoH,

I try Centos 7 now. I got this error:
make
make -C /lib/modules/3.10.0-957.1.3.el7.x86_64/build M=/home/hmobron/lg4l
make[1]: Entering directory /usr/src/kernels/3.10.0-957.1.3.el7.x86_64' LD /home/hmobron/lg4l/built-in.o CC [M] /home/hmobron/lg4l/hid-gcore.o /home/hmobron/lg4l/hid-gcore.c: In function ‘get_hdev_minor’: /home/hmobron/lg4l/hid-gcore.c:225:40: error: dereferencing pointer to incomplete type return ((struct hiddev *)hdev->hiddev)->minor; ^ /home/hmobron/lg4l/hid-gcore.c:226:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ make[2]: *** [/home/hmobron/lg4l/hid-gcore.o] Error 1 make[1]: *** [_module_/home/hmobron/lg4l] Error 2 make[1]: Leaving directory /usr/src/kernels/3.10.0-957.1.3.el7.x86_64'
make: *** [default] Error 2

from lg4l.

CMoH avatar CMoH commented on July 28, 2024

Wow - kernel 3.10.0 is quite old. However, this hiddev API change seems to match a change from kernel 4.11 to 4.12, so maybe you'll get it working by checking out the git branch kernel-4.11

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

I removed the ->minor and got
/home/hmobron/lg4l/hid-gcore.c:226:2: warning: return makes integer from pointer without a cast [enabled by default]
return ((struct hiddev *)hdev->hiddev);

But the compiling wend on. Make install worked and i think modeprobe hid-g110 to. And ./rebind worked to.

How can i programm the g keys?

from lg4l.

CMoH avatar CMoH commented on July 28, 2024

I don't think your changes are correct. That minor is used to generate the led device name, so you might get a weird name. Have you tried git checkout kernel-4.11 and make ?

There are some userspace tools here, which is the continuation of an abandoned project. You'll find more docs in the latter, and a newer version in the former page.

from lg4l.

CMoH avatar CMoH commented on July 28, 2024

By the way, have you seen the piper/ratbag projects?

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

I have done that: git checkout kernel-4.11 and make and it worked.
Now working on add macro's to the key. The gnome15 seems not the place for Centos and i use a keyboard the g110.

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

Hello CMoH,

I now can load the modules under Centos and Mint. Only Mint i need to run sudo depmod
to let modprobe to find the new modules. Thats great.

I only can't find a way to assign for example key G5 = ctrl+C or G6 = ctrl+c

from lg4l.

CMoH avatar CMoH commented on July 28, 2024

This is not implemented in the kernel module, but there are some people contributing to gnome15. Try addressing this on that project. Maybe it's easy to add support in the GUI for G110 and/or for Centos.

from lg4l.

HansHM avatar HansHM commented on July 28, 2024

Thank you very much for you help.

from lg4l.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.