Ubuntu Developer Week: Packing kernel modules with DKMS
A brief compilation of the irc chat in the framework of the 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 January Ubuntu Developer Week and my eyes are happy. A lot of good material was considered in the voluntary-compulsory communication of developers with the community. We start today by talking about nuclear modules and one great framework for caring for them.
DKMS is, according to the speaker, a program that allows you to easily manage the source code of the modules and automatically assemble them with the required kernel version. This system is mainly used by those who need third-party modules for the distribution kernel. DKMS is also used with modules from manufacturers of iron containing binary or closed parts (broadcom, fglrx, nvidia).
What can I say, a seemingly interesting topic absolutely did not cause a stir among the audience. Ben gave a link to his presentation, briefly talked about 2 technical nuances, and that was it.
Not a single question.
Ok, while the presentation video clip from Ben is swinging, we will consider the topic ourselves. I just have in the system a suitable module for the role of the experimental. The kernel of my Ubunta does not contain a laptop webcam driver, so we will go through all the stages of its assembly using DKMS.
We install the framework itself:
sudo aptitude install dkms
We look at what we have:
dkms status
We get the driver sources directly from the upstream:
sudo git clone repo.or.cz/r/microdia.git /usr/src/microdia-v2009.01
We create the configuration from the template:
sudo cp /usr/share/doc/dkms/sample.conf /usr/src/microdia-v2009.01/dkms.conf
Then we edit:
sudo vim /usr/src/microdia-v2009.01/dkms.conf
We bring dkms.conf to the following form: Do 1-2-3 : We look at the status:
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"
sudo dkms add -m microdia -v v2009.01
sudo dkms build -m microdia -v v2009.01
sudo dkms install -m microdia -v v2009.01
dkms status
We check the performance: Now we are waiting for the next Jaunty kernel update to test this auto-assembly. In the meantime, we rejoice at the working webcam and do not forget that Debian (and hence Ubuntu) has a native module-assistant for such purposes.
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