From 12f0539c785428c61e3776a3ccc7f8fe16a294e8 Mon Sep 17 00:00:00 2001 From: "P. Jung" Date: Sat, 22 Jan 2022 13:09:00 +0000 Subject: [PATCH] 5.16.2-3-fixes --- .SRCINFO | 62 ++++++------- PKGBUILD | 178 +++++++++++++++++------------------ config | 278 ++++++++++++++----------------------------------------- 3 files changed, 191 insertions(+), 327 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index 871df5e..e1f20e9 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = linux-cachyos pkgdesc = Linux CFS scheduler Kernel by CachyOS and with some other patches and other improvements pkgver = 5.16.2 - pkgrel = 2 + pkgrel = 3 url = https://github.com/CachyOS/linux-cachyos arch = x86_64 arch = x86_64_v3 @@ -21,18 +21,17 @@ pkgbase = linux-cachyos options = !strip source = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.16.2.tar.xz source = config - source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-lru-patches.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-arch-patches.patch - source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-blk-patches.patch - source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-pm.patch + source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-amdpstate.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-anbox.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-bbr2-patches.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-bfq-patches.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-btrfs.patch - source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-lrng.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-cfi.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-cpu.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-clearlinux.patch + source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-lrng.patch + source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-lru-le9-patches.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-f2fs-xfs-ext4-patches.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-misc.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-net-patches.patch @@ -43,34 +42,31 @@ pkgbase = linux-cachyos source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-ksmbd.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-rcu.patch source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/0001-zstd-patches.patch - source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.16/next/0001-mm-next.patch source = auto-cpu-optimization.sh - md5sums = fd00badc3b53d42da3d84a7cf6f53f17 - md5sums = 6048a8eb052a7b2a22b4ab159278b903 - md5sums = 76b9d9fa00184d10e7949bb948ca846d - md5sums = 3d8d1eeebba7d038f6d890619233e605 - md5sums = 194c8e20ad30973c32159cb23f3be4c9 - md5sums = 2faaa79055263c1cdeeaa2896e641696 - md5sums = 80e419d6847d4122a23a141fd3a40e52 - md5sums = d194311161f8f44755e532db738f4a2d - md5sums = b5b3d9d1cefc3955a82ec895f891abf3 - md5sums = e9dff9b551b8fa7c0b47ae5ac0b16365 - md5sums = 9f86c3b9e6271cfc4440864a6857b256 - md5sums = 0a353926bf4a790374e0f946a7039b40 - md5sums = d4c38ce51fb9a69aa92ad9b9e0199122 - md5sums = a687c26c262ccb9ad7cb54697a1476bc - md5sums = a35a6dea9bc12029b3a837d86d4b842a - md5sums = 80920e501b9b87bfe587edff445e6efe - md5sums = bf010dff1d7a48191d491eba2dde1227 - md5sums = 34a583709ee18ad075f497a1733aa8db - md5sums = be1e00d93e9c2ba91ee6017b82e64194 - md5sums = 28dcc1fe3029c6c316773bbcbe82954d - md5sums = 8fa4524671e6901bbdb47aaf8ecc0de8 - md5sums = 12ad5085b7f01793980f137f2c9451cb - md5sums = 167a4267269e6a709c54e7b9ea8bf8d5 - md5sums = bf58290793d3a095ef95fb1fac2de89a - md5sums = 6bb03b7a1b9207aaf77fb886d42bab74 - md5sums = 21c98f19e883879dd3336c1fa143fd31 + sha256sums = 09fe833a4d6304327bbe00e75ad7a2587188d1f406b3265fed11a0f8c5663b44 + sha256sums = 2b7f21f750dc5f96c7d62a3a63173f33f8b46f8f4be1d361e7bd4cd16fb2b128 + sha256sums = 8ac5db0022b75027970ddcc7ee80e4c57e8a235fd590ed6dcc402909bb063a8a + sha256sums = 0c1bc32aafa16c6daa4bf12595c352f535cea13ae0d4391d7d8916a9c4457341 + sha256sums = 0b64f616404ed70757f423c879bf3edf51525bfdb78f7ec8f1ae21412d9e8a2a + sha256sums = bc91fa787a28516b317fdd9e038ed2c10b61703a9848c1a9ad286e92d51c97be + sha256sums = 2d425719dc5992dabac1944270422c4217ff3f335a5d80a03cdec5c09ee1968c + sha256sums = 6e64484546582b4a747ef4c9d7fdf44005884a9abd86a7ecd9ab8d1f9e3e23d6 + sha256sums = eb57a61e3c1bf2966211f02a9ae080c3af4c7faf3f706821440e324a70d0cd20 + sha256sums = 7936b61ba25f03597fd563be82c31a5756d8a82c893f69a2d569f99d375b1362 + sha256sums = 915e992ed5ba2551ca648e4aa7340e9f250f6b7806287a061c1c8e40b1dc348b + sha256sums = e2d99ace9b54021c5ef53b4b51716816172d6304f6a823b88d5b4e9a68562aef + sha256sums = ff4215e6078864b9e556c3ceedbee8d6881b280755fcfbb97771148ebf05ef53 + sha256sums = c6c4b3720c2907be872037faf546702a060ac5b52733ed65d528bc907400bf69 + sha256sums = 5332ffc19ab2a50b162e07de425d60e473bb8b5be411ae669bae3471653f161f + sha256sums = db0d2fde8f1e994fbb4eb37c8affa3f0b339aa658f9ab5003bb2ce453a68ab95 + sha256sums = 81e1e9559ff3a1f2b7bc7ee450821dad9aaa0ff4bcb885d2c494943e1550754f + sha256sums = 8c2e3ce0874a23e4d8df419f79dd1d045ef349bbe1474717e9455c8197f41c4e + sha256sums = 9c7aebb85ef34d9c89d2e8ba34a9c82309d2ba9a14b8fdabaf01ba953ad6f08f + sha256sums = 9ae41e84e69fbb7e88e7278488eb42e2e1281cb6f7c9c18bf2d11ac692a08d7d + sha256sums = 045160e2253115688651f86f9e01c5a9d052bd71d0ea613f138125422db38141 + sha256sums = c1d1319d672f3b0ba0e016ae31bf7d189fea82985ff528117297b56facac65ad + sha256sums = 74c84814a670c68f0291f94b76fe00eac96b0e7965ed1762dbffd7c938dd9fdc + sha256sums = 65ec9ac5b8b28d5b61df1c72498059be2e7cb1f9b965bac0e4ffed3c05520b2b pkgname = linux-cachyos pkgdesc = The Linux CFS scheduler Kernel by CachyOS and with some other patches and other improvements kernel and modules @@ -82,8 +78,8 @@ pkgname = linux-cachyos optdepends = modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig provides = VIRTUALBOX-GUEST-MODULES provides = WIREGUARD-MODULE + provides = KSMBD-MODULE pkgname = linux-cachyos-headers pkgdesc = Headers and scripts for building modules for the Linux CFS scheduler Kernel by CachyOS and with some other patches and other improvements kernel - depends = linux-cachyos=5.16.2 depends = pahole diff --git a/PKGBUILD b/PKGBUILD index a412a6b..4e1c8da 100755 --- a/PKGBUILD +++ b/PKGBUILD @@ -59,13 +59,13 @@ _mq_deadline_disable=y _kyber_disable=y ### Enable protect file mappings under memory pressure -_mm_protect= +_mm_protect=y ### Enable multigenerational LRU _lru_enable=y ## Enable Page-Table-Check -_page_table_check=y +#_page_table_check=y ### Enable DAMON _damon= @@ -84,7 +84,7 @@ _use_optimization_select= # ATTENTION - one of two predefined values should be selected! # 'ultra' - highest compression ratio # 'normal' - standard compression ratio -_zstd_level='ultra' +_zstd_level='normal' ### Selecting the ZSTD module compression level # If you want to use ZSTD compression, @@ -110,7 +110,7 @@ _fork_brute= _use_llvm_lto= # Enable it for using the LLVM CFI PATCH for a better security -#_use_cfi= +_use_cfi= ## Enable PGO (patch is failing when cfi is also used) #_use_pgo= @@ -128,12 +128,12 @@ _minor=2 pkgver=${_major}.${_minor} _stable=${_major}.${_minor} #_stable=${_major} -_stablerc=${_major}-${_rcver} +#_stablerc=${_major}-${_rcver} _srcname=linux-${_stable} #_srcname=linux-${_major} arch=(x86_64 x86_64_v3) pkgdesc='Linux CFS scheduler Kernel by CachyOS and with some other patches and other improvements' -pkgrel=2 +pkgrel=3 arch=('x86_64' 'x86_64_v3') url="https://github.com/CachyOS/linux-cachyos" license=('GPL2') @@ -151,18 +151,17 @@ source=( # "${_patchsource}/sched/0001-cacULE-5.16-full.patch" # "${_patchsource}/sched/0001-bore-sched.patch" # "${_patchsource}/sched/0001-tt.patch" - "${_patchsource}/0001-lru-patches.patch" "${_patchsource}/0001-arch-patches.patch" - "${_patchsource}/0001-blk-patches.patch" - "${_patchsource}/0001-pm.patch" + "${_patchsource}/0001-amdpstate.patch" "${_patchsource}/0001-anbox.patch" "${_patchsource}/0001-bbr2-patches.patch" "${_patchsource}/0001-bfq-patches.patch" "${_patchsource}/0001-btrfs.patch" - "${_patchsource}/0001-lrng.patch" "${_patchsource}/0001-cfi.patch" "${_patchsource}/0001-cpu.patch" "${_patchsource}/0001-clearlinux.patch" + "${_patchsource}/0001-lrng.patch" + "${_patchsource}/0001-lru-le9-patches.patch" "${_patchsource}/0001-f2fs-xfs-ext4-patches.patch" "${_patchsource}/0001-misc.patch" "${_patchsource}/0001-net-patches.patch" @@ -174,8 +173,10 @@ source=( "${_patchsource}/0001-rcu.patch" "${_patchsource}/0001-zstd-patches.patch" # "${_patchsource}/0001-zen-patches.patch" - "${_patchsource}/next/0001-mm-next.patch" +# "${_patchsource}/next/0001-mm-next.patch" # "${_patchsource}/0001-FG-KASLR.patch" +# "${_patchsource}/0001-fix-building-with-gcc-trunk.patch" +# "${_patchsource}/0001-fortify.patch" "auto-cpu-optimization.sh" ) #if [ -n "$_use_pgo" ]; then @@ -183,11 +184,10 @@ source=( #fi if [ -n "$_use_llvm_lto" ]; then - LLVMOPTS="LLVM=1 LLVM_IAS=1" - CLANGOPTS="CC=clang LD=ld.lld" -else - LLVMOPTS="" - CLANGOPTS="" + BUILD_FLAGS=( + LLVM=1 + LLVM_IAS=1 + ) fi export KBUILD_BUILD_HOST=archlinux @@ -218,22 +218,6 @@ prepare() { echo "Setting config..." cp ../config .config - - ### Optionally use running kernel's config - # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191 - if [ -n "$_use_current" ]; then - if [[ -s /proc/config.gz ]]; then - echo "Extracting config from /proc/config.gz..." - # modprobe configs - zcat /proc/config.gz > ./.config - else - warning "Your kernel was not compiled with IKCONFIG_PROC!" - warning "You cannot read the current config!" - warning "Aborting!" - exit - fi - fi - ### Microarchitecture Optimization (GCC/CLANG) if [ -n "$_use_auto_optimization" ]; then "${srcdir}"/auto-cpu-optimization.sh @@ -290,8 +274,14 @@ prepare() { fi if [ -n "$_use_llvm_lto" ]; then - echo "Enable LLVM LTO" - scripts/config --disable CONFIG_LTO_NONE + scripts/config --disable LTO_NONE \ + --enable LTO \ + --enable LTO_CLANG \ + --enable ARCH_SUPPORTS_LTO_CLANG \ + --enable ARCH_SUPPORTS_LTO_CLANG_THIN \ + --enable HAS_LTO_CLANG \ + --enable LTO_CLANG_THIN \ + --enable HAVE_GCC_PLUGINS fi ### Optionally set tickrate to 1000 @@ -360,12 +350,12 @@ prepare() { fi ### Enable multigenerational LRU - if [ -n "$_page_table_check" ]; then - echo "Enabling Page-Table-Check..." - scripts/config --enable CONFIG_PAGE_TABLE_CHECK - scripts/config --enable CONFIG_PAGE_TABLE_CHECK_ENFORCED - scripts/config --enable CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK - fi +# if [ -n "$_page_table_check" ]; then +# echo "Enabling Page-Table-Check..." +# scripts/config --enable CONFIG_PAGE_TABLE_CHECK +# scripts/config --enable CONFIG_PAGE_TABLE_CHECK_ENFORCED +# scripts/config --enable CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK +# fi ### Enable multigenerational LRU if [ -n "$_lru_enable" ]; then @@ -504,26 +494,42 @@ prepare() { scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE scripts/config --enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 - ### Optionally load needed modules for the make localmodconfig - # See https://aur.archlinux.org/packages/modprobed-db - if [ -n "$_localmodcfg" ]; then - if [ -f $HOME/.config/modprobed.db ]; then - echo "Running Steven Rostedt's make localmodconfig now" - make $LLVMOPTS LSMOD=$HOME/.config/modprobed.db localmodconfig + ### Optionally use running kernel's config + # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191 + if [ -n "$_use_current" ]; then + if [[ -s /proc/config.gz ]]; then + echo "Extracting config from /proc/config.gz..." + # modprobe configs + zcat /proc/config.gz > ./.config else - echo "No modprobed.db data found" + warning "Your kernel was not compiled with IKCONFIG_PROC!" + warning "You cannot read the current config!" + warning "Aborting!" exit fi fi + + ### Optionally load needed modules for the make localmodconfig + # See https://aur.archlinux.org/packages/modprobed-db + if [ -n "$_localmodcfg" ]; then + if [ -e $HOME/.config/modprobed.db ]; then + echo "Running Steven Rostedt's make localmodconfig now" + make ${BUILD_FLAGS[*]} LSMOD=$HOME/.config/modprobed.db localmodconfig + else + echo "No modprobed.db data found" + exit + fi + fi + echo "Applying default config..." - make $LLVMOPTS olddefconfig - make $LLVMOPTS -s kernelrelease > version + make ${BUILD_FLAGS[*]} olddefconfig + make ${BUILD_FLAGS[*]} -s kernelrelease > version echo "Prepared $pkgbase version $(