summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.SRCINFO34
-rw-r--r--PKGBUILD1099
-rwxr-xr-xauto-cpu-optimization.sh69
-rw-r--r--configure365
4 files changed, 718 insertions, 849 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 50c5655a260f..a1905447c2cd 100755
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = linux-cacule-rdb
pkgdesc = Linux cacULE-RDB scheduler Kernel by CachyOS with other patches and improvements
- pkgver = 5.18.2
- pkgrel = 1
+ pkgver = 5.18.3
+ pkgrel = 2
url = https://github.com/CachyOS/linux-cachyos
arch = x86_64
arch = x86_64_v3
@@ -24,8 +24,9 @@ pkgbase = linux-cacule-rdb
makedepends = make
makedepends = patch
options = !strip
- source = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.18.2.tar.xz
+ source = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.18.3.tar.xz
source = config
+ source = git+https://github.com/ptr1337/zfs.git#commit=8941b63a931ca6fdc6d0ab46c037540569ba04a4
source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/sched/0001-cacULE-5.18.patch
source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/0001-amd-perf.patch
source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/0001-arch.patch
@@ -38,34 +39,33 @@ pkgbase = linux-cacule-rdb
source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/0001-fs-patches.patch
source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/0001-futex-winesync.patch
source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/0001-hwmon.patch
- source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/0001-hardening.patch
- source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/0001-kbuild.patch
source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/0001-lrng.patch
source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/0001-lru-le9-spf.patch
source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/0001-ksm.patch
source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/0001-zram-entropy-calculation.patch
+ source = https://raw.githubusercontent.com/ptr1337/kernel-patches/master/5.18/0001-PCI-Allow-BAR-movement-during-boot-and-hotplug.patch
source = auto-cpu-optimization.sh
- sha256sums = ef9ff2dfa5416a03e7e5fd9c308aaec385fe8ff9f4a62d957b167843849659a2
- sha256sums = fbff2747a1d8916f2de80455fb40f0ce1bf9d5df5dca7157234242b5b286fc90
+ sha256sums = c70cb405076c3cfd73e4de729430b0342ea21b92a04d8284a03fac664ef1cfea
+ sha256sums = 83425e8b1553f4ad0d8fdadbad3980b71f7a36742b3238813ff4d00cd3bf08f8
+ sha256sums = SKIP
sha256sums = 616390dc143695ac216696e86f58beee5df420fb3af22a6a098f7a14aaf5251e
- sha256sums = 85eeddbd0b1fdb44333c450e6d93e370dcd7e230cecccce47667aaa746bea3ae
+ sha256sums = 326d129f9435145add756dc967accd56ffe1d8ff1b6650f84d2578c41bd6dfd6
sha256sums = 2bfe45a67732a97cea01bf760a8f9fb297057c2488eb9e61720a0bb26c9b11e2
sha256sums = dc2898751118804bc3f36b5a6928a2927d04919ce41c0ce013009f5564d6d232
sha256sums = 3754c1ad6bc2fb4e73e9d77137e9f245b3be1a73a05685f0ca03f4c086e5d04d
sha256sums = e2266d499cebdd5d195a044048ae4a13755f1d3edb3ece2c3f8837228b4cd521
sha256sums = c2bf57d37db1f93c5f3eeff2e2957f01618f4786613c13755f9ae6989d2b745c
sha256sums = 30fd4ca078cb1eee0bc4005700da4d15515a577ccdb96ea7922040aa9086d6b7
- sha256sums = 4fde226af6680d151143c30143d1594d2b2994350ba1e4726f1768584df2a117
- sha256sums = 08bde51de2d012219628bf1831a475115266cf4a6969be8064e719140cc9c232
+ sha256sums = 6b6c8d1fbefe7aa165fc62aef527665777d474133e2507e1dc9d09b12282f857
+ sha256sums = f4ed599589fdd44270229492505f5f88e20d79e93b8044f8041a2fc90486bb4e
sha256sums = 1d9c83de97d541f5a7ae4612a96c05aea8ce38de5471cc21fd2197dbd6644d00
- sha256sums = c1aae07261bafc711c2d66e26c2c30e444e11509cacc7aec148dc021761294cd
- sha256sums = a2701625ea310c809fd7ecdf96c43a51ba28ed1dd8583fdbc06897a0a18230e2
- sha256sums = 781cd26d7b0794d11f103ada94140061117c628471a4c49f0228f22f0a6cf425
+ sha256sums = 344806f8ea9f0f7da883e2c27835153944df7a4b15bb3f97ec6b7b7709682f5d
sha256sums = 99b18e00ca3e038481a23f4c83bc285a1ad0e209d049a8476c8f997627aaea79
sha256sums = d2c542b3d44ef11364248c550d20ec7b52261cd98ee5191c24d59c9e0a69392e
sha256sums = 8edf9b9b1a9c26cc4d6dfaf5f14c06b197a04c5bbb8459dd292c033aa2534d19
sha256sums = efe8558b63feb0e76b61d69952c5300ad54c951d9044101be7c01932a54fb4fb
- sha256sums = be21f15aeb22b2ca1e35e4975590d30736af0483ea7464e3464a60d993e37e22
+ sha256sums = cb2494f5ad43fd260e26d771305dade3f9499fa1ffaf53cb9ef8c19b66dab7d7
+ sha256sums = ce8bf7807b45a27eed05a5e1de5a0bf6293a3bbc2085bacae70cd1368f368d1f
pkgname = linux-cacule-rdb
pkgdesc = The Linux cacULE-RDB scheduler Kernel by CachyOS with other patches and improvements kernel and modules
@@ -84,3 +84,9 @@ pkgname = linux-cacule-rdb
pkgname = linux-cacule-rdb-headers
pkgdesc = Headers and scripts for building modules for the Linux cacULE-RDB scheduler Kernel by CachyOS with other patches and improvements kernel
depends = pahole
+ depends = linux-cacule-rdb
+
+pkgname = linux-cacule-rdb-zfs
+ pkgdesc = zfs module for the Linux cacULE-RDB scheduler Kernel by CachyOS with other patches and improvements kernel
+ depends = pahole
+ depends = linux-cacule-rdb=5.18.3-2
diff --git a/PKGBUILD b/PKGBUILD
index b6fae37a7fb1..b4c79c1aa934 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -81,11 +81,18 @@ _spf_enable=y
## Enable Linux Random Number Generator
_lrng_enable=y
-## Apply Kernel automatic Optimization
-_use_auto_optimization=
+# CPU compiler optimizations - Defaults to prompt at kernel config if left empty
+# AMD CPUs : "k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver" "steamroller" "excavator" "zen" "zen2" "zen3"
+# Intel CPUs : "mpsc"(P4 & older Netburst based Xeon) "atom" "core2" "nehalem" "westmere" "silvermont" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylakex" "cannonlake" "icelake" "goldmont" "goldmontplus" "cascadelake" "cooperlake" "tigerlake" "sapphirerapids" "rocketlake" "alderlake"
+# Other options :
+# - "native_amd" (use compiler autodetection - Selecting your arch manually in the list above is recommended instead of this option)
+# - "native_intel" (use compiler autodetection and will prompt for P6_NOPS - Selecting your arch manually in the list above is recommended instead of this option)
+# - "generic" (kernel's default - to share the package between machines with different CPU µarch as long as they are x86-64)
+#
+# Or use the _use_auto_optimization with _use_auto_optimization=y
+_processor_opt=
-## Apply Kernel Optimization selecting
-_use_optimization_select=y
+_use_auto_optimization=y
# disable debug to lower the size of the kernel
_disable_debug=y
@@ -136,7 +143,7 @@ _srcname=linux-${_stable}
#_srcname=linux-${_major}
arch=(x86_64 x86_64_v3)
pkgdesc='Linux cacULE-RDB scheduler Kernel by CachyOS with other patches and improvements'
-pkgrel=1
+pkgrel=2
_kernver=$pkgver-$pkgrel
arch=('x86_64' 'x86_64_v3')
url="https://github.com/CachyOS/linux-cachyos"
@@ -144,78 +151,78 @@ license=('GPL2')
options=('!strip')
makedepends=('bc' 'texlive-latexextra' 'libelf' 'pahole' 'cpio' 'perl' 'tar' 'xz' 'zstd' 'xmlto' 'git' 'gcc' 'gcc-libs' 'glibc' 'binutils' 'make' 'patch')
if [ -n "$_use_llvm_lto" ]; then
- makedepends+=(clang llvm lld python)
- BUILD_FLAGS=(
- CC=clang
- LD=ld.lld
- LLVM=1
- LLVM_IAS=1
- )
+ makedepends+=(clang llvm lld python)
+ BUILD_FLAGS=(
+ CC=clang
+ LD=ld.lld
+ LLVM=1
+ LLVM_IAS=1
+ )
fi
_patchsource="https://raw.githubusercontent.com/ptr1337/kernel-patches/master/${_major}"
source=(
"https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/${_srcname}.tar.xz"
- "config")
+"config")
if [ -n "$_build_zfs" ]; then
source+=("git+https://github.com/ptr1337/zfs.git#commit=8941b63a931ca6fdc6d0ab46c037540569ba04a4")
fi
if [ "$_cpusched" = "bmq" ]; then
- source+=("${_patchsource}/sched/0001-prjc.patch")
+ source+=("${_patchsource}/sched/0001-prjc.patch")
fi
if [ "$_cpusched" = "pds" ]; then
- source+=("${_patchsource}/sched/0001-prjc.patch")
+ source+=("${_patchsource}/sched/0001-prjc.patch")
fi
if [ "$_cpusched" = "cacule" ]; then
- source+=("${_patchsource}/sched/0001-cacULE-5.18.patch")
+ source+=("${_patchsource}/sched/0001-cacULE-5.18.patch")
fi
if [ "$_cpusched" = "cacule-rdb" ]; then
- source+=("${_patchsource}/sched/0001-cacULE-5.18.patch")
+ source+=("${_patchsource}/sched/0001-cacULE-5.18.patch")
fi
if [ "$_cpusched" = "bore" ]; then
source+=("${_patchsource}/sched/0001-bore-sched.patch"
- "${_patchsource}/0001-migrate.patch")
+ "${_patchsource}/0001-migrate.patch")
fi
if [ "$_cpusched" = "cfs" ]; then
- source+=("${_patchsource}/0001-migrate.patch")
+ source+=("${_patchsource}/0001-migrate.patch")
fi
if [ "$_cpusched" = "tt" ]; then
- source+=("${_patchsource}/sched/0001-tt-5.18.patch")
+ source+=("${_patchsource}/sched/0001-tt-5.18.patch")
fi
if [ "$_cpusched" = "hardened" ]; then
- source+=(
- "${_patchsource}/sched/0001-bore-sched.patch"
- "${_patchsource}/0001-migrate.patch"
- "${_patchsource}/0001-hardening.patch"
+ source+=(
+ "${_patchsource}/sched/0001-bore-sched.patch"
+ "${_patchsource}/0001-migrate.patch"
+ "${_patchsource}/0001-hardening.patch"
"${_patchsource}/0001-hardened.patch")
fi
source+=(
- "${_patchsource}/0001-amd-perf.patch"
- "${_patchsource}/0001-arch.patch"
- "${_patchsource}/0001-bbr2.patch"
- "${_patchsource}/0001-cachy.patch"
- "${_patchsource}/0001-clearlinux.patch"
- "${_patchsource}/0001-cpu.patch"
- "${_patchsource}/0001-Extend-DAMOS-for-Proactive-LRU-lists-Sorting.patch"
- "${_patchsource}/0001-fixes.patch"
- "${_patchsource}/0001-fs-patches.patch"
- "${_patchsource}/0001-futex-winesync.patch"
- "${_patchsource}/0001-hwmon.patch"
- "${_patchsource}/0001-lrng.patch"
- "${_patchsource}/0001-lru-le9-spf.patch"
- "${_patchsource}/0001-ksm.patch"
- "${_patchsource}/0001-zram-entropy-calculation.patch"
- "${_patchsource}/0001-PCI-Allow-BAR-movement-during-boot-and-hotplug.patch"
- "auto-cpu-optimization.sh"
+ "${_patchsource}/0001-amd-perf.patch"
+ "${_patchsource}/0001-arch.patch"
+ "${_patchsource}/0001-bbr2.patch"
+ "${_patchsource}/0001-cachy.patch"
+ "${_patchsource}/0001-clearlinux.patch"
+ "${_patchsource}/0001-cpu.patch"
+ "${_patchsource}/0001-Extend-DAMOS-for-Proactive-LRU-lists-Sorting.patch"
+ "${_patchsource}/0001-fixes.patch"
+ "${_patchsource}/0001-fs-patches.patch"
+ "${_patchsource}/0001-futex-winesync.patch"
+ "${_patchsource}/0001-hwmon.patch"
+ "${_patchsource}/0001-lrng.patch"
+ "${_patchsource}/0001-lru-le9-spf.patch"
+ "${_patchsource}/0001-ksm.patch"
+ "${_patchsource}/0001-zram-entropy-calculation.patch"
+ "${_patchsource}/0001-PCI-Allow-BAR-movement-during-boot-and-hotplug.patch"
+ "auto-cpu-optimization.sh"
)
if [ -n "$_use_kcfi" ]; then
- source+=("${_patchsource}/0001-kcfi.patch")
- depends+=(clang llvm lld python)
- BUILD_FLAGS=(
- CC=clang
- LD=ld.lld
- LLVM=1
- )
+ source+=("${_patchsource}/0001-kcfi.patch")
+ depends+=(clang llvm lld python)
+ BUILD_FLAGS=(
+ CC=clang
+ LD=ld.lld
+ LLVM=1
+ )
fi
export KBUILD_BUILD_HOST=archlinux
@@ -224,14 +231,14 @@ export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EP
prepare() {
-cd ${srcdir}/$_srcname
+ cd ${srcdir}/$_srcname
- echo "Setting version..."
- scripts/setlocalversion --save-scmversion
- echo "-$pkgrel" > localversion.10-pkgrel
- echo "${pkgbase#linux}" > localversion.20-pkgname
+ echo "Setting version..."
+ scripts/setlocalversion --save-scmversion
+ echo "-$pkgrel" > localversion.10-pkgrel
+ echo "${pkgbase#linux}" > localversion.20-pkgname
-# [[ $src = 0001-zfs-2.1.5-staging.patch ]] && continue
+ # [[ $src = 0001-zfs-2.1.5-staging.patch ]] && continue
local src
for src in "${source[@]}"; do
src="${src%%::*}"
@@ -241,385 +248,387 @@ cd ${srcdir}/$_srcname
patch -Np1 < "../$src"
done
- echo "Setting config..."
- cp ../config .config
-
- if [ -n "$_use_auto_optimization" ]; then
- "${srcdir}"/auto-cpu-optimization.sh
- fi
-
- if [ -n "$_use_optimization_select" ]; then
- source "${startdir}"/configure
- cpu_arch
- fi
-
- ### Selecting the CPU scheduler
- if [ "$_cpusched" = "bmq" ]; then
- echo "Selecting BMQ CPU scheduler..."
- scripts/config --enable SCHED_ALT \
- --enable SCHED_BMQ \
- --disable SCHED_PDS
- elif [ "$_cpusched" = "pds" ]; then
- echo "Selecting PDS CPU scheduler..."
- scripts/config --enable SCHED_ALT \
- --disable SCHED_BMQ \
- --enable SCHED_PDS
- elif [ "$_cpusched" = "cacule" ]; then
- echo "Selecting CacULE scheduler..."
- scripts/config --enable CACULE_SCHED \
- --disable CACULE_RDB
- elif [ "$_cpusched" = "cacule-rdb" ]; then
- echo "Selecting CacULE-RDB scheduler..."
- scripts/config --enable CACULE_SCHED \
- --enable CACULE_RDB \
- --set-val RDB_INTERVAL 19
- elif [ "$_cpusched" = "bore" ]; then
- echo "Selecting BORE Scheduler..."
- scripts/config --enable SCHED_BORE
- elif [ "$_cpusched" = "tt" ]; then
- echo "Selecting TT Scheduler..."
- scripts/config --enable TT_SCHED
- scripts/config --enable TT_ACCOUNTING_STATS
- elif [ "$_cpusched" = "cfs" ]; then
- echo "Selecting Completely Fair Scheduler..."
- elif [ "$_cpusched" = "hardened" ]; then
- echo "Selecting hardened..."
- else
- if [ -n "$_cpusched" ]; then
- error "The value $_cpusched is invalid. Choose the correct one again."
- else
- error "The value is empty. Choose the correct one again."
+ echo "Setting config..."
+ cp ../config .config
+
+ if [ -n "$_processor_opt" ]; then
+ MARCH=$(echo $_processor_opt|tr '[:lower:]' '[:upper:]'&&echo)
+ MARCH2=M${MARCH}
+ scripts/config -k --disable CONFIG_GENERIC_CPU
+ scripts/config -k --enable CONFIG_${MARCH2}
fi
- error "Selecting the CPU scheduler failed!"
- exit
- fi
-
- if [ -n "$_use_kcfi" ]; then
- echo "Enabling kCFI"
- scripts/config --enable ARCH_SUPPORTS_CFI_CLANG \
- --enable CFI_CLANG
- fi
-
- if [ "$_use_llvm_lto" = "thin" ]; then
- echo "Enabling LLVM THIN LTO..."
- scripts/config \
- --enable LTO \
- --enable LTO_CLANG \
- --enable ARCH_SUPPORTS_LTO_CLANG \
- --enable ARCH_SUPPORTS_LTO_CLANG_THIN \
- --disable LTO_NONE \
- --enable HAS_LTO_CLANG \
- --disable LTO_CLANG_FULL \
- --enable LTO_CLANG_THIN \
- --enable HAVE_GCC_PLUGINS
- elif [ "$_use_llvm_lto" = "full" ]; then
- echo "Enabling LLVM FULL LTO..."
- scripts/config \
- --enable LTO \
- --enable LTO_CLANG \
- --enable ARCH_SUPPORTS_LTO_CLANG \
- --enable ARCH_SUPPORTS_LTO_CLANG_THIN \
- --disable LTO_NONE \
- --enable HAS_LTO_CLANG \
- --enable LTO_CLANG_FULL \
- --disable LTO_CLANG_THIN \
- --enable HAVE_GCC_PLUGINS
- else
- scripts/config --enable LTO_NONE
- fi
-
- if [ "$_HZ_ticks" = "1000" ]; then
- echo "Setting tick rate to 1k Hz..."
- scripts/config --disable HZ_300 \
- --enable HZ_1000 \
- --set-val HZ 1000
- elif [ "$_HZ_ticks" = "750" ]; then
- echo "Setting tick rate to 750Hz..."
- scripts/config --disable HZ_300 \
- --enable HZ_750 \
- --set-val HZ 750
- elif [ "$_HZ_ticks" = "600" ]; then
- echo "Setting tick rate to 600Hz..."
- scripts/config --disable HZ_300 \
- --enable HZ_600 \
- --set-val HZ 600
- elif [ "$_HZ_ticks" = "500" ]; then
- echo "Setting tick rate to 500Hz..."
- scripts/config --disable HZ_300 \
- --enable HZ_500 \
- --set-val HZ 500
- elif [ "$_HZ_ticks" = "300" ]; then
- echo "Setting tick rate to 300Hz..."
- fi
-
- if [ -n "$_NUMAdisable" ]; then
- echo "Disabling NUMA from kernel config..."
- scripts/config --disable NUMA \
- --disable AMD_NUMA \
- --disable X86_64_ACPI_NUMA \
- --disable NODES_SPAN_OTHER_NODES \
- --disable NUMA_EMU \
- --disable NEED_MULTIPLE_NODES \
- --disable USE_PERCPU_NUMA_NODE_ID \
- --disable ACPI_NUMA \
- --disable ARCH_SUPPORTS_NUMA_BALANCING \
- --disable NODES_SHIFT \
- --undefine NODES_SHIFT \
- --disable NEED_MULTIPLE_NODES
- fi
-
- if [ -n "$_mq_deadline_disable" ]; then
- echo "Disabling MQ-Deadline I/O scheduler..."
- scripts/config --disable MQ_IOSCHED_DEADLINE
- fi
-
- if [ -n "$_kyber_disable" ]; then
- echo "Disabling Kyber I/O scheduler..."
- scripts/config --disable MQ_IOSCHED_KYBER
- fi
-
- if [ -n "$_per_gov" ]; then
- echo "Setting performance governor..."
- scripts/config --disable CPU_FREQ_DEFAULT_GOV_SCHEDUTIL \
- --enable CPU_FREQ_DEFAULT_GOV_PERFORMANCE \
- --enable PCIEASPM \
- --enable PCIEASPM_PERFORMANCE \
- --enable PCIE_BUS_PERFORMANCE
- fi
-
- if [ "$_tickrate" = "perodic" ]; then
- echo "Enabling periodic ticks..."
- scripts/config --disable NO_HZ_IDLE \
- --disable NO_HZ_FULL \
- --disable NO_HZ \
- --disable NO_HZ_COMMON \
- --enable HZ_PERIODIC
- elif [ "$_tickrate" = "idle" ]; then
- echo "Enabling tickless idle..."
- scripts/config --disable HZ_PERIODIC \
- --disable NO_HZ_FULL \
- --enable NO_HZ_IDLE \
- --enable NO_HZ \
- --enable NO_HZ_COMMON
- elif [ "$_tickrate" = "full" ]; then
- echo "Enabling tickless idle..."
- scripts/config --disable HZ_PERIODIC \
- --disable NO_HZ_IDLE \
- --disable CONTEXT_TRACKING_FORCE \
- --enable NO_HZ_FULL_NODEF \
- --enable NO_HZ_FULL \
- --enable NO_HZ \
- --enable NO_HZ_COMMON \
- --enable CONTEXT_TRACKING
- fi
-
- if [ "$_preempt" = "full" ]; then
- echo "Enabling low latency preempt..."
- scripts/config --enable PREEMPT_BUILD \
- --disable PREEMPT_NONE \
- --disable PREEMPT_VOLUNTARY \
- --enable PREEMPT \
- --enable PREEMPT_COUNT \
- --enable PREEMPTION \
- --enable PREEMPT_DYNAMIC
- elif [ "$_preempt" = "voluntary" ]; then
- echo "Enabling tickless idle..."
- scripts/config --enable PREEMPT_BUILD \
- --disable PREEMPT_NONE \
- --enable PREEMPT_VOLUNTARY \
- --disable PREEMPT \
- --enable PREEMPT_COUNT \
- --enable PREEMPTION \
- --disable PREEMPT_DYNAMIC
- elif [ "$_tickrate" = "server" ]; then
- echo "Enabling tickless idle..."
- scripts/config --enable PREEMPT_NONE_BUILD \
- --enable PREEMPT_NONE \
- --disable PREEMPT_VOLUNTARY \
- --disable PREEMPT \
- --disable PREEMPT_COUNT \
- --disable PREEMPTION \
- --disable PREEMPT_DYNAMIC
- fi
-
- if [ -n "$_cc_harder" ]; then
- echo "Enabling KBUILD_CFLAGS -O3..."
- scripts/config --disable CC_OPTIMIZE_FOR_PERFORMANCE \
- --enable CC_OPTIMIZE_FOR_PERFORMANCE_O3
- fi
-
- if [ -n "$_tcp_bbr2" ]; then
- echo "Disabling TCP_CONG_CUBIC..."
- scripts/config --module TCP_CONG_CUBIC \
- --disable DEFAULT_CUBIC \
- --enable TCP_CONG_BBR2 \
- --enable DEFAULT_BBR2 \
- --set-str DEFAULT_TCP_CONG bbr2
- fi
-
- if [ -n "$_nf_cone" ]; then
- echo "Enabling FULLCONENAT..."
- scripts/config --module IP_NF_TARGET_FULLCONENAT \
- --module NETFILTER_XT_TARGET_FULLCONENAT
- fi
-
- if [ -n "$_spf_enable" ]; then
- echo "Enabling SPECULATIVE_PAGE_FAULT LRU..."
- scripts/config --enable SPECULATIVE_PAGE_FAULT
- fi
-
- if [ -n "$_lru_enable" ]; then
- echo "Enabling multigenerational LRU..."
- scripts/config --enable ARCH_HAS_NONLEAF_PMD_YOUNG \
- --enable LRU_GEN \
- --enable LRU_GEN_ENABLED \
- --disable LRU_GEN_STATS
- fi
-
- if [ -n "$_damon" ]; then
- echo "Enabling DAMON..."
- scripts/config --enable DAMON \
- --enable DAMON_VADDR \
- --enable DAMON_DBGFS \
- --enable DAMON_SYSFS \
- --enable DAMON_PADDR \
- --enable DAMON_RECLAIM
- fi
-
- if [ -n "$_lrng_enable" ]; then
- echo "Enabling Linux Random Number Generator ..."
- scripts/config --disable CONFIG_RANDOM_DEFAULT_IMPL
- scripts/config --enable CONFIG_LRNG
- scripts/config --enable CONFIG_LRNG_SHA256
- scripts/config --enable CONFIG_LRNG_COMMON_DEV_IF
- scripts/config --enable CONFIG_LRNG_DRNG_ATOMIC
- scripts/config --enable CONFIG_LRNG_SYSCTL
- scripts/config --enable CONFIG_LRNG_RANDOM_IF
- scripts/config --module CONFIG_LRNG_KCAPI_IF
- scripts/config --module CONFIG_LRNG_HWRAND_IF
- scripts/config --enable CONFIG_LRNG_DEV_IF
- scripts/config --enable CONFIG_LRNG_RUNTIME_ES_CONFIG
- scripts/config --enable CONFIG_LRNG_IRQ_DFLT_TIMER_ES
- scripts/config --disable CONFIG_LRNG_SCHED_DFLT_TIMER_ES
- scripts/config --enable CONFIG_LRNG_TIMER_COMMON
- scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_256
- scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_512
- scripts/config --enable CONFIG_LRNG_COLLECTION_SIZE_1024
- scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_2048
- scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_4096
- scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_8192
- scripts/config --set-val CONFIG_LRNG_COLLECTION_SIZE 1024
- scripts/config --enable CONFIG_LRNG_HEALTH_TESTS
- scripts/config --set-val CONFIG_LRNG_RCT_CUTOFF 31
- scripts/config --set-val CONFIG_LRNG_APT_CUTOFF 325
- scripts/config --enable CONFIG_LRNG_IRQ
- scripts/config --enable CONFIG_LRNG_CONTINUOUS_COMPRESSION_ENABLED
- scripts/config --disable CONFIG_LRNG_CONTINUOUS_COMPRESSION_DISABLED
- scripts/config --enable CONFIG_LRNG_ENABLE_CONTINUOUS_COMPRESSION
- scripts/config --enable CONFIG_LRNG_SWITCHABLE_CONTINUOUS_COMPRESSION
- scripts/config --set-val CONFIG_LRNG_IRQ_ENTROPY_RATE 256
- scripts/config --enable CONFIG_LRNG_JENT
- scripts/config --set-val CONFIG_LRNG_JENT_ENTROPY_RATE 16
- scripts/config --enable CONFIG_LRNG_CPU
- scripts/config --set-val CONFIG_LRNG_CPU_FULL_ENT_MULTIPLIER 1
- scripts/config --set-val CONFIG_LRNG_CPU_ENTROPY_RATE 8
- scripts/config --enable CONFIG_LRNG_SCHED
- scripts/config --set-val CONFIG_LRNG_SCHED_ENTROPY_RATE 4294967295
- scripts/config --enable CONFIG_LRNG_DRNG_CHACHA20
- scripts/config --module CONFIG_LRNG_DRBG
- scripts/config --module CONFIG_LRNG_DRNG_KCAPI
- scripts/config --enable CONFIG_LRNG_SWITCH
- scripts/config --enable CONFIG_LRNG_SWITCH_HASH
- scripts/config --module CONFIG_LRNG_HASH_KCAPI
- scripts/config --enable CONFIG_LRNG_SWITCH_DRNG
- scripts/config --module CONFIG_LRNG_SWITCH_DRBG
- scripts/config --module CONFIG_LRNG_SWITCH_DRNG_KCAPI
- scripts/config --enable CONFIG_LRNG_DFLT_DRNG_CHACHA20
- scripts/config --disable CONFIG_LRNG_DFLT_DRNG_DRBG
- scripts/config --disable CONFIG_LRNG_DFLT_DRNG_KCAPI
- scripts/config --enable CONFIG_LRNG_TESTING_MENU
- scripts/config --disable CONFIG_LRNG_RAW_HIRES_ENTROPY
- scripts/config --disable CONFIG_LRNG_RAW_JIFFIES_ENTROPY
- scripts/config --disable CONFIG_LRNG_RAW_IRQ_ENTROPY
- scripts/config --disable CONFIG_LRNG_RAW_RETIP_ENTROPY
- scripts/config --disable CONFIG_LRNG_RAW_REGS_ENTROPY
- scripts/config --disable CONFIG_LRNG_RAW_ARRAY
- scripts/config --disable CONFIG_LRNG_IRQ_PERF
- scripts/config --disable CONFIG_LRNG_RAW_SCHED_HIRES_ENTROPY
- scripts/config --disable CONFIG_LRNG_RAW_SCHED_PID_ENTROPY
- scripts/config --disable CONFIG_LRNG_RAW_SCHED_START_TIME_ENTROPY
- scripts/config --disable CONFIG_LRNG_RAW_SCHED_NVCSW_ENTROPY
- scripts/config --disable CONFIG_LRNG_SCHED_PERF
- scripts/config --disable CONFIG_LRNG_ACVT_HASH
- scripts/config --disable CONFIG_LRNG_RUNTIME_MAX_WO_RESEED_CONFIG
- scripts/config --disable CONFIG_LRNG_TEST_CPU_ES_COMPRESSION
- scripts/config --enable CONFIG_LRNG_SELFTEST
- scripts/config --disable CONFIG_LRNG_SELFTEST_PANIC
- fi
-
- if [ -n "$_zstd_swap_compression" ]; then
- echo "Enabling zram ZSTD compression..."
- scripts/config --disable ZRAM_DEF_COMP_LZORLE \
- --enable ZRAM_DEF_COMP_ZSTD \
- --set-str ZRAM_DEF_COMP zstd \
- --disable ZSWAP_COMPRESSOR_DEFAULT_LZ4 \
- --enable ZSWAP_COMPRESSOR_DEFAULT_ZSTD \
- --set-str ZSWAP_COMPRESSOR_DEFAULT zstd \
- --enable ZRAM_ENTROPY \
- --set-val ZRAM_ENTROPY_THRESHOLD 100000
- fi
-
- if [ -n "$_disable_debug" ]; then
- scripts/config --disable DEBUG_INFO \
- --disable DEBUG_INFO_BTF \
- --disable DEBUG_INFO_DWARF4 \
- --disable DEBUG_INFO_DWARF5 \
- --disable PAHOLE_HAS_SPLIT_BTF \
- --disable DEBUG_INFO_BTF_MODULES \
- --disable SLUB_DEBUG \
- --disable PM_DEBUG \
- --disable PM_ADVANCED_DEBUG \
- --disable PM_SLEEP_DEBUG \
- --disable ACPI_DEBUG \
- --disable SCHED_DEBUG \
- --disable LATENCYTOP \
- --disable DEBUG_PREEMPT
- fi
-
- echo "Enable USER_NS_UNPRIVILEGED"
- scripts/config --enable USER_NS
- echo "Enable WINE FASTSYNC"
- scripts/config --enable WINESYNC
-
- ### 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
+
+ if [ -n "$_use_auto_optimization" ]; then
+ "${srcdir}"/auto-cpu-optimization.sh
+ fi
+
+ ### Selecting the CPU scheduler
+ if [ "$_cpusched" = "bmq" ]; then
+ echo "Selecting BMQ CPU scheduler..."
+ scripts/config --enable SCHED_ALT \
+ --enable SCHED_BMQ \
+ --disable SCHED_PDS
+ elif [ "$_cpusched" = "pds" ]; then
+ echo "Selecting PDS CPU scheduler..."
+ scripts/config --enable SCHED_ALT \
+ --disable SCHED_BMQ \
+ --enable SCHED_PDS
+ elif [ "$_cpusched" = "cacule" ]; then
+ echo "Selecting CacULE scheduler..."
+ scripts/config --enable CACULE_SCHED \
+ --disable CACULE_RDB
+ elif [ "$_cpusched" = "cacule-rdb" ]; then
+ echo "Selecting CacULE-RDB scheduler..."
+ scripts/config --enable CACULE_SCHED \
+ --enable CACULE_RDB \
+ --set-val RDB_INTERVAL 19
+ elif [ "$_cpusched" = "bore" ]; then
+ echo "Selecting BORE Scheduler..."
+ scripts/config --enable SCHED_BORE
+ elif [ "$_cpusched" = "tt" ]; then
+ echo "Selecting TT Scheduler..."
+ scripts/config --enable TT_SCHED
+ scripts/config --enable TT_ACCOUNTING_STATS
+ elif [ "$_cpusched" = "cfs" ]; then
+ echo "Selecting Completely Fair Scheduler..."
+ elif [ "$_cpusched" = "hardened" ]; then
+ echo "Selecting hardened..."
else
- warning "Your kernel was not compiled with IKPROC!"
- warning "You cannot read the current config!"
- warning "Aborting!"
- exit
+ if [ -n "$_cpusched" ]; then
+ error "The value $_cpusched is invalid. Choose the correct one again."
+ else
+ error "The value is empty. Choose the correct one again."
+ fi
+ error "Selecting the CPU scheduler failed!"
+ exit
fi
- fi
+ if [ -n "$_use_kcfi" ]; then
+ echo "Enabling kCFI"
+ scripts/config --enable ARCH_SUPPORTS_CFI_CLANG \
+ --enable CFI_CLANG
+ 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
+ if [ "$_use_llvm_lto" = "thin" ]; then
+ echo "Enabling LLVM THIN LTO..."
+ scripts/config \
+ --enable LTO \
+ --enable LTO_CLANG \
+ --enable ARCH_SUPPORTS_LTO_CLANG \
+ --enable ARCH_SUPPORTS_LTO_CLANG_THIN \
+ --disable LTO_NONE \
+ --enable HAS_LTO_CLANG \
+ --disable LTO_CLANG_FULL \
+ --enable LTO_CLANG_THIN \
+ --enable HAVE_GCC_PLUGINS
+ elif [ "$_use_llvm_lto" = "full" ]; then
+ echo "Enabling LLVM FULL LTO..."
+ scripts/config \
+ --enable LTO \
+ --enable LTO_CLANG \
+ --enable ARCH_SUPPORTS_LTO_CLANG \
+ --enable ARCH_SUPPORTS_LTO_CLANG_THIN \
+ --disable LTO_NONE \
+ --enable HAS_LTO_CLANG \
+ --enable LTO_CLANG_FULL \
+ --disable LTO_CLANG_THIN \
+ --enable HAVE_GCC_PLUGINS
else
- echo "No modprobed.db data found"
- exit
+ scripts/config --enable LTO_NONE
+ fi
+
+ if [ "$_HZ_ticks" = "1000" ]; then
+ echo "Setting tick rate to 1k Hz..."
+ scripts/config --disable HZ_300 \
+ --enable HZ_1000 \
+ --set-val HZ 1000
+ elif [ "$_HZ_ticks" = "750" ]; then
+ echo "Setting tick rate to 750Hz..."
+ scripts/config --disable HZ_300 \
+ --enable HZ_750 \
+ --set-val HZ 750
+ elif [ "$_HZ_ticks" = "600" ]; then
+ echo "Setting tick rate to 600Hz..."
+ scripts/config --disable HZ_300 \
+ --enable HZ_600 \
+ --set-val HZ 600
+ elif [ "$_HZ_ticks" = "500" ]; then
+ echo "Setting tick rate to 500Hz..."
+ scripts/config --disable HZ_300 \
+ --enable HZ_500 \
+ --set-val HZ 500
+ elif [ "$_HZ_ticks" = "300" ]; then
+ echo "Setting tick rate to 300Hz..."
+ fi
+
+ if [ -n "$_NUMAdisable" ]; then
+ echo "Disabling NUMA from kernel config..."
+ scripts/config --disable NUMA \
+ --disable AMD_NUMA \
+ --disable X86_64_ACPI_NUMA \
+ --disable NODES_SPAN_OTHER_NODES \
+ --disable NUMA_EMU \
+ --disable NEED_MULTIPLE_NODES \
+ --disable USE_PERCPU_NUMA_NODE_ID \
+ --disable ACPI_NUMA \
+ --disable ARCH_SUPPORTS_NUMA_BALANCING \
+ --disable NODES_SHIFT \
+ --undefine NODES_SHIFT \
+ --disable NEED_MULTIPLE_NODES
+ fi
+
+ if [ -n "$_mq_deadline_disable" ]; then
+ echo "Disabling MQ-Deadline I/O scheduler..."
+ scripts/config --disable MQ_IOSCHED_DEADLINE
+ fi
+
+ if [ -n "$_kyber_disable" ]; then
+ echo "Disabling Kyber I/O scheduler..."
+ scripts/config --disable MQ_IOSCHED_KYBER
+ fi
+
+ if [ -n "$_per_gov" ]; then
+ echo "Setting performance governor..."
+ scripts/config --disable CPU_FREQ_DEFAULT_GOV_SCHEDUTIL \
+ --enable CPU_FREQ_DEFAULT_GOV_PERFORMANCE \
+ --enable PCIEASPM \
+ --enable PCIEASPM_PERFORMANCE \
+ --enable PCIE_BUS_PERFORMANCE
+ fi
+
+ if [ "$_tickrate" = "perodic" ]; then
+ echo "Enabling periodic ticks..."
+ scripts/config --disable NO_HZ_IDLE \
+ --disable NO_HZ_FULL \
+ --disable NO_HZ \
+ --disable NO_HZ_COMMON \
+ --enable HZ_PERIODIC
+ elif [ "$_tickrate" = "idle" ]; then
+ echo "Enabling tickless idle..."
+ scripts/config --disable HZ_PERIODIC \
+ --disable NO_HZ_FULL \
+ --enable NO_HZ_IDLE \
+ --enable NO_HZ \
+ --enable NO_HZ_COMMON
+ elif [ "$_tickrate" = "full" ]; then
+ echo "Enabling tickless idle..."
+ scripts/config --disable HZ_PERIODIC \
+ --disable NO_HZ_IDLE \
+ --disable CONTEXT_TRACKING_FORCE \
+ --enable NO_HZ_FULL_NODEF \
+ --enable NO_HZ_FULL \
+ --enable NO_HZ \
+ --enable NO_HZ_COMMON \
+ --enable CONTEXT_TRACKING
+ fi
+
+ if [ "$_preempt" = "full" ]; then
+ echo "Enabling low latency preempt..."
+ scripts/config --enable PREEMPT_BUILD \
+ --disable PREEMPT_NONE \
+ --disable PREEMPT_VOLUNTARY \
+ --enable PREEMPT \
+ --enable PREEMPT_COUNT \
+ --enable PREEMPTION \
+ --enable PREEMPT_DYNAMIC
+ elif [ "$_preempt" = "voluntary" ]; then
+ echo "Enabling tickless idle..."
+ scripts/config --enable PREEMPT_BUILD \
+ --disable PREEMPT_NONE \
+ --enable PREEMPT_VOLUNTARY \
+ --disable PREEMPT \
+ --enable PREEMPT_COUNT \
+ --enable PREEMPTION \
+ --disable PREEMPT_DYNAMIC
+ elif [ "$_tickrate" = "server" ]; then
+ echo "Enabling tickless idle..."
+ scripts/config --enable PREEMPT_NONE_BUILD \
+ --enable PREEMPT_NONE \
+ --disable PREEMPT_VOLUNTARY \
+ --disable PREEMPT \
+ --disable PREEMPT_COUNT \
+ --disable PREEMPTION \
+ --disable PREEMPT_DYNAMIC
+ fi
+
+ if [ -n "$_cc_harder" ]; then
+ echo "Enabling KBUILD_CFLAGS -O3..."
+ scripts/config --disable CC_OPTIMIZE_FOR_PERFORMANCE \
+ --enable CC_OPTIMIZE_FOR_PERFORMANCE_O3
+ fi
+
+ if [ -n "$_tcp_bbr2" ]; then
+ echo "Disabling TCP_CONG_CUBIC..."
+ scripts/config --module TCP_CONG_CUBIC \
+ --disable DEFAULT_CUBIC \
+ --enable TCP_CONG_BBR2 \
+ --enable DEFAULT_BBR2 \
+ --set-str DEFAULT_TCP_CONG bbr2
+ fi
+
+ if [ -n "$_nf_cone" ]; then
+ echo "Enabling FULLCONENAT..."
+ scripts/config --module IP_NF_TARGET_FULLCONENAT \
+ --module NETFILTER_XT_TARGET_FULLCONENAT
+ fi
+
+ if [ -n "$_spf_enable" ]; then
+ echo "Enabling SPECULATIVE_PAGE_FAULT LRU..."
+ scripts/config --enable SPECULATIVE_PAGE_FAULT
fi
- fi
- ### Rewrite configuration
+ if [ -n "$_lru_enable" ]; then
+ echo "Enabling multigenerational LRU..."
+ scripts/config --enable ARCH_HAS_NONLEAF_PMD_YOUNG \
+ --enable LRU_GEN \
+ --enable LRU_GEN_ENABLED \
+ --disable LRU_GEN_STATS
+ fi
+
+ if [ -n "$_damon" ]; then
+ echo "Enabling DAMON..."
+ scripts/config --enable DAMON \
+ --enable DAMON_VADDR \
+ --enable DAMON_DBGFS \
+ --enable DAMON_SYSFS \
+ --enable DAMON_PADDR \
+ --enable DAMON_RECLAIM
+ fi
+
+ if [ -n "$_lrng_enable" ]; then
+ echo "Enabling Linux Random Number Generator ..."
+ scripts/config --disable CONFIG_RANDOM_DEFAULT_IMPL
+ scripts/config --enable CONFIG_LRNG
+ scripts/config --enable CONFIG_LRNG_SHA256
+ scripts/config --enable CONFIG_LRNG_COMMON_DEV_IF
+ scripts/config --enable CONFIG_LRNG_DRNG_ATOMIC
+ scripts/config --enable CONFIG_LRNG_SYSCTL
+ scripts/config --enable CONFIG_LRNG_RANDOM_IF
+ scripts/config --module CONFIG_LRNG_KCAPI_IF
+ scripts/config --module CONFIG_LRNG_HWRAND_IF
+ scripts/config --enable CONFIG_LRNG_DEV_IF
+ scripts/config --enable CONFIG_LRNG_RUNTIME_ES_CONFIG
+ scripts/config --enable CONFIG_LRNG_IRQ_DFLT_TIMER_ES
+ scripts/config --disable CONFIG_LRNG_SCHED_DFLT_TIMER_ES
+ scripts/config --enable CONFIG_LRNG_TIMER_COMMON
+ scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_256
+ scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_512
+ scripts/config --enable CONFIG_LRNG_COLLECTION_SIZE_1024
+ scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_2048
+ scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_4096
+ scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_8192
+ scripts/config --set-val CONFIG_LRNG_COLLECTION_SIZE 1024
+ scripts/config --enable CONFIG_LRNG_HEALTH_TESTS
+ scripts/config --set-val CONFIG_LRNG_RCT_CUTOFF 31
+ scripts/config --set-val CONFIG_LRNG_APT_CUTOFF 325
+ scripts/config --enable CONFIG_LRNG_IRQ
+ scripts/config --enable CONFIG_LRNG_CONTINUOUS_COMPRESSION_ENABLED
+ scripts/config --disable CONFIG_LRNG_CONTINUOUS_COMPRESSION_DISABLED
+ scripts/config --enable CONFIG_LRNG_ENABLE_CONTINUOUS_COMPRESSION
+ scripts/config --enable CONFIG_LRNG_SWITCHABLE_CONTINUOUS_COMPRESSION
+ scripts/config --set-val CONFIG_LRNG_IRQ_ENTROPY_RATE 256
+ scripts/config --enable CONFIG_LRNG_JENT
+ scripts/config --set-val CONFIG_LRNG_JENT_ENTROPY_RATE 16
+ scripts/config --enable CONFIG_LRNG_CPU
+ scripts/config --set-val CONFIG_LRNG_CPU_FULL_ENT_MULTIPLIER 1
+ scripts/config --set-val CONFIG_LRNG_CPU_ENTROPY_RATE 8
+ scripts/config --enable CONFIG_LRNG_SCHED
+ scripts/config --set-val CONFIG_LRNG_SCHED_ENTROPY_RATE 4294967295
+ scripts/config --enable CONFIG_LRNG_DRNG_CHACHA20
+ scripts/config --module CONFIG_LRNG_DRBG
+ scripts/config --module CONFIG_LRNG_DRNG_KCAPI
+ scripts/config --enable CONFIG_LRNG_SWITCH
+ scripts/config --enable CONFIG_LRNG_SWITCH_HASH
+ scripts/config --module CONFIG_LRNG_HASH_KCAPI
+ scripts/config --enable CONFIG_LRNG_SWITCH_DRNG
+ scripts/config --module CONFIG_LRNG_SWITCH_DRBG
+ scripts/config --module CONFIG_LRNG_SWITCH_DRNG_KCAPI
+ scripts/config --enable CONFIG_LRNG_DFLT_DRNG_CHACHA20
+ scripts/config --disable CONFIG_LRNG_DFLT_DRNG_DRBG
+ scripts/config --disable CONFIG_LRNG_DFLT_DRNG_KCAPI
+ scripts/config --enable CONFIG_LRNG_TESTING_MENU
+ scripts/config --disable CONFIG_LRNG_RAW_HIRES_ENTROPY
+ scripts/config --disable CONFIG_LRNG_RAW_JIFFIES_ENTROPY
+ scripts/config --disable CONFIG_LRNG_RAW_IRQ_ENTROPY
+ scripts/config --disable CONFIG_LRNG_RAW_RETIP_ENTROPY
+ scripts/config --disable CONFIG_LRNG_RAW_REGS_ENTROPY
+ scripts/config --disable CONFIG_LRNG_RAW_ARRAY
+ scripts/config --disable CONFIG_LRNG_IRQ_PERF
+ scripts/config --disable CONFIG_LRNG_RAW_SCHED_HIRES_ENTROPY
+ scripts/config --disable CONFIG_LRNG_RAW_SCHED_PID_ENTROPY
+ scripts/config --disable CONFIG_LRNG_RAW_SCHED_START_TIME_ENTROPY
+ scripts/config --disable CONFIG_LRNG_RAW_SCHED_NVCSW_ENTROPY
+ scripts/config --disable CONFIG_LRNG_SCHED_PERF
+ scripts/config --disable CONFIG_LRNG_ACVT_HASH
+ scripts/config --disable CONFIG_LRNG_RUNTIME_MAX_WO_RESEED_CONFIG
+ scripts/config --disable CONFIG_LRNG_TEST_CPU_ES_COMPRESSION
+ scripts/config --enable CONFIG_LRNG_SELFTEST
+ scripts/config --disable CONFIG_LRNG_SELFTEST_PANIC
+ fi
+
+ if [ -n "$_zstd_swap_compression" ]; then
+ echo "Enabling zram ZSTD compression..."
+ scripts/config --disable ZRAM_DEF_COMP_LZORLE \
+ --enable ZRAM_DEF_COMP_ZSTD \
+ --set-str ZRAM_DEF_COMP zstd \
+ --disable ZSWAP_COMPRESSOR_DEFAULT_LZ4 \
+ --enable ZSWAP_COMPRESSOR_DEFAULT_ZSTD \
+ --set-str ZSWAP_COMPRESSOR_DEFAULT zstd \
+ --enable ZRAM_ENTROPY \
+ --set-val ZRAM_ENTROPY_THRESHOLD 100000
+ fi
+
+ if [ -n "$_disable_debug" ]; then
+ scripts/config --disable DEBUG_INFO \
+ --disable DEBUG_INFO_BTF \
+ --disable DEBUG_INFO_DWARF4 \
+ --disable DEBUG_INFO_DWARF5 \
+ --disable PAHOLE_HAS_SPLIT_BTF \
+ --disable DEBUG_INFO_BTF_MODULES \
+ --disable SLUB_DEBUG \
+ --disable PM_DEBUG \
+ --disable PM_ADVANCED_DEBUG \
+ --disable PM_SLEEP_DEBUG \
+ --disable ACPI_DEBUG \
+ --disable SCHED_DEBUG \
+ --disable LATENCYTOP \
+ --disable DEBUG_PREEMPT
+ fi
+
+ echo "Enable USER_NS_UNPRIVILEGED"
+ scripts/config --enable USER_NS
+ echo "Enable WINE FASTSYNC"
+ scripts/config --enable WINESYNC
+
+ ### 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 IKPROC!"
+ 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
+
+ ### Rewrite configuration
echo "Rewrite configuration..."
make ${BUILD_FLAGS[*]} prepare
yes "" | make ${BUILD_FLAGS[*]} config >/dev/null
@@ -630,14 +639,14 @@ cd ${srcdir}/$_srcname
echo "Prepared $pkgbase version $(<version)"
### Running make nconfig
- [[ -z "$_makenconfig" ]] || make ${BUILD_FLAGS[*]} nconfig
+ [[ -z "$_makenconfig" ]] || make ${BUILD_FLAGS[*]} nconfig
### Save configuration for later reuse
- echo "Save configuration for later reuse..."
- cat .config > "${startdir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"
+ echo "Save configuration for later reuse..."
+ cat .config > "${startdir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"
- ### Save configuration for later reuse
- # cp -Tf ./.config "${startdir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"
+ ### Save configuration for later reuse
+ # cp -Tf ./.config "${startdir}/config-${pkgver}-${pkgrel}${pkgbase#linux}"
}
@@ -671,30 +680,30 @@ _package() {
pkgdesc="The $pkgdesc kernel and modules"
depends=('coreutils' 'kmod' 'initramfs')
optdepends=('wireless-regdb: to set the correct wireless channels of your country'
- 'linux-firmware: firmware images needed for some devices'
- 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig'
- 'uksmd: Userspace KSM helper daemon')
+ 'linux-firmware: firmware images needed for some devices'
+ 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig'
+ 'uksmd: Userspace KSM helper daemon')
provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE KSMBD-MODULE UKSMD-BUILTIN)
cd ${srcdir}/$_srcname
- local kernver="$(<version)"
- local modulesdir="$pkgdir/usr/lib/modules/$kernver"
+ local kernver="$(<version)"
+ local modulesdir="$pkgdir/usr/lib/modules/$kernver"
- echo "Installing boot image..."
- # systemd expects to find the kernel here to allow hibernation
- # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
- install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"
+ echo "Installing boot image..."
+ # systemd expects to find the kernel here to allow hibernation
+ # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
+ install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"
- # Used by mkinitcpio to name the kernel
- echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
+ # Used by mkinitcpio to name the kernel
+ echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
- echo "Installing modules..."
- make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \
- DEPMOD=/doesnt/exist modules_install # Suppress depmod
+ echo "Installing modules..."
+ make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \
+ DEPMOD=/doesnt/exist modules_install # Suppress depmod
- # remove build and source links
- rm "$modulesdir"/{source,build}
+ # remove build and source links
+ rm "$modulesdir"/{source,build}
}
_package-headers() {
@@ -704,77 +713,77 @@ _package-headers() {
cd ${srcdir}/${_srcname}
local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
- echo "Installing build files..."
- install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \
- localversion.* version vmlinux
- install -Dt "$builddir/kernel" -m644 kernel/Makefile
- install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile
- cp -t "$builddir" -a scripts
-
- # required when STACK_VALIDATION is enabled
- install -Dt "$builddir/tools/objtool" tools/objtool/objtool
-
- # required when DEBUG_INFO_BTF_MODULES is enabled
- if [ -f tools/bpf/resolve_btfids/resolve_btfids ]; then
- install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids
- fi
-
- echo "Installing headers..."
- cp -t "$builddir" -a include
- cp -t "$builddir/arch/x86" -a arch/x86/include
- install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
-
- install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h
- install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h
-
- # https://bugs.archlinux.org/task/13146
- install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
-
- # https://bugs.archlinux.org/task/20402
- install -Dt "$builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
- install -Dt "$builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
- install -Dt "$builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h
-
- # https://bugs.archlinux.org/task/71392
- install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h
-
- echo "Installing KConfig files..."
- find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
-
- echo "Removing unneeded architectures..."
- local arch
- for arch in "$builddir"/arch/*/; do
- [[ $arch = */x86/ ]] && continue
- echo "Removing $(basename "$arch")"
- rm -r "$arch"
- done
-
- echo "Removing documentation..."
- rm -r "$builddir/Documentation"
-
- echo "Removing broken symlinks..."
- find -L "$builddir" -type l -printf 'Removing %P\n' -delete
-
- echo "Removing loose objects..."
- find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
-
- echo "Stripping build tools..."
- local file
- while read -rd '' file; do
- case "$(file -bi "$file")" in
- application/x-sharedlib\;*) # Libraries (.so)
- strip -v $STRIP_SHARED "$file" ;;
- application/x-archive\;*) # Libraries (.a)
- strip -v $STRIP_STATIC "$file" ;;
- application/x-executable\;*) # Binaries
- strip -v $STRIP_BINARIES "$file" ;;
- application/x-pie-executable\;*) # Relocatable binaries
- strip -v $STRIP_SHARED "$file" ;;
- esac
- done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
-
- echo "Stripping vmlinux..."
- strip -v $STRIP_STATIC "$builddir/vmlinux"
+ echo "Installing build files..."
+ install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \
+ localversion.* version vmlinux
+ install -Dt "$builddir/kernel" -m644 kernel/Makefile
+ install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile
+ cp -t "$builddir" -a scripts
+
+ # required when STACK_VALIDATION is enabled
+ install -Dt "$builddir/tools/objtool" tools/objtool/objtool
+
+ # required when DEBUG_INFO_BTF_MODULES is enabled
+ if [ -f tools/bpf/resolve_btfids/resolve_btfids ]; then
+ install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids
+ fi
+
+ echo "Installing headers..."
+ cp -t "$builddir" -a include
+ cp -t "$builddir/arch/x86" -a arch/x86/include
+ install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
+
+ install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h
+ install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h
+
+ # https://bugs.archlinux.org/task/13146
+ install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
+
+ # https://bugs.archlinux.org/task/20402
+ install -Dt "$builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
+ install -Dt "$builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
+ install -Dt "$builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h
+
+ # https://bugs.archlinux.org/task/71392
+ install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h
+
+ echo "Installing KConfig files..."
+ find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
+
+ echo "Removing unneeded architectures..."
+ local arch
+ for arch in "$builddir"/arch/*/; do
+ [[ $arch = */x86/ ]] && continue
+ echo "Removing $(basename "$arch")"
+ rm -r "$arch"
+ done
+
+ echo "Removing documentation..."
+ rm -r "$builddir/Documentation"
+
+ echo "Removing broken symlinks..."
+ find -L "$builddir" -type l -printf 'Removing %P\n' -delete
+
+ echo "Removing loose objects..."
+ find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
+
+ echo "Stripping build tools..."
+ local file
+ while read -rd '' file; do
+ case "$(file -bi "$file")" in
+ application/x-sharedlib\;*) # Libraries (.so)
+ strip -v $STRIP_SHARED "$file" ;;
+ application/x-archive\;*) # Libraries (.a)
+ strip -v $STRIP_STATIC "$file" ;;
+ application/x-executable\;*) # Binaries
+ strip -v $STRIP_BINARIES "$file" ;;
+ application/x-pie-executable\;*) # Relocatable binaries
+ strip -v $STRIP_SHARED "$file" ;;
+ esac
+ done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
+
+ echo "Stripping vmlinux..."
+ strip -v $STRIP_STATIC "$builddir/vmlinux"
echo "Adding symlink..."
mkdir -p "$pkgdir/usr/src"
@@ -785,11 +794,11 @@ _package-zfs(){
pkgdesc="zfs module for the $pkgdesc kernel"
depends=('pahole' linux-$pkgsuffix=$_kernver)
- cd ${srcdir}/"zfs"
- install -dm755 "$pkgdir/usr/lib/modules/${_kernver}-${pkgsuffix}"
- install -m644 module/*/*.ko "$pkgdir/usr/lib/modules/${_kernver}-${pkgsuffix}"
- find "$pkgdir" -name '*.ko' -exec zstd --rm -10 {} +
-# sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${pkgver}-${pkgbase}'/" "$startdir/zfs.install"
+ cd ${srcdir}/"zfs"
+ install -dm755 "$pkgdir/usr/lib/modules/${_kernver}-${pkgsuffix}"
+ install -m644 module/*/*.ko "$pkgdir/usr/lib/modules/${_kernver}-${pkgsuffix}"
+ find "$pkgdir" -name '*.ko' -exec zstd --rm -10 {} +
+ # sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${pkgver}-${pkgbase}'/" "$startdir/zfs.install"
}
pkgname=("$pkgbase" "$pkgbase-headers")
@@ -803,28 +812,24 @@ for _p in "${pkgname[@]}"; do
}"
done
-sha256sums=('ef9ff2dfa5416a03e7e5fd9c308aaec385fe8ff9f4a62d957b167843849659a2'
- 'e37566b5e26c139629c14fbcae237d1ff15caa592fc10593f1fd15698e5afb71'
- 'SKIP'
- '51bcca36288e44282017ed35b41855d22d108508c1a2501b71e5f4ccce885da2'
- 'e8179f661dc9ba2ad89455f0c7e952e9dd9b4d6445476384cbac2730cdd46b65'
- '6705db6d11e22ed9bb56a0ac3f22918667d52a835bb2ab678ac2c93d2902045d'
- '326d129f9435145add756dc967accd56ffe1d8ff1b6650f84d2578c41bd6dfd6'
- '2bfe45a67732a97cea01bf760a8f9fb297057c2488eb9e61720a0bb26c9b11e2'
- 'dc2898751118804bc3f36b5a6928a2927d04919ce41c0ce013009f5564d6d232'
- '3754c1ad6bc2fb4e73e9d77137e9f245b3be1a73a05685f0ca03f4c086e5d04d'
- 'e2266d499cebdd5d195a044048ae4a13755f1d3edb3ece2c3f8837228b4cd521'
- 'c2bf57d37db1f93c5f3eeff2e2957f01618f4786613c13755f9ae6989d2b745c'
- '30fd4ca078cb1eee0bc4005700da4d15515a577ccdb96ea7922040aa9086d6b7'
- '4b18c6a82b62c50b45568526eeb16ae877c8f52c407a4bb9c6144c07a0d1233a'
- 'f4ed599589fdd44270229492505f5f88e20d79e93b8044f8041a2fc90486bb4e'
- '1d9c83de97d541f5a7ae4612a96c05aea8ce38de5471cc21fd2197dbd6644d00'
- 'c1aae07261bafc711c2d66e26c2c30e444e11509cacc7aec148dc021761294cd'
- '781cd26d7b0794d11f103ada94140061117c628471a4c49f0228f22f0a6cf425'
- '99b18e00ca3e038481a23f4c83bc285a1ad0e209d049a8476c8f997627aaea79'
- 'd2c542b3d44ef11364248c550d20ec7b52261cd98ee5191c24d59c9e0a69392e'
- '8edf9b9b1a9c26cc4d6dfaf5f14c06b197a04c5bbb8459dd292c033aa2534d19'
- 'efe8558b63feb0e76b61d69952c5300ad54c951d9044101be7c01932a54fb4fb'
- 'cb2494f5ad43fd260e26d771305dade3f9499fa1ffaf53cb9ef8c19b66dab7d7'
- 'be21f15aeb22b2ca1e35e4975590d30736af0483ea7464e3464a60d993e37e22'
- 'SKIP')
+sha256sums=('c70cb405076c3cfd73e4de729430b0342ea21b92a04d8284a03fac664ef1cfea'
+ '83425e8b1553f4ad0d8fdadbad3980b71f7a36742b3238813ff4d00cd3bf08f8'
+ 'SKIP'
+ '616390dc143695ac216696e86f58beee5df420fb3af22a6a098f7a14aaf5251e'
+ '326d129f9435145add756dc967accd56ffe1d8ff1b6650f84d2578c41bd6dfd6'
+ '2bfe45a67732a97cea01bf760a8f9fb297057c2488eb9e61720a0bb26c9b11e2'
+ 'dc2898751118804bc3f36b5a6928a2927d04919ce41c0ce013009f5564d6d232'
+ '3754c1ad6bc2fb4e73e9d77137e9f245b3be1a73a05685f0ca03f4c086e5d04d'
+ 'e2266d499cebdd5d195a044048ae4a13755f1d3edb3ece2c3f8837228b4cd521'
+ 'c2bf57d37db1f93c5f3eeff2e2957f01618f4786613c13755f9ae6989d2b745c'
+ '30fd4ca078cb1eee0bc4005700da4d15515a577ccdb96ea7922040aa9086d6b7'
+ '6b6c8d1fbefe7aa165fc62aef527665777d474133e2507e1dc9d09b12282f857'
+ 'f4ed599589fdd44270229492505f5f88e20d79e93b8044f8041a2fc90486bb4e'
+ '1d9c83de97d541f5a7ae4612a96c05aea8ce38de5471cc21fd2197dbd6644d00'
+ '344806f8ea9f0f7da883e2c27835153944df7a4b15bb3f97ec6b7b7709682f5d'
+ '99b18e00ca3e038481a23f4c83bc285a1ad0e209d049a8476c8f997627aaea79'
+ 'd2c542b3d44ef11364248c550d20ec7b52261cd98ee5191c24d59c9e0a69392e'
+ '8edf9b9b1a9c26cc4d6dfaf5f14c06b197a04c5bbb8459dd292c033aa2534d19'
+ 'efe8558b63feb0e76b61d69952c5300ad54c951d9044101be7c01932a54fb4fb'
+ 'cb2494f5ad43fd260e26d771305dade3f9499fa1ffaf53cb9ef8c19b66dab7d7'
+'ce8bf7807b45a27eed05a5e1de5a0bf6293a3bbc2085bacae70cd1368f368d1f')
diff --git a/auto-cpu-optimization.sh b/auto-cpu-optimization.sh
index c0f9036e31fb..a86795ada77a 100755
--- a/auto-cpu-optimization.sh
+++ b/auto-cpu-optimization.sh
@@ -1,36 +1,43 @@
#!/bin/bash
-
-#######################################
-# AUTO-CPU-OPTIMIZATION #
-#######################################
-# CREATOR : BL4CKH47H4CK3R #
-#######################################
-# HTTPS://GITHUB.COM/BL4CKH47H4CK3R #
-#######################################
-
-CPU=`gcc -Q -march=native --help=target | grep march | awk '{print $2}' | head -1`
-MARCH=`echo ${CPU} | tr '[:lower:]' '[:upper:]'`&& echo
-
-if [[ ${MARCH} == "ZNVER" ]]
-then
- MARCH="ZEN"
-
-elif [[ ${MARCH} == "ZNVER2" ]]
-then
- MARCH="ZEN2"
-
-elif [[ ${MARCH} == "ZNVER3" ]]
-then
- MARCH="ZEN3"
-
-elif [[ ${MARCH} == "BDVER2" ]]
-then
- MARCH="MPILEDRIVER"
+CPU=$(gcc -Q -march=native --help=target|grep march=|awk '{print $2}'|head -1)
+MARCH=$(echo $CPU|tr '[:lower:]' '[:upper:]'&&echo)
+if [[ ${MARCH} == "ZNVER" ]]; then
+ MARCH="ZEN"
+elif [[ ${MARCH} == "ZNVER2" ]]; then
+ MARCH="ZEN2"
+elif [[ ${MARCH} == "ZNVER3" ]]; then
+ MARCH="ZEN3"
+elif [[ ${MARCH} == "BDVER1" ]]; then
+ MARCH="BULLDOZER"
+elif [[ ${MARCH} == "BDVER2" ]]; then
+ MARCH="PILEDRIVER"
+elif [[ ${MARCH} == "BDVER3" ]]; then
+ MARCH="STEAMROLLER"
+elif [[ ${MARCH} == "BDVER4" ]]; then
+ MARCH="EXCAVATOR"
+elif [[ ${MARCH} == "BTVER1" ]]; then
+ MARCH="BOBCAT"
+elif [[ ${MARCH} == "BTVER2" ]]; then
+ MARCH="JAGUAR"
+elif [[ ${MARCH} == "AMDFAM10" ]]; then
+ MARCH="MK10"
+elif [[ ${MARCH} == "K8-SSE3" ]]; then
+ MARCH="K8SSE3"
+elif [[ ${MARCH} == "BONNELL" ]]; then
+ MARCH="ATOM"
+elif [[ ${MARCH} == "GOLDMONT-PLUS" ]]; then
+ MARCH="GOLDMONTPLUS"
+elif [[ ${MARCH} == "SKYLAKE-AVX512" ]]; then
+ MARCH="SKYLAKE2"
+elif [[ ${MARCH} == "ICELAKE-CLIENT" ]]; then
+ MARCH="ICELAKE"
fi
-
+MARCH2=M${MARCH}
+echo
echo "----------------------------------"
echo "| APPLYING AUTO-CPU-OPTIMIZATION |"
echo "----------------------------------"
-echo "[*] DETECTED CPU (MARCH) : ${MARCH}"
-sed -i "/CONFIG_GENERIC_CPU=y/d;s/\# CONFIG_M${MARCH} is not set/CONFIG_M${MARCH}=y/g" .config
-sleep 3 && echo
+echo "[*] DETECTED CPU (MARCH) : ${MARCH2}"
+scripts/config -k --disable CONFIG_GENERIC_CPU
+scripts/config -k --enable CONFIG_${MARCH2}
+sleep 3&&echo
diff --git a/configure b/configure
index 2f1411ccbfa4..a54e08dc246d 100644
--- a/configure
+++ b/configure
@@ -1,263 +1,114 @@
-#!/usr/bin/bash
+#!/bin/bash
+_undefine() {
+ for _config_name in "$@"; do
+ scripts/config -k --undefine "${_config_name}"
+ done
+}
-cpu_arch() {
- plain ""
- plain "#########################################"
- plain "Set cpu microarchitecture optimization in GCC"
- read -rp "`echo $' > 1) M486SX : Select this for an 486-class CPU without an FPU such as AMD/Cyrix/IBM/Intel SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5S.\n \
- > 2) M486 : Select this for an 486-class CPU such as AMD/Cyrix/IBM/Intel 486DX/DX2/DX4 and UMC U5D.\n \
- > 3) M586 : Select this for an 586 or 686 series processor such as the AMD K5,the Cyrix 5x86, 6x86 and 6x86MX. This choice does not assume the RDTSC (Read Time Stamp Counter) instruction.\n \
- > 4) M586TSC : Select this for a Pentium Classic processor with the RDTSC (Read Time Stamp Counter) instruction for benchmarking.\n \
- > 5) M586MMX : Select this for a Pentium with the MMX graphics/multimedia extended instructions.\n \
- > 6) M686 : Select this for Intel Pentium Pro chips.\n \
- > 7) MPENTIUMII : Select this for Intel chips based on the Pentium-II and pre-Coppermine Celeron core.\n \
- > 8) MPENTIUMIII : Select this for Intel chips based on the Pentium-III and Celeron-Coppermine core.\n \
- > 9) MPENTIUMM : Select this for Intel Pentium M (not Pentium-4 M) notebook chips.\n \
- > 10) MPENTIUM4 : Select this for Intel Pentium 4 chips.\n \
- > 11) MK6 : Select this for an AMD K6-family processor.\n \
- > 12) MK7 : Select this for an AMD Athlon K7-family processor.\n \
- > 13) MK8 : Select this for an AMD Opteron or Athlon64 Hammer-family processor.\n \
- > 14) MK8SSE3 : Select this for improved AMD Opteron or Athlon64 Hammer-family processors.\n \
- > 15) MK10 : Select this for an AMD 61xx Eight-Core Magny-Cours, Athlon X2 7x50,Phenom X3/X4/II, Athlon II X2/X3/X4, or Turion II-family processor.\n \
- > 16) MBARCELONA : Select this for AMD Family 10h Barcelona processors.\n \
- > 17) MBOBCAT : Select this for AMD Family 14h Bobcat processors.\n \
- > 18) MJAGUAR : Select this for AMD Family 16h Jaguar processors.\n \
- > 19) MBULLDOZER : Select this for AMD Family 15h Bulldozer processors.\n \
- > 20) MPILEDRIVER : Select this for AMD Family 15h Piledriver processors.\n \
- > 21) MSTEAMROLLER : Select this for AMD Family 15h Steamroller processors.\n \
- > 22) MEXCAVATOR : Select this for AMD Family 15h Excavator processors.\n \
- > 23) MZEN : Select this for AMD Family 17h Zen processors.\n \
- > 24) MZEN2 : Select this for AMD Family 17h Zen 2 processors.\n \
- > 25) MZEN3 : Select this for AMD Family 19h Zen 3 processors. - GCC 10.3 required\n \
- > 26) MCRUSOE : Select this for a Transmeta Crusoe processor.\n \
- > 27) MEFFICEON : Select this for a Transmeta Efficeon processor.\n \
- > 28) MWINCHIPC6 : Select this for an IDT Winchip C6 chip.\n \
- > 29) MWINCHIP3D : Select this for an IDT Winchip-2, 2A or 3.\n \
- > 30) MELAN : Select this for an AMD Elan processor.\n \
- > 31) MGEODEGX1 : Select this for a Geode GX1 (Cyrix MediaGX) chip.\n \
- > 32) MGEODE_LX Select this for AMD Geode GX and LX processors.\n \
- > 33) MCYRIXIII : Select this for a Cyrix III or C3 chip.\n \
- > 34) MVIAC3_2 : Select this for a VIA C3 "Nehemiah".\n \
- > 35) MVIAC7 : Select this for a VIA C7.\n \
- > 36) MPSC : Optimize for Intel Pentium 4, Pentium D and older Nocona/Dempsey Xeon CPUs with Intel 64bit which is compatible with x86-64.\n \
- > 37) MATOM : Select this for the Intel Atom platform.\n \
- > 38) MCORE2 : Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and 53xx) CPUs.\n \
- > 39) MNEHALEM : Select this for 1st Gen Core processors in the Nehalem family.\n \
- > 40) MWESTMERE : Select this for the Intel Westmere formerly Nehalem-C family.\n \
- > 41) MSILVERMONT Select this for the Intel Silvermont platform.\n \
- > 42) MGOLDMONT : Select this for the Intel Goldmont platform including Apollo Lake and Denverton.\n \
- > 43) MGOLDMONTPLUS : Select this for the Intel Goldmont Plus platform including Gemini Lake.\n \
- > 44) MSANDYBRIDGE : Select this for 2nd Gen Core processors in the Sandy Bridge family.\n \
- > 45) MIVYBRIDGE : Select this for 3rd Gen Core processors in the Ivy Bridge family.\n \
- > 46) MHASWELL : Select this for 4th Gen Core processors in the Haswell family.\n \
- > 47) MBROADWELL : Select this for 5th Gen Core processors in the Broadwell family.\n \
- > 48) MSKYLAKE : Select this for 6th Gen Core processors in the Skylake family.\n \
- > 49) MSKYLAKEX : Select this for 6th Gen Core processors in the Skylake X family.\n \
- > 50) MCANNONLAKE : Select this for 8th Gen Core processors.\n \
- > 51) MICELAKE : Select this for 10th Gen Core processors in the Ice Lake family.\n \
- > 52) MCASCADELAKE : Select this for Xeon processors in the Cascade Lake family.\n \
- > 53) MCOOPERLAKE : Select this for Xeon processors in the Cooper Lake family. - GCC 10.1 required\n \
- > 54) MTIGERLAKE : Select this for third-generation 10 nm process processors in the Tiger Lake family. - GCC 10.1 required\n \
- > 55) MSAPPHIRERAPIDS : Select this for third-generation 10 nm process processors in the Sapphire Rapids family. - GCC 11 required\n \
- > 56) MALDERLAKE : Select this for twelfth-generation processors in the Alder Lake family.- GCC 11 required\n \
- > 57) GENERIC_CPU : Generic x86-64 CPU. Run equally well on all x86-64 CPUs.\n \
- > 58) GENERIC_CPU2 : Run equally well on all x86-64 CPUs with min support of x86-64-v2. - GCC 11 required\n \
- > 59) GENERIC_CPU3 : Generic x86-64-v3 CPU with v3 instructions. Run equally well on all x86-64 CPUs with min support of x86-64-v3. - GCC 11 required\n \
- > 60) GENERIC_CPU4 : Generic x86-64 CPU with v4 instructions. Run equally well on all x86-64 CPUs with min support of x86-64-v4. - GCC 11 required\n \
- > 61) MNATIVE_INTEL : Intel-Native optimizations autodetected by GCC.\n \
- > 62) MNATIVE_AMD : AMD-Native optimizations autodetected by GCC.\n \
- > Default (57 : Gneric CPU)\nchoice[0-62]: '`" _microarchitecture
+_enable() {
+ for _config_name in "$@"; do
+ scripts/config -k --enable "${_config_name}"
+ done
+}
- if [[ "$_microarchitecture" = "1" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_M486
- elif [[ "$_microarchitecture" = "2" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_M486
- elif [[ "$_microarchitecture" = "3" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_M586
- elif [[ "$_microarchitecture" = "4" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_M586TSC
- elif [[ "$_microarchitecture" = "5" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_M586MMX
- elif [[ "$_microarchitecture" = "6" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_M686
- elif [[ "$_microarchitecture" = "7" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MPENTIUMII
- elif [[ "$_microarchitecture" = "8" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MPENTIUMIII
- elif [[ "$_microarchitecture" = "9" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MPENTIUMM
- elif [[ "$_microarchitecture" = "10" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MPENTIUM4
- elif [[ "$_microarchitecture" = "11" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MK6
- elif [[ "$_microarchitecture" = "12" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MK7
- elif [[ "$_microarchitecture" = "13" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MK8
- elif [[ "$_microarchitecture" = "14" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MK8SSE3
- elif [[ "$_microarchitecture" = "15" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MK10
- elif [[ "$_microarchitecture" = "16" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MBARCELONA
- elif [[ "$_microarchitecture" = "17" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MBOBCAT
- elif [[ "$_microarchitecture" = "18" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MJAGUAR
- elif [[ "$_microarchitecture" = "19" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MBULLDOZER
- elif [[ "$_microarchitecture" = "20" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MPILEDRIVER
- elif [[ "$_microarchitecture" = "21" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MSTEAMROLLER
- elif [[ "$_microarchitecture" = "22" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MEXCAVATOR
- elif [[ "$_microarchitecture" = "23" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MZEN
- elif [[ "$_microarchitecture" = "24" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MZEN2
- elif [[ "$_microarchitecture" = "25" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MZEN3
- elif [[ "$_microarchitecture" = "26" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MCRUSOE
- elif [[ "$_microarchitecture" = "27" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MEFFICEON
- elif [[ "$_microarchitecture" = "28" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MWINCHIPC6
- elif [[ "$_microarchitecture" = "29" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MWINCHIP3D
- elif [[ "$_microarchitecture" = "30" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MELAN
- elif [[ "$_microarchitecture" = "31" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MGEODEGX1
- elif [[ "$_microarchitecture" = "32" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MGEODE_LX
- elif [[ "$_microarchitecture" = "33" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MCYRIXIII
- elif [[ "$_microarchitecture" = "34" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MVIAC3_2
- elif [[ "$_microarchitecture" = "35" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MVIAC7
- elif [[ "$_microarchitecture" = "36" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MPSC
- elif [[ "$_microarchitecture" = "37" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MATOM
- elif [[ "$_microarchitecture" = "38" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MCORE2
- elif [[ "$_microarchitecture" = "39" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MNEHALEM
- elif [[ "$_microarchitecture" = "40" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MWESTMERE
- elif [[ "$_microarchitecture" = "41" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MSILVERMONT
- elif [[ "$_microarchitecture" = "42" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MGOLDMONT
- elif [[ "$_microarchitecture" = "43" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MGOLDMONTPLUS
- elif [[ "$_microarchitecture" = "44" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MSANDYBRIDGE
- elif [[ "$_microarchitecture" = "45" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MIVYBRIDGE
- elif [[ "$_microarchitecture" = "46" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MHASWELL
- elif [[ "$_microarchitecture" = "47" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MBROADWELL
- elif [[ "$_microarchitecture" = "48" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MSKYLAKE
- elif [[ "$_microarchitecture" = "49" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MSKYLAKEX
- elif [[ "$_microarchitecture" = "50" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MCANNONLAKE
- elif [[ "$_microarchitecture" = "51" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MICELAKE
- elif [[ "$_microarchitecture" = "52" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MCASCADELAKE
- elif [[ "$_microarchitecture" = "53" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MCOOPERLAKE
- elif [[ "$_microarchitecture" = "54" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MTIGERLAKE
- elif [[ "$_microarchitecture" = "55" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MSAPPHIRERAPIDS
- elif [[ "$_microarchitecture" = "56" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MALDERLAKE
- elif [[ "$_microarchitecture" = "57" ]]; then
- scripts/config --enable CONFIG_GENERIC_CPU
- elif [[ "$_microarchitecture" = "58" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_GENERIC_CPU2
- elif [[ "$_microarchitecture" = "59" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_GENERIC_CPU3
- elif [[ "$_microarchitecture" = "60" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_GENERIC_CPU4
- elif [[ "$_microarchitecture" = "61" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MNATIVE_INTEL
- elif [[ "$_microarchitecture" = "62" ]]; then
- scripts/config --disable CONFIG_GENERIC_CPU
- scripts/config --enable CONFIG_MNATIVE_AMD
- else
- scripts/config --enable CONFIG_GENERIC_CPU
+_disable() {
+ for _config_name in "$@"; do
+ scripts/config -k --disable "${_config_name}"
+ done
+}
+
+_module() {
+ for _config_name in "$@"; do
+ scripts/config -k --module "${_config_name}"
+ done
+}
+
+_prompt_from_array() {
+ # Prompts from array, selects default index on empty user input
+ # Set the _default_index variable to enable default index selection
+
+ if [ $# = "0" ]; then
+ warning "Prompting on an empty array, please report this issue."
+ exit 1
fi
- plain ""
+ _N=$(($#-1))
+ _index=0
+ for _value in "$@"; do
+ if [ "$_index" = "$_default_index" ]; then
+ plain " > ${_index}) ${_value}"
+ else
+ plain " ${_index}) ${_value}"
+ fi
+ _index=$(($_index + 1))
+ done
+ while true; do
+ read -rp "[0-${_N}]: ";
+ if [[ -z "$REPLY" && -n "$_default_index" ]]; then
+ _selected_index="$_default_index"
+ break
+ elif [[ "$REPLY" =~ ^[0-9]+$ && 0 -le "$REPLY" && "$REPLY" -le $_N ]]; then
+ _selected_index="$REPLY"
+ break
+ else
+ echo "Wrong selection: select any number in 0-$_N"
+ fi
+ done
- sleep 2
+ _natural_index=$(($_selected_index + 1))
+ _selected_value="${!_natural_index}"
+ plain "Selected: ${_selected_value}"
+
+ unset _natural_index
+ unset _default_index
}
+# cpu opt
+_cpu_marchs=("native_amd" "native_intel" "generic_cpu" "generic_cpu2" "generic_cpu3" "generic_cpu4")
+_cpu_marchs+=("k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver")
+_cpu_marchs+=("steamroller" "excavator" "zen" "zen2" "zen3" "mpsc" "atom" "core2" "nehalem" "westmere")
+_cpu_marchs+=("bonnell" "silvermont" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake")
+_cpu_marchs+=("skylakex" "cannonlake" "icelake" "goldmont" "goldmontplus" "cascadelake")
+_cpu_marchs+=("cooperlake" "tigerlake" "sapphirerapids" "rocketlake" "alderlake")
+
+typeset -A _generic_march_map
+_generic_march_map=(
+ ["generic"]="generic_cpu"
+ ["generic_v2"]="generic_cpu2"
+ ["generic_v3"]="generic_cpu3"
+ ["generic_v4"]="generic_cpu4"
+)
+if [ -n "$_processor_opt" ]; then
+ # Replace customization.cfg convention with .config convention for generic
+ if [[ "${!_generic_march_map[@]}" =~ "$_processor_opt" ]]; then
+ _processor_opt="${_generic_march_map[$_processor_opt]}"
+ fi
+ if ! [[ "${_cpu_marchs[@]}" =~ "$_processor_opt" ]]; then
+ warning "the setup _processor_opt=\"${_processor_opt}\" not recognized. Prompting..."
+ _processor_opt=""
+ fi
+fi
+
+if [ -z "$_processor_opt" ]; then
+ msg2 "Please select the desired CPU micro-architecture"
+ _default_index="2"
+ _prompt_from_array "${_cpu_marchs[@]}"
+ _processor_opt="${_selected_value}"
+fi
+
+for _march in "${_cpu_marchs[@]}"
+do
+ _march_upper=`echo "$_march" | tr '[a-z]' '[A-Z]'`
+ if [ "$_processor_opt" = "$_march" ]; then
+ if [[ "$_march" = "generic"* ]]; then
+ _enable "${_march_upper}"
+ else
+ _enable "M${_march_upper}"
+ fi
+ else
+ if [[ "$_march" = "generic"* ]]; then
+ _disable "${_march_upper}"
+ else
+ _disable "M${_march_upper}"
+ fi
+ fi
+done