Compilation de kernel-header

Bonsoir,

Je souhaite utiliser mon noyau pour compiler des drivers NI qui seront compatible avec mon système.

/usr/src/linux-headers-4.19.0-0.bpo.2-amd64

Je dois effectuer les opérations suivante :
1-Configure the sources for the currently running kernel.
2-Prepare the headers for compilation.

Pour cela, ils disent en :
1-make cloneconfig
2-make modules_prepare

Sauf qu’à la base ces remarques sont pour OpenSuse plutôt que pour debian !

Est-ce que c’est correcte ou il y a une autre manière de s’y prendre pour Debian Stretch ?

Merci

J’essaie de répondre à cette problématique.

:/usr/src/linux-headers-4.19.0-0.bpo.2-amd64# make cloneconfig
/usr/src/linux-headers-4.19.0-0.bpo.2-common/scripts/Makefile.build:45: /usr/src/linux-headers-4.19.0-0.bpo.2-common/scripts/basic/Makefile: Aucun fichier ou dossier de ce type
make[3]: *** Aucune règle pour fabriquer la cible « /usr/src/linux-headers-4.19.0-0.bpo.2-common/scripts/basic/Makefile ». Arrêt.
make[2]: *** [/usr/src/linux-headers-4.19.0-0.bpo.2-common/Makefile:465: scripts_basic] Error 2
make[1]: *** [Makefile:146: sub-make] Error 2
make: *** [Makefile:8: all] Error 2

Voici le problème rencontré en question 6 ci-dessous, linux-source v4.19 a été installé. La version du noyau est linux-headers-4.19.0-0.bpo.2-amd64.


Q6. During installation, I get a message similar to the following one:
“Kernel source does not appear to be configured for the running kernel.
Configuration of kernel source is required to continue installation.”
I do have kernel sources installed. Is there anything else I need to do?

A6. This problem is known to affect SUSE Linux, but it is possible that other
distributions require similar steps to resolve this problem.

On openSUSE, complete the following steps:

  1. Ensure you have installed kernel-source and kernel-syms packages
    corresponding to the version of the currently running kernel. You
    can determine the currently running kernel version by issuing the
    command “uname -r”.

  2. Change the directory to the /usr/src/linux- directory,
    where corresponds to the currently running kernel version.

  3. Run “zcat /boot/symvers-.gz > Module.symvers” as root to
    prepare modversion support.

  4. Run “make cloneconfig” as root to configure the sources for the
    currently running kernel.

  5. Run “make modules_prepare” as root to prepare the headers for
    compilation.

  6. Run the NI-488.2 for Linux INSTALL script.

Les headers et image d’un noyau sont toujours fourni par Debian pour toutes les architectures

 apt list | grep 4.19.0-4


linux-headers-4.19.0-4-686-pae/testing,unstable 4.19.28-2 i386
linux-headers-4.19.0-4-686/testing,unstable 4.19.28-2 i386
linux-headers-4.19.0-4-all-amd64/testing,unstable 4.19.28-2 amd64
linux-headers-4.19.0-4-all-i386/testing,unstable 4.19.28-2 i386
linux-headers-4.19.0-4-all/testing,unstable 4.19.28-2 amd64
linux-headers-4.19.0-4-all/testing,unstable 4.19.28-2 i386
linux-headers-4.19.0-4-amd64/testing,unstable 4.19.28-2 amd64
linux-headers-4.19.0-4-cloud-amd64/testing,unstable 4.19.28-2 amd64
linux-headers-4.19.0-4-common-rt/testing,testing,unstable,unstable 4.19.28-2 all
linux-headers-4.19.0-4-common/testing,testing,unstable,unstable 4.19.28-2 all
linux-headers-4.19.0-4-rt-686-pae/testing,unstable 4.19.28-2 i386
linux-headers-4.19.0-4-rt-amd64/testing,unstable 4.19.28-2 amd64
linux-image-4.19.0-4-686-dbg/testing,unstable 4.19.28-2 i386
linux-image-4.19.0-4-686-pae-dbg/testing,unstable 4.19.28-2 i386
linux-image-4.19.0-4-686-pae-unsigned/testing,unstable 4.19.28-2 i386
linux-image-4.19.0-4-686-pae/testing,unstable 4.19.28-2 i386
linux-image-4.19.0-4-686-unsigned/testing,unstable 4.19.28-2 i386
linux-image-4.19.0-4-686/testing,unstable 4.19.28-2 i386
linux-image-4.19.0-4-amd64-dbg/testing,unstable 4.19.28-2 amd64
linux-image-4.19.0-4-amd64-unsigned/testing,unstable 4.19.28-2 amd64
linux-image-4.19.0-4-amd64/testing,unstable,now 4.19.28-2 amd64  [installé, automatique]
linux-image-4.19.0-4-cloud-amd64-dbg/testing,unstable 4.19.28-2 amd64
linux-image-4.19.0-4-cloud-amd64-unsigned/testing,unstable 4.19.28-2 amd64
linux-image-4.19.0-4-cloud-amd64/testing,unstable 4.19.28-2 amd64
linux-image-4.19.0-4-rt-686-pae-dbg/testing,unstable 4.19.28-2 i386
linux-image-4.19.0-4-rt-686-pae-unsigned/testing,unstable 4.19.28-2 i386
linux-image-4.19.0-4-rt-686-pae/testing,unstable 4.19.28-2 i386
linux-image-4.19.0-4-rt-amd64-dbg/testing,unstable 4.19.28-2 amd64
linux-image-4.19.0-4-rt-amd64-unsigned/testing,unstable 4.19.28-2 amd64
linux-image-4.19.0-4-rt-amd64/testing,unstable 4.19.28-2 amd64
linux-support-4.19.0-4/testing,testing,unstable,unstable 4.19.28-2 all

On s’en sert pour compiler un autre logiciel, comme un driver si on est certain qu’il n’est pas fourni par Debian
http://www.aboutdebian.com/compile.htm

La réponse de @grandtoubab n’est pas forcément claire, mais en fait, les headers ne sont que les .h du noyau, ce n’est pas le code source, juste les définitions des fonctions utilisables quand on compile un module.
Les instructions que tu indiques, indépendament du fait qu’elles soient pour suse, ne s’appliquent donc pas à ce qu’il y a dans /usr/src/linux-headers-4.19.0-0.bpo.2-amd64

Si tu nous dit ce que c’est que ces pilotes, on pourra te dire comment les compiler, mais ce que tu tentes de faire avec les headers, ne cherche plus, ça ne mène à rien.