Error building TW kernel locally
Hey, I'm trying to build the Tumbleweed kernel 6.2.12 on my machine running the same version to test some patches. I had built kernels like this in the past on TW but now I'm not having much luck. I've installed kernel-source-6.2.12-1.1 package from the repo, copied over /usr/src/linux-6.2.12-1 to my home dir, ran `make oldconfig` there, changed CONFIG_LOCALVERSION to "-1-test" in .config and then `make -j 12 binrpm-pkg`. I didn't apply any patches yet, just want to get the base kernel working. The build ends with errors: make[2]: *** [Makefile:2036: .] Error 2 make[1]: *** [scripts/Makefile.package:79: binrpm-pkg] Error 2 make: *** [Makefile:1680: binrpm-pkg] Error 2 There's also some errors about certs in the middle: make[4]: *** No rule to make target '.kernel_signing_key.pem', needed by 'certs/signing_key.x509'. Stop. make[4]: *** Waiting for unfinished jobs.... HOSTCC certs/extract-cert make[3]: *** [scripts/Makefile.build:505: certs] Error 2 make[3]: *** Waiting for unfinished jobs.... The whole output is here https://pastebin.com/vhxM5swj I'm not really sure is it because of the certs or something else. Anybody has any ideas? David
On 4/26/23 12:00, DB wrote:
Hey,
I'm trying to build the Tumbleweed kernel 6.2.12 on my machine running the same version to test some patches. I had built kernels like this in the past on TW but now I'm not having much luck.
I've installed kernel-source-6.2.12-1.1 package from the repo, copied over /usr/src/linux-6.2.12-1 to my home dir, ran `make oldconfig` there, changed CONFIG_LOCALVERSION to "-1-test" in .config and then `make -j 12 binrpm-pkg`. I didn't apply any patches yet, just want to get the base kernel working.
The build ends with errors: make[2]: *** [Makefile:2036: .] Error 2 make[1]: *** [scripts/Makefile.package:79: binrpm-pkg] Error 2 make: *** [Makefile:1680: binrpm-pkg] Error 2
There's also some errors about certs in the middle: make[4]: *** No rule to make target '.kernel_signing_key.pem', needed by 'certs/signing_key.x509'. Stop. make[4]: *** Waiting for unfinished jobs.... HOSTCC certs/extract-cert make[3]: *** [scripts/Makefile.build:505: certs] Error 2 make[3]: *** Waiting for unfinished jobs....
The whole output is here https://pastebin.com/vhxM5swj
I'm not really sure is it because of the certs or something else. Anybody has any ideas?
David, Yes, that certificate is not distributed. Edit .config and change CONFIG_MODULE_SIG_KEY=".kernel_signing_key.pem" to CONFIG_MODULE_SIG_KEY="certs/signing_key.pem" That key is part of the kernel source. If you want to do a 'sudo make modules_install install' after the build, you will need the kernel-install-tools package installed. Larry
CONFIG_MODULE_SIG_KEY="certs/signing_key.pem" helped, the kernel was built but it failed then on the RPM building: --- depmod: ERROR: could not open directory /home/db/rpmbuild/BUILDROOT/kernel-6.2.12_1_test-1.x86_64/lib/modules/6.2.12-1-test: No such file or directory depmod: FATAL: could not search modules: No such file or directory make[2]: *** [Makefile:1966: modules_install] Error 1 error: Bad exit status from /var/tmp/rpm-tmp.pOURt0 (%install) RPM build warnings: line 23: It's not recommended to have unversioned Obsoletes: Obsoletes: kernel-headers RPM build errors: Bad exit status from /var/tmp/rpm-tmp.pOURt0 (%install) make[1]: *** [scripts/Makefile.package:81: binrpm-pkg] Error 1 make: *** [Makefile:1680: binrpm-pkg] Error 2 --- depmod looks for modules in lib/modules/6.2.12-1-test but it seems they were installed in usr/lib/modules/6.2.12-1-test: --- INSTALL /home/db/rpmbuild/BUILDROOT/kernel-6.2.12_1_test-1.x86_64/usr/lib/modules/6.2.12-1-test/kernel/net/hsr/hsr.ko INSTALL /home/db/rpmbuild/BUILDROOT/kernel-6.2.12_1_test-1.x86_64/usr/lib/modules/6.2.12-1-test/kernel/net/qrtr/qrtr.ko INSTALL /home/db/rpmbuild/BUILDROOT/kernel-6.2.12_1_test-1.x86_64/usr/lib/modules/6.2.12-1-test/kernel/net/qrtr/qrtr-smd.ko --- I changed MODLIB in Makefile from $(INSTALL_MOD_PATH)/usr/lib/modules/$(KERNELRELEASE) to $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) and make binrpm-pkg seems to have completed successfully. The source also contains a file named Makefilee that has the "correct" MODLIB value. Is this perhaps some unfinished work since the /usr merge?
On 4/26/23 15:52, David B wrote:
CONFIG_MODULE_SIG_KEY="certs/signing_key.pem" helped, the kernel was built but it failed then on the RPM building: --- depmod: ERROR: could not open directory /home/db/rpmbuild/BUILDROOT/kernel-6.2.12_1_test-1.x86_64/lib/modules/6.2.12-1-test: No such file or directory depmod: FATAL: could not search modules: No such file or directory make[2]: *** [Makefile:1966: modules_install] Error 1 error: Bad exit status from /var/tmp/rpm-tmp.pOURt0 (%install)
RPM build warnings: line 23: It's not recommended to have unversioned Obsoletes: Obsoletes: kernel-headers
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.pOURt0 (%install) make[1]: *** [scripts/Makefile.package:81: binrpm-pkg] Error 1 make: *** [Makefile:1680: binrpm-pkg] Error 2 ---
depmod looks for modules in lib/modules/6.2.12-1-test but it seems they were installed in usr/lib/modules/6.2.12-1-test: --- INSTALL /home/db/rpmbuild/BUILDROOT/kernel-6.2.12_1_test-1.x86_64/usr/lib/modules/6.2.12-1-test/kernel/net/hsr/hsr.ko INSTALL /home/db/rpmbuild/BUILDROOT/kernel-6.2.12_1_test-1.x86_64/usr/lib/modules/6.2.12-1-test/kernel/net/qrtr/qrtr.ko INSTALL /home/db/rpmbuild/BUILDROOT/kernel-6.2.12_1_test-1.x86_64/usr/lib/modules/6.2.12-1-test/kernel/net/qrtr/qrtr-smd.ko ---
I changed MODLIB in Makefile from $(INSTALL_MOD_PATH)/usr/lib/modules/$(KERNELRELEASE) to $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) and make binrpm-pkg seems to have completed successfully.
The source also contains a file named Makefilee that has the "correct" MODLIB value. Is this perhaps some unfinished work since the /usr merge?
For my own kernel, I never build an RPM, nor a DEB file on Debian. When the original make ends, do a 'sudo make modules_install install' and reboot into your new kernel. You will need the package I mentioned earlier. Larry
I preferred RPM because of the "cleaner" install/uninstall through Zypper. Do you think I should create a bug report on BugZilla for this? RPM targets used to work in the past without problems. David ------- Original Message ------- On Thursday, April 27th, 2023 at 00:04, Larry Finger <Larry.Finger@lwfinger.net> wrote:
On 4/26/23 15:52, David B wrote:
CONFIG_MODULE_SIG_KEY="certs/signing_key.pem" helped, the kernel was built but it failed then on the RPM building: --- depmod: ERROR: could not open directory /home/db/rpmbuild/BUILDROOT/kernel-6.2.12_1_test-1.x86_64/lib/modules/6.2.12-1-test: No such file or directory depmod: FATAL: could not search modules: No such file or directory make[2]: *** [Makefile:1966: modules_install] Error 1 error: Bad exit status from /var/tmp/rpm-tmp.pOURt0 (%install)
RPM build warnings: line 23: It's not recommended to have unversioned Obsoletes: Obsoletes: kernel-headers
RPM build errors: Bad exit status from /var/tmp/rpm-tmp.pOURt0 (%install) make[1]: *** [scripts/Makefile.package:81: binrpm-pkg] Error 1 make: *** [Makefile:1680: binrpm-pkg] Error 2 ---
depmod looks for modules in lib/modules/6.2.12-1-test but it seems they were installed in usr/lib/modules/6.2.12-1-test: --- INSTALL /home/db/rpmbuild/BUILDROOT/kernel-6.2.12_1_test-1.x86_64/usr/lib/modules/6.2.12-1-test/kernel/net/hsr/hsr.ko INSTALL /home/db/rpmbuild/BUILDROOT/kernel-6.2.12_1_test-1.x86_64/usr/lib/modules/6.2.12-1-test/kernel/net/qrtr/qrtr.ko INSTALL /home/db/rpmbuild/BUILDROOT/kernel-6.2.12_1_test-1.x86_64/usr/lib/modules/6.2.12-1-test/kernel/net/qrtr/qrtr-smd.ko ---
I changed MODLIB in Makefile from $(INSTALL_MOD_PATH)/usr/lib/modules/$(KERNELRELEASE) to $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) and make binrpm-pkg seems to have completed successfully.
The source also contains a file named Makefilee that has the "correct" MODLIB value. Is this perhaps some unfinished work since the /usr merge?
For my own kernel, I never build an RPM, nor a DEB file on Debian. When the original make ends, do a 'sudo make modules_install install' and reboot into your new kernel. You will need the package I mentioned earlier.
Larry
On 4/26/23 16:14, DB wrote:
I preferred RPM because of the "cleaner" install/uninstall through Zypper.
Do you think I should create a bug report on BugZilla for this? RPM targets used to work in the past without problems.
I have a small script that cleans kernel parts out of /boot and /lib/modules/. As easy as zypper. If something that worked now fails, a Bugzilla item is warranted. Larry
Thanks for the help. Will create a bug report later. David ------- Original Message ------- On Thursday, April 27th, 2023 at 01:24, Larry Finger <Larry.Finger@lwfinger.net> wrote:
On 4/26/23 16:14, DB wrote:
I preferred RPM because of the "cleaner" install/uninstall through Zypper.
Do you think I should create a bug report on BugZilla for this? RPM targets used to work in the past without problems.
I have a small script that cleans kernel parts out of /boot and /lib/modules/. As easy as zypper.
If something that worked now fails, a Bugzilla item is warranted.
Larry
On Wed, Apr 26, 2023 at 09:14:16PM +0000, DB wrote:
I preferred RPM because of the "cleaner" install/uninstall through Zypper.
If you want to build a rpm package, the preferred way is to checkout the kernel-source repository (https://github.com/SUSE/kernel-source, branch stable for tumbleweed kernel), add your patch(es), export the OBS style directory with scripts/tar-up.sh and build with "osc build". Michal
On 27. 04. 23, 13:40, Michal Kubecek wrote:
On Wed, Apr 26, 2023 at 09:14:16PM +0000, DB wrote:
I preferred RPM because of the "cleaner" install/uninstall through Zypper.
If you want to build a rpm package, the preferred way is to checkout the kernel-source repository (https://github.com/SUSE/kernel-source, branch stable for tumbleweed kernel), add your patch(es), export the OBS style directory with scripts/tar-up.sh and build with "osc build".
Or checkout the uploaded kernel from OBS Kernel:* directly and update (e.g. updating patches.addon.tar.bz2) & "osc build" locally. Or link it to your home project and update patches.addon.tar.bz2 and let OBS build it for you. Note that make rpm is NOT supported and such a bug will be closed as INVALID. thanks, -- js suse labs
Thanks for clearing that up, will try out OBS/osc. David ------- Original Message ------- On Friday, April 28th, 2023 at 09:00, Jiri Slaby <jslaby@suse.cz> wrote:
On 27. 04. 23, 13:40, Michal Kubecek wrote:
On Wed, Apr 26, 2023 at 09:14:16PM +0000, DB wrote:
I preferred RPM because of the "cleaner" install/uninstall through Zypper.
If you want to build a rpm package, the preferred way is to checkout the kernel-source repository (https://github.com/SUSE/kernel-source, branch stable for tumbleweed kernel), add your patch(es), export the OBS style directory with scripts/tar-up.sh and build with "osc build".
Or checkout the uploaded kernel from OBS Kernel:* directly and update (e.g. updating patches.addon.tar.bz2) & "osc build" locally.
Or link it to your home project and update patches.addon.tar.bz2 and let OBS build it for you.
Note that make rpm is NOT supported and such a bug will be closed as INVALID.
thanks, -- js suse labs
On 4/26/23 12:00, DB wrote:
Hey,
There's also some errors about certs in the middle: make[4]: *** No rule to make target '.kernel_signing_key.pem', needed by 'certs/signing_key.x509'. Stop. make[4]: *** Waiting for unfinished jobs.... HOSTCC certs/extract-cert make[3]: *** [scripts/Makefile.build:505: certs] Error 2 make[3]: *** Waiting for unfinished jobs....
The whole output is here https://pastebin.com/vhxM5swj
I'm not really sure is it because of the certs or something else. Anybody has any ideas?
I went through this exercise only just recently, albeit on a Raspberry Pi - there was a kernel option that disabled this module signing stuff. Alternatively, there was a way to generate a dummy certificate. -- Per Jessen, Zürich (16.4°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland.
Hello, On Wed, Apr 26, 2023 at 01:07:34PM -0500, Larry Finger wrote:
On 4/26/23 12:00, DB wrote:
Hey,
I'm trying to build the Tumbleweed kernel 6.2.12 on my machine running the same version to test some patches. I had built kernels like this in the past on TW but now I'm not having much luck.
I've installed kernel-source-6.2.12-1.1 package from the repo, copied over /usr/src/linux-6.2.12-1 to my home dir, ran `make oldconfig` there, changed CONFIG_LOCALVERSION to "-1-test" in .config and then `make -j 12 binrpm-pkg`. I didn't apply any patches yet, just want to get the base kernel working.
The build ends with errors: make[2]: *** [Makefile:2036: .] Error 2 make[1]: *** [scripts/Makefile.package:79: binrpm-pkg] Error 2 make: *** [Makefile:1680: binrpm-pkg] Error 2
There's also some errors about certs in the middle: make[4]: *** No rule to make target '.kernel_signing_key.pem', needed by 'certs/signing_key.x509'. Stop. make[4]: *** Waiting for unfinished jobs.... HOSTCC certs/extract-cert make[3]: *** [scripts/Makefile.build:505: certs] Error 2 make[3]: *** Waiting for unfinished jobs....
The whole output is here https://pastebin.com/vhxM5swj
I'm not really sure is it because of the certs or something else. Anybody has any ideas?
David,
Yes, that certificate is not distributed. Edit .config and change CONFIG_MODULE_SIG_KEY=".kernel_signing_key.pem" to CONFIG_MODULE_SIG_KEY="certs/signing_key.pem" That key is part of the kernel source.
It's not part of the kernel source. It's dynamically generated. And recently it is also removed on make clean which makes it unsuitable for the default used in the kernel package. If you built the kernel package with rpmbuild it would generate a certificate for you but there is no automation in place when you are building the kernel by hand.
If you want to do a 'sudo make modules_install install' after the build, you will need the kernel-install-tools package installed.
Perhaps it could also include a tool for generating a certificate if somebody sent a PR. Thanks Michal
participants (7)
-
David B
-
DB
-
Jiri Slaby
-
Larry Finger
-
Michal Kubecek
-
Michal Suchánek
-
Per Jessen