Mailinglist Archive: opensuse (1264 mails)

< Previous Next >
[opensuse] Kernel compilation the openSUSE way?
I usually take the newest openSUSE kernel (from repository
Kernel_stable). But since some month I have a DVB T2 HD card, which
requires a patch (see

So I need to compile kernels myself. I have a working compilation path.
But the current path has 12 steps! It takes some time. I wonder, why it
is so complicated to configure, compile and install a Kernel under openSUSE.

Is there a better/easier/automated way to configure, compile and install
a Kernel under openSUSE?

I know this blog article. But the article uses Vanilla kernels and also
needs 6 steps. With additional patches (4 steps), third-party modules (2
steps) and cleanup (1 step) the article would also need 13 steps:

Compiling the Linux Kernel, the SUSE way

This is my Kernel configuration, compilation and installation path:

1. Update kernel-source and kernel-default from Kernel_stable repository
2. Save kernel-source: cp -a /usr/src/linux-4.x.y-...
3. Apply my patches
cd /usr/src/linux-4.x.y-my
patch -b -p1 < ~myuser/.../my-kernel-patch.patch
4. Copy standard configuration:
cd /usr/src/linux-4.x.y-my
cp -v /boot/config-4.11.4-1.gcba98ee-default .config
5. Edit .config:
remove some hardware-dependent settings
6. edit configuration interactively:
Disable CONFIG_EXPERT and CONFIG_DEBUG_KERNEL, because otherwise
"make binrpm-pkg" creates huge kernel binaries.

make oldconfig
Local version - append to kernel release (LOCALVERSION) [] (NEW) -my1
* Configure standard kernel features (expert users)
Configure standard kernel features (expert users) (EXPERT) [N/y/?]

Kernel debugging (DEBUG_KERNEL) [N/y/?] (NEW)

make menuconfig
Do some additional configuration.
7. Compile kernel
(-j4 for four processor cores, ionice and nice to reduce the load,
binrpm-pkg for RPM without source-RPM)
make clean
nice ionice -c idle make -j4 binrpm-pkg
8. Install the kernel RPM package
rpm -Uvh /usr/src/packages/RPMS/x86_64/kernel-4.x.y_my1-....x86_64.rpm
9. Install necessary symbolic links for "dkms"
cd /lib/modules/4.x.y-my1
ln -sv /usr/src/linux-4.x.y-my source
ln -sv /usr/src/linux-4.x.y-my build
10. Update third-party modules (e.g. Nvidia driver):
dkms install -m nvidia -v 375.66 -k 4.x.y-my1
11. Cleanup
cd /usr/src/linux-4.x.y-my
make clean
12. Select Grub configuration and reboot
grub2-once --list | less
grub2-once 2


To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >