Skip to content

Build and install

hipersayanX edited this page Oct 5, 2020 · 15 revisions

Dependencies

These are the minimum requirements to build the driver:

Additional tools that may be useful for development:

Build and install

You can build and install akvcam with the following commands:

cd akvcam/src
make
sudo make install

It may return some warnings about unknown symbols in depmod, you can run the following command:

sudo depmod -a

after that, the driver may work without problems. You can check the driver is installed with:

ls /lib/modules/$(uname -r)/extra/akvcam.ko*

And you can uninstall the driver with:

sudo make uninstall

Note: If you get an error similar to:

  INSTALL /home/user/git/webcamoid/akvcam/src/akvcam.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76
sign-file: certs/signing_key.pem: No such file or directory
  DEPMOD  5.4.0-21-generic
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-21-generic'

try installing the module with DKMS (bellow section).

Managing the module with DKMS

Alternatively to the install/uninstall step explained before you can install and manage the module using DKMS, this way the module will be rebuild automatically every time you update the kernel. To do so, like before, check that there are not any problem building the module:

cd akvcam/src
make
make clean

We need the sources directory to be clean, then if everything was right do:

sudo mkdir -p /usr/src/akvcam-${VERSION}
sudo cp -ar * /usr/src/akvcam-${VERSION}   # <- Inside akvcam/src directory
sudo dkms install akvcam/${VERSION}

Replace ${VERSION} with the actual driver version.
To uninstall the module do:

sudo dkms remove akvcam/${VERSION} --all
sudo rm -rvf /usr/src/akvcam-${VERSION}

Build flags

  • KERNEL_DIR: The path where kernel source are located. Default to /lib/modules/$(shell uname -r)/build.
  • DESTDIR: The install prefix of the driver, used with make install. Default to /.
  • USE_SPARSE=1: Use sparse to check for errors in source files when building.
  • SPARSE_MODE: Mode 1 only check errors when the source file is modified, mode 2 check errors every time the driver is built. Default to 2.

Build and develop with Qt Creator

You can open the driver source code as a normal Qt project, to do so just open the akvcam.pro file with Qt Creator and that's it. Qt Creator offers a lot of nice and modern features to improve driver development like static code parsing, error, warning and source tracking, and a lot more.

Clone this wiki locally