akvcam icon indicating copy to clipboard operation
akvcam copied to clipboard

akvcam module compilation

Open darkonen opened this issue 2 years ago • 12 comments

akvcam module compilation failed in kernel 5.18-rc3 make.log

darkonen avatar Apr 22 '22 08:04 darkonen

on kernel-5.18.2-pclos1 compilation works, but a other issue come up:

#modprobe akvcam modprobe: ERROR: could not insert 'akvcam': Exec format error

ohquait avatar Jun 07 '22 13:06 ohquait

SOLVED for PCLinuxOS a patch to /src/MAKEFILE was needed to enable rightly working dkms functions on this special distribution

ohquait avatar Jun 07 '22 18:06 ohquait

@ohquait which patches did you applied?

hipersayanX avatar Jun 11 '22 16:06 hipersayanX

@hipersayanX i use this: link: https://www.qua-it.org/XFCE/shots/share-with-pclos/pclos/akvcam-Makefile-pclos.patch link to patched Makefile: https://www.qua-it.org/XFCE/shots/share-with-pclos/pclos/akvcam-patched-Makefile

ohquait avatar Jun 14 '22 13:06 ohquait

have make reply on your git, how can post code in raw there? even i will post a patch the format of strings will breaks ... so i post you the links to patch and resulting patched Makefile Greetings

Am Sa., 11. Juni 2022 um 16:49 Uhr schrieb hipersayanX < @.***>:

@ohquait https://github.com/ohquait which patches did you applied?

— Reply to this email directly, view it on GitHub https://github.com/webcamoid/akvcam/issues/61#issuecomment-1152962710, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP5C6C77JWUCV5IKME6VAU3VOS7RHANCNFSM5UBTWPVA . You are receiving this because you were mentioned.Message ID: @.***>

-- also on @.***

ohquait avatar Jun 14 '22 13:06 ohquait

I have patched Makefile with this patch only on kernel 5.18.3. make => compilation failed (cf: make_5.18.3.log) then compilation with DKMS on not-patched kernel 5.19.0-rc2. same errors (cf: make_5.19.0-rc2.log)

make_5.18.3.log make_5.19.0-rc2.log

darkonen avatar Jun 14 '22 13:06 darkonen

here is the dkms.conf from pclos... with it all should works: link: https://www.qua-it.org/XFCE/shots/share-with-pclos/pclos/akvcam-pclos-dkms.conf in raw:

PACKAGE_NAME="akvcam" PACKAGE_VERSION="1.2.2-4pclos2022" BUILT_MODULE_NAME[0]="akvcam" DEST_MODULE_LOCATION[0]="/kernel/3rdparty/akvcam" MAKE[0]="export IGNORE_CC_MISMATCH=1; 'make' clean SKIP_STACK_VALIDATION=1 all" CLEAN="make clean" AUTOINSTALL="yes"

Am Di., 14. Juni 2022 um 13:57 Uhr schrieb darkonen < @.***>:

I have patched Makefile with this patch only on kernel 5.18.3. make => compilation failed (cf: make_5.18.3.log) then compilation with DKMS on not-patched kernel 5.19.0-rc2. same errors (cf: make_5.19.0-rc2.log)

make_5.18.3.log https://github.com/webcamoid/akvcam/files/8900364/make_5.18.3.log make_5.19.0-rc2.log https://github.com/webcamoid/akvcam/files/8900366/make_5.19.0-rc2.log

— Reply to this email directly, view it on GitHub https://github.com/webcamoid/akvcam/issues/61#issuecomment-1155222641, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP5C6C6EY6XJHN4IXEA4JJ3VPCFT5ANCNFSM5UBTWPVA . You are receiving this because you were mentioned.Message ID: @.***>

-- also on @.***

ohquait avatar Jun 14 '22 14:06 ohquait

here is the dkms.conf from pclos...with it all should works:link: https://www.qua-it.org/XFCE/shots/share-with-pclos/pclos/akvcam-pclos-dkms.conf

in raw: PACKAGE_NAME="akvcam" PACKAGE_VERSION="1.2.2-4pclos2022" BUILT_MODULE_NAME[0]="akvcam" DEST_MODULE_LOCATION[0]="/kernel/3rdparty/akvcam" MAKE[0]="export IGNORE_CC_MISMATCH=1; 'make' clean SKIP_STACK_VALIDATION=1 all" CLEAN="make clean" AUTOINSTALL="yes"

ohquait avatar Jun 14 '22 14:06 ohquait

