On Wed, 28 Jul 2021 00:25:42 -0000
I see you got the other method working, so you really don't need this,
but I'll comment just in case someone else reads this in the far
future. :-)
"Sampson Fung" <sampsonfung(a)gmail.com> wrote:
I got "user mockbuild does not exist - using root"
$ rpm -ivh kernel-5.13.5-200.fc34.src.rpm
Updating / installing...
1:kernel-5.13.5-200.fc34 warning: user mockbuild does
not exist - using root warning: user mockbuild does not exist - using
root warning: user mockbuild does not exist - using root
Harmless.
> Edit the kernel.spec
file and uncomment the #define line and add something like 20210727 to
distinguish this kernel from repository kernel.
I find at line 107: # define .local, after un-comment it:
$ rpmbuild -bp kernel.spec
error: line 107: Unknown tag: define buildid .local
Thus I undo and continue.
It has to be
%define buildid .local
Note the % sign in front of the define, it matters.
> rpmbuild -bb kernel.spec
Exit with error:
Processing
/home/fcc/rpmbuild/BUILD/kernel-5.13.5/linux-5.13.5-200.fc34.x86_64/configs/kernel-5.13.5-s390x.config
... done Processing
/home/fcc/rpmbuild/BUILD/kernel-5.13.5/linux-5.13.5-200.fc34.x86_64/configs/kernel-5.13.5-x86_64-debug.config
... Error: Mismatches found in configuration files Found
CONFIG_CC_VERSION_TEXT="gcc (scripts/dummy-tools/gcc)" after
generation, had CONFIG_CC_VERSION_TEXT="gcc (GCC) 11.1.1 20210531
(Red Hat 11.1.1-3)" in Source tree Found CONFIG_GCC_VERSION=200000
after generation, had CONFIG_GCC_VERSION=110101 in Source tree Found
CONFIG_AS_VERSION=25000 after generation, had CONFIG_AS_VERSION=23501
in Source tree Found CONFIG_LD_VERSION=25000 after generation, had
CONFIG_LD_VERSION=23501 in Source tree error: Bad exit status from
/var/tmp/rpm-tmp.wCoe4b (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.wCoe4b (%prep)
You can try the below. It will show whether the installed gcc on your
system is the same as the config files are expecting.
What is the output of rpm -q gcc?
What is the output of grep -i cc_version
/home/fcc/rpmbuild/BUILD/kernel-5.13.5/linux-5.13.5-200.fc34.x86_64/configs/kernel-5.13.5-x86_64-debug.confiG
?
Are they different? I think that creating the
~/rpmbuild/SOURCES/kernel-local file will fix this.
You can turn off debug config in the kernel.spec file. Set the switch
to 0 as it is set below.
# kernel-debug
%define with_debug %{?_without_debug: 0} %{?!_without_debug: 0}
# kernel-debuginfo
%define with_debuginfo %{?_without_debuginfo: 0} %{?!_without_debuginfo: 0}
You might as well turn off PAE as well as you don't need it.
# kernel PAE (only valid for ARM (lpae))
%define with_pae %{?_without_pae: 0} %{?!_without_pae: 0}
You can also turn off the build of architectures that you are not
interested in. Add the last line to your spec (it won't be there).
%define nobuildarches i386 i686 %{arm}
%endif
%define nobuildarches i386 i686 ppc64 s390x %{arm} %{power64} aarch64 ppc64le
That should get you a little further, if the other method doesn't work
out. It is more user friendly than this technique, which is a lot more
manual. Probably why it was replaced.
I recommend you put your effort into getting the other method working.