From 71fca2f42a6fcbe08ae7e8c7595e83e51c3fc428 Mon Sep 17 00:00:00 2001 From: Thorsten Leemhuis Date: Fri, 17 Aug 2018 20:10:11 +0200 Subject: vanillaify --- kernel.spec | 41 +++++++++++++++++++++++++++++++++++------ scripts/stable-update.sh | 21 +++++++++++++++++---- 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/kernel.spec b/kernel.spec index 32e7ded32..ff1334692 100644 --- a/kernel.spec +++ b/kernel.spec @@ -25,6 +25,8 @@ Summary: The Linux kernel %endif # define buildid .local +%define packager Thorsten Leemhuis https://fedoraproject.org/wiki/Kernel_Vanilla_Repositories +%define buildid .vanilla.knurd.1 # baserelease defines which build revision of this kernel version we're # building. We used to call this fedora_build, but the magical name @@ -42,7 +44,7 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be appended after the rcX and # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3" # -%global baserelease 300 +%global baserelease 350 %global fedora_build %{baserelease} # base_sublevel is the kernel version we're starting with and patching @@ -52,6 +54,8 @@ Summary: The Linux kernel ## If this is a released kernel ## %if 0%{?released_kernel} +# Is it a -stable RC? +%define stable_rc 0 # Do we have a -stable update to apply? %define stable_update 1 @@ -59,6 +63,10 @@ Summary: The Linux kernel %if 0%{?stable_update} %define stablerev %{stable_update} %define stable_base %{stable_update} +%if 0%{?stable_rc} +# stable RCs are incremental patches, so we need the previous stable patch +%define stable_base %(echo $((%{stable_update} - 1))) +%endif %endif %define rpmversion 4.%{base_sublevel}.%{stable_update} @@ -89,12 +97,12 @@ Summary: The Linux kernel # kernel PAE (only valid for i686 (PAE) and ARM (lpae)) %define with_pae %{?_without_pae: 0} %{?!_without_pae: 1} # kernel-debug -%define with_debug %{?_without_debug: 0} %{?!_without_debug: 1} +%define with_debug %{?_with_debug: 1} %{?!_with_debug: 0} # kernel-headers %define with_headers %{?_without_headers: 0} %{?!_without_headers: 1} %define with_cross_headers %{?_without_cross_headers: 0} %{?!_without_cross_headers: 1} # kernel-debuginfo -%define with_debuginfo %{?_without_debuginfo: 0} %{?!_without_debuginfo: 1} +%define with_debuginfo %{?_with_debuginfo: 1} %{?!_with_debuginfo: 0} # Want to build a the vsdo directories installed %define with_vdso_install %{?_without_vdso_install: 0} %{?!_without_vdso_install: 1} # @@ -114,7 +122,7 @@ Summary: The Linux kernel %define with_cross %{?_with_cross: 1} %{?!_with_cross: 0} # # build a release kernel on rawhide -%define with_release %{?_with_release: 1} %{?!_with_release: 0} +%define with_release %{?_without_release: 0} %{?!_without_release: 1} # verbose build, i.e. no silent rules and V=1 %define with_verbose %{?_with_verbose: 1} %{?!_with_verbose: 0} @@ -135,12 +143,17 @@ Summary: The Linux kernel %endif # Want to build a vanilla kernel build without any non-upstream patches? -%define with_vanilla %{?_with_vanilla: 1} %{?!_with_vanilla: 0} +%define with_vanilla %{?_without_vanilla: 0} %{?!_without_vanilla: 1} # pkg_release is what we'll fill in for the rpm Release: field %if 0%{?released_kernel} +%if 0%{?stable_rc} +%define stable_rctag .rc%{stable_rc} +%define pkg_release 0%{stable_rctag}.%{fedora_build}%{?buildid}%{?dist} +%else %define pkg_release %{fedora_build}%{?buildid}%{?dist} +%endif %else @@ -178,7 +191,7 @@ Summary: The Linux kernel %endif %if %{nopatches} -%define variant -vanilla +#define variant -vanilla %endif %if !%{debugbuildsenabled} @@ -474,6 +487,10 @@ Source2001: cpupower.config %define stable_patch_00 patch-4.%{base_sublevel}.%{stable_base}.xz Source5000: %{stable_patch_00} %endif +%if 0%{?stable_rc} +%define stable_patch_01 patch-3.%{base_sublevel}.%{stable_update}-rc%{stable_rc}.xz +Patch01: %{stable_patch_01} +%endif # non-released_kernel case # These are automagically defined by the rcrev and gitrev values set up @@ -1148,6 +1165,9 @@ do rm $i.tmp done %endif +%if 0%{?stable_rc} +ApplyPatch %{stable_patch_01} +%endif # only deal with configs if we are going to build for the arch %ifnarch %nobuildarches @@ -2386,6 +2406,15 @@ fi - Linux v4.16 - Disable debugging options. +* Sat Oct 20 2012 Thorsten Leemhuis - 3.7.0-0.rc1.git3.1.vanilla.mainline.knurd.1 +- add buildid ".vanilla.knurd.1" +- switch defines to build: +-- a vanilla kernel without debuging +-- no debug kernel and no debuginfo packages, to big to handle for me right now +- disable the variant macro as that adds "-vanilla" to %%name, which confuses + fedpkg and prevents installonly handling of packages in yum/dnf +- revert "Drop stable_rc macros" (8a6c714a8c) + ### # The following Emacs magic makes C-c C-e use UTC dates. # Local Variables: diff --git a/scripts/stable-update.sh b/scripts/stable-update.sh index a2ab4904a..962c3c4ec 100755 --- a/scripts/stable-update.sh +++ b/scripts/stable-update.sh @@ -13,6 +13,11 @@ # # Args: Stable version to update (e.g. 4.7.7, 4.8.1) +# update orgin +~/usr/bin/vanilla-kernel-helper.sh masterupdate +currentbranch=$(git symbolic-ref --short HEAD) +git merge --no-edit origin/${currentbranch%-user-thl-vanilla-fedora} || exit 1 + if [ $# -lt 1 ]; then echo "Need a version" exit 1 @@ -61,7 +66,10 @@ fi grep $1 sources &> /dev/null if [ ! $? -eq 0 ]; then - fedpkg upload patch-$1.xz + # thl is not an allowed uploader, skip this + # fedpkg upload patch-$1.xz + checksum=$(sha512sum patch-$1.xz) + echo "SHA512 (patch-$1.xz) = ${checksum:0:128}" >> sources # Cryptic awk: search for the previous patch level (if one exists) and # remove it from the source file @@ -77,8 +85,13 @@ awk -v STABLE=$SUBLEVEL '/%define stable_update/ \ mv kernel.spec.tmp kernel.spec # Reset the base release for use with rpmdev-bumpspec -BASERELEASE=`cat kernel.spec | grep "%global baserelease" | cut -d ' ' -f 3 | head -c 1`00 -BASERELEASE=$(($BASERELEASE-1)) +BASERELEASE=`cat kernel.spec | grep "%global baserelease" | cut -d ' ' -f 3 | head -c 1`50 +#BASERELEASE=$(($BASERELEASE-1)) BASERELEASE=$BASERELEASE perl -p -i -e 's|%global baserelease.*|%global baserelease $ENV{'BASERELEASE'}|' kernel.spec -rpmdev-bumpspec -c "Linux v$1" kernel.spec +# do not generate changelog: avoids merge conflicts that are not worth the trouble +# rpmdev-bumpspec -c "Linux v$1" kernel.spec + +git diff kernel.spec sources +sleep 1 || exit 1 +git commit -m "Linux v$1" kernel.spec sources -- cgit