Bonjour,
Je viens « de tester » de compiler un noyau Linux en partant des sources de kernel.org et cela en créant de packages debian.
Style çà doit bien faire 15 ans je n’ai pas compilé
Je crois que ce n’est pas conseillé pour « un newbe de la compile » comme moi, mais c’est pour apprendre et, que surtout j’étais sur un kernel 5.x et que j’ai compilé un kernel 6.x - Tout va buguer.
J’ai suivis cette documentation debian - 8.10. Compiling a Kernel en compilant un kernel v6.x que j’ai appelé « ninja » pour Linux kernel version history - Releases 6.x.y - « Hurr durr I’ma ninja sloth »
J’ajoute ce lien « Kernel Compilation in Debian Linux » et celle-ci « Debian Linux Kernel Handbook »
Comme c’est écrit ici :
Si vous choisissez de compiler votre propre noyau, vous devez en accepter les conséquences : Debian ne peut pas garantir les mises à jour de sécurité pour votre noyau personnalisé. En conservant le noyau fourni par Debian, vous bénéficiez des mises à jour préparées par l’équipe de sécurité du projet Debian.
Préparation :
root@vps:~ # apt install build-essential fakeroot bc python bison flex libelf-dev libssl-dev libncurses-dev dwarves lz4
root@vps:~ # mkdir kernel; cd kernel
root@vps:~/kernel # wget https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/linux-6.0.9.tar.xz
root@vps:~/kernel # wget https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/linux-6.0.9.tar.sign
root@vps:~/kernel # unxz -c linux-6.0.9.tar.xz | gpg --verify linux-6.0.9.tar.sign -
root@vps:~/kernel # tar -xaf linux-6.0.9.tar.xz
root@vps:~/kernel # cp -rp linux-6.0.9 /usr/src/
root@vps:~/kernel # cd /usr/src/
root@vps:/usr/src # ln -snf linux-6.0.9/ linux
root@vps:/usr/src # cp /boot/config-$(uname -r) /usr/src/linux/.config
root@vps:/usr/src # cd linux
root@vps:/usr/src/linux # mkdir debian/certs/
root@vps:/usr/src/linux # echo "les clefs : https://salsa.debian.org/kernel-team/linux/-/blob/master/debian/certs/debian-uefi-certs.pem" >>>>>>>>>> debian/certs/debian-uefi-certs.pem
Configuration :
root@vps:/usr/src/linux # make menuconfig
Compilation :
root@vps:/usr/src/linux # make deb-pkg LOCALVERSION=-ninja KDEB_PKGVERSION=$(make kernelversion)-1
make clean
sh ./scripts/package/mkdebian
TAR linux-upstream.tar.gz
origversion=$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$//');\
mv linux-upstream.tar.gz ../linux-upstream_${origversion}.orig.tar.gz
dpkg-buildpackage -r"fakeroot -u" -a$(cat debian/arch) -i.git -us -uc
dpkg-buildpackage: info: source package linux-upstream
dpkg-buildpackage: info: source version 6.0.9-1
dpkg-buildpackage: info: source distribution bullseye
dpkg-buildpackage: info: source changed by root <root@vps.zw3b.eu>
dpkg-buildpackage: info: host architecture amd64
dpkg-source -i.git --before-build .
debian/rules clean
rm -rf debian/*tmp debian/files
make clean
dpkg-source -i.git -b .
dpkg-source: info: using source format '1.0'
dpkg-source: warning: source directory 'linux-6.0.9' is not <sourcepackage>-<upstreamversion> 'linux-upstream-6.0.9'
dpkg-source: warning: .orig directory name linux-6.0.9.orig is not <package>-<upstreamversion> (wanted linux-upstream-6.0.9.orig)
dpkg-source: info: building linux-upstream using existing linux-upstream_6.0.9.orig.tar.gz
dpkg-source: info: building linux-upstream in linux-upstream_6.0.9-1.diff.gz
dpkg-source: warning: ignoring deletion of file .scmversion
[....]
[....]
INSTALL debian/linux-libc-dev/usr/include
dpkg-deb: building package 'linux-libc-dev' in '../linux-libc-dev_6.0.9-1_amd64.deb'.
dpkg-deb: building package 'linux-image-6.0.9-ninja' in '../linux-image-6.0.9-ninja_6.0.9-1_amd64.deb'.
dpkg-genbuildinfo
dpkg-genchanges >../linux-upstream_6.0.9-1_amd64.changes
dpkg-genchanges: info: including full source code in upload
dpkg-source -i.git --after-build .
dpkg-buildpackage: info: full upload (original source is included)
root@vps:/usr/src/linux #
Qui m’a créée ces fichiers :
root@vps:~ # ls -l /usr/src/
total 248460
lrwxrwxrwx 1 root root 12 Dec 11 17:59 linux -> linux-6.0.9/
drwxrwxr-x 26 root root 4096 Dec 11 23:05 linux-6.0.9
drwxr-xr-x 6 root root 4096 Dec 11 23:13 linux-headers-6.0.9-ninja
-rw-r--r-- 1 root root 8487080 Dec 11 23:06 linux-headers-6.0.9-ninja_6.0.9-1_amd64.deb
-rw-r--r-- 1 root root 20821448 Dec 11 23:07 linux-image-6.0.9-ninja_6.0.9-1_amd64.deb
-rw-r--r-- 1 root root 1266852 Dec 11 23:06 linux-libc-dev_6.0.9-1_amd64.deb
-rw-r--r-- 1 root root 251636 Dec 11 21:39 linux-upstream_6.0.9-1.diff.gz
-rw-r--r-- 1 root root 1061 Dec 11 21:39 linux-upstream_6.0.9-1.dsc
-rw-r--r-- 1 root root 5433 Dec 11 23:07 linux-upstream_6.0.9-1_amd64.buildinfo
-rw-r--r-- 1 root root 2654 Dec 11 23:07 linux-upstream_6.0.9-1_amd64.changes
-rw-r--r-- 1 root root 223544622 Dec 11 21:37 linux-upstream_6.0.9.orig.tar.gz
Pour installer le noyau Linux :
root@vps:~ # dpkg -i linux-libc-dev_6.0.9-1_amd64.deb
root@vps:~ # dpkg -i linux-image-6.0.9-ninja_6.0.9-1_amd64.deb
root@vps:~ # dpkg - i linux-headers-6.0.9-ninja_6.0.9-1_amd64.deb
Puis redémarrer :
root@vps:~ # reboot
Pour se retrouver sur un kernel 6.0.9.
root@vps:~ # uname -a
Linux vps 6.0.9-ninja #1 SMP PREEMPT_DYNAMIC Sun Dec 11 18:34:18 UTC 2022 x86_64 GNU/Linux
Je souhaiterais savoir à quoi servent ces fichiers après avoir lu « Upstream (développement logiciel) (en) , se dit d’un projet logiciel donné qui sert de base à un ou plusieurs autres, qualifiés pour leur part de downstream (comme par exemple le noyau Linux joue le rôle d’ upstream pour les distributions GNU/Linux). »
- linux-upstream_6.0.9-1.diff.gz
- linux-upstream_6.0.9-1.dsc
- linux-upstream_6.0.9-1_amd64.buildinfo
- linux-upstream_6.0.9-1_amd64.changes
- linux-upstream_6.0.9.orig.tar.gz
Donc, j’essaie de re-compiler avec d’autres valeurs dans la « .config » mais quand je relance la compilation du noyeau çà plante.
root@vps:/usr/src/linux # make deb-pkg LOCALVERSION=-ninja KDEB_PKGVERSION=$(make kernelversion)-2
SYNC include/config/auto.conf.cmd
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/confdata.o
HOSTCC scripts/kconfig/expr.o
LEX scripts/kconfig/lexer.lex.c
YACC scripts/kconfig/parser.tab.[ch]
HOSTCC scripts/kconfig/lexer.lex.o
HOSTCC scripts/kconfig/menu.o
HOSTCC scripts/kconfig/parser.tab.o
HOSTCC scripts/kconfig/preprocess.o
HOSTCC scripts/kconfig/symbol.o
HOSTCC scripts/kconfig/util.o
HOSTLD scripts/kconfig/conf
make clean
sh ./scripts/package/mkdebian
TAR linux-upstream.tar.gz
origversion=$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$//');\
mv linux-upstream.tar.gz ../linux-upstream_${origversion}.orig.tar.gz
dpkg-buildpackage -r"fakeroot -u" -a$(cat debian/arch) -i.git -us -uc
dpkg-buildpackage: info: source package linux-upstream
dpkg-buildpackage: info: source version 6.0.9-2
dpkg-buildpackage: info: source distribution bullseye
dpkg-buildpackage: info: source changed by root <root@vps.zw3b.eu>
dpkg-buildpackage: info: host architecture amd64
dpkg-source -i.git --before-build .
debian/rules clean
rm -rf debian/*tmp debian/files
make clean
dpkg-source -i.git -b .
dpkg-source: info: using source format '1.0'
dpkg-source: warning: source directory 'linux-6.0.9' is not <sourcepackage>-<upstreamversion> 'linux-upstream-6.0.9'
dpkg-source: warning: .orig directory name linux-6.0.9.orig is not <package>-<upstreamversion> (wanted linux-upstream-6.0.9.orig)
dpkg-source: info: building linux-upstream using existing linux-upstream_6.0.9.orig.tar.gz
dpkg-source: info: building linux-upstream in linux-upstream_6.0.9-2.diff.gz
dpkg-source: error: cannot represent change to debian/linux-headers/lib/modules/6.0.9-ninja/build:
dpkg-source: error: new version is symlink to /usr/src/linux-headers-6.0.9-ninja
dpkg-source: error: old version is nonexistent
dpkg-source: error: cannot represent change to debian/linux-headers/usr/src/linux-headers-6.0.9-ninja/include/dt-bindings/input/linux-event-codes.h:
dpkg-source: error: new version is symlink to ../../uapi/linux/input-event-codes.h
dpkg-source: error: old version is nonexistent
[....]
dpkg-source: warning: ignoring deletion of file .scmversion
dpkg-source: error: cannot represent change to debian/linux-headers/usr/share/doc/linux-headers-6.0.9-ninja/changelog.Debian.gz: binary file contents changed
dpkg-source: warning: newly created empty file 'debian/linux-headers/usr/src/linux-headers-6.0.9-ninja/include/config/64BIT' will not be represented in diff
dpkg-source: warning: newly created empty file 'debian/linux-headers/usr/src/linux-headers-6.0.9-ninja/include/config/ACPI' will not be represented in diff
[....]
dpkg-source: warning: executable mode 0755 of 'debian/linux-headers/usr/src/linux-headers-6.0.9-ninja/scripts/Lindent' will not be represented in diff
dpkg-source: warning: executable mode 0755 of 'debian/linux-headers/usr/src/linux-headers-6.0.9-ninja/scripts/adjust_autoksyms.sh' will not be represented in diff
dpkg-source: warning: executable mode 0755 of 'debian/linux-headers/usr/src/linux-headers-6.0.9-ninja/scripts/as-version.sh' will not be represented in diff
[....]
dpkg-source: warning: executable mode 0755 of 'debian/linux-image/DEBIAN/prerm' will not be represented in diff
dpkg-source: error: cannot represent change to debian/linux-image/boot/vmlinuz-6.0.9-ninja: binary file contents changed
dpkg-source: error: cannot represent change to debian/linux-image/lib/modules/6.0.9-ninja/modules.alias.bin: binary file contents changed
dpkg-source: warning: newly created empty file 'debian/linux-image/lib/modules/6.0.9-ninja/modules.builtin.alias.bin' will not be represented in diff
dpkg-source: error: cannot represent change to debian/linux-image/lib/modules/6.0.9-ninja/modules.builtin.bin: binary file contents changed
dpkg-source: error: cannot represent change to debian/linux-image/lib/modules/6.0.9-ninja/modules.builtin.modinfo: binary file contents changed
dpkg-source: error: cannot represent change to debian/linux-image/lib/modules/6.0.9-ninja/modules.dep.bin: binary file contents changed
dpkg-source: error: cannot represent change to debian/linux-image/lib/modules/6.0.9-ninja/modules.symbols.bin: binary file contents changed
dpkg-source: error: cannot represent change to debian/linux-image/usr/share/doc/linux-image-6.0.9-ninja/changelog.Debian.gz: binary file contents changed
dpkg-source: error: cannot represent change to debian/linux-libc-dev/usr/share/doc/linux-libc-dev/changelog.Debian.gz: binary file contents changed
dpkg-source: warning: the diff modifies the following upstream files:
.clang-format
.cocciconfig
.config.old
.get_maintainer.ignore
.mailmap
.version
CREDITS
MAINTAINERS
Module.symvers
README
dpkg-source: info: use the '3.0 (quilt)' format to have separate and documented changes to upstream files, see dpkg-source(1)
dpkg-source: error: unrepresentable changes to source
dpkg-buildpackage: error: dpkg-source -i.git -b . subprocess returned exit status 1
make[1]: *** [scripts/Makefile.package:77: deb-pkg] Error 1
make: *** [Makefile:1558: deb-pkg] Error 2
root@vps:/usr/src/linux #
Info, warning, errror in EN
info: using source format '1.0'
warning: source directory 'linux-6.0.9' is not <sourcepackage>-<upstreamversion> 'linux-upstream-6.0.9'
warning: ".origin" directory name linux-6.0.9.orig is not <package>-<upstreamversion> (wanted linux-upstream-6.0.9.orig)
info: building linux-upstream using existing linux-upstream_6.0.9.orig.tar.gz
info: building linux-upstream in linux-upstream_6.0.9-2.diff.gz
error: cannot represent change to "debian/linux-headers/lib/modules/6.0.9-ninja/build"
error: new version is symlink to /usr/src/linux-headers-6.0.9-ninja
error: old version is nonexistent
warning: ignoring deletion of file .scmversion
error: cannot represent change to debian/linux-headers/usr/share/doc/linux-headers-6.0.9-ninja/changelog.Debian.gz: binary file contents changed
warning: newly created empty file 'debian/linux-headers/usr/src/linux-headers-6.0.9-ninja/include/config/64BIT' will not be represented in diff
warning: executable mode 0755 of 'debian/linux-headers/usr/src/linux-headers-6.0.9-ninja/scripts/adjust_autoksyms.sh' will not be represented in diff
[…]
warning: the diff modifies the following upstream files:
.clang-format
.cocciconfig
.config.old
.get_maintainer.ignore
.mailmap
.version
CREDITS
MAINTAINERS
Module.symvers
README
info: Use the '3.0 (quilt) format to have separate and documented changes in upstream files, see DPKG-Source (1)
error: unrepresentable changes to source
Info, warning, errror in FR
Info: Utilisation du format source '1.0'
AVERTISSEMENT: Le répertoire source 'linux-6.0.9' n'est pas <sourcepackage>-<upstreamversion> 'linux-upstream-6.0.9'
AVERTISSEMENT: ".origin" Nom du répertoire linux-6.0.9.orig n'est pas <package>-<upstreamversion> (recherché linux-upstream-6.0.9.orig)
Info: Building Linux-Upstream à l'aide de linux-upstream_6.0.9.orig.tar.gz existant
Info: Building Linux-Upstream dans linux-upstream_6.0.9-2.diff.gz
Erreur: Impossible de représenter le changement en "debian/linux-headers/lib/modules/6.0.9-ninja/build"
Erreur: la nouvelle version est SymLink à /usr/src/linux-headers-6.0.9-ninja
Erreur: l'ancienne version est inexistante
AVERTISSEMENT: Ignorer la suppression du fichier .scmversion
Erreur: Impossible de représenter le changement pour debian/linux-headers/usr/share/doc/linux-headers-6.0.9-ninja/changelog.Debian.gz: le contenu du fichier binaire modifié
AVERTISSEMENT: Fichier vide nouvellement créé 'debian/linux-headers/usr/src/linux-headers-6.0.9-ninja/include/config/64BIT' ne sera pas représenté dans Diff
AVERTISSEMENT: Mode exécutable 0755 de '/linux-headers/usr/src/linux-headers-6.0.9-ninja/scripts/adjust_autoksyms.sh' ne sera pas représenté dans Difff
[.....]
AVERTISSEMENT: le Diff modifie les fichiers en amont suivants:
.clang-format
.cocciconfig
.config.old
.get_maintainer.ignore
.mailmap
.version
CREDITS
MAINTAINERS
Module.symvers
README
Info: Utilisez le format '3.0 (Quilt) pour avoir des modifications séparées et documentées dans les fichiers en amont, voir DPKG-source (1)
Erreur: modifications non représentables de la source
Note de Moi-même 19h25 :
À la place de «
$(make kernelversion)-1
» → → «$(make kernelversion)-2
»
il aurait été préférable que je mette «$(make kernelversion)-0.1
» → → «$(make kernelversion)-0.2
» etc, n’est-ce pas ?
Si vous avez des informations ? Qui peut m’aider ?
Merci.
Romain