![](https://seccdn.libravatar.org/avatar/ed90d0132a4f59f2d3a1cf82a1b70915.jpg?s=120&d=mm&r=g)
Hi Mark, On 26.06.23 00:29, Mark Rubin via openSUSE Factory wrote:
(Yes, I seem to be spamming this list. If it's any excuse, please know that I spend 24/48/more hours trying to solve each problem on my own before asking for help here.)
I'm trying to build the current openSUSE kernel. This isn't something I want to be spending time on, but for the reasons why, see https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/X...
I've done the following: [...] Finding the magic settings to fix that wasn't easy, but no matter. Continuing:
``` $ make binrpm-pkg
From what I seem to remember, the rpm targets are not really working or supported on the openSUSE kernel (or even on openSUSE with an upstream kernel source? I don't know). But, at least for me, they are also not really necessary since the kernel relatively cleanly installs in /boot and /lib/modules/<version> subdirectory and can easily be removed manually. I'll write down what I'm doing (from memory, so it might be slightly off...) to build a test kernel for my machine cd /my/sources/linux mkdir out zcat /proc/config.gz > out/.config make oldconfig O=out make menuconfig O=out # or edit out/.config I usually change CONFIG_LOCALVERSION="-seife" so that the custom kernel is easily identified. I also usually do unset CONFIG_DEBUG_INFO, as it saves a huge amount of disk space make -j 8 O=out sudo make install O=out sudo make modules_install O=out I like to have the built objects all in a extra directory for easy cleanup, thus the "O=out" If I know that there will be many builds (e.g. bisecting a bad kernel version), then I'm often also using ccache. Before rebooting into the new kernel, I often use "sudo grub2-emu" to check if it really is properly inserted into the grub menu, but that has always worked well for me. I think you need to have the "kernel-install-tools" package installed nowadays for the "make install" to work, but I have not had to build a kernel since this was changed :-) Best regards, and good luck.
So ... the questions (for anyone who has experience building kernels and would be willing to offer help):
the kernel@lists.opensuse.org mailing list would have connected you more directly with people that can give a definitive answer to these questions :-)
- Is there any reason why the "binrpm" target doesn't work or shouldn't be used? It seems (and is documented online) to be a better alternative to `make install` because it can't break the running system (it can be done as a non-root user and the resulting RPM later installed).
- Is this a bug either in `rpmbuild` or the makefile's invocation of it?
- Is doing `make rpm-pkg` (which is advertised to make two RPMs, one binary and one source) necessary instead? I've tried, and it errors with yet more problems which I'm trying to address, but predict that once it makes the source RPM it will break on the binary (the only thing I really want) with the same failure I'm already seeing.
- Is doing `make module_install` followed by `make install` what everyone uses, and I'm going down some untested and unsupported path?
I think so, but that's just me remembering things from the past.
As always, thanks for any advice or suggestions (including, I suppose, "If you don't know how to build the kernel you shouldn't be doing it.")
I think building kernels is not that hard (and it shouldn't be), so maybe one solution to the "make <something-rpm>" not working in opensuse would be to actually patch it out and replace it with some explanatory message... -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman