⬆️ ⬇️

Ubuntu Developer Week: Packing kernel modules with DKMS

Brief compilation of irc-chat in the framework of Ubuntu Developer Week on the topic "Packaging Kernel modules with DKMS"


We pack kernel modules with DKMS . Speaker: Ben Collins, already known to us



I look at the list of materials of the January Ubuntu Developer Week and the eye rejoices. A lot of good material was considered in the voluntary-compulsory communication of developers with the community. Let's start today with a conversation about nuclear modules and one great framework for their care.



DKMS is, according to the speaker, a program that allows you to easily manage the sources of modules and automatically build them with the required kernel version. Basically this system is used by those who need third-party modules for the distribution kernel. DKMS is also used with modules from iron manufacturers that contain binary or closed parts (broadcom, fglrx, nvidia).



What can I say, the seemingly interesting topic absolutely did not cause a stir among the audience. Ben gave a link to his presentation, briefly spoke about 2 technical nuances and that was it.

Not a single question.

')

Ok, while Ben’s presentation video clip is swinging, consider the topic yourself. I just have in the system a suitable module for the role of an experimental. The kernel of my Ubunt does not contain a laptop webcam driver, so we will go through all the stages of its assembly using DKMS.



Install the framework itself:

sudo aptitude install dkms

We look that we have:

dkms status

Get the driver source directly from upstream:

sudo git clone repo.or.cz/r/microdia.git /usr/src/microdia-v2009.01

Create a configuration from a template:

sudo cp /usr/share/doc/dkms/sample.conf /usr/src/microdia-v2009.01/dkms.conf

Then edit:

sudo vim /usr/src/microdia-v2009.01/dkms.conf

We bring dkms.conf to the following form:

PACKAGE_VERSION="v2009.01"

PACKAGE_NAME="microdia"



MAKE[0]="make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules"

CLEAN="make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"



BUILT_MODULE_NAME[0]="sn9c20x"

DEST_MODULE_LOCATION[0]="/kernel/drivers/media/video/usbvideo/"



REMAKE_INITRD="no"

AUTOINSTALL="yes"



We do 1-2-3 :

sudo dkms add -m microdia -v v2009.01

sudo dkms build -m microdia -v v2009.01

sudo dkms install -m microdia -v v2009.01


We look at the status:

dkms status

We check the performance:

sudo ls /lib/modules/`uname -r`/updates/dkms

sudo modprobe sn9c20x

ls -l /dev/video0

LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so mplayer tv:// -tv driver=v4l2:width=320:height=240:fps=25:device=/dev/video0 -vo xv




Now we are waiting for the next kernel update, Jaunty, to test this auto-build. In the meantime, we enjoy working webcam and do not forget that Debian (and therefore Ubuntu) has a native module-assistant for such purposes.



Starting with this post, I will publish in Ubuntarium, but many have not seen the previous notes about Open Week.

Source: https://habr.com/ru/post/51552/



All Articles