ups, i must do it again, the patch not solving the problem, i have a pre installed version on differ place, now i clean my kernel-tree and all dkms from tree and begin a newer build, if i can check success by install on kernel-5.17.... and then boot in kernel 5.18.3... and the command dkms status and a modprobe akvcam give my not errors, then i post here ....

ohquait avatar Jun 15 '22 10:06 ohquait

now it's working build as rpm dkms-akvcam on PCLinuxOS kernel-5.17.15, upload to my repo, then install with: apt-get update ; apt-get install dkms-akvcam no errors during modules build, reboot and : lsmod | grep akvcam akvcam 192512 0 videobuf2_vmalloc 16384 1 akvcam videobuf2_v4l2 36864 1 akvcam videobuf2_common 69632 4 videobuf2_vmalloc,videobuf2_v4l2,akvcam,videobuf2_memops videodev 270336 3 videobuf2_v4l2,videobuf2_common,akvcam

now reboot to kernel-5.18.4 and wait a few minutes, dkms automatical build for this kernel, if ready reboot, and : lsmod | grep akvcam akvcam 192512 0 videobuf2_vmalloc 16384 1 akvcam videobuf2_v4l2 36864 1 akvcam videobuf2_common 69632 4 videobuf2_vmalloc,videobuf2_v4l2,akvcam,videobuf2_memops videodev 270336 3 videobuf2_v4l2,videobuf2_common,akvcam

no Exec format errors by do # modprobe akvcam READY

patche:

--- a/src/Makefile
+++ b/src/Makefile
@@ -1,24 +1,15 @@
 MODULE_NAME = akvcam
 MODULE_VERSION = 1.2.2
-KERNEL_ROOT ?= $(shell realpath /lib/modules/$(shell uname -r))
-KERNEL_DIR ?= $(KERNEL_ROOT)/build
-COPY = cp -f
-MKDIR = mkdir -p
-RMDIR = rm -rvf
-PWD := $(shell pwd)
-DKMS := dkms
-DESTDIR :=
-PREFIX := $(DESTDIR)/usr/src
-INSTALLDIR := $(PREFIX)/$(MODULE_NAME)-$(MODULE_VERSION)
+SHELL := /bin/sh
+PWD ?= $(shell pwd)
+CC = gcc
+KVER ?= $(shell uname -r)
+KSRC := /lib/modules/$(KVER)/build
+MODDESTDIR := /lib/modules/$(KVER)/kernel/3rdparty/akvcam
+CLR_MODULE_FILES := *.mod.c *.mod *.o .*.cmd *.ko* *~ .tmp_versions* modules.order Module.symvers
+SYMBOL_FILE := Module.symvers
+MAKE = make
 
-HAVE_SPARSE := $(shell which sparse 2>/dev/null)
-SPARSE_MODE ?= 2
-
-ifdef USE_SPARSE
-ifdef HAVE_SPARSE
-SPARSE_VAR = C=$(SPARSE_MODE)
-endif
-endif
 
 obj-m += $(MODULE_NAME).o
 akvcam-objs := \
@@ -29,10 +20,10 @@
 	device.o \
 	driver.o \
 	file_read.o \
-        format.o \
+	format.o \
 	frame.o \
-        frame_filter.o \
-        ioctl.o \
+	frame_filter.o \
+	ioctl.o \
 	list.o \
 	log.o \
 	map.o \
@@ -41,24 +32,21 @@
 	utils.o
 
 all:
-	$(MAKE) -C $(KERNEL_DIR) M=$(PWD) $(SPARSE_VAR) modules
+	$(MAKE) -C $(KSRC) M=$(PWD) modules
+
+install:
+	mkdir -p $(MODDESTDIR)
+	install -p -m 644 $(MODULE_NAME).ko  $(MODDESTDIR)
+	xz -f $(MODDESTDIR)/$(MODULE_NAME).ko
+	/sbin/depmod -a $(KVER)
+
+uninstall:
+	modprobe -r $(MODULE_NAME)
+	rm -f $(MODDESTDIR)/$(MODULE_NAME).ko*
+	/sbin/depmod -a $(KVER)
 
 clean:
