#1065819 linux-source-6.6 cannot be rebuild according to debian documentation

#1065819#5
Date:
2024-03-10 10:47:17 UTC
From:
To:
As I wanted:

    1) to stay on long term kernel 6.6 branch,
    2) 6.7.x has been uploaded to unstable already,
    3) I would like to enable NTFS3, and AMD TEE

I decided I will try to recompile the kernel myself first (I have MOK keys already registered and used to manually sign some external modules).

I used the following debian documentation

https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-getting

https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-building

cd linux-source-6.6
make localmodconfig

and accepted the default values.

Then
    make clean
    make bindeb-pkg

And then it correctly builds the kernel and modules .ko file, then sign the ko and xz compress it to get foo.ko.xz. Here are extracts

  AR      drivers/gpu/built-in.a
  AR      drivers/built-in.a
  AR      built-in.a
  AR      vmlinux.a
  LD      vmlinux.o
  OBJCOPY modules.builtin.modinfo
  GEN     modules.builtin
  GEN     .vmlinux.objs
  MODPOST Module.symvers
  CC      .vmlinux.export.o
  UPD     include/generated/utsversion.h
  CC      init/version-timestamp.o
  LD      .tmp_vmlinux.btf
  BTF     .btf.vmlinux.bin.o
  LD      .tmp_vmlinux.kallsyms1
  NM      .tmp_vmlinux.kallsyms1.syms
  KSYMS   .tmp_vmlinux.kallsyms1.S
  AS      .tmp_vmlinux.kallsyms1.S
  LD      .tmp_vmlinux.kallsyms2
  NM      .tmp_vmlinux.kallsyms2.syms
  KSYMS   .tmp_vmlinux.kallsyms2.S
  AS      .tmp_vmlinux.kallsyms2.S
  LD      vmlinux
  BTFIDS  vmlinux
  NM      System.map
  SORTTAB vmlinux
  RELOCS  arch/x86/boot/compressed/vmlinux.relocs
  RSTRIP  vmlinux

...

 SIGN debian/linux-image/lib/modules/6.6.15/kernel/net/bluetooth/bluetooth.ko
  XZ debian/linux-image/lib/modules/6.6.15/kernel/net/bluetooth/bluetooth.ko.xz
  INSTALL debian/linux-image/lib/modules/6.6.15/kernel/net/bluetooth/rfcomm/rfcomm.ko
  SIGN debian/linux-image/lib/modules/6.6.15/kernel/net/bluetooth/rfcomm/rfcomm.ko
  XZ debian/linux-image/lib/modules/6.6.15/kernel/net/bluetooth/rfcomm/rfcomm.ko.xz
  INSTALL debian/linux-image/lib/modules/6.6.15/kernel/net/bluetooth/bnep/bnep.ko
  SIGN debian/linux-image/lib/modules/6.6.15/kernel/net/bluetooth/bnep/bnep.ko
  XZ debian/linux-image/lib/modules/6.6.15/kernel/net/bluetooth/bnep/bnep.ko.xz
  INSTALL debian/linux-image/lib/modules/6.6.15/kernel/net/rfkill/rfkill.ko
  SIGN    debian/linux-image/lib/modules/6.6.15/kernel/net/rfkill/rfkill.ko
  XZ debian/linux-image/lib/modules/6.6.15/kernel/net/rfkill/rfkill.ko.xz
  INSTALL debian/linux-image/lib/modules/6.6.15/kernel/virt/lib/irqbypass.ko
  SIGN debian/linux-image/lib/modules/6.6.15/kernel/virt/lib/irqbypass.ko
  XZ debian/linux-image/lib/modules/6.6.15/kernel/virt/lib/irqbypass.ko.xz
  DEPMOD  debian/linux-image/lib/modules/6.6.15
  INSTALL debian/linux-libc-dev/usr/include

But then it tries to sign again the modules using the .ko file that does not exist:

ls -l debian/linux-image/lib/modules/6.6.15/kernel/arch/x86/events/*.ko*
-rw-rw-r-- 1 valette valette 103484  9 mars  19:39 debian/linux-image/lib/modules/6.6.15/kernel/arch/x86/events/rapl.ko.xz

And fails with:

  SIGN debian/linux-image/lib/modules/6.6.15/kernel/arch/x86/events/rapl.ko
At main.c:298:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75
sign-file: debian/linux-image/lib/modules/6.6.15/kernel/arch/x86/events/rapl.ko
make[6]: *** [scripts/Makefile.modinst:137 : debian/linux-image/lib/modules/6.6.15/kernel/arch/x86/events/rapl.ko] Erreur 1
make[5]: *** [Makefile:1846 : modules_install] Erreur 2
make[4]: *** [Makefile:2061 : run-command] Erreur 2
make[3]: *** [debian/rules:17 : binary-arch] Erreur 2
dpkg-buildpackage: erreur: le sous-processus make -f debian/rules binary a retourné lâ\x80\x99état de sortie 2
make[2]: *** [scripts/Makefile.package:146 : bindeb-pkg] Erreur 2
make[1]: *** [/usr/src/linux-source-6.6/Makefile:1563 : bindeb-pkg] Erreur 2
make: *** [Makefile:246 : __sub-make] Erreur 2

#1065819#10
Date:
2024-03-10 11:25:38 UTC
From:
To:
Control: severity -1 important

Yes, the kernel included Debian package support can't handle compressed
modules in various ways.  Just disable them for now.

Bastian

#1065819#17
Date:
2024-03-10 11:31:10 UTC
From:
To:

OK. Will try.

Maybe doc should be updated until it is fixed.

It however means that you cannot get the same linux-image when you
rebuild. Plus it annoys me to revert back my own script for external
modules signature.

Thanks anyway.