From 54ee067858df136ed137ad3013e2334f4ec6afa2 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Sat, 25 May 2019 16:12:23 -0700 Subject: Updated to 5.0.18.a Reorganized patches --- PKGBUILD | 40 ++++++++++++++++++--------------- bdver2-fix-for-graysky.patch | 11 ---------- ck_modify-for-hardened.patch | 44 +++++++++++++++++++++++++++++++++++++ ck_remove-excess-extraversion.patch | 18 +++++++++++++++ config.x86_64 | 2 +- graysky_bdver2-hotfix.patch | 11 ++++++++++ modify-ck-for-hardened.patch | 44 ------------------------------------- remove-excess-ck-extraversion.patch | 24 -------------------- 8 files changed, 96 insertions(+), 98 deletions(-) delete mode 100644 bdver2-fix-for-graysky.patch create mode 100644 ck_modify-for-hardened.patch create mode 100644 ck_remove-excess-extraversion.patch create mode 100644 graysky_bdver2-hotfix.patch delete mode 100644 modify-ck-for-hardened.patch delete mode 100644 remove-excess-ck-extraversion.patch diff --git a/PKGBUILD b/PKGBUILD index 63e1b55..483877b 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -7,7 +7,8 @@ # # I maintain this because: # Parabola version patch script does not apply consistently -# Parabola version lacks ath9k, bdver2, greysky2, and raid6 patches +# Parabola version lacks graysky gcc patch with bdver2 fix +# Parabola version lacks ath9k regdom and raid6 algo patches # Parabola version lacks ck patches # Parabola version allows SEED, SM3, SM4, and Streebog # Parabola version is 300 Hz @@ -17,7 +18,7 @@ pkgbase=linux-libre-hardened-ck _majver=5.0 -_minver=17 +_minver=18 if [ "$_minver" == "0" ]; then _pkgver=${_majver} else @@ -27,7 +28,7 @@ _gnumajver=${_majver}-gnu _gnupkgver=${_pkgver}-gnu _hardenedver=a _ckpatchversion=1 -_ckpatch="patch-5.0-ck${_ckpatchversion}" +_ckpatch="patch-${_majver}-ck${_ckpatchversion}" _gcc_more_v='20180509' _srcname=linux-${_majver} pkgver=${_pkgver}.${_hardenedver} @@ -43,11 +44,11 @@ source=( https://linux-libre.fsfla.org/pub/linux-libre/releases/${_gnumajver}/linux-libre-${_gnumajver}.tar.xz{,.sign} https://linux-libre.fsfla.org/pub/linux-libre/releases/${_gnupkgver}/patch-${_gnumajver}-${_gnupkgver}.xz{,.sign} https://github.com/anthraxx/linux-hardened/releases/download/${pkgver}/linux-hardened-${pkgver}.patch{,.sig} - remove-excess-ck-extraversion.patch - modify-ck-for-hardened.patch + ck_remove-excess-extraversion.patch + ck_modify-for-hardened.patch http://ck.kolivas.org/patches/5.0/${_majver}/${_majver}-ck${_ckpatchversion}/${_ckpatch}.xz + graysky_bdver2-hotfix.patch enable_additional_cpu_optimizations-$_gcc_more_v.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/$_gcc_more_v.tar.gz - bdver2-fix-for-graysky.patch ath9k-regdom-hack.patch raid6-default-algo.patch config.x86_64 # the main kernel config files @@ -57,18 +58,18 @@ source=( ) sha256sums=('7df5025d1960520bfea158054130467770eca379999d5ac48175ed5ee804faa1' 'SKIP' - '1d4806638f4328c19eaa21d38f53e42e1791022b4c163db66f2e758ba783688f' + '02d0624c4cf96100be7ac229cf3379435d6b0ca2d6258671f22ea64d0e9a4436' 'SKIP' - '12a6c606905b4b425fc1e883e67cf5a0f28730fa4ae72637740ac98176b8aae6' + 'e9c0b0d389c166ea6f2c0e5d526d294a5fa39ddc04a6733c2aa2fd5c60962269' 'SKIP' - '2a551169f8cbb424900372fe698ae9003fbcad3614a46ca3f56b103f9c1ea763' + 'a2db6672b2d35f3006c7151e8fa90f5187dcdac9fcc46e88e78d45c7d8226d1f' 'b6defd1ef672b73631ecfa79fc204d6219175f333b53d86af668c1e1a9b6288e' '661f64bbd8bf49afcc7c760c4148b2e2108511a1eadcae917cfe6056a83d8476' + '229e063a578db0a278108f37b24da20c2a2a18d825e98a67e426cb0f4b492e4a' '226e30068ea0fecdb22f337391385701996bfbdba37cdcf0f1dbf55f1080542d' - 'd35338c92d0dbf27ffedaf100bd852dd13fd9b5d49b12a10b91194a2ae654447' 'e7ebf050c22bcec0028c0b3c79fd6d3913b0370ecc6a23dfe78ce475630cf503' '0f81d6e4158b7beeb0eb514f1b9401f7e23699cb0f7b0d513e25dae1815daaeb' - 'f07ed5494946466a08c2a9bef690327e528cd61e1996edd851939d98ca8b5ef5' + 'c2447221433a6adb401475dad0fec82f980ac7c126098d780f29a83d98df4a8e' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65') @@ -96,23 +97,26 @@ prepare() { msg2 "Applying hardened patch" patch -Np1 < ../linux-hardened-${pkgver}.patch + # ck hotfixes msg2 "Applying ck patch hotfixes" - patch -p1 -i ../remove-excess-ck-extraversion.patch "$srcdir/${_ckpatch}" - patch -p1 -i ../modify-ck-for-hardened.patch "$srcdir/${_ckpatch}" + patch -p1 -i ../ck_remove-excess-extraversion.patch "$srcdir/${_ckpatch}" + patch -p1 -i ../ck_modify-for-hardened.patch "$srcdir/${_ckpatch}" sed -i '/-CFLAGS/ s/$/ \$(LIBELF_FLAGS)/' "$srcdir/${_ckpatch}" # ck patch msg2 "Applying ck patch" patch -F 3 -Np1 -i ../${_ckpatch} - # graysky2 gcc patch - msg2 "Applying graysky2 cpu patch" + + # graysky gcc hotfixes + msg2 "Applying graysky gcc patch hotfixes" + patch -p1 -i ../graysky_bdver2-hotfix.patch "$srcdir/kernel_gcc_patch-${_gcc_more_v}/enable_additional_cpu_optimizations_for_gcc_v8.1+_kernel_v4.13+.patch" + + # graysky gcc patch + msg2 "Applying graysky cpu patch" patch -p1 -i ../kernel_gcc_patch-${_gcc_more_v}/enable_additional_cpu_optimizations_for_gcc_v8.1+_kernel_v4.13+.patch - # Fix stack warnings and ldconfig segfaults on bdver2 with graysky2 gcc patch - msg2 "Applying bdver2 fix for graysky2 cpu patch" - patch -p1 -i ../bdver2-fix-for-graysky.patch # Ignore ath9k eeprom patch msg2 "Applying ath9k patch" diff --git a/bdver2-fix-for-graysky.patch b/bdver2-fix-for-graysky.patch deleted file mode 100644 index b7e5402..0000000 --- a/bdver2-fix-for-graysky.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/x86/Makefile -+++ b/arch/x86/Makefile -@@ -492,7 +492,7 @@ - cflags-$(CONFIG_MBOBCAT) += $(call cc-option,-march=btver1) - cflags-$(CONFIG_MJAGUAR) += $(call cc-option,-march=btver2) - cflags-$(CONFIG_MBULLDOZER) += $(call cc-option,-march=bdver1) -- cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2) -+ cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2) $(call cc-option,-mno-tbm) - cflags-$(CONFIG_MSTEAMROLLER) += $(call cc-option,-march=bdver3) - cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-march=bdver4) - cflags-$(CONFIG_MZEN) += $(call cc-option,-march=znver1) diff --git a/ck_modify-for-hardened.patch b/ck_modify-for-hardened.patch new file mode 100644 index 0000000..c54860a --- /dev/null +++ b/ck_modify-for-hardened.patch @@ -0,0 +1,44 @@ +--- a/patch-5.0-ck1 ++++ b/patch-5.0-ck1 +@@ -16348,15 +16348,11 @@ + index ba4d9e85feb8..226771720139 100644 + --- a/kernel/sysctl.c + +++ b/kernel/sysctl.c +-@@ -127,9 +127,17 @@ static int __maybe_unused one = 1; +- static int __maybe_unused two = 2; +- static int __maybe_unused four = 4; +- static unsigned long one_ul = 1; +--static int one_hundred = 100; +--static int one_thousand = 1000; ++@@ -127,7 +127,15 @@ static int __maybe_unused four __read_only = 4; ++ static unsigned long one_ul __read_only = 1; ++ static int one_hundred __read_only = 100; ++ static int one_thousand __read_only = 1000; + -#ifdef CONFIG_PRINTK +-+static int __read_mostly one_hundred = 100; +-+static int __read_mostly one_thousand = 1000; + +#ifdef CONFIG_SCHED_MUQSS + +extern int rr_interval; + +extern int sched_interactive; +@@ -16366,7 +16362,7 @@ + +extern int hrtimer_granularity_us; + +extern int hrtimeout_min_us; + +#if defined(CONFIG_PRINTK) || defined(CONFIG_SCHED_MUQSS) +- static int ten_thousand = 10000; ++ static int ten_thousand __read_only = 10000; + #endif + #ifdef CONFIG_PERF_EVENTS + @@ -296,7 +304,7 @@ static struct ctl_table sysctl_base_table[] = { +@@ -16375,9 +16371,9 @@ + + -#ifdef CONFIG_SCHED_DEBUG + +#if defined(CONFIG_SCHED_DEBUG) && !defined(CONFIG_SCHED_MUQSS) +- static int min_sched_granularity_ns = 100000; /* 100 usecs */ +- static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */ +- static int min_wakeup_granularity_ns; /* 0 usecs */ ++ static int min_sched_granularity_ns __read_only = 100000; /* 100 usecs */ ++ static int max_sched_granularity_ns __read_only = NSEC_PER_SEC; /* 1 second */ ++ static int min_wakeup_granularity_ns __read_only; /* 0 usecs */ + @@ -313,6 +321,7 @@ static int max_extfrag_threshold = 1000; + #endif + diff --git a/ck_remove-excess-extraversion.patch b/ck_remove-excess-extraversion.patch new file mode 100644 index 0000000..9182f31 --- /dev/null +++ b/ck_remove-excess-extraversion.patch @@ -0,0 +1,18 @@ +--- a/patch-5.1-ck1 ++++ b/patch-5.1-ck1 +@@ -833,15 +833,0 @@ +-diff --git a/Makefile b/Makefile +-index 26c92f892d24..e3325aecd55c 100644 +---- a/Makefile +-+++ b/Makefile +-@@ -15,6 +15,10 @@ NAME = Shy Crocodile +- PHONY := _all +- _all: +- +-+CKVERSION = -ck1 +-+CKNAME = MuQSS Powered +-+EXTRAVERSION := $(EXTRAVERSION)$(CKVERSION) +-+ +- # We are using a recursive build, so we need to do a little thinking +- # to get the ordering right. +- # diff --git a/config.x86_64 b/config.x86_64 index feec88f..02ca319 100644 --- a/config.x86_64 +++ b/config.x86_64 @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 5.0.17 Kernel Configuration +# Linux/x86 5.0.18 Kernel Configuration # # diff --git a/graysky_bdver2-hotfix.patch b/graysky_bdver2-hotfix.patch new file mode 100644 index 0000000..5cd9dbc --- /dev/null +++ b/graysky_bdver2-hotfix.patch @@ -0,0 +1,11 @@ +--- a/kernel_gcc_patch-20180509/enable_additional_cpu_optimizations_for_gcc_v8.1+_kernel_v4.13+.patch ++++ b/kernel_gcc_patch-20180509/enable_additional_cpu_optimizations_for_gcc_v8.1+_kernel_v4.13+.patch +@@ -492,7 +492,7 @@ + cflags-$(CONFIG_MBARCELONA) += $(call cc-option,-march=barcelona) + + cflags-$(CONFIG_MBOBCAT) += $(call cc-option,-march=btver1) + + cflags-$(CONFIG_MJAGUAR) += $(call cc-option,-march=btver2) + + cflags-$(CONFIG_MBULLDOZER) += $(call cc-option,-march=bdver1) +-+ cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2) +++ cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2) $(call cc-option,-mno-tbm) + + cflags-$(CONFIG_MSTEAMROLLER) += $(call cc-option,-march=bdver3) + + cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-march=bdver4) + + cflags-$(CONFIG_MZEN) += $(call cc-option,-march=znver1) diff --git a/modify-ck-for-hardened.patch b/modify-ck-for-hardened.patch deleted file mode 100644 index c54860a..0000000 --- a/modify-ck-for-hardened.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- a/patch-5.0-ck1 -+++ b/patch-5.0-ck1 -@@ -16348,15 +16348,11 @@ - index ba4d9e85feb8..226771720139 100644 - --- a/kernel/sysctl.c - +++ b/kernel/sysctl.c --@@ -127,9 +127,17 @@ static int __maybe_unused one = 1; -- static int __maybe_unused two = 2; -- static int __maybe_unused four = 4; -- static unsigned long one_ul = 1; ---static int one_hundred = 100; ---static int one_thousand = 1000; -+@@ -127,7 +127,15 @@ static int __maybe_unused four __read_only = 4; -+ static unsigned long one_ul __read_only = 1; -+ static int one_hundred __read_only = 100; -+ static int one_thousand __read_only = 1000; - -#ifdef CONFIG_PRINTK --+static int __read_mostly one_hundred = 100; --+static int __read_mostly one_thousand = 1000; - +#ifdef CONFIG_SCHED_MUQSS - +extern int rr_interval; - +extern int sched_interactive; -@@ -16366,7 +16362,7 @@ - +extern int hrtimer_granularity_us; - +extern int hrtimeout_min_us; - +#if defined(CONFIG_PRINTK) || defined(CONFIG_SCHED_MUQSS) -- static int ten_thousand = 10000; -+ static int ten_thousand __read_only = 10000; - #endif - #ifdef CONFIG_PERF_EVENTS - @@ -296,7 +304,7 @@ static struct ctl_table sysctl_base_table[] = { -@@ -16375,9 +16371,9 @@ - - -#ifdef CONFIG_SCHED_DEBUG - +#if defined(CONFIG_SCHED_DEBUG) && !defined(CONFIG_SCHED_MUQSS) -- static int min_sched_granularity_ns = 100000; /* 100 usecs */ -- static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */ -- static int min_wakeup_granularity_ns; /* 0 usecs */ -+ static int min_sched_granularity_ns __read_only = 100000; /* 100 usecs */ -+ static int max_sched_granularity_ns __read_only = NSEC_PER_SEC; /* 1 second */ -+ static int min_wakeup_granularity_ns __read_only; /* 0 usecs */ - @@ -313,6 +321,7 @@ static int max_extfrag_threshold = 1000; - #endif - diff --git a/remove-excess-ck-extraversion.patch b/remove-excess-ck-extraversion.patch deleted file mode 100644 index 4e751e5..0000000 --- a/remove-excess-ck-extraversion.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/patch-5.0-ck1 -+++ b/patch-5.0-ck1 -@@ -833,21 +833,6 @@ - + 2: Expire timeslice and recalculate deadline. - + - +============================================================== --diff --git a/Makefile b/Makefile --index d5713e7b1e50..3ee4f3805466 100644 ----- a/Makefile --+++ b/Makefile --@@ -15,6 +15,10 @@ NAME = Shy Crocodile -- PHONY := _all -- _all: -- --+CKVERSION = -ck1 --+CKNAME = MuQSS Powered --+EXTRAVERSION := $(EXTRAVERSION)$(CKVERSION) --+ -- # Do not use make's built-in rules and variables -- # (this increases performance and avoids hard-to-debug behaviour) -- MAKEFLAGS += -rR - diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig - index 584a6e114853..2d497c3710f2 100644 - --- a/arch/alpha/Kconfig -- cgit v1.2.1