Fixed building of the RPM with the sources

It needs a valid .config file for the kernel, so use the config for
nrj-desktop for that.
This commit is contained in:
Evgenii Shatokhin 2016-07-22 13:50:32 +03:00
parent 7427d5561d
commit f30b4e83b7

View file

@ -646,16 +646,15 @@ sed -i 's/# CONFIG_DEBUG_INFO is not set/CONFIG_DEBUG_INFO=y\nCONFIG_DEBUG_INFO_
./kernel-%{arch_suffix}.config ./kernel-%{arch_suffix}.config
%endif %endif
FLAVOURS="" # We may not want to build nrj-desktop flavour in some cases but its config
# is nice to have. It is used when preparing the RPM with the sources,
# for example.
FLAVOURS="nrj-desktop"
cp %{SOURCE111} .
%if %{build_nrj_laptop} %if %{build_nrj_laptop}
cp %{SOURCE112} . cp %{SOURCE112} .
FLAVOURS="nrj-laptop ${FLAVOURS}" FLAVOURS="${FLAVOURS} nrj-laptop"
%endif
%if %{build_nrj_desktop}
cp %{SOURCE111} .
FLAVOURS="nrj-desktop ${FLAVOURS}"
%endif %endif
CONFIG_DIR=arch/x86/configs CONFIG_DIR=arch/x86/configs
@ -696,29 +695,19 @@ find . -name '.get_maintainer.ignore' | %kxargs rm -f
PrepareKernel() { PrepareKernel() {
name=$1 name=$1
extension=$2 extension=$2
%ifarch %{ix86} x86_64
config_dir=arch/x86/configs config_dir=arch/x86/configs
%endif
%ifarch %arm
config_dir=arch/arm/configs
%endif
%ifarch aarc64
config_dir=arch/arm64/configs
%endif
echo "Make config for kernel $extension" echo "Make config for kernel $extension"
%smake -s mrproper %smake -s mrproper
if [ -z "$name" ]; then if [ -z "$name" ]; then
cp ${config_dir}/%{arch_suffix}_defconfig-desktop .config cp ${config_dir}/%{arch_suffix}_defconfig-nrj-desktop .config
else else
cp ${config_dir}/%{arch_suffix}_defconfig-$name .config cp ${config_dir}/%{arch_suffix}_defconfig-$name .config
fi fi
# make sure EXTRAVERSION says what we want it to say # make sure EXTRAVERSION says what we want it to say
LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -$extension/" Makefile LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -$extension/" Makefile
%smake oldconfig
} }
BuildKernel() { BuildKernel() {
@ -1122,7 +1111,7 @@ chmod +x tools/power/cpupower/utils/version-gen.sh
# We don't make to repeat the depend code at the install phase # We don't make to repeat the depend code at the install phase
%if %build_source %if %build_source
PrepareKernel "" %{buildrpmrel}custom PrepareKernel "" %{buildrpmrel}-custom
%smake -s mrproper %smake -s mrproper
%endif %endif