spec: set CONFIG_LOCALVERSION
authorŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 4 Jan 2021 19:23:41 +0000 (20:23 +0100)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Fri, 26 Mar 2021 18:26:46 +0000 (19:26 +0100)
Set CONFIG_LOCALVERSION insetad of EXTRAVERSION in Makefile to carry
information about the platform variant.

Change-Id: I72986cb618b998983f1e9f6eccba7d6e4603248f
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
packaging/linux-rpi4.spec

index 0065596..4985a68 100644 (file)
@@ -87,11 +87,11 @@ counter events as well as various kernel internal events.
 %{?asan:/usr/bin/gcc-unforce-options}
 %{?ubsan:/usr/bin/gcc-unforce-options}
 
-# Make sure EXTRAVERSION says what we want it to say
-sed -i "s/^EXTRAVERSION.*/EXTRAVERSION = -%{variant}/" Makefile
-
 # 1-1. Set config file
 make %{config_name} %{?_smp_mflags}
+if ! grep -q "^CONFIG_LOCALVERSION=\"-%{variant}" .config; then
+    ./scripts/config --set-str CONFIG_LOCALVERSION "-%{variant}$(eval $(grep ^CONFIG_LOCALVERSION= .config); echo $CONFIG_LOCALVERSION)"
+fi
 
 # 1-2. Build Image/Image.gz
 make %{?_smp_mflags}