-	$(MAKE) -C $(KERNEL_DIR) M=$(PWD) clean
-
-install: uninstall
-	$(MKDIR) $(INSTALLDIR)
-	$(COPY) Makefile $(INSTALLDIR)
-	$(COPY) dkms.conf $(INSTALLDIR)
-	$(COPY) *.h $(INSTALLDIR)
-	$(COPY) *.c $(INSTALLDIR)
-
-dkms_install: | dkms_uninstall install
-	$(DKMS) install $(MODULE_NAME)/$(MODULE_VERSION)
-
-uninstall:
-	$(RMDIR) $(INSTALLDIR)
-
-dkms_uninstall:
-	- $(DKMS) remove $(MODULE_NAME)/$(MODULE_VERSION) --all
-	$(RMDIR) $(INSTALLDIR)
+	$(MAKE) -C $(KSRC) M=$(shell pwd) clean
+	rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order
+	rm -fr *.mod.c *.mod *.o .*.cmd *.ko* *~
+	rm -fr .tmp_versions*

######################## dkms.conf:

PACKAGE_NAME="akvcam"
PACKAGE_VERSION="1.2.2-9pclos2022"
BUILT_MODULE_NAME="akvcam"
BUILT_MODULE_LOCATION="./"
DEST_MODULE_LOCATION="/kernel/3rdparty/akvcam"
MAKE="export IGNORE_CC_MISMATCH=1; 'make' KSRC=${kernel_source_dir} SKIP_STACK_VALIDATION=1 all"
CLEAN="make clean"
AUTOINSTALL="yes"

PCLinuxOS still keep older version but good configured dkms-stuff without systemd's

Hope this will help to compile the modules on other distri's

P.S. the srpm for unpacking and see all includes is here: https://www.qua-it.org/XFCE/repo/SRPMS.quait/SRPMS.x86_64/dkms-akvcam-1.2.2-9pclos2022.src.rpm

ohquait avatar Jun 16 '22 10:06 ohquait

for me can close

ohquait avatar Jun 18 '22 09:06 ohquait

@ohquait

for me can close

Don't, I must still check what I can take from the patch.

hipersayanX avatar Jun 18 '22 18:06 hipersayanX

akvcam module compilation failed in kernel 5.18-rc3 make.log

darkonen avatar Oct 02 '22 12:10 darkonen

Hello,

it's OK now for me

akvcam/1.2.3, 5.19.12, x86_64: installed akvcam/1.2.3, 6.0.0-rc7, x86_64: installed v4l2loopback/0.12.7, 5.19.12, x86_64: installed v4l2loopback/0.12.7, 6.0.0-rc7, x86_64: installed virtualbox/6.1.38, 5.19.12, x86_64: installed virtualbox/6.1.38, 6.0.0-rc7, x86_64: installed

Le 11/06/2022 à 18:49, hipersayanX a écrit :

@ohquait https://github.com/ohquait which patches did you applied?

— Reply to this email directly, view it on GitHub https://github.com/webcamoid/akvcam/issues/61#issuecomment-1152962710, or unsubscribe https://github.com/notifications/unsubscribe-auth/APJNFJGJ7LTKUYKDDAKNBQ3VOS7RHANCNFSM5UBTWPVA. You are receiving this because you authored the thread.Message ID: @.***>

darkonen avatar Oct 02 '22 12:10 darkonen

it's not working on my Debian/Sid distribution.

What's your gcc version (may be the problem)?

I made compilation with gcc 11.3.0 version

Le 16/06/2022 à 12:12, ohquait a écrit :

now it's working build as rpm dkms-akvcam on PCLinuxOS kernel-5.17.15, upload to my repo, then install with: apt-get update ; apt-get install dkms-akvcam no errors during modules build, reboot and : lsmod | grep akvcam akvcam 192512 0 videobuf2_vmalloc 16384 1 akvcam videobuf2_v4l2 36864 1 akvcam videobuf2_common 69632 4 videobuf2_vmalloc,videobuf2_v4l2,akvcam,videobuf2_memops videodev 270336 3 videobuf2_v4l2,videobuf2_common,akvcam

now reboot to kernel-5.18.4 and wait a few minutes, dkms automatical build for this kernel, if ready reboot, and : lsmod | grep akvcam akvcam 192512 0 videobuf2_vmalloc 16384 1 akvcam videobuf2_v4l2 36864 1 akvcam videobuf2_common 69632 4 videobuf2_vmalloc,videobuf2_v4l2,akvcam,videobuf2_memops videodev 270336 3 videobuf2_v4l2,videobuf2_common,akvcam

no Exec format errors by do # modprobe akvcam READY

patche:

