Outils pour utilisateurs

Outils du site


tech:notes_dkms_et_construction_paquet_debian_netatop

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
tech:notes_dkms_et_construction_paquet_debian_netatop [2025/11/11 17:07] Jean-Baptistetech:notes_dkms_et_construction_paquet_debian_netatop [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Brouillon Module}}
 +
 +# Notes DKMS et construction paquet Debian netatop
 +
 +DKMS
 +* http://blog.valouille.fr/2013/05/compiler-un-paquet-debian-dkms-pour-un-module-noyau/
 +* http://www.xkyle.com/building-linux-packages-for-kernel-drivers/
 +
 +Netatop DKMS :
 +* https://aur.archlinux.org/packages/netatop-dkms/
 +
 +~~~
 +Error!  Build offailed for:
 +Consult the make.log in the build directory
 +~~~
 +
 +On met le code source dans
 +/usr/src/netatop-0.7
 +
 +On créer un fichier dkms.conf
 +
 +`/usr/src/netatop-0.7/dkms.conf`
 +~~~ini
 +PACKAGE_NAME="netatop"
 +PACKAGE_VERSION="0.7"
 +MAKE="make"
 +CLEAN="make clean"
 +BUILT_MODULE_NAME[0]="netatop"
 +DEST_MODULE_LOCATION[0]="/updates"
 +AUTOINSTALL="yes"
 +REMAKE_INITRD=no
 +~~~
 +
 +~~~bash
 +dkms add -m netatop -v 0.7
 +~~~
 +
 +~~~
 +Creating symlink /var/lib/dkms/netatop/0.7/source ->
 +                 /usr/src/netatop-0.7
 +
 +DKMS: add completed
 +~~~
 +
 +~~~bash
 +dkms build -m netatop -v 0.7
 +~~~
 +
 +~~~
 +Error!  Build of netatop.ko failed for: 3.16.0-4-amd64 (x86_64)
 +Consult the make.log in the build directory
 +~~~
 +Si erreur on copie le Makefile, que l'on modifiera
 +
 +
 +~~~bash
 +cp -p Makefile Makefile.dkms
 +vim Makefile.dkms
 +~~~
 +
 +`/usr/src/netatop-0.7/Makefile.dkms`
 +~~~make
 +all:
 +                ./mkversion
 +                cd module; make
 +                cp -p ./module/netatop.ko .
 +
 +clean:
 +                cd module; make clean
 +~~~
 +
 +On modifie me fichier dkms.conf pour que **make** prend le nouveau Makefile.dkms
 +
 +`/usr/src/netatop-0.7/dkms.conf`
 +~~~ini
 +PACKAGE_NAME="netatop"
 +PACKAGE_VERSION="0.7"
 +MAKE="make -f Makefile.dkms"
 +CLEAN="make -f Makefile.dkms clean"
 +BUILT_MODULE_NAME[0]="netatop"
 +DEST_MODULE_LOCATION[0]="/updates"
 +AUTOINSTALL="yes"
 +REMAKE_INITRD=no
 +~~~
 +
 +Puis
 +
 +~~~bash
 +dkms build -m netatop -v 0.7
 +~~~
 +
 +Construction d'un paquet Debian
 +~~~bash
 +dkms mkdeb -m netatop -v 0.7
 +cp -p /var/lib/dkms/netatop/0.7/deb/netatop-dkms_0.7_all.deb ~
 +~~~
 +
 +Reset : On remet tous à neuf
 +
 +~~~bash
 +make clean
 +dkms remove -m netatop -v 0.7 -k all
 +rm /var/lib/dkms/netatop -rf
 +~~~
 +
 +On test
 +
 +~~~bash
 +dpkg -i netatop-dkms_0.7_all.deb
 +~~~
 +
 +~~~
 +DKMS: add completed.
 +First Installation: checking all kernels...
 +Building only for 3.16.0-4-amd64
 +Building for architecture amd64
 +Building initial module for 3.16.0-4-amd64
 +Error! Bad return status for module build on kernel: 3.16.0-4-amd64 (amd64)
 +Consult /var/lib/dkms/netatop/0.7/build/make.log for more information.
 +~~~
 +
 +Voyons ça
 +`/var/lib/dkms/netatop/0.7/build/make.log`
 +~~~
 +DKMS make.log for netatop-0.7 for kernel 3.16.0-4-amd64 (amd64)
 +dimanche 8 mai 2016, 22:05:44 (UTC+0200)
 +./mkversion
 +make: execvp: ./mkversion: Permission non accordée
 +Makefile.dkms:2: recipe for target 'all' failed
 +make: *** [all] Error 127
 +~~~
 +
 +La solution la plus simple, on ajoute un `chmod +x` dans le Makefile.dkms
 +
 +`Makefile.dkms`
 +~~~make
 +all:
 +        chmod +x ./mkversion ./netatop.init
 +        ./mkversion
 +        cd module; make
 +        cp -p ./module/netatop.ko .
 +
 +clean:
 +        cd module; make clean
 +~~~
 +
 +
 +## Notes
 +
 +Status
 +~~~bash
 +dkms status -m netatop
 +~~~
 +
 +Reset : On remet tous à neuf
 +~~~bash
 +make clean
 +dkms remove -m netatop -v 0.7 -k all
 +rm /var/lib/dkms/netatop -rf
 +~~~
 +
 +Module linux
 +~~~
 +rmmod netatop
 +modprobe netatop
 +depmod -a
 +~~~
 +
 +
 +Exemple de conf
 +
 +`dkms.conf`
 +~~~ini
 +PACKAGE_NAME="e1000e"
 +PACKAGE_VERSION="3.4.2.4"
 +MAKE[0]="cd src/ && make KVERSION=$kernelver BUILD_KERNEL=$kernelver"
 +CLEAN="cd src/ && make clean"
 +BUILT_MODULE_NAME[0]="e1000e"
 +BUILT_MODULE_LOCATION[0]="src/"
 +DEST_MODULE_LOCATION[0]="/updates"
 +REMAKE_INITRD="yes"
 +AUTOINSTALL="yes"
 +~~~
 +
 +Source : https://github.com/kelebek333/e1000e-dkms/blob/master/dkms.conf
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki