Score:0

Problem : Custom linux kernel and crypto

cn flag

I followed this topic to build the new kernel 5.15 on my laptop dell with Ubuntu 20.04.3 and its kernel 5.14.0-1008-oem. Unfortunately, I have some difficulties to build my new kernel because of my encrypted ssd. I am not used to work with this concept when I build a kernel so maybe I did a mistake in the .config.

It's my work computer so I need to keep my Ubuntu with this encryption. But I need to build this kernel to modify the perf linux module too.

Some information about the encrypted method :

$ sudo dmsetup status
nvme0n1p4_crypt: 0 980125696 crypt

$ sudo cryptsetup status /dev/mapper/nvme0n1p4_crypt
/dev/mapper/nvme0n1p4_crypt is active and is in use.
  type:    LUKS1
  cipher:  aes-xts-plain64
  keysize: 512 bits
  key location: dm-crypt
  device:  /dev/nvme0n1p4
  sector size:  512
  offset:  4096 sectors
  size:    980125696 sectors
  mode:    read/write
  flags:   discards

I followed the topic but instead of using :

$ make menuconfig

I used :

$ make olddefconfig
$ make oldconfig
+ modified these lines in the .config : 
CONFIG_MODULE_SIG_KEY=""
CONFIG_SYSTEM_TRUSTED_KEYS=""
CONFIG_SYSTEM_BLACKLIST_HASH_LIST=""
CONFIG_SYSTEM_REVOCATION_KEYS=""
If I don't do that, It doesn't work at the beginning with x509 certificate not found and not loaded.

The end of my make after 1 hour :

  LD [M]  sound/x86/snd-hdmi-lpe-audio.ko
  LD [M]  sound/xen/snd_xen_front.ko
make KERNELRELEASE=5.15.0 ARCH=x86  KBUILD_BUILD_VERSION=1 -f ./Makefile intdeb-pkg
sh ./scripts/package/builddeb
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support
  INSTALL debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/aegis128-aesni.ko
  INSTALL debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/aesni-intel.ko
  INSTALL debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/blake2s-x86_64.ko
  INSTALL debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/blowfish-x86_64.ko
  INSTALL debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko
  INSTALL debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/camellia-aesni-avx2.ko
  INSTALL debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/camellia-x86_64.ko
  INSTALL debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/cast5-avx-x86_64.ko
  SIGN    debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/aegis128-aesni.ko
  SIGN    debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/blowfish-x86_64.ko
  SIGN    debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/blake2s-x86_64.ko
  SIGN    debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko
  SIGN    debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/camellia-aesni-avx2.ko
  SIGN    debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/cast5-avx-x86_64.ko
  SIGN    debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/camellia-x86_64.ko
  SIGN    debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/aesni-intel.ko
At main.c:160:
At main.c:160:
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76
At main.c:160:
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76
At main.c:160:
At main.c:160:
sign-file: - SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76
At main.c:160:
sign-file: - SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
At main.c:160:
: No such file or directory
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
sign-file: - SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
: No such file or directory
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76
: No such file or directory
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76
sign-file: - SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76
sign-file: sign-file: sign-file: : No such file or directory
sign-file: : No such file or directory
: No such file or directory
: No such file or directory
: No such file or directory
make[6]: *** [scripts/Makefile.modinst:83 : debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/cast5-avx-x86_64.ko] Erreur 1
make[6]: *** Suppression du fichier « debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/cast5-avx-x86_64.ko »
make[6]: *** Attente des tâches non terminées....
make[6]: *** [scripts/Makefile.modinst:83 : debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/aegis128-aesni.ko] Erreur 1
make[6]: *** Suppression du fichier « debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/aegis128-aesni.ko »
make[6]: *** [scripts/Makefile.modinst:83 : debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/blowfish-x86_64.ko] Erreur 1
make[6]: *** Suppression du fichier « debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/blowfish-x86_64.ko »
make[6]: *** [scripts/Makefile.modinst:83 : debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/blake2s-x86_64.ko] Erreur 1
make[6]: *** Suppression du fichier « debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/blake2s-x86_64.ko »
make[6]: *** [scripts/Makefile.modinst:83 : debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko] Erreur 1
make[6]: *** Suppression du fichier « debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko »
make[6]: *** [scripts/Makefile.modinst:83 : debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/camellia-aesni-avx2.ko] Erreur 1
make[6]: *** Suppression du fichier « debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/camellia-aesni-avx2.ko »
make[6]: *** [scripts/Makefile.modinst:83 : debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/camellia-x86_64.ko] Erreur 1
make[6]: *** Suppression du fichier « debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/camellia-x86_64.ko »
make[6]: *** [scripts/Makefile.modinst:83 : debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/aesni-intel.ko] Erreur 1
make[6]: *** Suppression du fichier « debian/linux-image/lib/modules/5.15.0/kernel/arch/x86/crypto/aesni-intel.ko »
make[5]: *** [Makefile:1794 : modules_install] Erreur 2
make[4]: *** [scripts/Makefile.package:87 : intdeb-pkg] Erreur 2
make[3]: *** [Makefile:1576 : intdeb-pkg] Erreur 2
make[2]: *** [debian/rules:13 : binary-arch] Erreur 2
dpkg-buildpackage: erreur: debian/rules binary subprocess returned exit status 2
make[1]: *** [scripts/Makefile.package:77 : deb-pkg] Erreur 2
make: *** [Makefile:1576 : deb-pkg] Erreur 2

How to fix it ?

Nmath avatar
ng flag
If this is your work computer, why are you using an untested kernel?
Matthmatth03 avatar
cn flag
Because I'm a Phd student and because I need to do some tests. It's a stable version so it's fine I think. I need to have the last version of perf.
Nmath avatar
ng flag
"stable" in this context does not mean what you think it means. This is an [XY Problem](https://meta.stackexchange.com/a/66378)
Matthmatth03 avatar
cn flag
So you think the only problem is to use kernel 5.15 ? Yes I think I can understand the "stable" term. Wikipedia definition : "Also called production release, the stable release is the last release candidate (RC) which has passed all verifications / tests. The remaining bugs are considered as acceptable. This release goes to production. Some domains (for example, Linux distributions), have two types of stable releases: normal, or stable releases and long-term support (LTS) releases which are maintained for a longer period of time. "
Nmath avatar
ng flag
The "stable" kernel on kernel.org is not "stable" on Ubuntu. Your system is a lot more than a kernel. Ubuntu publishes it's own kernel that is modified and tested to work on Ubuntu. The "stable" release on Ubuntu is the LTS release and the most recent LTS, 20.04, is on kernel 5.4. There is an option to use a "HWE" kernel on 20.04 which is currently kernel 5.14- and the HWE kernel is considered less stable than the GE kernel. HWE is intended to provide support for newer hardware that might not be supported on GE. 5.15 is not even supported on 20.04, and is definitely not "stable"
Nmath avatar
ng flag
You can read about "mainline" kernels on the [Ubuntu Wiki](https://wiki.ubuntu.com/Kernel/MainlineBuilds). These kernels are advertised as **for testing only** and are likely to contain bugs. Note that even these kernels have undergone more testing on Ubuntu than the kernels on kernel.org. The reason this is probably an XY problem is because you believe you need an untested/unsupported kernel, when there is probably a better option to solve your problem, but instead of asking about that problem, you are troubleshooting a kernel that's not expected to work bug-free on your system.
Nmath avatar
ng flag
It would probably be easier to figure out what is needed to run your particular application or hardware rather than try to troubleshoot what might be wrong with the custom kernel that you are trying to build.
Matthmatth03 avatar
cn flag
Ok it's fine. I succeeded to build perf tool without using this kernel. I though it couldn't be possible to do that with a different kernel so my problem is resolved. Ok I understood you wanted to explain me. I will save time. Thank you. But by curiosity, if you have a method or a topic to show me how build a custom kernel properly without cheating with security keys, I could appreciate that.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.