|--- a/src/Makefile +++ b/src/Makefile @@ -1,24 +1,15 @@ MODULE_NAME = akvcam MODULE_VERSION = 1.2.2 -KERNEL_ROOT ?= $(shell realpath /lib/modules/$(shell uname -r)) -KERNEL_DIR ?= $(KERNEL_ROOT)/build -COPY = cp -f -MKDIR = mkdir -p -RMDIR = rm -rvf -PWD := $(shell pwd) -DKMS := dkms -DESTDIR := -PREFIX := $(DESTDIR)/usr/src -INSTALLDIR := $(PREFIX)/$(MODULE_NAME)-$(MODULE_VERSION) +SHELL := /bin/sh +PWD ?= $(shell pwd) +CC = gcc +KVER ?= $(shell uname -r) +KSRC := /lib/modules/$(KVER)/build +MODDESTDIR := /lib/modules/$(KVER)/kernel/3rdparty/akvcam +CLR_MODULE_FILES := *.mod.c .mod .o ..cmd .ko ~ .tmp_versions modules.order Module.symvers +SYMBOL_FILE := Module.symvers +MAKE = make -HAVE_SPARSE := $(shell which sparse 2>/dev/null) -SPARSE_MODE ?= 2 - -ifdef USE_SPARSE -ifdef HAVE_SPARSE -SPARSE_VAR = C=$(SPARSE_MODE) -endif -endif obj-m += $(MODULE_NAME).o akvcam-objs := \ @@ -29,10 +20,10 @@ device.o \ driver.o \ file_read.o \ - format.o \ + format.o \ frame.o \ - frame_filter.o \ - ioctl.o \ + frame_filter.o \ + ioctl.o \ list.o \ log.o \ map.o \ @@ -41,24 +32,21 @@ utils.o all: - $(MAKE) -C $(KERNEL_DIR) M=$(PWD) $(SPARSE_VAR) modules + $(MAKE) -C $(KSRC) M=$(PWD) modules + +install: + mkdir -p $(MODDESTDIR) + install -p -m 644 $(MODULE_NAME).ko $(MODDESTDIR) + xz -f $(MODDESTDIR)/$(MODULE_NAME).ko + /sbin/depmod -a $(KVER) + +uninstall: + modprobe -r $(MODULE_NAME) + rm -f $(MODDESTDIR)/$(MODULE_NAME).ko + /sbin/depmod -a $(KVER) clean: - $(MAKE) -C $(KERNEL_DIR) M=$(PWD) clean - -install: uninstall - $(MKDIR) $(INSTALLDIR) - $(COPY) Makefile $(INSTALLDIR) - $(COPY) dkms.conf $(INSTALLDIR) - $(COPY) *.h $(INSTALLDIR) - $(COPY) *.c $(INSTALLDIR) - -dkms_install: | dkms_uninstall install - $(DKMS) install $(MODULE_NAME)/$(MODULE_VERSION) - -uninstall: - $(RMDIR) $(INSTALLDIR) - -dkms_uninstall: - - $(DKMS) remove $(MODULE_NAME)/$(MODULE_VERSION) --all - $(RMDIR) $(INSTALLDIR) + $(MAKE) -C $(KSRC) M=$(shell pwd) clean + rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order + rm -fr *.mod.c *.mod .o ..cmd .ko ~ + rm -fr .tmp_versions |

######################## dkms.conf:

|PACKAGE_NAME="akvcam" PACKAGE_VERSION="1.2.2-9pclos2022" BUILT_MODULE_NAME="akvcam" BUILT_MODULE_LOCATION="./" DEST_MODULE_LOCATION="/kernel/3rdparty/akvcam" MAKE="export IGNORE_CC_MISMATCH=1; 'make' KSRC=${kernel_source_dir} SKIP_STACK_VALIDATION=1 all" CLEAN="make clean" AUTOINSTALL="yes" |

PCLinuxOS still keep older version but good configured dkms-stuff without systemd's

Hope this will help to compile the modules on other distri's

— Reply to this email directly, view it on GitHub https://github.com/webcamoid/akvcam/issues/61#issuecomment-1157484242, or unsubscribe https://github.com/notifications/unsubscribe-auth/APJNFJHFMKV2HDFJSFWYZNLVPL4XBANCNFSM5UBTWPVA. You are receiving this because you authored the thread.Message ID: @.***>

darkonen avatar Oct 11 '22 07:10 darkonen

just to inform, all seem to be good with 1.2.3 release: for check: https://www.qua-it.org/XFCE/repo/SRPMS.quait/SRPMS.x86_64/dkms-akvcam-1.2.3-1pclos2022.src.rpm

ohquait avatar Oct 11 '22 12:10 ohquait