Kernel for Microsoft Surface on OBS

Hello. I have a Surface Laptop 4 and want to build a patched kernel using the patches from the Linux Surface project: GitHub - linux-surface/linux-surface: Linux Kernel for Surface Devices. This is all new to me, btw

I have branched the opensuse kernel-stable:kernel-source, then patched using the surface patches. As per the Linux Surface notes, I added the patches to patches.addon.tar.bz2 and appended the following to series.conf:

patches.addon/0001-secureboot.patch
patches.addon/0002-surface3-oemb.patch
patches.addon/0003-mwifiex.patch
patches.addon/0004-ath10k.patch
patches.addon/0005-ipts.patch
patches.addon/0006-ithc.patch
patches.addon/0007-surface-sam.patch
patches.addon/0008-surface-sam-over-hid.patch
patches.addon/0009-surface-button.patch
patches.addon/0010-surface-typecover.patch
patches.addon/0011-surface-shutdown.patch
patches.addon/0012-surface-gpe.patch
patches.addon/0013-cameras.patch
patches.addon/0014-amd-gpio.patch
patches.addon/0015-rtc.patch

I also added the extra config from the surface project to config.addon.tar.gz2

I linked to the Tumbleweed x86_64 repository. All the flavours build, except for kernel-source:kernel-kvmsmall. This fails with an error:

[ 42s] RPM build errors:
[ 42s] Bad exit status from /var/tmp/rpm-tmp.r06xnm (%prep)

Can anyone help me see why this fails please?

Also, I’m linking to the stable branch, but my repo builds a later version [6.11.6-8.1] than the current opensuse one [6.11.6.2.1]. I can force install my kernel with: zypper install kernel-default-6.11.6-8.1.x86_64 but then that breaks other installs. Why is it a different version to main? Am I linking the wrong repository?

Thanks for your help

Why do you need this kernel for the special hardware? kvmsmall flavor is intended for use in virtual machines and lacks a lot of kernel options needed on real hardware.

I don’t need it, I guess. Just trying to understand why it fails.

The real problem is why it’s a newer version of the kernel

My best guess is that your patches touch kernel configuration which does not match the config you provide. Build script tries to make sure there is no accidental side effects so it effectively runs make config and compares the result with combined default and add-on configuration. If you compare build log of the original kernel and your project, in your project configuration is re-generated:

[   39s] + make syncconfig ARCH=x86 --output-sync -j12 -C .. O=/home/abuild/rpmbuild/BUILD/kernel-kvmsmall-6.11.6/linux-6.11/linux-obj
[   39s]   GEN     Makefile
[   39s]   HOSTCC  scripts/basic/fixdep
[   39s]   LEX     scripts/kconfig/lexer.lex.c
[   39s]   HOSTCC  scripts/kconfig/util.o
[   39s]   YACC    scripts/kconfig/parser.tab.[ch]
[   39s]   HOSTCC  scripts/kconfig/preprocess.o
[   39s]   HOSTCC  scripts/kconfig/conf.o
[   39s]   HOSTCC  scripts/kconfig/menu.o
[   39s]   HOSTCC  scripts/kconfig/confdata.o
[   39s]   HOSTCC  scripts/kconfig/expr.o
[   39s]   HOSTCC  scripts/kconfig/symbol.o
[   39s]   HOSTCC  scripts/kconfig/parser.tab.o
[   39s]   HOSTCC  scripts/kconfig/lexer.lex.o
[   39s]   HOSTLD  scripts/kconfig/conf
[   42s] *
[   42s] * Restart config...

I failed to parse this sentence. I understand every word, but not what these words mean together.

P.S. and this question is completely unrelated to OBS. OBS is just a messenger here.

Looks like this extra option:

[   42s] -# CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION is not set
[   42s] +# CONFIG_SURFACE_BOOK1_DGPU_SWITCH is not set

You probably need to also provide add-on for kvmsmall with this option unset.

Thanks for this. I will compare the build logs as you suggest and try to find the problem.

To try to explain my second question: my kernel-source links to Kernel-stable:kernel-source. My project builds a new version each time the kernel-stable:kernel-source is updated, so they should be the same version.

I have done zypper dup and zypper update so my installed kernel should be the latest, but when I look in Yast, my build of the kernel is ahead of that from the suse repositories:

zypper install kernel-default-6.11.6-8.1.x86_64

I want my version of the kernel to be the same as that installed from the Tumbleweed repository. Is my build linked to the wrong kernel-source?

Thanks

The auto-generated release numbers are project specific and cannot be directly compared between projects. These numbers are not even known before package is built, so there is no way linked projects can obtain them.

Ah, thank you. I did not realise that

One related question. I’m trying to append “-surface” to my kernel build but can’t get it to work. I added the following lines to the config.addon:

CONFIG_LOCALVERSION=“-surface”
CONFIG_LOCALVERSION_AUTO=n

…and also tried:

CONFIG_LOCALVERSION=“-surface”
CONFIG_LOCALVERSION_AUTO=y

…and just:

CONFIG_LOCALVERSION=“-surface”

… but no good. Can you tell me how to change the displayed version please?

Hi,

Did you read the warning about OpenSuse Tumbleweed on this page :