linux-tkg: The double equal sign amusement continuation

This commit is contained in:
Tk-Glitch
2020-08-17 16:43:41 +02:00
parent 25d9259519
commit 967331d0be
9 changed files with 390 additions and 390 deletions

View File

@@ -123,7 +123,7 @@ build() {
PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH} PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH}
fi fi
if [ "$_force_all_threads" == "true" ]; then if [ "$_force_all_threads" = "true" ]; then
_force_all_threads="-j$((`nproc`*2))" _force_all_threads="-j$((`nproc`*2))"
else else
_force_all_threads="${MAKEFLAGS}" _force_all_threads="${MAKEFLAGS}"
@@ -258,7 +258,7 @@ hackheaders() {
echo "Stripping vmlinux..." echo "Stripping vmlinux..."
strip -v $STRIP_STATIC "$builddir/vmlinux" strip -v $STRIP_STATIC "$builddir/vmlinux"
if [ $_NUKR == "true" ]; then if [ $_NUKR = "true" ]; then
rm -rf "$srcdir" # Nuke the entire src folder so it'll get regenerated clean on next build rm -rf "$srcdir" # Nuke the entire src folder so it'll get regenerated clean on next build
fi fi
} }

View File

@@ -40,17 +40,17 @@ if [ -e "$_EXT_CONFIG_PATH" ]; then
source "$_EXT_CONFIG_PATH" source "$_EXT_CONFIG_PATH"
fi fi
if [ "$1" == "install" ] || [ "$1" == "config" ]; then if [ "$1" = "install" ] || [ "$1" = "config" ]; then
source linux*-tkg-config/prepare source linux*-tkg-config/prepare
if [ $1 == "install" ] && [ "$_distro" != "Ubuntu" ]; then if [ $1 = "install" ] && [ "$_distro" != "Ubuntu" ]; then
msg2 "Variable \"_distro\" in \"customization.cfg\" hasn't been set to \"Ubuntu\"" msg2 "Variable \"_distro\" in \"customization.cfg\" hasn't been set to \"Ubuntu\""
msg2 "This script can only install custom kernels for Ubuntu and Debian derivatives. Exiting..." msg2 "This script can only install custom kernels for Ubuntu and Debian derivatives. Exiting..."
exit 0 exit 0
fi fi
if [ "$_distro" == "Ubuntu" ]; then if [ "$_distro" = "Ubuntu" ]; then
msg2 "Installing dependencies" msg2 "Installing dependencies"
sudo apt install git build-essential kernel-package fakeroot libncurses5-dev libssl-dev ccache bison flex sudo apt install git build-essential kernel-package fakeroot libncurses5-dev libssl-dev ccache bison flex
else else
@@ -58,7 +58,7 @@ if [ "$1" == "install" ] || [ "$1" == "config" ]; then
fi fi
# Force prepare script to avoid Arch specific commands if the user didn't change _distro from "Arch" # Force prepare script to avoid Arch specific commands if the user didn't change _distro from "Arch"
if [ "$1" == "config" ]; then if [ "$1" = "config" ]; then
_distro="" _distro=""
fi fi
@@ -112,14 +112,14 @@ if [ "$1" == "install" ] || [ "$1" == "config" ]; then
msg2 "Configuration done." msg2 "Configuration done."
fi fi
if [ "$1" == "install" ]; then if [ "$1" = "install" ]; then
# Use custom compiler paths if defined # Use custom compiler paths if defined
if [ -n "${CUSTOM_GCC_PATH}" ]; then if [ -n "${CUSTOM_GCC_PATH}" ]; then
PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH} PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH}
fi fi
if [ "$_force_all_threads" == "true" ]; then if [ "$_force_all_threads" = "true" ]; then
_thread_num=`nproc` _thread_num=`nproc`
else else
_thread_num=`expr \`nproc\` / 4` _thread_num=`expr \`nproc\` / 4`
@@ -130,7 +130,7 @@ if [ "$1" == "install" ]; then
# ccache # ccache
if [ "$_noccache" != "true" ]; then if [ "$_noccache" != "true" ]; then
if [ "$_distro" == "Ubuntu" ] && dpkg -l ccache > /dev/null; then if [ "$_distro" = "Ubuntu" ] && dpkg -l ccache > /dev/null; then
export PATH="/usr/lib/ccache/bin/:$PATH" export PATH="/usr/lib/ccache/bin/:$PATH"
export CCACHE_SLOPPINESS="file_macro,locale,time_macros" export CCACHE_SLOPPINESS="file_macro,locale,time_macros"
export CCACHE_NOHASHDIR="true" export CCACHE_NOHASHDIR="true"
@@ -143,11 +143,11 @@ if [ "$1" == "install" ]; then
_kernel_flavor="tkg-${_cpusched}" _kernel_flavor="tkg-${_cpusched}"
fi fi
if [ "$_distro" == "Ubuntu" ]; then if [ "$_distro" = "Ubuntu" ]; then
if make -j ${_thread_num} deb-pkg LOCALVERSION=-${_kernel_flavor}; then if make -j ${_thread_num} deb-pkg LOCALVERSION=-${_kernel_flavor}; then
msg2 "Building successfully finished!" msg2 "Building successfully finished!"
read -p "Do you want to install the new Kernel ? y/[n]: " _install read -p "Do you want to install the new Kernel ? y/[n]: " _install
if [[ $_install =~ [yY] ]] || [[ $_install =~ [yY] ]] || [ $_install == "yes" ] || [ $_install == "Yes" ]; then if [[ $_install =~ [yY] ]] || [[ $_install =~ [yY] ]] || [ $_install = "yes" ] || [ $_install = "Yes" ]; then
cd "$_where" cd "$_where"
_kernelname=$_basekernel.$_kernel_subver-$_kernel_flavor _kernelname=$_basekernel.$_kernel_subver-$_kernel_flavor
_headers_deb=linux-headers-${_kernelname}*.deb _headers_deb=linux-headers-${_kernelname}*.deb
@@ -164,7 +164,7 @@ if [ "$1" == "install" ]; then
fi fi
fi fi
if [ "$1" == "uninstall" ]; then if [ "$1" = "uninstall" ]; then
cd "$_where" cd "$_where"

View File

@@ -19,9 +19,9 @@ _tkg_initscript() {
plain "Do you want to use a predefined optimized profile?" plain "Do you want to use a predefined optimized profile?"
read -rp "`echo $' > 1.Custom\n 2.Ryzen Desktop (Performance)\n 3.Other Desktop (Performance)\nchoice[1-3?]: '`" _OPTIPROFILE; read -rp "`echo $' > 1.Custom\n 2.Ryzen Desktop (Performance)\n 3.Other Desktop (Performance)\nchoice[1-3?]: '`" _OPTIPROFILE;
fi fi
if [ "$_OPTIPROFILE" == "2" ]; then if [ "$_OPTIPROFILE" = "2" ]; then
source "$_where"/ryzen-desktop-profile.cfg && msg2 "Ryzen Desktop (Performance) profile will be used." && msg2 "" source "$_where"/ryzen-desktop-profile.cfg && msg2 "Ryzen Desktop (Performance) profile will be used." && msg2 ""
elif [ "$_OPTIPROFILE" == "3" ]; then elif [ "$_OPTIPROFILE" = "3" ]; then
source "$_where"/generic-desktop-profile.cfg && msg2 "Generic Desktop (Performance) profile will be used." && msg2 "" source "$_where"/generic-desktop-profile.cfg && msg2 "Generic Desktop (Performance) profile will be used." && msg2 ""
fi fi
@@ -34,11 +34,11 @@ _tkg_initscript() {
if [ -z "$_cpusched" ] && [ ! -e "$_where"/cpuschedset ]; then if [ -z "$_cpusched" ] && [ ! -e "$_where"/cpuschedset ]; then
plain "What CPU sched variant do you want to build/install?" plain "What CPU sched variant do you want to build/install?"
read -rp "`echo $' > 1.PDS\n 2.MuQSS\n 3.BMQ\n 4.CFS\nchoice[1-4?]: '`" CONDITION; read -rp "`echo $' > 1.PDS\n 2.MuQSS\n 3.BMQ\n 4.CFS\nchoice[1-4?]: '`" CONDITION;
if [ "$CONDITION" == "2" ]; then if [ "$CONDITION" = "2" ]; then
echo "_cpusched=\"MuQSS\"" > "$_where"/cpuschedset echo "_cpusched=\"MuQSS\"" > "$_where"/cpuschedset
elif [ "$CONDITION" == "3" ]; then elif [ "$CONDITION" = "3" ]; then
echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset
elif [ "$CONDITION" == "4" ]; then elif [ "$CONDITION" = "4" ]; then
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
else else
echo "_cpusched=\"pds\"" > "$_where"/cpuschedset echo "_cpusched=\"pds\"" > "$_where"/cpuschedset
@@ -46,18 +46,18 @@ _tkg_initscript() {
if [ -n "$_custom_pkgbase" ]; then if [ -n "$_custom_pkgbase" ]; then
echo "_custom_pkgbase=\"${_custom_pkgbase}\"" >> "$_where"/cpuschedset echo "_custom_pkgbase=\"${_custom_pkgbase}\"" >> "$_where"/cpuschedset
fi fi
elif [ "$_cpusched" == "muqss" ] || [ "$_cpusched" == "MuQSS" ]; then elif [ "$_cpusched" = "muqss" ] || [ "$_cpusched" = "MuQSS" ]; then
echo "_cpusched=\"MuQSS\"" > "$_where"/cpuschedset echo "_cpusched=\"MuQSS\"" > "$_where"/cpuschedset
elif [ "$_cpusched" == "pds" ]; then elif [ "$_cpusched" = "pds" ]; then
echo "_cpusched=\"pds\"" > "$_where"/cpuschedset echo "_cpusched=\"pds\"" > "$_where"/cpuschedset
elif [ "$_cpusched" == "bmq" ]; then elif [ "$_cpusched" = "bmq" ]; then
echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset
else else
if [ "$_nofallback" != "true" ]; then if [ "$_nofallback" != "true" ]; then
warning "Something is wrong with your cpusched selection. Do you want to fallback to CFS (default)?" warning "Something is wrong with your cpusched selection. Do you want to fallback to CFS (default)?"
read -rp "`echo $' > N/y : '`" _fallback; read -rp "`echo $' > N/y : '`" _fallback;
fi fi
if [[ "$_fallback" =~ [yY] ]] || [ "$_nofallback" == "true" ]; then if [[ "$_fallback" =~ [yY] ]] || [ "$_nofallback" = "true" ]; then
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
else else
error "Exiting..." error "Exiting..."
@@ -77,7 +77,7 @@ user_patcher() {
printf '%s\n' "${_patches[@]}" printf '%s\n' "${_patches[@]}"
read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION;
fi fi
if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" = "true" ]; then
for _f in "${_patches[@]}"; do for _f in "${_patches[@]}"; do
if [ -e "${_f}" ]; then if [ -e "${_f}" ]; then
msg2 "######################################################" msg2 "######################################################"
@@ -99,7 +99,7 @@ user_patcher() {
printf '%s\n' "${_patches[@]}" printf '%s\n' "${_patches[@]}"
read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION;
fi fi
if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" = "true" ]; then
for _f in "${_patches[@]}"; do for _f in "${_patches[@]}"; do
if [ -e "${_f}" ]; then if [ -e "${_f}" ]; then
msg2 "######################################################" msg2 "######################################################"
@@ -117,7 +117,7 @@ user_patcher() {
_tkg_srcprep() { _tkg_srcprep() {
if [ "${_distro}" == "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
msg2 "Setting version..." msg2 "Setting version..."
scripts/setlocalversion --save-scmversion scripts/setlocalversion --save-scmversion
echo "-$pkgrel-tkg-${_cpusched}" > localversion.10-pkgrel echo "-$pkgrel-tkg-${_cpusched}" > localversion.10-pkgrel
@@ -128,7 +128,7 @@ _tkg_srcprep() {
patch -p1 -i "$srcdir"/patch-"${pkgver}" patch -p1 -i "$srcdir"/patch-"${pkgver}"
# ARCH Patches # ARCH Patches
if [ "${_configfile}" == "config_hardened.x86_64" ] && [ "${_cpusched}" == "cfs" ]; then if [ "${_configfile}" = "config_hardened.x86_64" ] && [ "${_cpusched}" = "cfs" ]; then
msg2 "Using linux hardened patchset" msg2 "Using linux hardened patchset"
patch -Np1 -i "$srcdir"/0012-linux-hardened.patch patch -Np1 -i "$srcdir"/0012-linux-hardened.patch
else else
@@ -138,7 +138,7 @@ _tkg_srcprep() {
# graysky's cpu opts - https://github.com/graysky2/kernel_gcc_patch # graysky's cpu opts - https://github.com/graysky2/kernel_gcc_patch
msg2 "Applying graysky's cpu opts patch" msg2 "Applying graysky's cpu opts patch"
if [ "${_distro}" == "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v5.7%2B.patch patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v5.7%2B.patch
else else
patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1+_kernel_v5.7+.patch patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1+_kernel_v5.7+.patch
@@ -159,17 +159,17 @@ _tkg_srcprep() {
fi fi
fi fi
if [ "$_misc_adds" == "true" ]; then if [ "$_misc_adds" = "true" ]; then
msg2 "Applying misc additions patch" msg2 "Applying misc additions patch"
patch -Np1 -i "$srcdir"/0012-misc-additions.patch patch -Np1 -i "$srcdir"/0012-misc-additions.patch
fi fi
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
# MuQSS # MuQSS
msg2 "Applying MuQSS base patch" msg2 "Applying MuQSS base patch"
patch -Np1 -i "$srcdir"/0004-5.7-ck1.patch patch -Np1 -i "$srcdir"/0004-5.7-ck1.patch
if [ "${_aggressive_ondemand}" == "true" ]; then if [ "${_aggressive_ondemand}" = "true" ]; then
msg2 "Applying MuQSS agressive ondemand governor patch" msg2 "Applying MuQSS agressive ondemand governor patch"
patch -Np1 -i "$srcdir"/0004-glitched-ondemand-muqss.patch patch -Np1 -i "$srcdir"/0004-glitched-ondemand-muqss.patch
fi fi
@@ -177,12 +177,12 @@ _tkg_srcprep() {
msg2 "Applying Glitched MuQSS patch" msg2 "Applying Glitched MuQSS patch"
patch -Np1 -i "$srcdir"/0004-glitched-muqss.patch patch -Np1 -i "$srcdir"/0004-glitched-muqss.patch
elif [ "${_cpusched}" == "pds" ]; then elif [ "${_cpusched}" = "pds" ]; then
# PDS-mq # PDS-mq
msg2 "Applying PDS base patch" msg2 "Applying PDS base patch"
patch -Np1 -i "$srcdir"/0005-v5.7_undead-pds099o.patch patch -Np1 -i "$srcdir"/0005-v5.7_undead-pds099o.patch
if [ "${_aggressive_ondemand}" == "true" ]; then if [ "${_aggressive_ondemand}" = "true" ]; then
msg2 "Applying PDS agressive ondemand governor patch" msg2 "Applying PDS agressive ondemand governor patch"
patch -Np1 -i "$srcdir"/0005-glitched-ondemand-pds.patch patch -Np1 -i "$srcdir"/0005-glitched-ondemand-pds.patch
fi fi
@@ -190,13 +190,13 @@ _tkg_srcprep() {
msg2 "Applying Glitched PDS patch" msg2 "Applying Glitched PDS patch"
patch -Np1 -i "$srcdir"/0005-glitched-pds.patch patch -Np1 -i "$srcdir"/0005-glitched-pds.patch
elif [ "${_cpusched}" == "bmq" ]; then elif [ "${_cpusched}" = "bmq" ]; then
# Project C / BMQ # Project C / BMQ
msg2 "Applying Project C / BMQ base patch" msg2 "Applying Project C / BMQ base patch"
patch -Np1 -i "$srcdir"/0009-prjc_v5.7-r3.patch patch -Np1 -i "$srcdir"/0009-prjc_v5.7-r3.patch
if [ "${_aggressive_ondemand}" == "true" ]; then if [ "${_aggressive_ondemand}" = "true" ]; then
msg2 "Applying BMQ agressive ondemand governor patch" msg2 "Applying BMQ agressive ondemand governor patch"
patch -Np1 -i "$srcdir"/0009-glitched-ondemand-bmq.patch patch -Np1 -i "$srcdir"/0009-glitched-ondemand-bmq.patch
fi fi
@@ -204,12 +204,12 @@ _tkg_srcprep() {
msg2 "Applying Glitched BMQ patch" msg2 "Applying Glitched BMQ patch"
patch -Np1 -i "$srcdir"/0009-glitched-bmq.patch patch -Np1 -i "$srcdir"/0009-glitched-bmq.patch
elif [ "${_cpusched}" == "cfs" ]; then elif [ "${_cpusched}" = "cfs" ]; then
msg2 "Applying Glitched CFS patch" msg2 "Applying Glitched CFS patch"
patch -Np1 -i "$srcdir"/0003-glitched-cfs.patch patch -Np1 -i "$srcdir"/0003-glitched-cfs.patch
fi fi
if [ "${_distro}" == "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
if [ -z "${_configfile}" ]; then if [ -z "${_configfile}" ]; then
_configfile="config.x86_64" _configfile="config.x86_64"
fi fi
@@ -236,7 +236,7 @@ _tkg_srcprep() {
echo "CONFIG_CMDLINE=\"${_custom_commandline}\"" >> ./.config echo "CONFIG_CMDLINE=\"${_custom_commandline}\"" >> ./.config
echo "# CONFIG_CMDLINE_OVERRIDE is not set" >> ./.config echo "# CONFIG_CMDLINE_OVERRIDE is not set" >> ./.config
if [ "$_noccache" != "true" ]; then if [ "$_noccache" != "true" ]; then
if { [ "$_distro" == "Arch" ] && pacman -Qq ccache &> /dev/null; } || { [ "$_distro" == "Ubuntu" ] && dpkg -l ccache > /dev/null; }; then if { [ "$_distro" = "Arch" ] && pacman -Qq ccache &> /dev/null; } || { [ "$_distro" = "Ubuntu" ] && dpkg -l ccache > /dev/null; }; then
sed -i -e 's/CONFIG_GCC_PLUGINS=y/# CONFIG_GCC_PLUGINS is not set/' ./.config sed -i -e 's/CONFIG_GCC_PLUGINS=y/# CONFIG_GCC_PLUGINS is not set/' ./.config
fi fi
fi fi
@@ -276,7 +276,7 @@ _tkg_srcprep() {
echo "# CONFIG_MTIGERLAKE is not set" >> ./.config echo "# CONFIG_MTIGERLAKE is not set" >> ./.config
# Disable some debugging # Disable some debugging
if [ "${_debugdisable}" == "true" ]; then if [ "${_debugdisable}" = "true" ]; then
sed -i -e 's/CONFIG_SLUB_DEBUG=y/# CONFIG_SLUB_DEBUG is not set/' ./.config sed -i -e 's/CONFIG_SLUB_DEBUG=y/# CONFIG_SLUB_DEBUG is not set/' ./.config
sed -i -e 's/CONFIG_PM_DEBUG=y/# CONFIG_PM_DEBUG is not set/' ./.config sed -i -e 's/CONFIG_PM_DEBUG=y/# CONFIG_PM_DEBUG is not set/' ./.config
sed -i -e 's/CONFIG_PM_ADVANCED_DEBUG=y/# CONFIG_PM_ADVANCED_DEBUG is not set/' ./.config sed -i -e 's/CONFIG_PM_ADVANCED_DEBUG=y/# CONFIG_PM_ADVANCED_DEBUG is not set/' ./.config
@@ -287,18 +287,18 @@ _tkg_srcprep() {
sed -i -e 's/CONFIG_DEBUG_PREEMPT=y/# CONFIG_DEBUG_PREEMPT is not set/' ./.config sed -i -e 's/CONFIG_DEBUG_PREEMPT=y/# CONFIG_DEBUG_PREEMPT is not set/' ./.config
fi fi
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
# MuQSS default config # MuQSS default config
echo "CONFIG_SCHED_MUQSS=y" >> ./.config echo "CONFIG_SCHED_MUQSS=y" >> ./.config
elif [ "${_cpusched}" == "pds" ]; then elif [ "${_cpusched}" = "pds" ]; then
# PDS default config # PDS default config
echo "CONFIG_SCHED_PDS=y" >> ./.config echo "CONFIG_SCHED_PDS=y" >> ./.config
elif [ "${_cpusched}" == "bmq" ]; then elif [ "${_cpusched}" = "bmq" ]; then
# BMQ default config # BMQ default config
echo "CONFIG_SCHED_ALT=y" >> ./.config echo "CONFIG_SCHED_ALT=y" >> ./.config
fi fi
if [ "${_cpusched}" == "MuQSS" ] || [ "${_cpusched}" == "pds" ] || [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "MuQSS" ] || [ "${_cpusched}" = "pds" ] || [ "${_cpusched}" = "bmq" ]; then
# Disable CFS # Disable CFS
sed -i -e 's/CONFIG_FAIR_GROUP_SCHED=y/# CONFIG_FAIR_GROUP_SCHED is not set/' ./.config sed -i -e 's/CONFIG_FAIR_GROUP_SCHED=y/# CONFIG_FAIR_GROUP_SCHED is not set/' ./.config
sed -i -e 's/CONFIG_CFS_BANDWIDTH=y/# CONFIG_CFS_BANDWIDTH is not set/' ./.config sed -i -e 's/CONFIG_CFS_BANDWIDTH=y/# CONFIG_CFS_BANDWIDTH is not set/' ./.config
@@ -318,30 +318,30 @@ _tkg_srcprep() {
plain "0: No yield." plain "0: No yield."
plain "1: Deboost and requeue task. (default)" plain "1: Deboost and requeue task. (default)"
plain "2: Set rq skip task." plain "2: Set rq skip task."
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
read -rp "`echo $'\n 0. Supposedly best option for gaming performance - could lead to stability issues on some (AMD) platforms when combined with MuQSS\n > 1. Default and recommended option for MuQSS - could lead to stability issues on some (Intel) platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0; read -rp "`echo $'\n 0. Supposedly best option for gaming performance - could lead to stability issues on some (AMD) platforms when combined with MuQSS\n > 1. Default and recommended option for MuQSS - could lead to stability issues on some (Intel) platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0;
else else
read -rp "`echo $'\n > 0. Recommended option for gaming on PDS - "tkg" default\n 1. Default, but can lead to stability issues on some platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0; read -rp "`echo $'\n > 0. Recommended option for gaming on PDS - "tkg" default\n 1. Default, but can lead to stability issues on some platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0;
fi fi
fi fi
if [ "$CONDITION0" == "0" ]; then if [ "$CONDITION0" = "0" ]; then
if [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "bmq" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c
else else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c
fi fi
elif [ "$CONDITION0" == "1" ]; then elif [ "$CONDITION0" = "1" ]; then
msg2 "Using default CPU sched yield type (1)" msg2 "Using default CPU sched yield type (1)"
elif [ "$CONDITION0" == "2" ]; then elif [ "$CONDITION0" = "2" ]; then
if [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "bmq" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/alt_core.c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/alt_core.c
else else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/"${_cpusched}".c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/"${_cpusched}".c
fi fi
else else
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
msg2 "Using default CPU sched yield type (1)" msg2 "Using default CPU sched yield type (1)"
elif [ "${_cpusched}" == "bmq" ]; then elif [ "${_cpusched}" = "bmq" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c
else else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c
@@ -350,7 +350,7 @@ _tkg_srcprep() {
fi fi
# Round Robin interval # Round Robin interval
if [ "${_cpusched}" == "MuQSS" ] || [ "${_cpusched}" == "pds" ] || [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "MuQSS" ] || [ "${_cpusched}" = "pds" ] || [ "${_cpusched}" = "bmq" ]; then
if [ -n "$_rr_interval" ]; then if [ -n "$_rr_interval" ]; then
CONDITION1="$_rr_interval" CONDITION1="$_rr_interval"
else else
@@ -365,16 +365,16 @@ _tkg_srcprep() {
plain "BMQ default: 2ms" plain "BMQ default: 2ms"
read -rp "`echo $'\n > 0.Keep defaults\n 1.2ms\n 2.4ms\n 3.6ms\n 4.8ms\n [0-4?]: '`" CONDITION1; read -rp "`echo $'\n > 0.Keep defaults\n 1.2ms\n 2.4ms\n 3.6ms\n 4.8ms\n [0-4?]: '`" CONDITION1;
fi fi
if [ "$CONDITION1" == "1" ]; then if [ "$CONDITION1" = "1" ]; then
msg2 "Using 2ms rr_interval" msg2 "Using 2ms rr_interval"
_rrvalue="2" _rrvalue="2"
elif [ "$CONDITION1" == "2" ]; then elif [ "$CONDITION1" = "2" ]; then
msg2 "Using 4ms rr_interval" msg2 "Using 4ms rr_interval"
_rrvalue="4" _rrvalue="4"
elif [ "$CONDITION1" == "3" ]; then elif [ "$CONDITION1" = "3" ]; then
msg2 "Using 6ms rr_interval" msg2 "Using 6ms rr_interval"
_rrvalue="6" _rrvalue="6"
elif [ "$CONDITION1" == "4" ]; then elif [ "$CONDITION1" = "4" ]; then
msg2 "Using 8ms rr_interval" msg2 "Using 8ms rr_interval"
_rrvalue="8" _rrvalue="8"
else else
@@ -382,34 +382,34 @@ _tkg_srcprep() {
_rrvalue="default" _rrvalue="default"
fi fi
if [ "$_rrvalue" != "default" ]; then if [ "$_rrvalue" != "default" ]; then
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
sed -i -e "s/int rr_interval __read_mostly = 6;/int rr_interval __read_mostly = ${_rrvalue};/" ./kernel/sched/"${_cpusched}".c sed -i -e "s/int rr_interval __read_mostly = 6;/int rr_interval __read_mostly = ${_rrvalue};/" ./kernel/sched/"${_cpusched}".c
elif [ "${_cpusched}" == "pds" ]; then elif [ "${_cpusched}" = "pds" ]; then
sed -i -e "s/#define SCHED_DEFAULT_RR (4)/#define SCHED_DEFAULT_RR (${_rrvalue})/" ./kernel/sched/"${_cpusched}".c sed -i -e "s/#define SCHED_DEFAULT_RR (4)/#define SCHED_DEFAULT_RR (${_rrvalue})/" ./kernel/sched/"${_cpusched}".c
elif [ "${_cpusched}" == "bmq" ]; then elif [ "${_cpusched}" = "bmq" ]; then
sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (${_rrvalue} * 1000 * 1000);/" ./kernel/sched/alt_core.c sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (${_rrvalue} * 1000 * 1000);/" ./kernel/sched/alt_core.c
fi fi
else else
if [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "bmq" ]; then
sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (2 * 1000 * 1000);/" ./kernel/sched/alt_core.c sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (2 * 1000 * 1000);/" ./kernel/sched/alt_core.c
fi fi
fi fi
fi fi
# zenify # zenify
if [ "$_zenify" == "true" ]; then if [ "$_zenify" = "true" ]; then
echo "CONFIG_ZENIFY=y" >> ./.config echo "CONFIG_ZENIFY=y" >> ./.config
elif [ "$_zenify" == "false" ]; then elif [ "$_zenify" = "false" ]; then
echo "# CONFIG_ZENIFY is not set" >> ./.config echo "# CONFIG_ZENIFY is not set" >> ./.config
fi fi
# compiler optimization level # compiler optimization level
if [ "$_compileroptlevel" == "1" ]; then if [ "$_compileroptlevel" = "1" ]; then
echo "# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set" >> ./.config echo "# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set" >> ./.config
elif [ "$_compileroptlevel" == "2" ]; then elif [ "$_compileroptlevel" = "2" ]; then
sed -i -e 's/CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y/# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set/' ./.config sed -i -e 's/CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y/# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set/' ./.config
echo "CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y" >> ./.config echo "CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y" >> ./.config
elif [ "$_compileroptlevel" == "3" ]; then elif [ "$_compileroptlevel" = "3" ]; then
sed -i -e 's/CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y/# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set/' ./.config sed -i -e 's/CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y/# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set/' ./.config
sed -i -e 's/# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set/CONFIG_CC_OPTIMIZE_FOR_SIZE=y/' ./.config sed -i -e 's/# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set/CONFIG_CC_OPTIMIZE_FOR_SIZE=y/' ./.config
echo "# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set" >> ./.config echo "# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set" >> ./.config
@@ -424,103 +424,103 @@ _tkg_srcprep() {
sed -i -e 's/CONFIG_GENERIC_CPU=y/# CONFIG_GENERIC_CPU is not set/' ./.config sed -i -e 's/CONFIG_GENERIC_CPU=y/# CONFIG_GENERIC_CPU is not set/' ./.config
fi fi
if [ "$_processor_opt" == "native" ]; then if [ "$_processor_opt" = "native" ]; then
echo "CONFIG_MNATIVE=y" >> ./.config echo "CONFIG_MNATIVE=y" >> ./.config
elif [ "$_processor_opt" == "k8" ]; then elif [ "$_processor_opt" = "k8" ]; then
sed -i -e 's/# CONFIG_MK8 is not set/CONFIG_MK8=y/' ./.config sed -i -e 's/# CONFIG_MK8 is not set/CONFIG_MK8=y/' ./.config
elif [ "$_processor_opt" == "k8sse3" ]; then elif [ "$_processor_opt" = "k8sse3" ]; then
sed -i -e 's/# CONFIG_MK8SSE3 is not set/CONFIG_MK8SSE3=y/' ./.config sed -i -e 's/# CONFIG_MK8SSE3 is not set/CONFIG_MK8SSE3=y/' ./.config
elif [ "$_processor_opt" == "k10" ]; then elif [ "$_processor_opt" = "k10" ]; then
sed -i -e 's/# CONFIG_MK10 is not set/CONFIG_MK10=y/' ./.config sed -i -e 's/# CONFIG_MK10 is not set/CONFIG_MK10=y/' ./.config
elif [ "$_processor_opt" == "barcelona" ]; then elif [ "$_processor_opt" = "barcelona" ]; then
sed -i -e 's/# CONFIG_MBARCELONA is not set/CONFIG_MBARCELONA=y/' ./.config sed -i -e 's/# CONFIG_MBARCELONA is not set/CONFIG_MBARCELONA=y/' ./.config
elif [ "$_processor_opt" == "bobcat" ]; then elif [ "$_processor_opt" = "bobcat" ]; then
sed -i -e 's/# CONFIG_MBOBCAT is not set/CONFIG_MBOBCAT=y/' ./.config sed -i -e 's/# CONFIG_MBOBCAT is not set/CONFIG_MBOBCAT=y/' ./.config
elif [ "$_processor_opt" == "jaguar" ]; then elif [ "$_processor_opt" = "jaguar" ]; then
sed -i -e 's/# CONFIG_MJAGUAR is not set/CONFIG_MJAGUAR=y/' ./.config sed -i -e 's/# CONFIG_MJAGUAR is not set/CONFIG_MJAGUAR=y/' ./.config
elif [ "$_processor_opt" == "bulldozer" ]; then elif [ "$_processor_opt" = "bulldozer" ]; then
sed -i -e 's/# CONFIG_MBULLDOZER is not set/CONFIG_MBULLDOZER=y/' ./.config sed -i -e 's/# CONFIG_MBULLDOZER is not set/CONFIG_MBULLDOZER=y/' ./.config
elif [ "$_processor_opt" == "piledriver" ]; then elif [ "$_processor_opt" = "piledriver" ]; then
sed -i -e 's/# CONFIG_MPILEDRIVER is not set/CONFIG_MPILEDRIVER=y/' ./.config sed -i -e 's/# CONFIG_MPILEDRIVER is not set/CONFIG_MPILEDRIVER=y/' ./.config
elif [ "$_processor_opt" == "steamroller" ]; then elif [ "$_processor_opt" = "steamroller" ]; then
sed -i -e 's/# CONFIG_MSTEAMROLLER is not set/CONFIG_MSTEAMROLLER=y/' ./.config sed -i -e 's/# CONFIG_MSTEAMROLLER is not set/CONFIG_MSTEAMROLLER=y/' ./.config
elif [ "$_processor_opt" == "excavator" ]; then elif [ "$_processor_opt" = "excavator" ]; then
sed -i -e 's/# CONFIG_MEXCAVATOR is not set/CONFIG_MEXCAVATOR=y/' ./.config sed -i -e 's/# CONFIG_MEXCAVATOR is not set/CONFIG_MEXCAVATOR=y/' ./.config
elif [ "$_processor_opt" == "zen" ]; then elif [ "$_processor_opt" = "zen" ]; then
sed -i -e 's/# CONFIG_MZEN is not set/CONFIG_MZEN=y/' ./.config sed -i -e 's/# CONFIG_MZEN is not set/CONFIG_MZEN=y/' ./.config
elif [ "$_processor_opt" == "zen2" ]; then elif [ "$_processor_opt" = "zen2" ]; then
sed -i -e 's/# CONFIG_MZEN2 is not set/CONFIG_MZEN2=y/' ./.config sed -i -e 's/# CONFIG_MZEN2 is not set/CONFIG_MZEN2=y/' ./.config
elif [ "$_processor_opt" == "mpsc" ]; then elif [ "$_processor_opt" = "mpsc" ]; then
sed -i -e 's/# CONFIG_MPSC is not set/CONFIG_MPSC=y/' ./.config sed -i -e 's/# CONFIG_MPSC is not set/CONFIG_MPSC=y/' ./.config
elif [ "$_processor_opt" == "atom" ]; then elif [ "$_processor_opt" = "atom" ]; then
sed -i -e 's/# CONFIG_MATOM is not set/CONFIG_MATOM=y/' ./.config sed -i -e 's/# CONFIG_MATOM is not set/CONFIG_MATOM=y/' ./.config
elif [ "$_processor_opt" == "core2" ]; then elif [ "$_processor_opt" = "core2" ]; then
sed -i -e 's/# CONFIG_MCORE2 is not set/CONFIG_MCORE2=y/' ./.config sed -i -e 's/# CONFIG_MCORE2 is not set/CONFIG_MCORE2=y/' ./.config
elif [ "$_processor_opt" == "nehalem" ]; then elif [ "$_processor_opt" = "nehalem" ]; then
sed -i -e 's/# CONFIG_MNEHALEM is not set/CONFIG_MNEHALEM=y/' ./.config sed -i -e 's/# CONFIG_MNEHALEM is not set/CONFIG_MNEHALEM=y/' ./.config
elif [ "$_processor_opt" == "westmere" ]; then elif [ "$_processor_opt" = "westmere" ]; then
sed -i -e 's/# CONFIG_MWESTMERE is not set/CONFIG_MWESTMERE=y/' ./.config sed -i -e 's/# CONFIG_MWESTMERE is not set/CONFIG_MWESTMERE=y/' ./.config
elif [ "$_processor_opt" == "silvermont" ]; then elif [ "$_processor_opt" = "silvermont" ]; then
sed -i -e 's/# CONFIG_MSILVERMONT is not set/CONFIG_MSILVERMONT=y/' ./.config sed -i -e 's/# CONFIG_MSILVERMONT is not set/CONFIG_MSILVERMONT=y/' ./.config
elif [ "$_processor_opt" == "sandybridge" ]; then elif [ "$_processor_opt" = "sandybridge" ]; then
sed -i -e 's/# CONFIG_MSANDYBRIDGE is not set/CONFIG_MSANDYBRIDGE=y/' ./.config sed -i -e 's/# CONFIG_MSANDYBRIDGE is not set/CONFIG_MSANDYBRIDGE=y/' ./.config
elif [ "$_processor_opt" == "ivybridge" ]; then elif [ "$_processor_opt" = "ivybridge" ]; then
sed -i -e 's/# CONFIG_MIVYBRIDGE is not set/CONFIG_MIVYBRIDGE=y/' ./.config sed -i -e 's/# CONFIG_MIVYBRIDGE is not set/CONFIG_MIVYBRIDGE=y/' ./.config
elif [ "$_processor_opt" == "haswell" ]; then elif [ "$_processor_opt" = "haswell" ]; then
sed -i -e 's/# CONFIG_MHASWELL is not set/CONFIG_MHASWELL=y/' ./.config sed -i -e 's/# CONFIG_MHASWELL is not set/CONFIG_MHASWELL=y/' ./.config
elif [ "$_processor_opt" == "broadwell" ]; then elif [ "$_processor_opt" = "broadwell" ]; then
sed -i -e 's/# CONFIG_MBROADWELL is not set/CONFIG_MBROADWELL=y/' ./.config sed -i -e 's/# CONFIG_MBROADWELL is not set/CONFIG_MBROADWELL=y/' ./.config
elif [ "$_processor_opt" == "skylake" ]; then elif [ "$_processor_opt" = "skylake" ]; then
sed -i -e 's/# CONFIG_MSKYLAKE is not set/CONFIG_MSKYLAKE=y/' ./.config sed -i -e 's/# CONFIG_MSKYLAKE is not set/CONFIG_MSKYLAKE=y/' ./.config
elif [ "$_processor_opt" == "skylakex" ]; then elif [ "$_processor_opt" = "skylakex" ]; then
sed -i -e 's/# CONFIG_MSKYLAKEX is not set/CONFIG_MSKYLAKEX=y/' ./.config sed -i -e 's/# CONFIG_MSKYLAKEX is not set/CONFIG_MSKYLAKEX=y/' ./.config
elif [ "$_processor_opt" == "cannonlake" ]; then elif [ "$_processor_opt" = "cannonlake" ]; then
sed -i -e 's/# CONFIG_MCANNONLAKE is not set/CONFIG_MCANNONLAKE=y/' ./.config sed -i -e 's/# CONFIG_MCANNONLAKE is not set/CONFIG_MCANNONLAKE=y/' ./.config
elif [ "$_processor_opt" == "icelake" ]; then elif [ "$_processor_opt" = "icelake" ]; then
sed -i -e 's/# CONFIG_MICELAKE is not set/CONFIG_MICELAKE=y/' ./.config sed -i -e 's/# CONFIG_MICELAKE is not set/CONFIG_MICELAKE=y/' ./.config
elif [ "$_processor_opt" == "goldmont" ]; then elif [ "$_processor_opt" = "goldmont" ]; then
sed -i -e 's/# CONFIG_MGOLDMONT is not set/CONFIG_MGOLDMONT=y/' ./.config sed -i -e 's/# CONFIG_MGOLDMONT is not set/CONFIG_MGOLDMONT=y/' ./.config
elif [ "$_processor_opt" == "goldmontplus" ]; then elif [ "$_processor_opt" = "goldmontplus" ]; then
sed -i -e 's/# CONFIG_MGOLDMONTPLUS is not set/CONFIG_MGOLDMONTPLUS=y/' ./.config sed -i -e 's/# CONFIG_MGOLDMONTPLUS is not set/CONFIG_MGOLDMONTPLUS=y/' ./.config
elif [ "$_processor_opt" == "cascadelake" ]; then elif [ "$_processor_opt" = "cascadelake" ]; then
sed -i -e 's/# CONFIG_MCASCADELAKE is not set/CONFIG_MCASCADELAKE=y/' ./.config sed -i -e 's/# CONFIG_MCASCADELAKE is not set/CONFIG_MCASCADELAKE=y/' ./.config
elif [ "$_processor_opt" == "cooperlake" ]; then elif [ "$_processor_opt" = "cooperlake" ]; then
sed -i -e 's/# CONFIG_MCOOPERLAKE is not set/CONFIG_MCOOPERLAKE=y/' ./.config sed -i -e 's/# CONFIG_MCOOPERLAKE is not set/CONFIG_MCOOPERLAKE=y/' ./.config
elif [ "$_processor_opt" == "tigerlake" ]; then elif [ "$_processor_opt" = "tigerlake" ]; then
sed -i -e 's/# CONFIG_MTIGERLAKE is not set/CONFIG_MTIGERLAKE=y/' ./.config sed -i -e 's/# CONFIG_MTIGERLAKE is not set/CONFIG_MTIGERLAKE=y/' ./.config
fi fi
# irq threading # irq threading
if [ "$_irq_threading" == "true" ]; then if [ "$_irq_threading" = "true" ]; then
echo "CONFIG_FORCE_IRQ_THREADING=y" >> ./.config echo "CONFIG_FORCE_IRQ_THREADING=y" >> ./.config
elif [ "$_irq_threading" == "false" ]; then elif [ "$_irq_threading" = "false" ]; then
echo "# CONFIG_FORCE_IRQ_THREADING is not set" >> ./.config echo "# CONFIG_FORCE_IRQ_THREADING is not set" >> ./.config
fi fi
# smt nice # smt nice
if [ "$_smt_nice" == "true" ]; then if [ "$_smt_nice" = "true" ]; then
echo "CONFIG_SMT_NICE=y" >> ./.config echo "CONFIG_SMT_NICE=y" >> ./.config
elif [ "$_smt_nice" == "false" ]; then elif [ "$_smt_nice" = "false" ]; then
echo "# CONFIG_SMT_NICE is not set" >> ./.config echo "# CONFIG_SMT_NICE is not set" >> ./.config
fi fi
# random trust cpu # random trust cpu
if [ "$_random_trust_cpu" == "true" ]; then if [ "$_random_trust_cpu" = "true" ]; then
sed -i -e 's/# CONFIG_RANDOM_TRUST_CPU is not set/CONFIG_RANDOM_TRUST_CPU=y/' ./.config sed -i -e 's/# CONFIG_RANDOM_TRUST_CPU is not set/CONFIG_RANDOM_TRUST_CPU=y/' ./.config
fi fi
# rq sharing # rq sharing
if [ "$_runqueue_sharing" == "none" ]; then if [ "$_runqueue_sharing" = "none" ]; then
echo -e "CONFIG_RQ_NONE=y\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "CONFIG_RQ_NONE=y\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config
elif [ -z "$_runqueue_sharing" ] || [ "$_runqueue_sharing" == "smt" ]; then elif [ -z "$_runqueue_sharing" ] || [ "$_runqueue_sharing" = "smt" ]; then
echo -e "# CONFIG_RQ_NONE is not set\nCONFIG_RQ_SMT=y\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\nCONFIG_RQ_SMT=y\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config
elif [ "$_runqueue_sharing" == "mc" ]; then elif [ "$_runqueue_sharing" = "mc" ]; then
echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\nCONFIG_RQ_MC=y\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\nCONFIG_RQ_MC=y\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config
elif [ "$_runqueue_sharing" == "smp" ]; then elif [ "$_runqueue_sharing" = "smp" ]; then
echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\nCONFIG_RQ_SMP=y\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\nCONFIG_RQ_SMP=y\n# CONFIG_RQ_ALL is not set" >> ./.config
elif [ "$_runqueue_sharing" == "all" ]; then elif [ "$_runqueue_sharing" = "all" ]; then
echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\nCONFIG_RQ_ALL=y" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\nCONFIG_RQ_ALL=y" >> ./.config
elif [ "$_runqueue_sharing" == "mc-llc" ]; then elif [ "$_runqueue_sharing" = "mc-llc" ]; then
echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\nCONFIG_RQ_MC_LLC=y\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\nCONFIG_RQ_MC_LLC=y\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config
fi fi
@@ -528,7 +528,7 @@ _tkg_srcprep() {
if [ -n "$_timer_freq" ] && [ "$_timer_freq" != "300" ]; then if [ -n "$_timer_freq" ] && [ "$_timer_freq" != "300" ]; then
sed -i -e 's/CONFIG_HZ_300=y/# CONFIG_HZ_300 is not set/' ./.config sed -i -e 's/CONFIG_HZ_300=y/# CONFIG_HZ_300 is not set/' ./.config
sed -i -e 's/CONFIG_HZ_300_NODEF=y/# CONFIG_HZ_300_NODEF is not set/' ./.config sed -i -e 's/CONFIG_HZ_300_NODEF=y/# CONFIG_HZ_300_NODEF is not set/' ./.config
if [ "$_timer_freq" == "1000" ]; then if [ "$_timer_freq" = "1000" ]; then
sed -i -e 's/# CONFIG_HZ_1000 is not set/CONFIG_HZ_1000=y/' ./.config sed -i -e 's/# CONFIG_HZ_1000 is not set/CONFIG_HZ_1000=y/' ./.config
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=1000/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=1000/' ./.config
echo "# CONFIG_HZ_500 is not set" >> ./.config echo "# CONFIG_HZ_500 is not set" >> ./.config
@@ -538,7 +538,7 @@ _tkg_srcprep() {
echo "CONFIG_HZ_1000_NODEF=y" >> ./.config echo "CONFIG_HZ_1000_NODEF=y" >> ./.config
echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config
elif [ "$_timer_freq" == "750" ]; then elif [ "$_timer_freq" = "750" ]; then
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=750/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=750/' ./.config
echo "# CONFIG_HZ_500 is not set" >> ./.config echo "# CONFIG_HZ_500 is not set" >> ./.config
echo "# CONFIG_HZ_500_NODEF is not set" >> ./.config echo "# CONFIG_HZ_500_NODEF is not set" >> ./.config
@@ -547,7 +547,7 @@ _tkg_srcprep() {
echo "# CONFIG_HZ_1000_NODEF is not set" >> ./.config echo "# CONFIG_HZ_1000_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config
elif [ "$_timer_freq" == "500" ]; then elif [ "$_timer_freq" = "500" ]; then
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=500/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=500/' ./.config
echo "CONFIG_HZ_500=y" >> ./.config echo "CONFIG_HZ_500=y" >> ./.config
echo "CONFIG_HZ_500_NODEF=y" >> ./.config echo "CONFIG_HZ_500_NODEF=y" >> ./.config
@@ -556,7 +556,7 @@ _tkg_srcprep() {
echo "# CONFIG_HZ_1000_NODEF is not set" >> ./.config echo "# CONFIG_HZ_1000_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config
elif [ "$_timer_freq" == "100" ]; then elif [ "$_timer_freq" = "100" ]; then
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=100/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=100/' ./.config
echo "# CONFIG_HZ_500 is not set" >> ./.config echo "# CONFIG_HZ_500 is not set" >> ./.config
echo "# CONFIG_HZ_750 is not set" >> ./.config echo "# CONFIG_HZ_750 is not set" >> ./.config
@@ -568,7 +568,7 @@ _tkg_srcprep() {
echo "CONFIG_HZ_100=y" >> ./.config echo "CONFIG_HZ_100=y" >> ./.config
echo "CONFIG_HZ_100_NODEF=y" >> ./.config echo "CONFIG_HZ_100_NODEF=y" >> ./.config
fi fi
elif [ "${_cpusched}" == "MuQSS" ] && [ -z "$_timer_freq" ]; then elif [ "${_cpusched}" = "MuQSS" ] && [ -z "$_timer_freq" ]; then
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=100/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=100/' ./.config
echo "# CONFIG_HZ_500 is not set" >> ./.config echo "# CONFIG_HZ_500 is not set" >> ./.config
echo "# CONFIG_HZ_750 is not set" >> ./.config echo "# CONFIG_HZ_750 is not set" >> ./.config
@@ -590,16 +590,16 @@ _tkg_srcprep() {
fi fi
# default cpu gov # default cpu gov
if [ "$_default_cpu_gov" == "performance" ]; then if [ "$_default_cpu_gov" = "performance" ]; then
sed -i -e 's/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y/# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set/' ./.config sed -i -e 's/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y/# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set/' ./.config
sed -i -e 's/# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set/CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y/' ./.config sed -i -e 's/# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set/CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y/' ./.config
elif [ "$_default_cpu_gov" == "ondemand" ]; then elif [ "$_default_cpu_gov" = "ondemand" ]; then
sed -i -e 's/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y/# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set/' ./.config sed -i -e 's/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y/# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set/' ./.config
sed -i -e 's/# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set/CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y/' ./.config sed -i -e 's/# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set/CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y/' ./.config
fi fi
# ACPI_CPUFREQ disablement # ACPI_CPUFREQ disablement
if [ "$_disable_acpi_cpufreq" == "true" ]; then if [ "$_disable_acpi_cpufreq" = "true" ]; then
sed -i -e 's/CONFIG_X86_ACPI_CPUFREQ=m/# CONFIG_X86_ACPI_CPUFREQ is not set/' ./.config sed -i -e 's/CONFIG_X86_ACPI_CPUFREQ=m/# CONFIG_X86_ACPI_CPUFREQ is not set/' ./.config
fi fi
@@ -610,7 +610,7 @@ _tkg_srcprep() {
plain "and analyzing of kernel functions." plain "and analyzing of kernel functions."
read -rp "`echo $' > N/y : '`" CONDITION2; read -rp "`echo $' > N/y : '`" CONDITION2;
fi fi
if [[ "$CONDITION2" =~ [yY] ]] || [ "$_ftracedisable" == "true" ]; then if [[ "$CONDITION2" =~ [yY] ]] || [ "$_ftracedisable" = "true" ]; then
sed -i -e 's/CONFIG_FUNCTION_TRACER=y/# CONFIG_FUNCTION_TRACER is not set/' ./.config sed -i -e 's/CONFIG_FUNCTION_TRACER=y/# CONFIG_FUNCTION_TRACER is not set/' ./.config
sed -i -e 's/CONFIG_FUNCTION_GRAPH_TRACER=y/# CONFIG_FUNCTION_GRAPH_TRACER is not set/' ./.config sed -i -e 's/CONFIG_FUNCTION_GRAPH_TRACER=y/# CONFIG_FUNCTION_GRAPH_TRACER is not set/' ./.config
fi fi
@@ -622,7 +622,7 @@ _tkg_srcprep() {
plain "https://bbs.archlinux.org/viewtopic.php?id=239174" plain "https://bbs.archlinux.org/viewtopic.php?id=239174"
read -rp "`echo $' > N/y : '`" CONDITION3; read -rp "`echo $' > N/y : '`" CONDITION3;
fi fi
if [[ "$CONDITION3" =~ [yY] ]] || [ "$_numadisable" == "true" ]; then if [[ "$CONDITION3" =~ [yY] ]] || [ "$_numadisable" = "true" ]; then
# disable NUMA since 99.9% of users do not have multiple CPUs but do have multiple cores in one CPU # disable NUMA since 99.9% of users do not have multiple CPUs but do have multiple cores in one CPU
sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \ sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \
-i -e '/CONFIG_AMD_NUMA=y/d' \ -i -e '/CONFIG_AMD_NUMA=y/d' \
@@ -641,20 +641,20 @@ _tkg_srcprep() {
plain "Use CattaRappa mode (Tickless/Dynticks) ?" plain "Use CattaRappa mode (Tickless/Dynticks) ?"
plain "Can give higher performances in many cases but lower consistency on some hardware." plain "Can give higher performances in many cases but lower consistency on some hardware."
plain "Just tickless idle can perform better with some platforms (mostly AMD) or CPU schedulers (mostly MuQSS)." plain "Just tickless idle can perform better with some platforms (mostly AMD) or CPU schedulers (mostly MuQSS)."
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
read -rp "`echo $'\n 0.No, use periodic ticks\n 1.Yes, full tickless baby!\n > 2.Just tickless idle plz\n [0-2?]: '`" CONDITION4; read -rp "`echo $'\n 0.No, use periodic ticks\n 1.Yes, full tickless baby!\n > 2.Just tickless idle plz\n [0-2?]: '`" CONDITION4;
else else
read -rp "`echo $'\n 0.No, use periodic ticks\n > 1.Yes, full tickless baby!\n 2.Just tickless idle plz\n [0-2?]: '`" CONDITION4; read -rp "`echo $'\n 0.No, use periodic ticks\n > 1.Yes, full tickless baby!\n 2.Just tickless idle plz\n [0-2?]: '`" CONDITION4;
fi fi
fi fi
if [ "$CONDITION4" == "0" ] || [ "$_tickless" == "0" ]; then if [ "$CONDITION4" = "0" ] || [ "$_tickless" = "0" ]; then
echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config
sed -i -e 's/# CONFIG_HZ_PERIODIC is not set/CONFIG_HZ_PERIODIC=y/' ./.config sed -i -e 's/# CONFIG_HZ_PERIODIC is not set/CONFIG_HZ_PERIODIC=y/' ./.config
sed -i -e 's/CONFIG_NO_HZ_IDLE=y/# CONFIG_NO_HZ_IDLE is not set/' ./.config sed -i -e 's/CONFIG_NO_HZ_IDLE=y/# CONFIG_NO_HZ_IDLE is not set/' ./.config
sed -i -e 's/CONFIG_NO_HZ_FULL=y/# CONFIG_NO_HZ_FULL is not set/' ./.config sed -i -e 's/CONFIG_NO_HZ_FULL=y/# CONFIG_NO_HZ_FULL is not set/' ./.config
sed -i -e 's/CONFIG_NO_HZ=y/# CONFIG_NO_HZ is not set/' ./.config sed -i -e 's/CONFIG_NO_HZ=y/# CONFIG_NO_HZ is not set/' ./.config
sed -i -e 's/CONFIG_NO_HZ_COMMON=y/# CONFIG_NO_HZ_COMMON is not set/' ./.config sed -i -e 's/CONFIG_NO_HZ_COMMON=y/# CONFIG_NO_HZ_COMMON is not set/' ./.config
elif [ "$CONDITION4" == "2" ] || [ "$_tickless" == "2" ]; then elif [ "$CONDITION4" = "2" ] || [ "$_tickless" = "2" ]; then
echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config
sed -i -e 's/CONFIG_HZ_PERIODIC=y/# CONFIG_HZ_PERIODIC is not set/' ./.config sed -i -e 's/CONFIG_HZ_PERIODIC=y/# CONFIG_HZ_PERIODIC is not set/' ./.config
sed -i -e 's/# CONFIG_NO_HZ_IDLE is not set/CONFIG_NO_HZ_IDLE=y/' ./.config sed -i -e 's/# CONFIG_NO_HZ_IDLE is not set/CONFIG_NO_HZ_IDLE=y/' ./.config
@@ -662,7 +662,7 @@ _tkg_srcprep() {
sed -i -e 's/# CONFIG_NO_HZ is not set/CONFIG_NO_HZ=y/' ./.config sed -i -e 's/# CONFIG_NO_HZ is not set/CONFIG_NO_HZ=y/' ./.config
sed -i -e 's/# CONFIG_NO_HZ_COMMON is not set/CONFIG_NO_HZ_COMMON=y/' ./.config sed -i -e 's/# CONFIG_NO_HZ_COMMON is not set/CONFIG_NO_HZ_COMMON=y/' ./.config
else else
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config
sed -i -e 's/CONFIG_HZ_PERIODIC=y/# CONFIG_HZ_PERIODIC is not set/' ./.config sed -i -e 's/CONFIG_HZ_PERIODIC=y/# CONFIG_HZ_PERIODIC is not set/' ./.config
sed -i -e 's/# CONFIG_NO_HZ_IDLE is not set/CONFIG_NO_HZ_IDLE=y/' ./.config sed -i -e 's/# CONFIG_NO_HZ_IDLE is not set/CONFIG_NO_HZ_IDLE=y/' ./.config
@@ -689,7 +689,7 @@ _tkg_srcprep() {
plain "and improve throughput on other schedulers (at the cost of latency)" plain "and improve throughput on other schedulers (at the cost of latency)"
read -rp "`echo $' > N/y : '`" CONDITION5; read -rp "`echo $' > N/y : '`" CONDITION5;
fi fi
if [[ "$CONDITION5" =~ [yY] ]] || [ "$_voluntary_preempt" == "true" ]; then if [[ "$CONDITION5" =~ [yY] ]] || [ "$_voluntary_preempt" = "true" ]; then
sed -i -e 's/CONFIG_PREEMPT=y/# CONFIG_PREEMPT is not set/' ./.config sed -i -e 's/CONFIG_PREEMPT=y/# CONFIG_PREEMPT is not set/' ./.config
sed -i -e 's/CONFIG_PREEMPT_LL=y/# CONFIG_PREEMPT_LL is not set/' ./.config sed -i -e 's/CONFIG_PREEMPT_LL=y/# CONFIG_PREEMPT_LL is not set/' ./.config
sed -i -e 's/# CONFIG_PREEMPT_VOLUNTARY is not set/CONFIG_PREEMPT_VOLUNTARY=y/' ./.config sed -i -e 's/# CONFIG_PREEMPT_VOLUNTARY is not set/CONFIG_PREEMPT_VOLUNTARY=y/' ./.config
@@ -701,7 +701,7 @@ _tkg_srcprep() {
plain "Enable Device Tree and Open Firmware support?" plain "Enable Device Tree and Open Firmware support?"
read -rp "`echo $' > N/y : '`" CONDITION6; read -rp "`echo $' > N/y : '`" CONDITION6;
fi fi
if [[ "$CONDITION6" =~ [yY] ]] || [ "$_OFenable" == "true" ]; then if [[ "$CONDITION6" =~ [yY] ]] || [ "$_OFenable" = "true" ]; then
sed -i -e 's/# CONFIG_OF is not set/CONFIG_OF=y/' ./.config sed -i -e 's/# CONFIG_OF is not set/CONFIG_OF=y/' ./.config
fi fi
@@ -712,7 +712,7 @@ _tkg_srcprep() {
plain "https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_.28ACS_override_patch.29" plain "https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_.28ACS_override_patch.29"
read -rp "`echo $' > N/y : '`" CONDITION7; read -rp "`echo $' > N/y : '`" CONDITION7;
fi fi
if [[ "$CONDITION7" =~ [yY] ]] || [ "$_acs_override" == "true" ]; then if [[ "$CONDITION7" =~ [yY] ]] || [ "$_acs_override" = "true" ]; then
msg2 "Patching ACS override" msg2 "Patching ACS override"
patch -Np1 -i "$srcdir"/0006-add-acs-overrides_iommu.patch patch -Np1 -i "$srcdir"/0006-add-acs-overrides_iommu.patch
fi fi
@@ -724,7 +724,7 @@ _tkg_srcprep() {
plain "https://bcachefs.org/" plain "https://bcachefs.org/"
read -rp "`echo $' > N/y : '`" CONDITION8; read -rp "`echo $' > N/y : '`" CONDITION8;
fi fi
if [[ "$CONDITION8" =~ [yY] ]] || [ "$_bcachefs" == "true" ]; then if [[ "$CONDITION8" =~ [yY] ]] || [ "$_bcachefs" = "true" ]; then
msg2 "Patching Bcache filesystem support override" msg2 "Patching Bcache filesystem support override"
patch -Np1 -i "$srcdir"/0008-5.7-bcachefs.patch patch -Np1 -i "$srcdir"/0008-5.7-bcachefs.patch
@@ -743,7 +743,7 @@ _tkg_srcprep() {
plain "https://steamcommunity.com/games/221410/announcements/detail/2957094910196249305" plain "https://steamcommunity.com/games/221410/announcements/detail/2957094910196249305"
read -rp "`echo $' > N/y : '`" CONDITION9; read -rp "`echo $' > N/y : '`" CONDITION9;
fi fi
if [[ "$CONDITION9" =~ [yY] ]] || [ "$_fsync" == "true" ]; then if [[ "$CONDITION9" =~ [yY] ]] || [ "$_fsync" = "true" ]; then
msg2 "Patching Fsync support" msg2 "Patching Fsync support"
patch -Np1 -i "$srcdir"/0007-v5.7-fsync.patch patch -Np1 -i "$srcdir"/0007-v5.7-fsync.patch
fi fi
@@ -755,7 +755,7 @@ _tkg_srcprep() {
plain "https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch" plain "https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch"
read -rp "`echo $' > N/y : '`" CONDITION11; read -rp "`echo $' > N/y : '`" CONDITION11;
fi fi
if [[ "$CONDITION11" =~ [yY] ]] || [ "$_zfsfix" == "true" ]; then if [[ "$CONDITION11" =~ [yY] ]] || [ "$_zfsfix" = "true" ]; then
msg2 "Patching missing symbol for AES-NI/AVX support on ZFS" msg2 "Patching missing symbol for AES-NI/AVX support on ZFS"
patch -Np1 -i "$srcdir"/0011-ZFS-fix.patch patch -Np1 -i "$srcdir"/0011-ZFS-fix.patch
fi fi
@@ -772,7 +772,7 @@ _tkg_srcprep() {
fi fi
# userpatches # userpatches
if [ "$_user_patches" == "true" ]; then if [ "$_user_patches" = "true" ]; then
_userpatch_target="linux-${_basekernel}" _userpatch_target="linux-${_basekernel}"
_userpatch_ext="my" _userpatch_ext="my"
user_patcher user_patcher
@@ -783,7 +783,7 @@ _tkg_srcprep() {
rm -f "$_where"/$_p rm -f "$_where"/$_p
done done
if [ "$_distro" == "Arch" ]; then if [ "$_distro" = "Arch" ]; then
# don't run depmod on 'make install'. We'll do this ourselves in packaging # don't run depmod on 'make install'. We'll do this ourselves in packaging
sed -i '2iexit 0' scripts/depmod.sh sed -i '2iexit 0' scripts/depmod.sh
@@ -800,7 +800,7 @@ _tkg_srcprep() {
plain "!!!! Make sure to have a well populated db !!!!" plain "!!!! Make sure to have a well populated db !!!!"
read -rp "`echo $' > N/y : '`" CONDITIONMPDB; read -rp "`echo $' > N/y : '`" CONDITIONMPDB;
fi fi
if [[ "$CONDITIONMPDB" =~ [yY] ]] || [ "$_modprobeddb" == "true" ]; then if [[ "$CONDITIONMPDB" =~ [yY] ]] || [ "$_modprobeddb" = "true" ]; then
sudo modprobed-db recall sudo modprobed-db recall
make localmodconfig make localmodconfig
fi fi
@@ -889,7 +889,7 @@ _tkg_srcprep() {
rm .config.orig rm .config.orig
fi fi
if [ "$_distro" == "Arch" ]; then if [ "$_distro" = "Arch" ]; then
make -s kernelrelease > version make -s kernelrelease > version
msg2 "Prepared %s version %s" "$pkgbase" "$(<version)" msg2 "Prepared %s version %s" "$pkgbase" "$(<version)"
fi fi
@@ -965,7 +965,7 @@ exit_cleanup() {
rm -f "$srcdir"/linux-${_basekernel}/mm/uksm.c rm -f "$srcdir"/linux-${_basekernel}/mm/uksm.c
fi fi
if [ "${_distro}" == "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
remove_deps remove_deps
fi fi

View File

@@ -123,7 +123,7 @@ build() {
PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH} PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH}
fi fi
if [ "$_force_all_threads" == "true" ]; then if [ "$_force_all_threads" = "true" ]; then
_force_all_threads="-j$((`nproc`*2))" _force_all_threads="-j$((`nproc`*2))"
else else
_force_all_threads="${MAKEFLAGS}" _force_all_threads="${MAKEFLAGS}"
@@ -258,7 +258,7 @@ hackheaders() {
echo "Stripping vmlinux..." echo "Stripping vmlinux..."
strip -v $STRIP_STATIC "$builddir/vmlinux" strip -v $STRIP_STATIC "$builddir/vmlinux"
if [ $_NUKR == "true" ]; then if [ $_NUKR = "true" ]; then
rm -rf "$srcdir" # Nuke the entire src folder so it'll get regenerated clean on next build rm -rf "$srcdir" # Nuke the entire src folder so it'll get regenerated clean on next build
fi fi
} }

View File

@@ -40,17 +40,17 @@ if [ -e "$_EXT_CONFIG_PATH" ]; then
source "$_EXT_CONFIG_PATH" source "$_EXT_CONFIG_PATH"
fi fi
if [ "$1" == "install" ] || [ "$1" == "config" ]; then if [ "$1" = "install" ] || [ "$1" = "config" ]; then
source linux*-tkg-config/prepare source linux*-tkg-config/prepare
if [ $1 == "install" ] && [ "$_distro" != "Ubuntu" ]; then if [ $1 = "install" ] && [ "$_distro" != "Ubuntu" ]; then
msg2 "Variable \"_distro\" in \"customization.cfg\" hasn't been set to \"Ubuntu\"" msg2 "Variable \"_distro\" in \"customization.cfg\" hasn't been set to \"Ubuntu\""
msg2 "This script can only install custom kernels for Ubuntu and Debian derivatives. Exiting..." msg2 "This script can only install custom kernels for Ubuntu and Debian derivatives. Exiting..."
exit 0 exit 0
fi fi
if [ "$_distro" == "Ubuntu" ]; then if [ "$_distro" = "Ubuntu" ]; then
msg2 "Installing dependencies" msg2 "Installing dependencies"
sudo apt install git build-essential kernel-package fakeroot libncurses5-dev libssl-dev ccache bison flex sudo apt install git build-essential kernel-package fakeroot libncurses5-dev libssl-dev ccache bison flex
else else
@@ -58,7 +58,7 @@ if [ "$1" == "install" ] || [ "$1" == "config" ]; then
fi fi
# Force prepare script to avoid Arch specific commands if the user didn't change _distro from "Arch" # Force prepare script to avoid Arch specific commands if the user didn't change _distro from "Arch"
if [ "$1" == "config" ]; then if [ "$1" = "config" ]; then
_distro="" _distro=""
fi fi
@@ -112,14 +112,14 @@ if [ "$1" == "install" ] || [ "$1" == "config" ]; then
msg2 "Configuration done." msg2 "Configuration done."
fi fi
if [ "$1" == "install" ]; then if [ "$1" = "install" ]; then
# Use custom compiler paths if defined # Use custom compiler paths if defined
if [ -n "${CUSTOM_GCC_PATH}" ]; then if [ -n "${CUSTOM_GCC_PATH}" ]; then
PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH} PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH}
fi fi
if [ "$_force_all_threads" == "true" ]; then if [ "$_force_all_threads" = "true" ]; then
_thread_num=`nproc` _thread_num=`nproc`
else else
_thread_num=`expr \`nproc\` / 4` _thread_num=`expr \`nproc\` / 4`
@@ -130,7 +130,7 @@ if [ "$1" == "install" ]; then
# ccache # ccache
if [ "$_noccache" != "true" ]; then if [ "$_noccache" != "true" ]; then
if [ "$_distro" == "Ubuntu" ] && dpkg -l ccache > /dev/null; then if [ "$_distro" = "Ubuntu" ] && dpkg -l ccache > /dev/null; then
export PATH="/usr/lib/ccache/bin/:$PATH" export PATH="/usr/lib/ccache/bin/:$PATH"
export CCACHE_SLOPPINESS="file_macro,locale,time_macros" export CCACHE_SLOPPINESS="file_macro,locale,time_macros"
export CCACHE_NOHASHDIR="true" export CCACHE_NOHASHDIR="true"
@@ -143,11 +143,11 @@ if [ "$1" == "install" ]; then
_kernel_flavor="tkg-${_cpusched}" _kernel_flavor="tkg-${_cpusched}"
fi fi
if [ "$_distro" == "Ubuntu" ]; then if [ "$_distro" = "Ubuntu" ]; then
if make -j ${_thread_num} deb-pkg LOCALVERSION=-${_kernel_flavor}; then if make -j ${_thread_num} deb-pkg LOCALVERSION=-${_kernel_flavor}; then
msg2 "Building successfully finished!" msg2 "Building successfully finished!"
read -p "Do you want to install the new Kernel ? y/[n]: " _install read -p "Do you want to install the new Kernel ? y/[n]: " _install
if [[ $_install =~ [yY] ]] || [[ $_install =~ [yY] ]] || [ $_install == "yes" ] || [ $_install == "Yes" ]; then if [[ $_install =~ [yY] ]] || [[ $_install =~ [yY] ]] || [ $_install = "yes" ] || [ $_install = "Yes" ]; then
cd "$_where" cd "$_where"
_kernelname=$_basekernel.$_kernel_subver-$_kernel_flavor _kernelname=$_basekernel.$_kernel_subver-$_kernel_flavor
_headers_deb=linux-headers-${_kernelname}*.deb _headers_deb=linux-headers-${_kernelname}*.deb
@@ -164,7 +164,7 @@ if [ "$1" == "install" ]; then
fi fi
fi fi
if [ "$1" == "uninstall" ]; then if [ "$1" = "uninstall" ]; then
cd "$_where" cd "$_where"

View File

@@ -19,9 +19,9 @@ _tkg_initscript() {
plain "Do you want to use a predefined optimized profile?" plain "Do you want to use a predefined optimized profile?"
read -rp "`echo $' > 1.Custom\n 2.Ryzen Desktop (Performance)\n 3.Other Desktop (Performance)\nchoice[1-3?]: '`" _OPTIPROFILE; read -rp "`echo $' > 1.Custom\n 2.Ryzen Desktop (Performance)\n 3.Other Desktop (Performance)\nchoice[1-3?]: '`" _OPTIPROFILE;
fi fi
if [ "$_OPTIPROFILE" == "2" ]; then if [ "$_OPTIPROFILE" = "2" ]; then
source "$_where"/ryzen-desktop-profile.cfg && msg2 "Ryzen Desktop (Performance) profile will be used." && msg2 "" source "$_where"/ryzen-desktop-profile.cfg && msg2 "Ryzen Desktop (Performance) profile will be used." && msg2 ""
elif [ "$_OPTIPROFILE" == "3" ]; then elif [ "$_OPTIPROFILE" = "3" ]; then
source "$_where"/generic-desktop-profile.cfg && msg2 "Generic Desktop (Performance) profile will be used." && msg2 "" source "$_where"/generic-desktop-profile.cfg && msg2 "Generic Desktop (Performance) profile will be used." && msg2 ""
fi fi
@@ -34,9 +34,9 @@ _tkg_initscript() {
if [ -z "$_cpusched" ] && [ ! -e "$_where"/cpuschedset ]; then if [ -z "$_cpusched" ] && [ ! -e "$_where"/cpuschedset ]; then
plain "What CPU sched variant do you want to build/install?" plain "What CPU sched variant do you want to build/install?"
read -rp "`echo $' > 1.PDS\n 2.Project C / BMQ\n 3.CFS\nchoice[1-3?]: '`" CONDITION; read -rp "`echo $' > 1.PDS\n 2.Project C / BMQ\n 3.CFS\nchoice[1-3?]: '`" CONDITION;
if [ "$CONDITION" == "2" ]; then if [ "$CONDITION" = "2" ]; then
echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset
elif [ "$CONDITION" == "3" ]; then elif [ "$CONDITION" = "3" ]; then
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
else else
echo "_cpusched=\"pds\"" > "$_where"/cpuschedset echo "_cpusched=\"pds\"" > "$_where"/cpuschedset
@@ -44,18 +44,18 @@ _tkg_initscript() {
if [ -n "$_custom_pkgbase" ]; then if [ -n "$_custom_pkgbase" ]; then
echo "_custom_pkgbase=\"${_custom_pkgbase}\"" >> "$_where"/cpuschedset echo "_custom_pkgbase=\"${_custom_pkgbase}\"" >> "$_where"/cpuschedset
fi fi
elif [ "$_cpusched" == "pds" ]; then elif [ "$_cpusched" = "pds" ]; then
echo "_cpusched=\"pds\"" > "$_where"/cpuschedset echo "_cpusched=\"pds\"" > "$_where"/cpuschedset
elif [ "$_cpusched" == "cfs" ]; then elif [ "$_cpusched" = "cfs" ]; then
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
elif [ "$_cpusched" == "bmq" ]; then elif [ "$_cpusched" = "bmq" ]; then
echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset
else else
if [ "$_nofallback" != "true" ]; then if [ "$_nofallback" != "true" ]; then
warning "Something is wrong with your cpusched selection. Do you want to fallback to CFS (default)?" warning "Something is wrong with your cpusched selection. Do you want to fallback to CFS (default)?"
read -rp "`echo $' > N/y : '`" _fallback; read -rp "`echo $' > N/y : '`" _fallback;
fi fi
if [[ "$_fallback" =~ [yY] ]] || [ "$_nofallback" == "true" ]; then if [[ "$_fallback" =~ [yY] ]] || [ "$_nofallback" = "true" ]; then
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
else else
error "Exiting..." error "Exiting..."
@@ -75,7 +75,7 @@ user_patcher() {
printf '%s\n' "${_patches[@]}" printf '%s\n' "${_patches[@]}"
read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION;
fi fi
if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" = "true" ]; then
for _f in "${_patches[@]}"; do for _f in "${_patches[@]}"; do
if [ -e "${_f}" ]; then if [ -e "${_f}" ]; then
msg2 "######################################################" msg2 "######################################################"
@@ -97,7 +97,7 @@ user_patcher() {
printf '%s\n' "${_patches[@]}" printf '%s\n' "${_patches[@]}"
read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION;
fi fi
if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" = "true" ]; then
for _f in "${_patches[@]}"; do for _f in "${_patches[@]}"; do
if [ -e "${_f}" ]; then if [ -e "${_f}" ]; then
msg2 "######################################################" msg2 "######################################################"
@@ -115,7 +115,7 @@ user_patcher() {
_tkg_srcprep() { _tkg_srcprep() {
if [ "${_distro}" == "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
msg2 "Setting version..." msg2 "Setting version..."
scripts/setlocalversion --save-scmversion scripts/setlocalversion --save-scmversion
echo "-$pkgrel-tkg-${_cpusched}" > localversion.10-pkgrel echo "-$pkgrel-tkg-${_cpusched}" > localversion.10-pkgrel
@@ -126,7 +126,7 @@ _tkg_srcprep() {
patch -p1 -i "$srcdir"/patch-"${pkgver}" patch -p1 -i "$srcdir"/patch-"${pkgver}"
# ARCH Patches # ARCH Patches
if [ "${_configfile}" == "config_hardened.x86_64" ] && [ "${_cpusched}" == "cfs" ]; then if [ "${_configfile}" = "config_hardened.x86_64" ] && [ "${_cpusched}" = "cfs" ]; then
msg2 "Using linux hardened patchset" msg2 "Using linux hardened patchset"
patch -Np1 -i "$srcdir"/0012-linux-hardened.patch patch -Np1 -i "$srcdir"/0012-linux-hardened.patch
else else
@@ -136,7 +136,7 @@ _tkg_srcprep() {
# graysky's cpu opts - https://github.com/graysky2/kernel_gcc_patch # graysky's cpu opts - https://github.com/graysky2/kernel_gcc_patch
msg2 "Applying graysky's cpu opts patch" msg2 "Applying graysky's cpu opts patch"
if [ "${_distro}" == "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v5.8%2B.patch patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v5.8%2B.patch
else else
patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1+_kernel_v5.8+.patch patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1+_kernel_v5.8+.patch
@@ -157,17 +157,17 @@ _tkg_srcprep() {
fi fi
fi fi
if [ "$_misc_adds" == "true" ]; then if [ "$_misc_adds" = "true" ]; then
msg2 "Applying misc additions patch" msg2 "Applying misc additions patch"
patch -Np1 -i "$srcdir"/0012-misc-additions.patch patch -Np1 -i "$srcdir"/0012-misc-additions.patch
fi fi
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
# MuQSS # MuQSS
msg2 "Applying MuQSS base patch" msg2 "Applying MuQSS base patch"
patch -Np1 -i "$srcdir"/0004-5.8-ck1.patch patch -Np1 -i "$srcdir"/0004-5.8-ck1.patch
if [ "${_aggressive_ondemand}" == "true" ]; then if [ "${_aggressive_ondemand}" = "true" ]; then
msg2 "Applying MuQSS agressive ondemand governor patch" msg2 "Applying MuQSS agressive ondemand governor patch"
patch -Np1 -i "$srcdir"/0004-glitched-ondemand-muqss.patch patch -Np1 -i "$srcdir"/0004-glitched-ondemand-muqss.patch
fi fi
@@ -175,12 +175,12 @@ _tkg_srcprep() {
msg2 "Applying Glitched MuQSS patch" msg2 "Applying Glitched MuQSS patch"
patch -Np1 -i "$srcdir"/0004-glitched-muqss.patch patch -Np1 -i "$srcdir"/0004-glitched-muqss.patch
elif [ "${_cpusched}" == "pds" ]; then elif [ "${_cpusched}" = "pds" ]; then
# PDS-mq # PDS-mq
msg2 "Applying PDS base patch" msg2 "Applying PDS base patch"
patch -Np1 -i "$srcdir"/0005-v5.8_undead-pds099o.patch patch -Np1 -i "$srcdir"/0005-v5.8_undead-pds099o.patch
if [ "${_aggressive_ondemand}" == "true" ]; then if [ "${_aggressive_ondemand}" = "true" ]; then
msg2 "Applying PDS agressive ondemand governor patch" msg2 "Applying PDS agressive ondemand governor patch"
patch -Np1 -i "$srcdir"/0005-glitched-ondemand-pds.patch patch -Np1 -i "$srcdir"/0005-glitched-ondemand-pds.patch
fi fi
@@ -188,13 +188,13 @@ _tkg_srcprep() {
msg2 "Applying Glitched PDS patch" msg2 "Applying Glitched PDS patch"
patch -Np1 -i "$srcdir"/0005-glitched-pds.patch patch -Np1 -i "$srcdir"/0005-glitched-pds.patch
elif [ "${_cpusched}" == "bmq" ]; then elif [ "${_cpusched}" = "bmq" ]; then
# Project C / BMQ # Project C / BMQ
msg2 "Applying Project C / BMQ base patch" msg2 "Applying Project C / BMQ base patch"
patch -Np1 -i "$srcdir"/0009-prjc_v5.8-r0.patch patch -Np1 -i "$srcdir"/0009-prjc_v5.8-r0.patch
if [ "${_aggressive_ondemand}" == "true" ]; then if [ "${_aggressive_ondemand}" = "true" ]; then
msg2 "Applying BMQ agressive ondemand governor patch" msg2 "Applying BMQ agressive ondemand governor patch"
patch -Np1 -i "$srcdir"/0009-glitched-ondemand-bmq.patch patch -Np1 -i "$srcdir"/0009-glitched-ondemand-bmq.patch
fi fi
@@ -202,12 +202,12 @@ _tkg_srcprep() {
msg2 "Applying Glitched BMQ patch" msg2 "Applying Glitched BMQ patch"
patch -Np1 -i "$srcdir"/0009-glitched-bmq.patch patch -Np1 -i "$srcdir"/0009-glitched-bmq.patch
elif [ "${_cpusched}" == "cfs" ]; then elif [ "${_cpusched}" = "cfs" ]; then
msg2 "Applying Glitched CFS patch" msg2 "Applying Glitched CFS patch"
patch -Np1 -i "$srcdir"/0003-glitched-cfs.patch patch -Np1 -i "$srcdir"/0003-glitched-cfs.patch
fi fi
if [ "${_distro}" == "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
if [ -z "${_configfile}" ]; then if [ -z "${_configfile}" ]; then
_configfile="config.x86_64" _configfile="config.x86_64"
fi fi
@@ -234,7 +234,7 @@ _tkg_srcprep() {
echo "CONFIG_CMDLINE=\"${_custom_commandline}\"" >> ./.config echo "CONFIG_CMDLINE=\"${_custom_commandline}\"" >> ./.config
echo "# CONFIG_CMDLINE_OVERRIDE is not set" >> ./.config echo "# CONFIG_CMDLINE_OVERRIDE is not set" >> ./.config
if [ "$_noccache" != "true" ]; then if [ "$_noccache" != "true" ]; then
if { [ "$_distro" == "Arch" ] && pacman -Qq ccache &> /dev/null; } || { [ "$_distro" == "Ubuntu" ] && dpkg -l ccache > /dev/null; }; then if { [ "$_distro" = "Arch" ] && pacman -Qq ccache &> /dev/null; } || { [ "$_distro" = "Ubuntu" ] && dpkg -l ccache > /dev/null; }; then
sed -i -e 's/CONFIG_GCC_PLUGINS=y/# CONFIG_GCC_PLUGINS is not set/' ./.config sed -i -e 's/CONFIG_GCC_PLUGINS=y/# CONFIG_GCC_PLUGINS is not set/' ./.config
fi fi
fi fi
@@ -274,7 +274,7 @@ _tkg_srcprep() {
echo "# CONFIG_MTIGERLAKE is not set" >> ./.config echo "# CONFIG_MTIGERLAKE is not set" >> ./.config
# Disable some debugging # Disable some debugging
if [ "${_debugdisable}" == "true" ]; then if [ "${_debugdisable}" = "true" ]; then
sed -i -e 's/CONFIG_SLUB_DEBUG=y/# CONFIG_SLUB_DEBUG is not set/' ./.config sed -i -e 's/CONFIG_SLUB_DEBUG=y/# CONFIG_SLUB_DEBUG is not set/' ./.config
sed -i -e 's/CONFIG_PM_DEBUG=y/# CONFIG_PM_DEBUG is not set/' ./.config sed -i -e 's/CONFIG_PM_DEBUG=y/# CONFIG_PM_DEBUG is not set/' ./.config
sed -i -e 's/CONFIG_PM_ADVANCED_DEBUG=y/# CONFIG_PM_ADVANCED_DEBUG is not set/' ./.config sed -i -e 's/CONFIG_PM_ADVANCED_DEBUG=y/# CONFIG_PM_ADVANCED_DEBUG is not set/' ./.config
@@ -285,18 +285,18 @@ _tkg_srcprep() {
sed -i -e 's/CONFIG_DEBUG_PREEMPT=y/# CONFIG_DEBUG_PREEMPT is not set/' ./.config sed -i -e 's/CONFIG_DEBUG_PREEMPT=y/# CONFIG_DEBUG_PREEMPT is not set/' ./.config
fi fi
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
# MuQSS default config # MuQSS default config
echo "CONFIG_SCHED_MUQSS=y" >> ./.config echo "CONFIG_SCHED_MUQSS=y" >> ./.config
elif [ "${_cpusched}" == "pds" ]; then elif [ "${_cpusched}" = "pds" ]; then
# PDS default config # PDS default config
echo "CONFIG_SCHED_PDS=y" >> ./.config echo "CONFIG_SCHED_PDS=y" >> ./.config
elif [ "${_cpusched}" == "bmq" ]; then elif [ "${_cpusched}" = "bmq" ]; then
# BMQ default config # BMQ default config
echo "CONFIG_SCHED_ALT=y" >> ./.config echo "CONFIG_SCHED_ALT=y" >> ./.config
fi fi
if [ "${_cpusched}" == "MuQSS" ] || [ "${_cpusched}" == "pds" ] || [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "MuQSS" ] || [ "${_cpusched}" = "pds" ] || [ "${_cpusched}" = "bmq" ]; then
# Disable CFS # Disable CFS
sed -i -e 's/CONFIG_FAIR_GROUP_SCHED=y/# CONFIG_FAIR_GROUP_SCHED is not set/' ./.config sed -i -e 's/CONFIG_FAIR_GROUP_SCHED=y/# CONFIG_FAIR_GROUP_SCHED is not set/' ./.config
sed -i -e 's/CONFIG_CFS_BANDWIDTH=y/# CONFIG_CFS_BANDWIDTH is not set/' ./.config sed -i -e 's/CONFIG_CFS_BANDWIDTH=y/# CONFIG_CFS_BANDWIDTH is not set/' ./.config
@@ -316,30 +316,30 @@ _tkg_srcprep() {
plain "0: No yield." plain "0: No yield."
plain "1: Deboost and requeue task. (default)" plain "1: Deboost and requeue task. (default)"
plain "2: Set rq skip task." plain "2: Set rq skip task."
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
read -rp "`echo $'\n 0. Supposedly best option for gaming performance - could lead to stability issues on some (AMD) platforms when combined with MuQSS\n > 1. Default and recommended option for MuQSS - could lead to stability issues on some (Intel) platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0; read -rp "`echo $'\n 0. Supposedly best option for gaming performance - could lead to stability issues on some (AMD) platforms when combined with MuQSS\n > 1. Default and recommended option for MuQSS - could lead to stability issues on some (Intel) platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0;
else else
read -rp "`echo $'\n > 0. Recommended option for gaming on PDS - "tkg" default\n 1. Default, but can lead to stability issues on some platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0; read -rp "`echo $'\n > 0. Recommended option for gaming on PDS - "tkg" default\n 1. Default, but can lead to stability issues on some platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0;
fi fi
fi fi
if [ "$CONDITION0" == "0" ]; then if [ "$CONDITION0" = "0" ]; then
if [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "bmq" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c
else else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c
fi fi
elif [ "$CONDITION0" == "1" ]; then elif [ "$CONDITION0" = "1" ]; then
msg2 "Using default CPU sched yield type (1)" msg2 "Using default CPU sched yield type (1)"
elif [ "$CONDITION0" == "2" ]; then elif [ "$CONDITION0" = "2" ]; then
if [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "bmq" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/alt_core.c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/alt_core.c
else else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/"${_cpusched}".c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/"${_cpusched}".c
fi fi
else else
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
msg2 "Using default CPU sched yield type (1)" msg2 "Using default CPU sched yield type (1)"
elif [ "${_cpusched}" == "bmq" ]; then elif [ "${_cpusched}" = "bmq" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c
else else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c
@@ -348,7 +348,7 @@ _tkg_srcprep() {
fi fi
# Round Robin interval # Round Robin interval
if [ "${_cpusched}" == "MuQSS" ] || [ "${_cpusched}" == "pds" ] || [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "MuQSS" ] || [ "${_cpusched}" = "pds" ] || [ "${_cpusched}" = "bmq" ]; then
if [ -n "$_rr_interval" ]; then if [ -n "$_rr_interval" ]; then
CONDITION1="$_rr_interval" CONDITION1="$_rr_interval"
else else
@@ -363,16 +363,16 @@ _tkg_srcprep() {
plain "BMQ default: 2ms" plain "BMQ default: 2ms"
read -rp "`echo $'\n > 0.Keep defaults\n 1.2ms\n 2.4ms\n 3.6ms\n 4.8ms\n [0-4?]: '`" CONDITION1; read -rp "`echo $'\n > 0.Keep defaults\n 1.2ms\n 2.4ms\n 3.6ms\n 4.8ms\n [0-4?]: '`" CONDITION1;
fi fi
if [ "$CONDITION1" == "1" ]; then if [ "$CONDITION1" = "1" ]; then
msg2 "Using 2ms rr_interval" msg2 "Using 2ms rr_interval"
_rrvalue="2" _rrvalue="2"
elif [ "$CONDITION1" == "2" ]; then elif [ "$CONDITION1" = "2" ]; then
msg2 "Using 4ms rr_interval" msg2 "Using 4ms rr_interval"
_rrvalue="4" _rrvalue="4"
elif [ "$CONDITION1" == "3" ]; then elif [ "$CONDITION1" = "3" ]; then
msg2 "Using 6ms rr_interval" msg2 "Using 6ms rr_interval"
_rrvalue="6" _rrvalue="6"
elif [ "$CONDITION1" == "4" ]; then elif [ "$CONDITION1" = "4" ]; then
msg2 "Using 8ms rr_interval" msg2 "Using 8ms rr_interval"
_rrvalue="8" _rrvalue="8"
else else
@@ -380,34 +380,34 @@ _tkg_srcprep() {
_rrvalue="default" _rrvalue="default"
fi fi
if [ "$_rrvalue" != "default" ]; then if [ "$_rrvalue" != "default" ]; then
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
sed -i -e "s/int rr_interval __read_mostly = 6;/int rr_interval __read_mostly = ${_rrvalue};/" ./kernel/sched/"${_cpusched}".c sed -i -e "s/int rr_interval __read_mostly = 6;/int rr_interval __read_mostly = ${_rrvalue};/" ./kernel/sched/"${_cpusched}".c
elif [ "${_cpusched}" == "pds" ]; then elif [ "${_cpusched}" = "pds" ]; then
sed -i -e "s/#define SCHED_DEFAULT_RR (4)/#define SCHED_DEFAULT_RR (${_rrvalue})/" ./kernel/sched/"${_cpusched}".c sed -i -e "s/#define SCHED_DEFAULT_RR (4)/#define SCHED_DEFAULT_RR (${_rrvalue})/" ./kernel/sched/"${_cpusched}".c
elif [ "${_cpusched}" == "bmq" ]; then elif [ "${_cpusched}" = "bmq" ]; then
sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (${_rrvalue} * 1000 * 1000);/" ./kernel/sched/alt_core.c sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (${_rrvalue} * 1000 * 1000);/" ./kernel/sched/alt_core.c
fi fi
else else
if [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "bmq" ]; then
sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (2 * 1000 * 1000);/" ./kernel/sched/alt_core.c sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (2 * 1000 * 1000);/" ./kernel/sched/alt_core.c
fi fi
fi fi
fi fi
# zenify # zenify
if [ "$_zenify" == "true" ]; then if [ "$_zenify" = "true" ]; then
echo "CONFIG_ZENIFY=y" >> ./.config echo "CONFIG_ZENIFY=y" >> ./.config
elif [ "$_zenify" == "false" ]; then elif [ "$_zenify" = "false" ]; then
echo "# CONFIG_ZENIFY is not set" >> ./.config echo "# CONFIG_ZENIFY is not set" >> ./.config
fi fi
# compiler optimization level # compiler optimization level
if [ "$_compileroptlevel" == "1" ]; then if [ "$_compileroptlevel" = "1" ]; then
echo "# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set" >> ./.config echo "# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set" >> ./.config
elif [ "$_compileroptlevel" == "2" ]; then elif [ "$_compileroptlevel" = "2" ]; then
sed -i -e 's/CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y/# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set/' ./.config sed -i -e 's/CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y/# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set/' ./.config
echo "CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y" >> ./.config echo "CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y" >> ./.config
elif [ "$_compileroptlevel" == "3" ]; then elif [ "$_compileroptlevel" = "3" ]; then
sed -i -e 's/CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y/# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set/' ./.config sed -i -e 's/CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y/# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set/' ./.config
sed -i -e 's/# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set/CONFIG_CC_OPTIMIZE_FOR_SIZE=y/' ./.config sed -i -e 's/# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set/CONFIG_CC_OPTIMIZE_FOR_SIZE=y/' ./.config
echo "# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set" >> ./.config echo "# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set" >> ./.config
@@ -422,103 +422,103 @@ _tkg_srcprep() {
sed -i -e 's/CONFIG_GENERIC_CPU=y/# CONFIG_GENERIC_CPU is not set/' ./.config sed -i -e 's/CONFIG_GENERIC_CPU=y/# CONFIG_GENERIC_CPU is not set/' ./.config
fi fi
if [ "$_processor_opt" == "native" ]; then if [ "$_processor_opt" = "native" ]; then
echo "CONFIG_MNATIVE=y" >> ./.config echo "CONFIG_MNATIVE=y" >> ./.config
elif [ "$_processor_opt" == "k8" ]; then elif [ "$_processor_opt" = "k8" ]; then
sed -i -e 's/# CONFIG_MK8 is not set/CONFIG_MK8=y/' ./.config sed -i -e 's/# CONFIG_MK8 is not set/CONFIG_MK8=y/' ./.config
elif [ "$_processor_opt" == "k8sse3" ]; then elif [ "$_processor_opt" = "k8sse3" ]; then
sed -i -e 's/# CONFIG_MK8SSE3 is not set/CONFIG_MK8SSE3=y/' ./.config sed -i -e 's/# CONFIG_MK8SSE3 is not set/CONFIG_MK8SSE3=y/' ./.config
elif [ "$_processor_opt" == "k10" ]; then elif [ "$_processor_opt" = "k10" ]; then
sed -i -e 's/# CONFIG_MK10 is not set/CONFIG_MK10=y/' ./.config sed -i -e 's/# CONFIG_MK10 is not set/CONFIG_MK10=y/' ./.config
elif [ "$_processor_opt" == "barcelona" ]; then elif [ "$_processor_opt" = "barcelona" ]; then
sed -i -e 's/# CONFIG_MBARCELONA is not set/CONFIG_MBARCELONA=y/' ./.config sed -i -e 's/# CONFIG_MBARCELONA is not set/CONFIG_MBARCELONA=y/' ./.config
elif [ "$_processor_opt" == "bobcat" ]; then elif [ "$_processor_opt" = "bobcat" ]; then
sed -i -e 's/# CONFIG_MBOBCAT is not set/CONFIG_MBOBCAT=y/' ./.config sed -i -e 's/# CONFIG_MBOBCAT is not set/CONFIG_MBOBCAT=y/' ./.config
elif [ "$_processor_opt" == "jaguar" ]; then elif [ "$_processor_opt" = "jaguar" ]; then
sed -i -e 's/# CONFIG_MJAGUAR is not set/CONFIG_MJAGUAR=y/' ./.config sed -i -e 's/# CONFIG_MJAGUAR is not set/CONFIG_MJAGUAR=y/' ./.config
elif [ "$_processor_opt" == "bulldozer" ]; then elif [ "$_processor_opt" = "bulldozer" ]; then
sed -i -e 's/# CONFIG_MBULLDOZER is not set/CONFIG_MBULLDOZER=y/' ./.config sed -i -e 's/# CONFIG_MBULLDOZER is not set/CONFIG_MBULLDOZER=y/' ./.config
elif [ "$_processor_opt" == "piledriver" ]; then elif [ "$_processor_opt" = "piledriver" ]; then
sed -i -e 's/# CONFIG_MPILEDRIVER is not set/CONFIG_MPILEDRIVER=y/' ./.config sed -i -e 's/# CONFIG_MPILEDRIVER is not set/CONFIG_MPILEDRIVER=y/' ./.config
elif [ "$_processor_opt" == "steamroller" ]; then elif [ "$_processor_opt" = "steamroller" ]; then
sed -i -e 's/# CONFIG_MSTEAMROLLER is not set/CONFIG_MSTEAMROLLER=y/' ./.config sed -i -e 's/# CONFIG_MSTEAMROLLER is not set/CONFIG_MSTEAMROLLER=y/' ./.config
elif [ "$_processor_opt" == "excavator" ]; then elif [ "$_processor_opt" = "excavator" ]; then
sed -i -e 's/# CONFIG_MEXCAVATOR is not set/CONFIG_MEXCAVATOR=y/' ./.config sed -i -e 's/# CONFIG_MEXCAVATOR is not set/CONFIG_MEXCAVATOR=y/' ./.config
elif [ "$_processor_opt" == "zen" ]; then elif [ "$_processor_opt" = "zen" ]; then
sed -i -e 's/# CONFIG_MZEN is not set/CONFIG_MZEN=y/' ./.config sed -i -e 's/# CONFIG_MZEN is not set/CONFIG_MZEN=y/' ./.config
elif [ "$_processor_opt" == "zen2" ]; then elif [ "$_processor_opt" = "zen2" ]; then
sed -i -e 's/# CONFIG_MZEN2 is not set/CONFIG_MZEN2=y/' ./.config sed -i -e 's/# CONFIG_MZEN2 is not set/CONFIG_MZEN2=y/' ./.config
elif [ "$_processor_opt" == "mpsc" ]; then elif [ "$_processor_opt" = "mpsc" ]; then
sed -i -e 's/# CONFIG_MPSC is not set/CONFIG_MPSC=y/' ./.config sed -i -e 's/# CONFIG_MPSC is not set/CONFIG_MPSC=y/' ./.config
elif [ "$_processor_opt" == "atom" ]; then elif [ "$_processor_opt" = "atom" ]; then
sed -i -e 's/# CONFIG_MATOM is not set/CONFIG_MATOM=y/' ./.config sed -i -e 's/# CONFIG_MATOM is not set/CONFIG_MATOM=y/' ./.config
elif [ "$_processor_opt" == "core2" ]; then elif [ "$_processor_opt" = "core2" ]; then
sed -i -e 's/# CONFIG_MCORE2 is not set/CONFIG_MCORE2=y/' ./.config sed -i -e 's/# CONFIG_MCORE2 is not set/CONFIG_MCORE2=y/' ./.config
elif [ "$_processor_opt" == "nehalem" ]; then elif [ "$_processor_opt" = "nehalem" ]; then
sed -i -e 's/# CONFIG_MNEHALEM is not set/CONFIG_MNEHALEM=y/' ./.config sed -i -e 's/# CONFIG_MNEHALEM is not set/CONFIG_MNEHALEM=y/' ./.config
elif [ "$_processor_opt" == "westmere" ]; then elif [ "$_processor_opt" = "westmere" ]; then
sed -i -e 's/# CONFIG_MWESTMERE is not set/CONFIG_MWESTMERE=y/' ./.config sed -i -e 's/# CONFIG_MWESTMERE is not set/CONFIG_MWESTMERE=y/' ./.config
elif [ "$_processor_opt" == "silvermont" ]; then elif [ "$_processor_opt" = "silvermont" ]; then
sed -i -e 's/# CONFIG_MSILVERMONT is not set/CONFIG_MSILVERMONT=y/' ./.config sed -i -e 's/# CONFIG_MSILVERMONT is not set/CONFIG_MSILVERMONT=y/' ./.config
elif [ "$_processor_opt" == "sandybridge" ]; then elif [ "$_processor_opt" = "sandybridge" ]; then
sed -i -e 's/# CONFIG_MSANDYBRIDGE is not set/CONFIG_MSANDYBRIDGE=y/' ./.config sed -i -e 's/# CONFIG_MSANDYBRIDGE is not set/CONFIG_MSANDYBRIDGE=y/' ./.config
elif [ "$_processor_opt" == "ivybridge" ]; then elif [ "$_processor_opt" = "ivybridge" ]; then
sed -i -e 's/# CONFIG_MIVYBRIDGE is not set/CONFIG_MIVYBRIDGE=y/' ./.config sed -i -e 's/# CONFIG_MIVYBRIDGE is not set/CONFIG_MIVYBRIDGE=y/' ./.config
elif [ "$_processor_opt" == "haswell" ]; then elif [ "$_processor_opt" = "haswell" ]; then
sed -i -e 's/# CONFIG_MHASWELL is not set/CONFIG_MHASWELL=y/' ./.config sed -i -e 's/# CONFIG_MHASWELL is not set/CONFIG_MHASWELL=y/' ./.config
elif [ "$_processor_opt" == "broadwell" ]; then elif [ "$_processor_opt" = "broadwell" ]; then
sed -i -e 's/# CONFIG_MBROADWELL is not set/CONFIG_MBROADWELL=y/' ./.config sed -i -e 's/# CONFIG_MBROADWELL is not set/CONFIG_MBROADWELL=y/' ./.config
elif [ "$_processor_opt" == "skylake" ]; then elif [ "$_processor_opt" = "skylake" ]; then
sed -i -e 's/# CONFIG_MSKYLAKE is not set/CONFIG_MSKYLAKE=y/' ./.config sed -i -e 's/# CONFIG_MSKYLAKE is not set/CONFIG_MSKYLAKE=y/' ./.config
elif [ "$_processor_opt" == "skylakex" ]; then elif [ "$_processor_opt" = "skylakex" ]; then
sed -i -e 's/# CONFIG_MSKYLAKEX is not set/CONFIG_MSKYLAKEX=y/' ./.config sed -i -e 's/# CONFIG_MSKYLAKEX is not set/CONFIG_MSKYLAKEX=y/' ./.config
elif [ "$_processor_opt" == "cannonlake" ]; then elif [ "$_processor_opt" = "cannonlake" ]; then
sed -i -e 's/# CONFIG_MCANNONLAKE is not set/CONFIG_MCANNONLAKE=y/' ./.config sed -i -e 's/# CONFIG_MCANNONLAKE is not set/CONFIG_MCANNONLAKE=y/' ./.config
elif [ "$_processor_opt" == "icelake" ]; then elif [ "$_processor_opt" = "icelake" ]; then
sed -i -e 's/# CONFIG_MICELAKE is not set/CONFIG_MICELAKE=y/' ./.config sed -i -e 's/# CONFIG_MICELAKE is not set/CONFIG_MICELAKE=y/' ./.config
elif [ "$_processor_opt" == "goldmont" ]; then elif [ "$_processor_opt" = "goldmont" ]; then
sed -i -e 's/# CONFIG_MGOLDMONT is not set/CONFIG_MGOLDMONT=y/' ./.config sed -i -e 's/# CONFIG_MGOLDMONT is not set/CONFIG_MGOLDMONT=y/' ./.config
elif [ "$_processor_opt" == "goldmontplus" ]; then elif [ "$_processor_opt" = "goldmontplus" ]; then
sed -i -e 's/# CONFIG_MGOLDMONTPLUS is not set/CONFIG_MGOLDMONTPLUS=y/' ./.config sed -i -e 's/# CONFIG_MGOLDMONTPLUS is not set/CONFIG_MGOLDMONTPLUS=y/' ./.config
elif [ "$_processor_opt" == "cascadelake" ]; then elif [ "$_processor_opt" = "cascadelake" ]; then
sed -i -e 's/# CONFIG_MCASCADELAKE is not set/CONFIG_MCASCADELAKE=y/' ./.config sed -i -e 's/# CONFIG_MCASCADELAKE is not set/CONFIG_MCASCADELAKE=y/' ./.config
elif [ "$_processor_opt" == "cooperlake" ]; then elif [ "$_processor_opt" = "cooperlake" ]; then
sed -i -e 's/# CONFIG_MCOOPERLAKE is not set/CONFIG_MCOOPERLAKE=y/' ./.config sed -i -e 's/# CONFIG_MCOOPERLAKE is not set/CONFIG_MCOOPERLAKE=y/' ./.config
elif [ "$_processor_opt" == "tigerlake" ]; then elif [ "$_processor_opt" = "tigerlake" ]; then
sed -i -e 's/# CONFIG_MTIGERLAKE is not set/CONFIG_MTIGERLAKE=y/' ./.config sed -i -e 's/# CONFIG_MTIGERLAKE is not set/CONFIG_MTIGERLAKE=y/' ./.config
fi fi
# irq threading # irq threading
if [ "$_irq_threading" == "true" ]; then if [ "$_irq_threading" = "true" ]; then
echo "CONFIG_FORCE_IRQ_THREADING=y" >> ./.config echo "CONFIG_FORCE_IRQ_THREADING=y" >> ./.config
elif [ "$_irq_threading" == "false" ]; then elif [ "$_irq_threading" = "false" ]; then
echo "# CONFIG_FORCE_IRQ_THREADING is not set" >> ./.config echo "# CONFIG_FORCE_IRQ_THREADING is not set" >> ./.config
fi fi
# smt nice # smt nice
if [ "$_smt_nice" == "true" ]; then if [ "$_smt_nice" = "true" ]; then
echo "CONFIG_SMT_NICE=y" >> ./.config echo "CONFIG_SMT_NICE=y" >> ./.config
elif [ "$_smt_nice" == "false" ]; then elif [ "$_smt_nice" = "false" ]; then
echo "# CONFIG_SMT_NICE is not set" >> ./.config echo "# CONFIG_SMT_NICE is not set" >> ./.config
fi fi
# random trust cpu # random trust cpu
if [ "$_random_trust_cpu" == "true" ]; then if [ "$_random_trust_cpu" = "true" ]; then
sed -i -e 's/# CONFIG_RANDOM_TRUST_CPU is not set/CONFIG_RANDOM_TRUST_CPU=y/' ./.config sed -i -e 's/# CONFIG_RANDOM_TRUST_CPU is not set/CONFIG_RANDOM_TRUST_CPU=y/' ./.config
fi fi
# rq sharing # rq sharing
if [ "$_runqueue_sharing" == "none" ]; then if [ "$_runqueue_sharing" = "none" ]; then
echo -e "CONFIG_RQ_NONE=y\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "CONFIG_RQ_NONE=y\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config
elif [ -z "$_runqueue_sharing" ] || [ "$_runqueue_sharing" == "smt" ]; then elif [ -z "$_runqueue_sharing" ] || [ "$_runqueue_sharing" = "smt" ]; then
echo -e "# CONFIG_RQ_NONE is not set\nCONFIG_RQ_SMT=y\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\nCONFIG_RQ_SMT=y\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config
elif [ "$_runqueue_sharing" == "mc" ]; then elif [ "$_runqueue_sharing" = "mc" ]; then
echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\nCONFIG_RQ_MC=y\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\nCONFIG_RQ_MC=y\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config
elif [ "$_runqueue_sharing" == "smp" ]; then elif [ "$_runqueue_sharing" = "smp" ]; then
echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\nCONFIG_RQ_SMP=y\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\nCONFIG_RQ_SMP=y\n# CONFIG_RQ_ALL is not set" >> ./.config
elif [ "$_runqueue_sharing" == "all" ]; then elif [ "$_runqueue_sharing" = "all" ]; then
echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\nCONFIG_RQ_ALL=y" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\nCONFIG_RQ_ALL=y" >> ./.config
elif [ "$_runqueue_sharing" == "mc-llc" ]; then elif [ "$_runqueue_sharing" = "mc-llc" ]; then
echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\nCONFIG_RQ_MC_LLC=y\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\nCONFIG_RQ_MC_LLC=y\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config
fi fi
@@ -526,7 +526,7 @@ _tkg_srcprep() {
if [ -n "$_timer_freq" ] && [ "$_timer_freq" != "300" ]; then if [ -n "$_timer_freq" ] && [ "$_timer_freq" != "300" ]; then
sed -i -e 's/CONFIG_HZ_300=y/# CONFIG_HZ_300 is not set/' ./.config sed -i -e 's/CONFIG_HZ_300=y/# CONFIG_HZ_300 is not set/' ./.config
sed -i -e 's/CONFIG_HZ_300_NODEF=y/# CONFIG_HZ_300_NODEF is not set/' ./.config sed -i -e 's/CONFIG_HZ_300_NODEF=y/# CONFIG_HZ_300_NODEF is not set/' ./.config
if [ "$_timer_freq" == "1000" ]; then if [ "$_timer_freq" = "1000" ]; then
sed -i -e 's/# CONFIG_HZ_1000 is not set/CONFIG_HZ_1000=y/' ./.config sed -i -e 's/# CONFIG_HZ_1000 is not set/CONFIG_HZ_1000=y/' ./.config
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=1000/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=1000/' ./.config
echo "# CONFIG_HZ_500 is not set" >> ./.config echo "# CONFIG_HZ_500 is not set" >> ./.config
@@ -536,7 +536,7 @@ _tkg_srcprep() {
echo "CONFIG_HZ_1000_NODEF=y" >> ./.config echo "CONFIG_HZ_1000_NODEF=y" >> ./.config
echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config
elif [ "$_timer_freq" == "750" ]; then elif [ "$_timer_freq" = "750" ]; then
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=750/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=750/' ./.config
echo "# CONFIG_HZ_500 is not set" >> ./.config echo "# CONFIG_HZ_500 is not set" >> ./.config
echo "# CONFIG_HZ_500_NODEF is not set" >> ./.config echo "# CONFIG_HZ_500_NODEF is not set" >> ./.config
@@ -545,7 +545,7 @@ _tkg_srcprep() {
echo "# CONFIG_HZ_1000_NODEF is not set" >> ./.config echo "# CONFIG_HZ_1000_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config
elif [ "$_timer_freq" == "500" ]; then elif [ "$_timer_freq" = "500" ]; then
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=500/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=500/' ./.config
echo "CONFIG_HZ_500=y" >> ./.config echo "CONFIG_HZ_500=y" >> ./.config
echo "CONFIG_HZ_500_NODEF=y" >> ./.config echo "CONFIG_HZ_500_NODEF=y" >> ./.config
@@ -554,7 +554,7 @@ _tkg_srcprep() {
echo "# CONFIG_HZ_1000_NODEF is not set" >> ./.config echo "# CONFIG_HZ_1000_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config
elif [ "$_timer_freq" == "100" ]; then elif [ "$_timer_freq" = "100" ]; then
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=100/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=100/' ./.config
echo "# CONFIG_HZ_500 is not set" >> ./.config echo "# CONFIG_HZ_500 is not set" >> ./.config
echo "# CONFIG_HZ_750 is not set" >> ./.config echo "# CONFIG_HZ_750 is not set" >> ./.config
@@ -566,7 +566,7 @@ _tkg_srcprep() {
echo "CONFIG_HZ_100=y" >> ./.config echo "CONFIG_HZ_100=y" >> ./.config
echo "CONFIG_HZ_100_NODEF=y" >> ./.config echo "CONFIG_HZ_100_NODEF=y" >> ./.config
fi fi
elif [ "${_cpusched}" == "MuQSS" ] && [ -z "$_timer_freq" ]; then elif [ "${_cpusched}" = "MuQSS" ] && [ -z "$_timer_freq" ]; then
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=100/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=100/' ./.config
echo "# CONFIG_HZ_500 is not set" >> ./.config echo "# CONFIG_HZ_500 is not set" >> ./.config
echo "# CONFIG_HZ_750 is not set" >> ./.config echo "# CONFIG_HZ_750 is not set" >> ./.config
@@ -588,16 +588,16 @@ _tkg_srcprep() {
fi fi
# default cpu gov # default cpu gov
if [ "$_default_cpu_gov" == "performance" ]; then if [ "$_default_cpu_gov" = "performance" ]; then
sed -i -e 's/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y/# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set/' ./.config sed -i -e 's/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y/# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set/' ./.config
sed -i -e 's/# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set/CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y/' ./.config sed -i -e 's/# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set/CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y/' ./.config
elif [ "$_default_cpu_gov" == "ondemand" ]; then elif [ "$_default_cpu_gov" = "ondemand" ]; then
sed -i -e 's/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y/# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set/' ./.config sed -i -e 's/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y/# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set/' ./.config
sed -i -e 's/# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set/CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y/' ./.config sed -i -e 's/# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set/CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y/' ./.config
fi fi
# ACPI_CPUFREQ disablement # ACPI_CPUFREQ disablement
if [ "$_disable_acpi_cpufreq" == "true" ]; then if [ "$_disable_acpi_cpufreq" = "true" ]; then
sed -i -e 's/CONFIG_X86_ACPI_CPUFREQ=m/# CONFIG_X86_ACPI_CPUFREQ is not set/' ./.config sed -i -e 's/CONFIG_X86_ACPI_CPUFREQ=m/# CONFIG_X86_ACPI_CPUFREQ is not set/' ./.config
fi fi
@@ -608,7 +608,7 @@ _tkg_srcprep() {
plain "and analyzing of kernel functions." plain "and analyzing of kernel functions."
read -rp "`echo $' > N/y : '`" CONDITION2; read -rp "`echo $' > N/y : '`" CONDITION2;
fi fi
if [[ "$CONDITION2" =~ [yY] ]] || [ "$_ftracedisable" == "true" ]; then if [[ "$CONDITION2" =~ [yY] ]] || [ "$_ftracedisable" = "true" ]; then
sed -i -e 's/CONFIG_FUNCTION_TRACER=y/# CONFIG_FUNCTION_TRACER is not set/' ./.config sed -i -e 's/CONFIG_FUNCTION_TRACER=y/# CONFIG_FUNCTION_TRACER is not set/' ./.config
sed -i -e 's/CONFIG_FUNCTION_GRAPH_TRACER=y/# CONFIG_FUNCTION_GRAPH_TRACER is not set/' ./.config sed -i -e 's/CONFIG_FUNCTION_GRAPH_TRACER=y/# CONFIG_FUNCTION_GRAPH_TRACER is not set/' ./.config
fi fi
@@ -620,7 +620,7 @@ _tkg_srcprep() {
plain "https://bbs.archlinux.org/viewtopic.php?id=239174" plain "https://bbs.archlinux.org/viewtopic.php?id=239174"
read -rp "`echo $' > N/y : '`" CONDITION3; read -rp "`echo $' > N/y : '`" CONDITION3;
fi fi
if [[ "$CONDITION3" =~ [yY] ]] || [ "$_numadisable" == "true" ]; then if [[ "$CONDITION3" =~ [yY] ]] || [ "$_numadisable" = "true" ]; then
# disable NUMA since 99.9% of users do not have multiple CPUs but do have multiple cores in one CPU # disable NUMA since 99.9% of users do not have multiple CPUs but do have multiple cores in one CPU
sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \ sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \
-i -e '/CONFIG_AMD_NUMA=y/d' \ -i -e '/CONFIG_AMD_NUMA=y/d' \
@@ -639,20 +639,20 @@ _tkg_srcprep() {
plain "Use CattaRappa mode (Tickless/Dynticks) ?" plain "Use CattaRappa mode (Tickless/Dynticks) ?"
plain "Can give higher performances in many cases but lower consistency on some hardware." plain "Can give higher performances in many cases but lower consistency on some hardware."
plain "Just tickless idle can perform better with some platforms (mostly AMD) or CPU schedulers (mostly MuQSS)." plain "Just tickless idle can perform better with some platforms (mostly AMD) or CPU schedulers (mostly MuQSS)."
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
read -rp "`echo $'\n 0.No, use periodic ticks\n 1.Yes, full tickless baby!\n > 2.Just tickless idle plz\n [0-2?]: '`" CONDITION4; read -rp "`echo $'\n 0.No, use periodic ticks\n 1.Yes, full tickless baby!\n > 2.Just tickless idle plz\n [0-2?]: '`" CONDITION4;
else else
read -rp "`echo $'\n 0.No, use periodic ticks\n > 1.Yes, full tickless baby!\n 2.Just tickless idle plz\n [0-2?]: '`" CONDITION4; read -rp "`echo $'\n 0.No, use periodic ticks\n > 1.Yes, full tickless baby!\n 2.Just tickless idle plz\n [0-2?]: '`" CONDITION4;
fi fi
fi fi
if [ "$CONDITION4" == "0" ] || [ "$_tickless" == "0" ]; then if [ "$CONDITION4" = "0" ] || [ "$_tickless" = "0" ]; then
echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config
sed -i -e 's/# CONFIG_HZ_PERIODIC is not set/CONFIG_HZ_PERIODIC=y/' ./.config sed -i -e 's/# CONFIG_HZ_PERIODIC is not set/CONFIG_HZ_PERIODIC=y/' ./.config
sed -i -e 's/CONFIG_NO_HZ_IDLE=y/# CONFIG_NO_HZ_IDLE is not set/' ./.config sed -i -e 's/CONFIG_NO_HZ_IDLE=y/# CONFIG_NO_HZ_IDLE is not set/' ./.config
sed -i -e 's/CONFIG_NO_HZ_FULL=y/# CONFIG_NO_HZ_FULL is not set/' ./.config sed -i -e 's/CONFIG_NO_HZ_FULL=y/# CONFIG_NO_HZ_FULL is not set/' ./.config
sed -i -e 's/CONFIG_NO_HZ=y/# CONFIG_NO_HZ is not set/' ./.config sed -i -e 's/CONFIG_NO_HZ=y/# CONFIG_NO_HZ is not set/' ./.config
sed -i -e 's/CONFIG_NO_HZ_COMMON=y/# CONFIG_NO_HZ_COMMON is not set/' ./.config sed -i -e 's/CONFIG_NO_HZ_COMMON=y/# CONFIG_NO_HZ_COMMON is not set/' ./.config
elif [ "$CONDITION4" == "2" ] || [ "$_tickless" == "2" ]; then elif [ "$CONDITION4" = "2" ] || [ "$_tickless" = "2" ]; then
echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config
sed -i -e 's/CONFIG_HZ_PERIODIC=y/# CONFIG_HZ_PERIODIC is not set/' ./.config sed -i -e 's/CONFIG_HZ_PERIODIC=y/# CONFIG_HZ_PERIODIC is not set/' ./.config
sed -i -e 's/# CONFIG_NO_HZ_IDLE is not set/CONFIG_NO_HZ_IDLE=y/' ./.config sed -i -e 's/# CONFIG_NO_HZ_IDLE is not set/CONFIG_NO_HZ_IDLE=y/' ./.config
@@ -660,7 +660,7 @@ _tkg_srcprep() {
sed -i -e 's/# CONFIG_NO_HZ is not set/CONFIG_NO_HZ=y/' ./.config sed -i -e 's/# CONFIG_NO_HZ is not set/CONFIG_NO_HZ=y/' ./.config
sed -i -e 's/# CONFIG_NO_HZ_COMMON is not set/CONFIG_NO_HZ_COMMON=y/' ./.config sed -i -e 's/# CONFIG_NO_HZ_COMMON is not set/CONFIG_NO_HZ_COMMON=y/' ./.config
else else
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config
sed -i -e 's/CONFIG_HZ_PERIODIC=y/# CONFIG_HZ_PERIODIC is not set/' ./.config sed -i -e 's/CONFIG_HZ_PERIODIC=y/# CONFIG_HZ_PERIODIC is not set/' ./.config
sed -i -e 's/# CONFIG_NO_HZ_IDLE is not set/CONFIG_NO_HZ_IDLE=y/' ./.config sed -i -e 's/# CONFIG_NO_HZ_IDLE is not set/CONFIG_NO_HZ_IDLE=y/' ./.config
@@ -687,7 +687,7 @@ _tkg_srcprep() {
plain "and improve throughput on other schedulers (at the cost of latency)" plain "and improve throughput on other schedulers (at the cost of latency)"
read -rp "`echo $' > N/y : '`" CONDITION5; read -rp "`echo $' > N/y : '`" CONDITION5;
fi fi
if [[ "$CONDITION5" =~ [yY] ]] || [ "$_voluntary_preempt" == "true" ]; then if [[ "$CONDITION5" =~ [yY] ]] || [ "$_voluntary_preempt" = "true" ]; then
sed -i -e 's/CONFIG_PREEMPT=y/# CONFIG_PREEMPT is not set/' ./.config sed -i -e 's/CONFIG_PREEMPT=y/# CONFIG_PREEMPT is not set/' ./.config
sed -i -e 's/CONFIG_PREEMPT_LL=y/# CONFIG_PREEMPT_LL is not set/' ./.config sed -i -e 's/CONFIG_PREEMPT_LL=y/# CONFIG_PREEMPT_LL is not set/' ./.config
sed -i -e 's/# CONFIG_PREEMPT_VOLUNTARY is not set/CONFIG_PREEMPT_VOLUNTARY=y/' ./.config sed -i -e 's/# CONFIG_PREEMPT_VOLUNTARY is not set/CONFIG_PREEMPT_VOLUNTARY=y/' ./.config
@@ -699,7 +699,7 @@ _tkg_srcprep() {
plain "Enable Device Tree and Open Firmware support?" plain "Enable Device Tree and Open Firmware support?"
read -rp "`echo $' > N/y : '`" CONDITION6; read -rp "`echo $' > N/y : '`" CONDITION6;
fi fi
if [[ "$CONDITION6" =~ [yY] ]] || [ "$_OFenable" == "true" ]; then if [[ "$CONDITION6" =~ [yY] ]] || [ "$_OFenable" = "true" ]; then
sed -i -e 's/# CONFIG_OF is not set/CONFIG_OF=y/' ./.config sed -i -e 's/# CONFIG_OF is not set/CONFIG_OF=y/' ./.config
fi fi
@@ -710,7 +710,7 @@ _tkg_srcprep() {
plain "https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_.28ACS_override_patch.29" plain "https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_.28ACS_override_patch.29"
read -rp "`echo $' > N/y : '`" CONDITION7; read -rp "`echo $' > N/y : '`" CONDITION7;
fi fi
if [[ "$CONDITION7" =~ [yY] ]] || [ "$_acs_override" == "true" ]; then if [[ "$CONDITION7" =~ [yY] ]] || [ "$_acs_override" = "true" ]; then
msg2 "Patching ACS override" msg2 "Patching ACS override"
patch -Np1 -i "$srcdir"/0006-add-acs-overrides_iommu.patch patch -Np1 -i "$srcdir"/0006-add-acs-overrides_iommu.patch
fi fi
@@ -722,7 +722,7 @@ _tkg_srcprep() {
# plain "https://bcachefs.org/" # plain "https://bcachefs.org/"
# read -rp "`echo $' > N/y : '`" CONDITION8; # read -rp "`echo $' > N/y : '`" CONDITION8;
#fi #fi
#if [[ "$CONDITION8" =~ [yY] ]] || [ "$_bcachefs" == "true" ]; then #if [[ "$CONDITION8" =~ [yY] ]] || [ "$_bcachefs" = "true" ]; then
# msg2 "Patching Bcache filesystem support override" # msg2 "Patching Bcache filesystem support override"
# patch -Np1 -i "$srcdir"/0008-5.8-bcachefs.patch # patch -Np1 -i "$srcdir"/0008-5.8-bcachefs.patch
# echo "CONFIG_BCACHEFS_FS=m" >> ./.config # echo "CONFIG_BCACHEFS_FS=m" >> ./.config
@@ -740,7 +740,7 @@ _tkg_srcprep() {
plain "https://steamcommunity.com/games/221410/announcements/detail/2957094910196249305" plain "https://steamcommunity.com/games/221410/announcements/detail/2957094910196249305"
read -rp "`echo $' > N/y : '`" CONDITION9; read -rp "`echo $' > N/y : '`" CONDITION9;
fi fi
if [[ "$CONDITION9" =~ [yY] ]] || [ "$_fsync" == "true" ]; then if [[ "$CONDITION9" =~ [yY] ]] || [ "$_fsync" = "true" ]; then
msg2 "Patching Fsync support" msg2 "Patching Fsync support"
patch -Np1 -i "$srcdir"/0007-v5.8-fsync.patch patch -Np1 -i "$srcdir"/0007-v5.8-fsync.patch
fi fi
@@ -752,7 +752,7 @@ _tkg_srcprep() {
plain "https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch" plain "https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch"
read -rp "`echo $' > N/y : '`" CONDITION11; read -rp "`echo $' > N/y : '`" CONDITION11;
fi fi
if [[ "$CONDITION11" =~ [yY] ]] || [ "$_zfsfix" == "true" ]; then if [[ "$CONDITION11" =~ [yY] ]] || [ "$_zfsfix" = "true" ]; then
msg2 "Patching missing symbol for AES-NI/AVX support on ZFS" msg2 "Patching missing symbol for AES-NI/AVX support on ZFS"
patch -Np1 -i "$srcdir"/0011-ZFS-fix.patch patch -Np1 -i "$srcdir"/0011-ZFS-fix.patch
fi fi
@@ -769,7 +769,7 @@ _tkg_srcprep() {
fi fi
# userpatches # userpatches
if [ "$_user_patches" == "true" ]; then if [ "$_user_patches" = "true" ]; then
_userpatch_target="linux-${_basekernel}" _userpatch_target="linux-${_basekernel}"
_userpatch_ext="my" _userpatch_ext="my"
user_patcher user_patcher
@@ -780,7 +780,7 @@ _tkg_srcprep() {
rm -f "$_where"/$_p rm -f "$_where"/$_p
done done
if [ "$_distro" == "Arch" ]; then if [ "$_distro" = "Arch" ]; then
# don't run depmod on 'make install'. We'll do this ourselves in packaging # don't run depmod on 'make install'. We'll do this ourselves in packaging
sed -i '2iexit 0' scripts/depmod.sh sed -i '2iexit 0' scripts/depmod.sh
@@ -797,7 +797,7 @@ _tkg_srcprep() {
plain "!!!! Make sure to have a well populated db !!!!" plain "!!!! Make sure to have a well populated db !!!!"
read -rp "`echo $' > N/y : '`" CONDITIONMPDB; read -rp "`echo $' > N/y : '`" CONDITIONMPDB;
fi fi
if [[ "$CONDITIONMPDB" =~ [yY] ]] || [ "$_modprobeddb" == "true" ]; then if [[ "$CONDITIONMPDB" =~ [yY] ]] || [ "$_modprobeddb" = "true" ]; then
sudo modprobed-db recall sudo modprobed-db recall
make localmodconfig make localmodconfig
fi fi
@@ -886,7 +886,7 @@ _tkg_srcprep() {
rm .config.orig rm .config.orig
fi fi
if [ "$_distro" == "Arch" ]; then if [ "$_distro" = "Arch" ]; then
make -s kernelrelease > version make -s kernelrelease > version
msg2 "Prepared %s version %s" "$pkgbase" "$(<version)" msg2 "Prepared %s version %s" "$pkgbase" "$(<version)"
fi fi
@@ -962,7 +962,7 @@ exit_cleanup() {
rm -f "$srcdir"/linux-${_basekernel}/mm/uksm.c rm -f "$srcdir"/linux-${_basekernel}/mm/uksm.c
fi fi
if [ "${_distro}" == "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
remove_deps remove_deps
fi fi

View File

@@ -118,7 +118,7 @@ build() {
PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH} PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH}
fi fi
if [ "$_force_all_threads" == "true" ]; then if [ "$_force_all_threads" = "true" ]; then
_force_all_threads="-j$((`nproc`*2))" _force_all_threads="-j$((`nproc`*2))"
else else
_force_all_threads="${MAKEFLAGS}" _force_all_threads="${MAKEFLAGS}"
@@ -253,7 +253,7 @@ hackheaders() {
echo "Stripping vmlinux..." echo "Stripping vmlinux..."
strip -v $STRIP_STATIC "$builddir/vmlinux" strip -v $STRIP_STATIC "$builddir/vmlinux"
if [ $_NUKR == "true" ]; then if [ $_NUKR = "true" ]; then
rm -rf "$srcdir" # Nuke the entire src folder so it'll get regenerated clean on next build rm -rf "$srcdir" # Nuke the entire src folder so it'll get regenerated clean on next build
fi fi
} }

View File

@@ -40,17 +40,17 @@ if [ -e "$_EXT_CONFIG_PATH" ]; then
source "$_EXT_CONFIG_PATH" source "$_EXT_CONFIG_PATH"
fi fi
if [ "$1" == "install" ] || [ "$1" == "config" ]; then if [ "$1" = "install" ] || [ "$1" = "config" ]; then
source linux*-tkg-config/prepare source linux*-tkg-config/prepare
if [ $1 == "install" ] && [ "$_distro" != "Ubuntu" ]; then if [ $1 = "install" ] && [ "$_distro" != "Ubuntu" ]; then
msg2 "Variable \"_distro\" in \"customization.cfg\" hasn't been set to \"Ubuntu\"" msg2 "Variable \"_distro\" in \"customization.cfg\" hasn't been set to \"Ubuntu\""
msg2 "This script can only install custom kernels for Ubuntu and Debian derivatives. Exiting..." msg2 "This script can only install custom kernels for Ubuntu and Debian derivatives. Exiting..."
exit 0 exit 0
fi fi
if [ "$_distro" == "Ubuntu" ]; then if [ "$_distro" = "Ubuntu" ]; then
msg2 "Installing dependencies" msg2 "Installing dependencies"
sudo apt install git build-essential kernel-package fakeroot libncurses5-dev libssl-dev ccache bison flex sudo apt install git build-essential kernel-package fakeroot libncurses5-dev libssl-dev ccache bison flex
else else
@@ -58,7 +58,7 @@ if [ "$1" == "install" ] || [ "$1" == "config" ]; then
fi fi
# Force prepare script to avoid Arch specific commands if the user didn't change _distro from "Arch" # Force prepare script to avoid Arch specific commands if the user didn't change _distro from "Arch"
if [ "$1" == "config" ]; then if [ "$1" = "config" ]; then
_distro="" _distro=""
fi fi
@@ -112,14 +112,14 @@ if [ "$1" == "install" ] || [ "$1" == "config" ]; then
msg2 "Configuration done." msg2 "Configuration done."
fi fi
if [ "$1" == "install" ]; then if [ "$1" = "install" ]; then
# Use custom compiler paths if defined # Use custom compiler paths if defined
if [ -n "${CUSTOM_GCC_PATH}" ]; then if [ -n "${CUSTOM_GCC_PATH}" ]; then
PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH} PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH}
fi fi
if [ "$_force_all_threads" == "true" ]; then if [ "$_force_all_threads" = "true" ]; then
_thread_num=`nproc` _thread_num=`nproc`
else else
_thread_num=`expr \`nproc\` / 4` _thread_num=`expr \`nproc\` / 4`
@@ -130,7 +130,7 @@ if [ "$1" == "install" ]; then
# ccache # ccache
if [ "$_noccache" != "true" ]; then if [ "$_noccache" != "true" ]; then
if [ "$_distro" == "Ubuntu" ] && dpkg -l ccache > /dev/null; then if [ "$_distro" = "Ubuntu" ] && dpkg -l ccache > /dev/null; then
export PATH="/usr/lib/ccache/bin/:$PATH" export PATH="/usr/lib/ccache/bin/:$PATH"
export CCACHE_SLOPPINESS="file_macro,locale,time_macros" export CCACHE_SLOPPINESS="file_macro,locale,time_macros"
export CCACHE_NOHASHDIR="true" export CCACHE_NOHASHDIR="true"
@@ -143,11 +143,11 @@ if [ "$1" == "install" ]; then
_kernel_flavor="tkg-${_cpusched}" _kernel_flavor="tkg-${_cpusched}"
fi fi
if [ "$_distro" == "Ubuntu" ]; then if [ "$_distro" = "Ubuntu" ]; then
if make -j ${_thread_num} deb-pkg LOCALVERSION=-${_kernel_flavor}; then if make -j ${_thread_num} deb-pkg LOCALVERSION=-${_kernel_flavor}; then
msg2 "Building successfully finished!" msg2 "Building successfully finished!"
read -p "Do you want to install the new Kernel ? y/[n]: " _install read -p "Do you want to install the new Kernel ? y/[n]: " _install
if [[ $_install =~ [yY] ]] || [[ $_install =~ [yY] ]] || [ $_install == "yes" ] || [ $_install == "Yes" ]; then if [[ $_install =~ [yY] ]] || [[ $_install =~ [yY] ]] || [ $_install = "yes" ] || [ $_install = "Yes" ]; then
cd "$_where" cd "$_where"
_kernelname=$_basekernel.$_kernel_subver-$_kernel_flavor _kernelname=$_basekernel.$_kernel_subver-$_kernel_flavor
_headers_deb=linux-headers-${_kernelname}*.deb _headers_deb=linux-headers-${_kernelname}*.deb
@@ -164,7 +164,7 @@ if [ "$1" == "install" ]; then
fi fi
fi fi
if [ "$1" == "uninstall" ]; then if [ "$1" = "uninstall" ]; then
cd "$_where" cd "$_where"

View File

@@ -19,9 +19,9 @@ _tkg_initscript() {
plain "Do you want to use a predefined optimized profile?" plain "Do you want to use a predefined optimized profile?"
read -rp "`echo $' > 1.Custom\n 2.Ryzen Desktop (Performance)\n 3.Other Desktop (Performance)\nchoice[1-3?]: '`" _OPTIPROFILE; read -rp "`echo $' > 1.Custom\n 2.Ryzen Desktop (Performance)\n 3.Other Desktop (Performance)\nchoice[1-3?]: '`" _OPTIPROFILE;
fi fi
if [ "$_OPTIPROFILE" == "2" ]; then if [ "$_OPTIPROFILE" = "2" ]; then
source "$_where"/ryzen-desktop-profile.cfg && msg2 "Ryzen Desktop (Performance) profile will be used." && msg2 "" source "$_where"/ryzen-desktop-profile.cfg && msg2 "Ryzen Desktop (Performance) profile will be used." && msg2 ""
elif [ "$_OPTIPROFILE" == "3" ]; then elif [ "$_OPTIPROFILE" = "3" ]; then
source "$_where"/generic-desktop-profile.cfg && msg2 "Generic Desktop (Performance) profile will be used." && msg2 "" source "$_where"/generic-desktop-profile.cfg && msg2 "Generic Desktop (Performance) profile will be used." && msg2 ""
fi fi
@@ -34,7 +34,7 @@ _tkg_initscript() {
#if [ -z "$_cpusched" ] && [ ! -e "$_where"/cpuschedset ]; then #if [ -z "$_cpusched" ] && [ ! -e "$_where"/cpuschedset ]; then
# plain "What CPU sched variant do you want to build/install?" # plain "What CPU sched variant do you want to build/install?"
# read -rp "`echo $' > 1.PDS\n 2.CFS\nchoice[1-2?]: '`" CONDITION; # read -rp "`echo $' > 1.PDS\n 2.CFS\nchoice[1-2?]: '`" CONDITION;
# if [ "$CONDITION" == "2" ]; then # if [ "$CONDITION" = "2" ]; then
# echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset # echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
# else # else
# echo "_cpusched=\"pds\"" > "$_where"/cpuschedset # echo "_cpusched=\"pds\"" > "$_where"/cpuschedset
@@ -42,18 +42,18 @@ _tkg_initscript() {
if [ -n "$_custom_pkgbase" ]; then if [ -n "$_custom_pkgbase" ]; then
echo "_custom_pkgbase=\"${_custom_pkgbase}\"" >> "$_where"/cpuschedset echo "_custom_pkgbase=\"${_custom_pkgbase}\"" >> "$_where"/cpuschedset
fi fi
#elif [ "$_cpusched" == "muqss" ] || [ "$_cpusched" == "MuQSS" ]; then #elif [ "$_cpusched" = "muqss" ] || [ "$_cpusched" = "MuQSS" ]; then
# echo "_cpusched=\"MuQSS\"" > "$_where"/cpuschedset # echo "_cpusched=\"MuQSS\"" > "$_where"/cpuschedset
#elif [ "$_cpusched" == "pds" ]; then #elif [ "$_cpusched" = "pds" ]; then
# echo "_cpusched=\"pds\"" > "$_where"/cpuschedset # echo "_cpusched=\"pds\"" > "$_where"/cpuschedset
#elif [ "$_cpusched" == "bmq" ]; then #elif [ "$_cpusched" = "bmq" ]; then
# echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset # echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset
#else #else
# if [ "$_nofallback" != "true" ]; then # if [ "$_nofallback" != "true" ]; then
# warning "Something is wrong with your cpusched selection. Do you want to fallback to CFS (default)?" # warning "Something is wrong with your cpusched selection. Do you want to fallback to CFS (default)?"
# read -rp "`echo $' > N/y : '`" _fallback; # read -rp "`echo $' > N/y : '`" _fallback;
# fi # fi
# if [[ "$_fallback" =~ [yY] ]] || [ "$_nofallback" == "true" ]; then # if [[ "$_fallback" =~ [yY] ]] || [ "$_nofallback" = "true" ]; then
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
# else # else
# error "Exiting..." # error "Exiting..."
@@ -73,7 +73,7 @@ user_patcher() {
printf '%s\n' "${_patches[@]}" printf '%s\n' "${_patches[@]}"
read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION;
fi fi
if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" = "true" ]; then
for _f in "${_patches[@]}"; do for _f in "${_patches[@]}"; do
if [ -e "${_f}" ]; then if [ -e "${_f}" ]; then
msg2 "######################################################" msg2 "######################################################"
@@ -95,7 +95,7 @@ user_patcher() {
printf '%s\n' "${_patches[@]}" printf '%s\n' "${_patches[@]}"
read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION;
fi fi
if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" = "true" ]; then
for _f in "${_patches[@]}"; do for _f in "${_patches[@]}"; do
if [ -e "${_f}" ]; then if [ -e "${_f}" ]; then
msg2 "######################################################" msg2 "######################################################"
@@ -113,7 +113,7 @@ user_patcher() {
_tkg_srcprep() { _tkg_srcprep() {
if [ "${_distro}" == "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
msg2 "Setting version..." msg2 "Setting version..."
scripts/setlocalversion --save-scmversion scripts/setlocalversion --save-scmversion
echo "-$pkgrel-tkg-${_cpusched}" > localversion.10-pkgrel echo "-$pkgrel-tkg-${_cpusched}" > localversion.10-pkgrel
@@ -124,7 +124,7 @@ _tkg_srcprep() {
#patch -p1 -i "$srcdir"/patch-"${pkgver}" #patch -p1 -i "$srcdir"/patch-"${pkgver}"
# ARCH Patches # ARCH Patches
if [ "${_configfile}" == "config_hardened.x86_64" ] && [ "${_cpusched}" == "cfs" ]; then if [ "${_configfile}" = "config_hardened.x86_64" ] && [ "${_cpusched}" = "cfs" ]; then
msg2 "Using linux hardened patchset" msg2 "Using linux hardened patchset"
patch -Np1 -i "$srcdir"/0012-linux-hardened.patch patch -Np1 -i "$srcdir"/0012-linux-hardened.patch
else else
@@ -134,7 +134,7 @@ _tkg_srcprep() {
# graysky's cpu opts - https://github.com/graysky2/kernel_gcc_patch # graysky's cpu opts - https://github.com/graysky2/kernel_gcc_patch
msg2 "Applying graysky's cpu opts patch" msg2 "Applying graysky's cpu opts patch"
if [ "${_distro}" == "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v5.8%2B.patch patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v5.8%2B.patch
else else
patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1+_kernel_v5.8+.patch patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1+_kernel_v5.8+.patch
@@ -155,17 +155,17 @@ _tkg_srcprep() {
fi fi
fi fi
if [ "$_misc_adds" == "true" ]; then if [ "$_misc_adds" = "true" ]; then
msg2 "Applying misc additions patch" msg2 "Applying misc additions patch"
patch -Np1 -i "$srcdir"/0012-misc-additions.patch patch -Np1 -i "$srcdir"/0012-misc-additions.patch
fi fi
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
# MuQSS # MuQSS
msg2 "Applying MuQSS base patch" msg2 "Applying MuQSS base patch"
patch -Np1 -i "$srcdir"/0004-5.9-ck1.patch patch -Np1 -i "$srcdir"/0004-5.9-ck1.patch
if [ "${_aggressive_ondemand}" == "true" ]; then if [ "${_aggressive_ondemand}" = "true" ]; then
msg2 "Applying MuQSS agressive ondemand governor patch" msg2 "Applying MuQSS agressive ondemand governor patch"
patch -Np1 -i "$srcdir"/0004-glitched-ondemand-muqss.patch patch -Np1 -i "$srcdir"/0004-glitched-ondemand-muqss.patch
fi fi
@@ -173,12 +173,12 @@ _tkg_srcprep() {
msg2 "Applying Glitched MuQSS patch" msg2 "Applying Glitched MuQSS patch"
patch -Np1 -i "$srcdir"/0004-glitched-muqss.patch patch -Np1 -i "$srcdir"/0004-glitched-muqss.patch
elif [ "${_cpusched}" == "pds" ]; then elif [ "${_cpusched}" = "pds" ]; then
# PDS-mq # PDS-mq
msg2 "Applying PDS base patch" msg2 "Applying PDS base patch"
patch -Np1 -i "$srcdir"/0005-v5.9_undead-pds099o.patch patch -Np1 -i "$srcdir"/0005-v5.9_undead-pds099o.patch
if [ "${_aggressive_ondemand}" == "true" ]; then if [ "${_aggressive_ondemand}" = "true" ]; then
msg2 "Applying PDS agressive ondemand governor patch" msg2 "Applying PDS agressive ondemand governor patch"
patch -Np1 -i "$srcdir"/0005-glitched-ondemand-pds.patch patch -Np1 -i "$srcdir"/0005-glitched-ondemand-pds.patch
fi fi
@@ -186,13 +186,13 @@ _tkg_srcprep() {
msg2 "Applying Glitched PDS patch" msg2 "Applying Glitched PDS patch"
patch -Np1 -i "$srcdir"/0005-glitched-pds.patch patch -Np1 -i "$srcdir"/0005-glitched-pds.patch
elif [ "${_cpusched}" == "bmq" ]; then elif [ "${_cpusched}" = "bmq" ]; then
# Project C / BMQ # Project C / BMQ
msg2 "Applying Project C / BMQ base patch" msg2 "Applying Project C / BMQ base patch"
patch -Np1 -i "$srcdir"/0009-prjc_v5.9-r0.patch patch -Np1 -i "$srcdir"/0009-prjc_v5.9-r0.patch
if [ "${_aggressive_ondemand}" == "true" ]; then if [ "${_aggressive_ondemand}" = "true" ]; then
msg2 "Applying BMQ agressive ondemand governor patch" msg2 "Applying BMQ agressive ondemand governor patch"
patch -Np1 -i "$srcdir"/0009-glitched-ondemand-bmq.patch patch -Np1 -i "$srcdir"/0009-glitched-ondemand-bmq.patch
fi fi
@@ -200,12 +200,12 @@ _tkg_srcprep() {
msg2 "Applying Glitched BMQ patch" msg2 "Applying Glitched BMQ patch"
patch -Np1 -i "$srcdir"/0009-glitched-bmq.patch patch -Np1 -i "$srcdir"/0009-glitched-bmq.patch
elif [ "${_cpusched}" == "cfs" ]; then elif [ "${_cpusched}" = "cfs" ]; then
msg2 "Applying Glitched CFS patch" msg2 "Applying Glitched CFS patch"
patch -Np1 -i "$srcdir"/0003-glitched-cfs.patch patch -Np1 -i "$srcdir"/0003-glitched-cfs.patch
fi fi
if [ "${_distro}" == "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
if [ -z "${_configfile}" ]; then if [ -z "${_configfile}" ]; then
_configfile="config.x86_64" _configfile="config.x86_64"
fi fi
@@ -232,7 +232,7 @@ _tkg_srcprep() {
echo "CONFIG_CMDLINE=\"${_custom_commandline}\"" >> ./.config echo "CONFIG_CMDLINE=\"${_custom_commandline}\"" >> ./.config
echo "# CONFIG_CMDLINE_OVERRIDE is not set" >> ./.config echo "# CONFIG_CMDLINE_OVERRIDE is not set" >> ./.config
if [ "$_noccache" != "true" ]; then if [ "$_noccache" != "true" ]; then
if { [ "$_distro" == "Arch" ] && pacman -Qq ccache &> /dev/null; } || { [ "$_distro" == "Ubuntu" ] && dpkg -l ccache > /dev/null; }; then if { [ "$_distro" = "Arch" ] && pacman -Qq ccache &> /dev/null; } || { [ "$_distro" = "Ubuntu" ] && dpkg -l ccache > /dev/null; }; then
sed -i -e 's/CONFIG_GCC_PLUGINS=y/# CONFIG_GCC_PLUGINS is not set/' ./.config sed -i -e 's/CONFIG_GCC_PLUGINS=y/# CONFIG_GCC_PLUGINS is not set/' ./.config
fi fi
fi fi
@@ -272,7 +272,7 @@ _tkg_srcprep() {
echo "# CONFIG_MTIGERLAKE is not set" >> ./.config echo "# CONFIG_MTIGERLAKE is not set" >> ./.config
# Disable some debugging # Disable some debugging
if [ "${_debugdisable}" == "true" ]; then if [ "${_debugdisable}" = "true" ]; then
sed -i -e 's/CONFIG_SLUB_DEBUG=y/# CONFIG_SLUB_DEBUG is not set/' ./.config sed -i -e 's/CONFIG_SLUB_DEBUG=y/# CONFIG_SLUB_DEBUG is not set/' ./.config
sed -i -e 's/CONFIG_PM_DEBUG=y/# CONFIG_PM_DEBUG is not set/' ./.config sed -i -e 's/CONFIG_PM_DEBUG=y/# CONFIG_PM_DEBUG is not set/' ./.config
sed -i -e 's/CONFIG_PM_ADVANCED_DEBUG=y/# CONFIG_PM_ADVANCED_DEBUG is not set/' ./.config sed -i -e 's/CONFIG_PM_ADVANCED_DEBUG=y/# CONFIG_PM_ADVANCED_DEBUG is not set/' ./.config
@@ -283,18 +283,18 @@ _tkg_srcprep() {
sed -i -e 's/CONFIG_DEBUG_PREEMPT=y/# CONFIG_DEBUG_PREEMPT is not set/' ./.config sed -i -e 's/CONFIG_DEBUG_PREEMPT=y/# CONFIG_DEBUG_PREEMPT is not set/' ./.config
fi fi
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
# MuQSS default config # MuQSS default config
echo "CONFIG_SCHED_MUQSS=y" >> ./.config echo "CONFIG_SCHED_MUQSS=y" >> ./.config
elif [ "${_cpusched}" == "pds" ]; then elif [ "${_cpusched}" = "pds" ]; then
# PDS default config # PDS default config
echo "CONFIG_SCHED_PDS=y" >> ./.config echo "CONFIG_SCHED_PDS=y" >> ./.config
elif [ "${_cpusched}" == "bmq" ]; then elif [ "${_cpusched}" = "bmq" ]; then
# BMQ default config # BMQ default config
echo "CONFIG_SCHED_ALT=y" >> ./.config echo "CONFIG_SCHED_ALT=y" >> ./.config
fi fi
if [ "${_cpusched}" == "MuQSS" ] || [ "${_cpusched}" == "pds" ] || [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "MuQSS" ] || [ "${_cpusched}" = "pds" ] || [ "${_cpusched}" = "bmq" ]; then
# Disable CFS # Disable CFS
sed -i -e 's/CONFIG_FAIR_GROUP_SCHED=y/# CONFIG_FAIR_GROUP_SCHED is not set/' ./.config sed -i -e 's/CONFIG_FAIR_GROUP_SCHED=y/# CONFIG_FAIR_GROUP_SCHED is not set/' ./.config
sed -i -e 's/CONFIG_CFS_BANDWIDTH=y/# CONFIG_CFS_BANDWIDTH is not set/' ./.config sed -i -e 's/CONFIG_CFS_BANDWIDTH=y/# CONFIG_CFS_BANDWIDTH is not set/' ./.config
@@ -314,30 +314,30 @@ _tkg_srcprep() {
plain "0: No yield." plain "0: No yield."
plain "1: Deboost and requeue task. (default)" plain "1: Deboost and requeue task. (default)"
plain "2: Set rq skip task." plain "2: Set rq skip task."
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
read -rp "`echo $'\n 0. Supposedly best option for gaming performance - could lead to stability issues on some (AMD) platforms when combined with MuQSS\n > 1. Default and recommended option for MuQSS - could lead to stability issues on some (Intel) platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0; read -rp "`echo $'\n 0. Supposedly best option for gaming performance - could lead to stability issues on some (AMD) platforms when combined with MuQSS\n > 1. Default and recommended option for MuQSS - could lead to stability issues on some (Intel) platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0;
else else
read -rp "`echo $'\n > 0. Recommended option for gaming on PDS - "tkg" default\n 1. Default, but can lead to stability issues on some platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0; read -rp "`echo $'\n > 0. Recommended option for gaming on PDS - "tkg" default\n 1. Default, but can lead to stability issues on some platforms\n 2. Can be a good option with low rr_interval on MuQSS\n [0-2?]: '`" CONDITION0;
fi fi
fi fi
if [ "$CONDITION0" == "0" ]; then if [ "$CONDITION0" = "0" ]; then
if [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "bmq" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c
else else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c
fi fi
elif [ "$CONDITION0" == "1" ]; then elif [ "$CONDITION0" = "1" ]; then
msg2 "Using default CPU sched yield type (1)" msg2 "Using default CPU sched yield type (1)"
elif [ "$CONDITION0" == "2" ]; then elif [ "$CONDITION0" = "2" ]; then
if [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "bmq" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/alt_core.c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/alt_core.c
else else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/"${_cpusched}".c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/"${_cpusched}".c
fi fi
else else
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
msg2 "Using default CPU sched yield type (1)" msg2 "Using default CPU sched yield type (1)"
elif [ "${_cpusched}" == "bmq" ]; then elif [ "${_cpusched}" = "bmq" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/alt_core.c
else else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/"${_cpusched}".c
@@ -346,7 +346,7 @@ _tkg_srcprep() {
fi fi
# Round Robin interval # Round Robin interval
if [ "${_cpusched}" == "MuQSS" ] || [ "${_cpusched}" == "pds" ] || [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "MuQSS" ] || [ "${_cpusched}" = "pds" ] || [ "${_cpusched}" = "bmq" ]; then
if [ -n "$_rr_interval" ]; then if [ -n "$_rr_interval" ]; then
CONDITION1="$_rr_interval" CONDITION1="$_rr_interval"
else else
@@ -361,16 +361,16 @@ _tkg_srcprep() {
plain "BMQ default: 2ms" plain "BMQ default: 2ms"
read -rp "`echo $'\n > 0.Keep defaults\n 1.2ms\n 2.4ms\n 3.6ms\n 4.8ms\n [0-4?]: '`" CONDITION1; read -rp "`echo $'\n > 0.Keep defaults\n 1.2ms\n 2.4ms\n 3.6ms\n 4.8ms\n [0-4?]: '`" CONDITION1;
fi fi
if [ "$CONDITION1" == "1" ]; then if [ "$CONDITION1" = "1" ]; then
msg2 "Using 2ms rr_interval" msg2 "Using 2ms rr_interval"
_rrvalue="2" _rrvalue="2"
elif [ "$CONDITION1" == "2" ]; then elif [ "$CONDITION1" = "2" ]; then
msg2 "Using 4ms rr_interval" msg2 "Using 4ms rr_interval"
_rrvalue="4" _rrvalue="4"
elif [ "$CONDITION1" == "3" ]; then elif [ "$CONDITION1" = "3" ]; then
msg2 "Using 6ms rr_interval" msg2 "Using 6ms rr_interval"
_rrvalue="6" _rrvalue="6"
elif [ "$CONDITION1" == "4" ]; then elif [ "$CONDITION1" = "4" ]; then
msg2 "Using 8ms rr_interval" msg2 "Using 8ms rr_interval"
_rrvalue="8" _rrvalue="8"
else else
@@ -378,34 +378,34 @@ _tkg_srcprep() {
_rrvalue="default" _rrvalue="default"
fi fi
if [ "$_rrvalue" != "default" ]; then if [ "$_rrvalue" != "default" ]; then
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
sed -i -e "s/int rr_interval __read_mostly = 6;/int rr_interval __read_mostly = ${_rrvalue};/" ./kernel/sched/"${_cpusched}".c sed -i -e "s/int rr_interval __read_mostly = 6;/int rr_interval __read_mostly = ${_rrvalue};/" ./kernel/sched/"${_cpusched}".c
elif [ "${_cpusched}" == "pds" ]; then elif [ "${_cpusched}" = "pds" ]; then
sed -i -e "s/#define SCHED_DEFAULT_RR (4)/#define SCHED_DEFAULT_RR (${_rrvalue})/" ./kernel/sched/"${_cpusched}".c sed -i -e "s/#define SCHED_DEFAULT_RR (4)/#define SCHED_DEFAULT_RR (${_rrvalue})/" ./kernel/sched/"${_cpusched}".c
elif [ "${_cpusched}" == "bmq" ]; then elif [ "${_cpusched}" = "bmq" ]; then
sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (${_rrvalue} * 1000 * 1000);/" ./kernel/sched/alt_core.c sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (${_rrvalue} * 1000 * 1000);/" ./kernel/sched/alt_core.c
fi fi
else else
if [ "${_cpusched}" == "bmq" ]; then if [ "${_cpusched}" = "bmq" ]; then
sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (2 * 1000 * 1000);/" ./kernel/sched/alt_core.c sed -i -e "s/u64 sched_timeslice_ns __read_mostly = (4 * 1000 * 1000);/u64 sched_timeslice_ns __read_mostly = (2 * 1000 * 1000);/" ./kernel/sched/alt_core.c
fi fi
fi fi
fi fi
# zenify # zenify
if [ "$_zenify" == "true" ]; then if [ "$_zenify" = "true" ]; then
echo "CONFIG_ZENIFY=y" >> ./.config echo "CONFIG_ZENIFY=y" >> ./.config
elif [ "$_zenify" == "false" ]; then elif [ "$_zenify" = "false" ]; then
echo "# CONFIG_ZENIFY is not set" >> ./.config echo "# CONFIG_ZENIFY is not set" >> ./.config
fi fi
# compiler optimization level # compiler optimization level
if [ "$_compileroptlevel" == "1" ]; then if [ "$_compileroptlevel" = "1" ]; then
echo "# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set" >> ./.config echo "# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set" >> ./.config
elif [ "$_compileroptlevel" == "2" ]; then elif [ "$_compileroptlevel" = "2" ]; then
sed -i -e 's/CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y/# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set/' ./.config sed -i -e 's/CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y/# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set/' ./.config
echo "CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y" >> ./.config echo "CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y" >> ./.config
elif [ "$_compileroptlevel" == "3" ]; then elif [ "$_compileroptlevel" = "3" ]; then
sed -i -e 's/CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y/# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set/' ./.config sed -i -e 's/CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y/# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set/' ./.config
sed -i -e 's/# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set/CONFIG_CC_OPTIMIZE_FOR_SIZE=y/' ./.config sed -i -e 's/# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set/CONFIG_CC_OPTIMIZE_FOR_SIZE=y/' ./.config
echo "# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set" >> ./.config echo "# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set" >> ./.config
@@ -420,103 +420,103 @@ _tkg_srcprep() {
sed -i -e 's/CONFIG_GENERIC_CPU=y/# CONFIG_GENERIC_CPU is not set/' ./.config sed -i -e 's/CONFIG_GENERIC_CPU=y/# CONFIG_GENERIC_CPU is not set/' ./.config
fi fi
if [ "$_processor_opt" == "native" ]; then if [ "$_processor_opt" = "native" ]; then
echo "CONFIG_MNATIVE=y" >> ./.config echo "CONFIG_MNATIVE=y" >> ./.config
elif [ "$_processor_opt" == "k8" ]; then elif [ "$_processor_opt" = "k8" ]; then
sed -i -e 's/# CONFIG_MK8 is not set/CONFIG_MK8=y/' ./.config sed -i -e 's/# CONFIG_MK8 is not set/CONFIG_MK8=y/' ./.config
elif [ "$_processor_opt" == "k8sse3" ]; then elif [ "$_processor_opt" = "k8sse3" ]; then
sed -i -e 's/# CONFIG_MK8SSE3 is not set/CONFIG_MK8SSE3=y/' ./.config sed -i -e 's/# CONFIG_MK8SSE3 is not set/CONFIG_MK8SSE3=y/' ./.config
elif [ "$_processor_opt" == "k10" ]; then elif [ "$_processor_opt" = "k10" ]; then
sed -i -e 's/# CONFIG_MK10 is not set/CONFIG_MK10=y/' ./.config sed -i -e 's/# CONFIG_MK10 is not set/CONFIG_MK10=y/' ./.config
elif [ "$_processor_opt" == "barcelona" ]; then elif [ "$_processor_opt" = "barcelona" ]; then
sed -i -e 's/# CONFIG_MBARCELONA is not set/CONFIG_MBARCELONA=y/' ./.config sed -i -e 's/# CONFIG_MBARCELONA is not set/CONFIG_MBARCELONA=y/' ./.config
elif [ "$_processor_opt" == "bobcat" ]; then elif [ "$_processor_opt" = "bobcat" ]; then
sed -i -e 's/# CONFIG_MBOBCAT is not set/CONFIG_MBOBCAT=y/' ./.config sed -i -e 's/# CONFIG_MBOBCAT is not set/CONFIG_MBOBCAT=y/' ./.config
elif [ "$_processor_opt" == "jaguar" ]; then elif [ "$_processor_opt" = "jaguar" ]; then
sed -i -e 's/# CONFIG_MJAGUAR is not set/CONFIG_MJAGUAR=y/' ./.config sed -i -e 's/# CONFIG_MJAGUAR is not set/CONFIG_MJAGUAR=y/' ./.config
elif [ "$_processor_opt" == "bulldozer" ]; then elif [ "$_processor_opt" = "bulldozer" ]; then
sed -i -e 's/# CONFIG_MBULLDOZER is not set/CONFIG_MBULLDOZER=y/' ./.config sed -i -e 's/# CONFIG_MBULLDOZER is not set/CONFIG_MBULLDOZER=y/' ./.config
elif [ "$_processor_opt" == "piledriver" ]; then elif [ "$_processor_opt" = "piledriver" ]; then
sed -i -e 's/# CONFIG_MPILEDRIVER is not set/CONFIG_MPILEDRIVER=y/' ./.config sed -i -e 's/# CONFIG_MPILEDRIVER is not set/CONFIG_MPILEDRIVER=y/' ./.config
elif [ "$_processor_opt" == "steamroller" ]; then elif [ "$_processor_opt" = "steamroller" ]; then
sed -i -e 's/# CONFIG_MSTEAMROLLER is not set/CONFIG_MSTEAMROLLER=y/' ./.config sed -i -e 's/# CONFIG_MSTEAMROLLER is not set/CONFIG_MSTEAMROLLER=y/' ./.config
elif [ "$_processor_opt" == "excavator" ]; then elif [ "$_processor_opt" = "excavator" ]; then
sed -i -e 's/# CONFIG_MEXCAVATOR is not set/CONFIG_MEXCAVATOR=y/' ./.config sed -i -e 's/# CONFIG_MEXCAVATOR is not set/CONFIG_MEXCAVATOR=y/' ./.config
elif [ "$_processor_opt" == "zen" ]; then elif [ "$_processor_opt" = "zen" ]; then
sed -i -e 's/# CONFIG_MZEN is not set/CONFIG_MZEN=y/' ./.config sed -i -e 's/# CONFIG_MZEN is not set/CONFIG_MZEN=y/' ./.config
elif [ "$_processor_opt" == "zen2" ]; then elif [ "$_processor_opt" = "zen2" ]; then
sed -i -e 's/# CONFIG_MZEN2 is not set/CONFIG_MZEN2=y/' ./.config sed -i -e 's/# CONFIG_MZEN2 is not set/CONFIG_MZEN2=y/' ./.config
elif [ "$_processor_opt" == "mpsc" ]; then elif [ "$_processor_opt" = "mpsc" ]; then
sed -i -e 's/# CONFIG_MPSC is not set/CONFIG_MPSC=y/' ./.config sed -i -e 's/# CONFIG_MPSC is not set/CONFIG_MPSC=y/' ./.config
elif [ "$_processor_opt" == "atom" ]; then elif [ "$_processor_opt" = "atom" ]; then
sed -i -e 's/# CONFIG_MATOM is not set/CONFIG_MATOM=y/' ./.config sed -i -e 's/# CONFIG_MATOM is not set/CONFIG_MATOM=y/' ./.config
elif [ "$_processor_opt" == "core2" ]; then elif [ "$_processor_opt" = "core2" ]; then
sed -i -e 's/# CONFIG_MCORE2 is not set/CONFIG_MCORE2=y/' ./.config sed -i -e 's/# CONFIG_MCORE2 is not set/CONFIG_MCORE2=y/' ./.config
elif [ "$_processor_opt" == "nehalem" ]; then elif [ "$_processor_opt" = "nehalem" ]; then
sed -i -e 's/# CONFIG_MNEHALEM is not set/CONFIG_MNEHALEM=y/' ./.config sed -i -e 's/# CONFIG_MNEHALEM is not set/CONFIG_MNEHALEM=y/' ./.config
elif [ "$_processor_opt" == "westmere" ]; then elif [ "$_processor_opt" = "westmere" ]; then
sed -i -e 's/# CONFIG_MWESTMERE is not set/CONFIG_MWESTMERE=y/' ./.config sed -i -e 's/# CONFIG_MWESTMERE is not set/CONFIG_MWESTMERE=y/' ./.config
elif [ "$_processor_opt" == "silvermont" ]; then elif [ "$_processor_opt" = "silvermont" ]; then
sed -i -e 's/# CONFIG_MSILVERMONT is not set/CONFIG_MSILVERMONT=y/' ./.config sed -i -e 's/# CONFIG_MSILVERMONT is not set/CONFIG_MSILVERMONT=y/' ./.config
elif [ "$_processor_opt" == "sandybridge" ]; then elif [ "$_processor_opt" = "sandybridge" ]; then
sed -i -e 's/# CONFIG_MSANDYBRIDGE is not set/CONFIG_MSANDYBRIDGE=y/' ./.config sed -i -e 's/# CONFIG_MSANDYBRIDGE is not set/CONFIG_MSANDYBRIDGE=y/' ./.config
elif [ "$_processor_opt" == "ivybridge" ]; then elif [ "$_processor_opt" = "ivybridge" ]; then
sed -i -e 's/# CONFIG_MIVYBRIDGE is not set/CONFIG_MIVYBRIDGE=y/' ./.config sed -i -e 's/# CONFIG_MIVYBRIDGE is not set/CONFIG_MIVYBRIDGE=y/' ./.config
elif [ "$_processor_opt" == "haswell" ]; then elif [ "$_processor_opt" = "haswell" ]; then
sed -i -e 's/# CONFIG_MHASWELL is not set/CONFIG_MHASWELL=y/' ./.config sed -i -e 's/# CONFIG_MHASWELL is not set/CONFIG_MHASWELL=y/' ./.config
elif [ "$_processor_opt" == "broadwell" ]; then elif [ "$_processor_opt" = "broadwell" ]; then
sed -i -e 's/# CONFIG_MBROADWELL is not set/CONFIG_MBROADWELL=y/' ./.config sed -i -e 's/# CONFIG_MBROADWELL is not set/CONFIG_MBROADWELL=y/' ./.config
elif [ "$_processor_opt" == "skylake" ]; then elif [ "$_processor_opt" = "skylake" ]; then
sed -i -e 's/# CONFIG_MSKYLAKE is not set/CONFIG_MSKYLAKE=y/' ./.config sed -i -e 's/# CONFIG_MSKYLAKE is not set/CONFIG_MSKYLAKE=y/' ./.config
elif [ "$_processor_opt" == "skylakex" ]; then elif [ "$_processor_opt" = "skylakex" ]; then
sed -i -e 's/# CONFIG_MSKYLAKEX is not set/CONFIG_MSKYLAKEX=y/' ./.config sed -i -e 's/# CONFIG_MSKYLAKEX is not set/CONFIG_MSKYLAKEX=y/' ./.config
elif [ "$_processor_opt" == "cannonlake" ]; then elif [ "$_processor_opt" = "cannonlake" ]; then
sed -i -e 's/# CONFIG_MCANNONLAKE is not set/CONFIG_MCANNONLAKE=y/' ./.config sed -i -e 's/# CONFIG_MCANNONLAKE is not set/CONFIG_MCANNONLAKE=y/' ./.config
elif [ "$_processor_opt" == "icelake" ]; then elif [ "$_processor_opt" = "icelake" ]; then
sed -i -e 's/# CONFIG_MICELAKE is not set/CONFIG_MICELAKE=y/' ./.config sed -i -e 's/# CONFIG_MICELAKE is not set/CONFIG_MICELAKE=y/' ./.config
elif [ "$_processor_opt" == "goldmont" ]; then elif [ "$_processor_opt" = "goldmont" ]; then
sed -i -e 's/# CONFIG_MGOLDMONT is not set/CONFIG_MGOLDMONT=y/' ./.config sed -i -e 's/# CONFIG_MGOLDMONT is not set/CONFIG_MGOLDMONT=y/' ./.config
elif [ "$_processor_opt" == "goldmontplus" ]; then elif [ "$_processor_opt" = "goldmontplus" ]; then
sed -i -e 's/# CONFIG_MGOLDMONTPLUS is not set/CONFIG_MGOLDMONTPLUS=y/' ./.config sed -i -e 's/# CONFIG_MGOLDMONTPLUS is not set/CONFIG_MGOLDMONTPLUS=y/' ./.config
elif [ "$_processor_opt" == "cascadelake" ]; then elif [ "$_processor_opt" = "cascadelake" ]; then
sed -i -e 's/# CONFIG_MCASCADELAKE is not set/CONFIG_MCASCADELAKE=y/' ./.config sed -i -e 's/# CONFIG_MCASCADELAKE is not set/CONFIG_MCASCADELAKE=y/' ./.config
elif [ "$_processor_opt" == "cooperlake" ]; then elif [ "$_processor_opt" = "cooperlake" ]; then
sed -i -e 's/# CONFIG_MCOOPERLAKE is not set/CONFIG_MCOOPERLAKE=y/' ./.config sed -i -e 's/# CONFIG_MCOOPERLAKE is not set/CONFIG_MCOOPERLAKE=y/' ./.config
elif [ "$_processor_opt" == "tigerlake" ]; then elif [ "$_processor_opt" = "tigerlake" ]; then
sed -i -e 's/# CONFIG_MTIGERLAKE is not set/CONFIG_MTIGERLAKE=y/' ./.config sed -i -e 's/# CONFIG_MTIGERLAKE is not set/CONFIG_MTIGERLAKE=y/' ./.config
fi fi
# irq threading # irq threading
if [ "$_irq_threading" == "true" ]; then if [ "$_irq_threading" = "true" ]; then
echo "CONFIG_FORCE_IRQ_THREADING=y" >> ./.config echo "CONFIG_FORCE_IRQ_THREADING=y" >> ./.config
elif [ "$_irq_threading" == "false" ]; then elif [ "$_irq_threading" = "false" ]; then
echo "# CONFIG_FORCE_IRQ_THREADING is not set" >> ./.config echo "# CONFIG_FORCE_IRQ_THREADING is not set" >> ./.config
fi fi
# smt nice # smt nice
if [ "$_smt_nice" == "true" ]; then if [ "$_smt_nice" = "true" ]; then
echo "CONFIG_SMT_NICE=y" >> ./.config echo "CONFIG_SMT_NICE=y" >> ./.config
elif [ "$_smt_nice" == "false" ]; then elif [ "$_smt_nice" = "false" ]; then
echo "# CONFIG_SMT_NICE is not set" >> ./.config echo "# CONFIG_SMT_NICE is not set" >> ./.config
fi fi
# random trust cpu # random trust cpu
if [ "$_random_trust_cpu" == "true" ]; then if [ "$_random_trust_cpu" = "true" ]; then
sed -i -e 's/# CONFIG_RANDOM_TRUST_CPU is not set/CONFIG_RANDOM_TRUST_CPU=y/' ./.config sed -i -e 's/# CONFIG_RANDOM_TRUST_CPU is not set/CONFIG_RANDOM_TRUST_CPU=y/' ./.config
fi fi
# rq sharing # rq sharing
if [ "$_runqueue_sharing" == "none" ]; then if [ "$_runqueue_sharing" = "none" ]; then
echo -e "CONFIG_RQ_NONE=y\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "CONFIG_RQ_NONE=y\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config
elif [ -z "$_runqueue_sharing" ] || [ "$_runqueue_sharing" == "smt" ]; then elif [ -z "$_runqueue_sharing" ] || [ "$_runqueue_sharing" = "smt" ]; then
echo -e "# CONFIG_RQ_NONE is not set\nCONFIG_RQ_SMT=y\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\nCONFIG_RQ_SMT=y\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config
elif [ "$_runqueue_sharing" == "mc" ]; then elif [ "$_runqueue_sharing" = "mc" ]; then
echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\nCONFIG_RQ_MC=y\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\nCONFIG_RQ_MC=y\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config
elif [ "$_runqueue_sharing" == "smp" ]; then elif [ "$_runqueue_sharing" = "smp" ]; then
echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\nCONFIG_RQ_SMP=y\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\nCONFIG_RQ_SMP=y\n# CONFIG_RQ_ALL is not set" >> ./.config
elif [ "$_runqueue_sharing" == "all" ]; then elif [ "$_runqueue_sharing" = "all" ]; then
echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\nCONFIG_RQ_ALL=y" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\n# CONFIG_RQ_MC_LLC is not set\n# CONFIG_RQ_SMP is not set\nCONFIG_RQ_ALL=y" >> ./.config
elif [ "$_runqueue_sharing" == "mc-llc" ]; then elif [ "$_runqueue_sharing" = "mc-llc" ]; then
echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\nCONFIG_RQ_MC_LLC=y\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config echo -e "# CONFIG_RQ_NONE is not set\n# CONFIG_RQ_SMT is not set\n# CONFIG_RQ_MC is not set\nCONFIG_RQ_MC_LLC=y\n# CONFIG_RQ_SMP is not set\n# CONFIG_RQ_ALL is not set" >> ./.config
fi fi
@@ -524,7 +524,7 @@ _tkg_srcprep() {
if [ -n "$_timer_freq" ] && [ "$_timer_freq" != "300" ]; then if [ -n "$_timer_freq" ] && [ "$_timer_freq" != "300" ]; then
sed -i -e 's/CONFIG_HZ_300=y/# CONFIG_HZ_300 is not set/' ./.config sed -i -e 's/CONFIG_HZ_300=y/# CONFIG_HZ_300 is not set/' ./.config
sed -i -e 's/CONFIG_HZ_300_NODEF=y/# CONFIG_HZ_300_NODEF is not set/' ./.config sed -i -e 's/CONFIG_HZ_300_NODEF=y/# CONFIG_HZ_300_NODEF is not set/' ./.config
if [ "$_timer_freq" == "1000" ]; then if [ "$_timer_freq" = "1000" ]; then
sed -i -e 's/# CONFIG_HZ_1000 is not set/CONFIG_HZ_1000=y/' ./.config sed -i -e 's/# CONFIG_HZ_1000 is not set/CONFIG_HZ_1000=y/' ./.config
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=1000/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=1000/' ./.config
echo "# CONFIG_HZ_500 is not set" >> ./.config echo "# CONFIG_HZ_500 is not set" >> ./.config
@@ -534,7 +534,7 @@ _tkg_srcprep() {
echo "CONFIG_HZ_1000_NODEF=y" >> ./.config echo "CONFIG_HZ_1000_NODEF=y" >> ./.config
echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config
elif [ "$_timer_freq" == "750" ]; then elif [ "$_timer_freq" = "750" ]; then
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=750/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=750/' ./.config
echo "# CONFIG_HZ_500 is not set" >> ./.config echo "# CONFIG_HZ_500 is not set" >> ./.config
echo "# CONFIG_HZ_500_NODEF is not set" >> ./.config echo "# CONFIG_HZ_500_NODEF is not set" >> ./.config
@@ -543,7 +543,7 @@ _tkg_srcprep() {
echo "# CONFIG_HZ_1000_NODEF is not set" >> ./.config echo "# CONFIG_HZ_1000_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config
elif [ "$_timer_freq" == "500" ]; then elif [ "$_timer_freq" = "500" ]; then
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=500/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=500/' ./.config
echo "CONFIG_HZ_500=y" >> ./.config echo "CONFIG_HZ_500=y" >> ./.config
echo "CONFIG_HZ_500_NODEF=y" >> ./.config echo "CONFIG_HZ_500_NODEF=y" >> ./.config
@@ -552,7 +552,7 @@ _tkg_srcprep() {
echo "# CONFIG_HZ_1000_NODEF is not set" >> ./.config echo "# CONFIG_HZ_1000_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config echo "# CONFIG_HZ_250_NODEF is not set" >> ./.config
echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config echo "# CONFIG_HZ_300_NODEF is not set" >> ./.config
elif [ "$_timer_freq" == "100" ]; then elif [ "$_timer_freq" = "100" ]; then
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=100/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=100/' ./.config
echo "# CONFIG_HZ_500 is not set" >> ./.config echo "# CONFIG_HZ_500 is not set" >> ./.config
echo "# CONFIG_HZ_750 is not set" >> ./.config echo "# CONFIG_HZ_750 is not set" >> ./.config
@@ -564,7 +564,7 @@ _tkg_srcprep() {
echo "CONFIG_HZ_100=y" >> ./.config echo "CONFIG_HZ_100=y" >> ./.config
echo "CONFIG_HZ_100_NODEF=y" >> ./.config echo "CONFIG_HZ_100_NODEF=y" >> ./.config
fi fi
elif [ "${_cpusched}" == "MuQSS" ] && [ -z "$_timer_freq" ]; then elif [ "${_cpusched}" = "MuQSS" ] && [ -z "$_timer_freq" ]; then
sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=100/' ./.config sed -i -e 's/CONFIG_HZ=300/CONFIG_HZ=100/' ./.config
echo "# CONFIG_HZ_500 is not set" >> ./.config echo "# CONFIG_HZ_500 is not set" >> ./.config
echo "# CONFIG_HZ_750 is not set" >> ./.config echo "# CONFIG_HZ_750 is not set" >> ./.config
@@ -586,16 +586,16 @@ _tkg_srcprep() {
fi fi
# default cpu gov # default cpu gov
if [ "$_default_cpu_gov" == "performance" ]; then if [ "$_default_cpu_gov" = "performance" ]; then
sed -i -e 's/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y/# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set/' ./.config sed -i -e 's/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y/# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set/' ./.config
sed -i -e 's/# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set/CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y/' ./.config sed -i -e 's/# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set/CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y/' ./.config
elif [ "$_default_cpu_gov" == "ondemand" ]; then elif [ "$_default_cpu_gov" = "ondemand" ]; then
sed -i -e 's/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y/# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set/' ./.config sed -i -e 's/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y/# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set/' ./.config
sed -i -e 's/# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set/CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y/' ./.config sed -i -e 's/# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set/CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y/' ./.config
fi fi
# ACPI_CPUFREQ disablement # ACPI_CPUFREQ disablement
if [ "$_disable_acpi_cpufreq" == "true" ]; then if [ "$_disable_acpi_cpufreq" = "true" ]; then
sed -i -e 's/CONFIG_X86_ACPI_CPUFREQ=m/# CONFIG_X86_ACPI_CPUFREQ is not set/' ./.config sed -i -e 's/CONFIG_X86_ACPI_CPUFREQ=m/# CONFIG_X86_ACPI_CPUFREQ is not set/' ./.config
fi fi
@@ -606,7 +606,7 @@ _tkg_srcprep() {
plain "and analyzing of kernel functions." plain "and analyzing of kernel functions."
read -rp "`echo $' > N/y : '`" CONDITION2; read -rp "`echo $' > N/y : '`" CONDITION2;
fi fi
if [[ "$CONDITION2" =~ [yY] ]] || [ "$_ftracedisable" == "true" ]; then if [[ "$CONDITION2" =~ [yY] ]] || [ "$_ftracedisable" = "true" ]; then
sed -i -e 's/CONFIG_FUNCTION_TRACER=y/# CONFIG_FUNCTION_TRACER is not set/' ./.config sed -i -e 's/CONFIG_FUNCTION_TRACER=y/# CONFIG_FUNCTION_TRACER is not set/' ./.config
sed -i -e 's/CONFIG_FUNCTION_GRAPH_TRACER=y/# CONFIG_FUNCTION_GRAPH_TRACER is not set/' ./.config sed -i -e 's/CONFIG_FUNCTION_GRAPH_TRACER=y/# CONFIG_FUNCTION_GRAPH_TRACER is not set/' ./.config
fi fi
@@ -618,7 +618,7 @@ _tkg_srcprep() {
plain "https://bbs.archlinux.org/viewtopic.php?id=239174" plain "https://bbs.archlinux.org/viewtopic.php?id=239174"
read -rp "`echo $' > N/y : '`" CONDITION3; read -rp "`echo $' > N/y : '`" CONDITION3;
fi fi
if [[ "$CONDITION3" =~ [yY] ]] || [ "$_numadisable" == "true" ]; then if [[ "$CONDITION3" =~ [yY] ]] || [ "$_numadisable" = "true" ]; then
# disable NUMA since 99.9% of users do not have multiple CPUs but do have multiple cores in one CPU # disable NUMA since 99.9% of users do not have multiple CPUs but do have multiple cores in one CPU
sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \ sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \
-i -e '/CONFIG_AMD_NUMA=y/d' \ -i -e '/CONFIG_AMD_NUMA=y/d' \
@@ -637,20 +637,20 @@ _tkg_srcprep() {
plain "Use CattaRappa mode (Tickless/Dynticks) ?" plain "Use CattaRappa mode (Tickless/Dynticks) ?"
plain "Can give higher performances in many cases but lower consistency on some hardware." plain "Can give higher performances in many cases but lower consistency on some hardware."
plain "Just tickless idle can perform better with some platforms (mostly AMD) or CPU schedulers (mostly MuQSS)." plain "Just tickless idle can perform better with some platforms (mostly AMD) or CPU schedulers (mostly MuQSS)."
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
read -rp "`echo $'\n 0.No, use periodic ticks\n 1.Yes, full tickless baby!\n > 2.Just tickless idle plz\n [0-2?]: '`" CONDITION4; read -rp "`echo $'\n 0.No, use periodic ticks\n 1.Yes, full tickless baby!\n > 2.Just tickless idle plz\n [0-2?]: '`" CONDITION4;
else else
read -rp "`echo $'\n 0.No, use periodic ticks\n > 1.Yes, full tickless baby!\n 2.Just tickless idle plz\n [0-2?]: '`" CONDITION4; read -rp "`echo $'\n 0.No, use periodic ticks\n > 1.Yes, full tickless baby!\n 2.Just tickless idle plz\n [0-2?]: '`" CONDITION4;
fi fi
fi fi
if [ "$CONDITION4" == "0" ] || [ "$_tickless" == "0" ]; then if [ "$CONDITION4" = "0" ] || [ "$_tickless" = "0" ]; then
echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config
sed -i -e 's/# CONFIG_HZ_PERIODIC is not set/CONFIG_HZ_PERIODIC=y/' ./.config sed -i -e 's/# CONFIG_HZ_PERIODIC is not set/CONFIG_HZ_PERIODIC=y/' ./.config
sed -i -e 's/CONFIG_NO_HZ_IDLE=y/# CONFIG_NO_HZ_IDLE is not set/' ./.config sed -i -e 's/CONFIG_NO_HZ_IDLE=y/# CONFIG_NO_HZ_IDLE is not set/' ./.config
sed -i -e 's/CONFIG_NO_HZ_FULL=y/# CONFIG_NO_HZ_FULL is not set/' ./.config sed -i -e 's/CONFIG_NO_HZ_FULL=y/# CONFIG_NO_HZ_FULL is not set/' ./.config
sed -i -e 's/CONFIG_NO_HZ=y/# CONFIG_NO_HZ is not set/' ./.config sed -i -e 's/CONFIG_NO_HZ=y/# CONFIG_NO_HZ is not set/' ./.config
sed -i -e 's/CONFIG_NO_HZ_COMMON=y/# CONFIG_NO_HZ_COMMON is not set/' ./.config sed -i -e 's/CONFIG_NO_HZ_COMMON=y/# CONFIG_NO_HZ_COMMON is not set/' ./.config
elif [ "$CONDITION4" == "2" ] || [ "$_tickless" == "2" ]; then elif [ "$CONDITION4" = "2" ] || [ "$_tickless" = "2" ]; then
echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config
sed -i -e 's/CONFIG_HZ_PERIODIC=y/# CONFIG_HZ_PERIODIC is not set/' ./.config sed -i -e 's/CONFIG_HZ_PERIODIC=y/# CONFIG_HZ_PERIODIC is not set/' ./.config
sed -i -e 's/# CONFIG_NO_HZ_IDLE is not set/CONFIG_NO_HZ_IDLE=y/' ./.config sed -i -e 's/# CONFIG_NO_HZ_IDLE is not set/CONFIG_NO_HZ_IDLE=y/' ./.config
@@ -658,7 +658,7 @@ _tkg_srcprep() {
sed -i -e 's/# CONFIG_NO_HZ is not set/CONFIG_NO_HZ=y/' ./.config sed -i -e 's/# CONFIG_NO_HZ is not set/CONFIG_NO_HZ=y/' ./.config
sed -i -e 's/# CONFIG_NO_HZ_COMMON is not set/CONFIG_NO_HZ_COMMON=y/' ./.config sed -i -e 's/# CONFIG_NO_HZ_COMMON is not set/CONFIG_NO_HZ_COMMON=y/' ./.config
else else
if [ "${_cpusched}" == "MuQSS" ]; then if [ "${_cpusched}" = "MuQSS" ]; then
echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config echo "# CONFIG_NO_HZ_FULL_NODEF is not set" >> ./.config
sed -i -e 's/CONFIG_HZ_PERIODIC=y/# CONFIG_HZ_PERIODIC is not set/' ./.config sed -i -e 's/CONFIG_HZ_PERIODIC=y/# CONFIG_HZ_PERIODIC is not set/' ./.config
sed -i -e 's/# CONFIG_NO_HZ_IDLE is not set/CONFIG_NO_HZ_IDLE=y/' ./.config sed -i -e 's/# CONFIG_NO_HZ_IDLE is not set/CONFIG_NO_HZ_IDLE=y/' ./.config
@@ -685,7 +685,7 @@ _tkg_srcprep() {
plain "and improve throughput on other schedulers (at the cost of latency)" plain "and improve throughput on other schedulers (at the cost of latency)"
read -rp "`echo $' > N/y : '`" CONDITION5; read -rp "`echo $' > N/y : '`" CONDITION5;
fi fi
if [[ "$CONDITION5" =~ [yY] ]] || [ "$_voluntary_preempt" == "true" ]; then if [[ "$CONDITION5" =~ [yY] ]] || [ "$_voluntary_preempt" = "true" ]; then
sed -i -e 's/CONFIG_PREEMPT=y/# CONFIG_PREEMPT is not set/' ./.config sed -i -e 's/CONFIG_PREEMPT=y/# CONFIG_PREEMPT is not set/' ./.config
sed -i -e 's/CONFIG_PREEMPT_LL=y/# CONFIG_PREEMPT_LL is not set/' ./.config sed -i -e 's/CONFIG_PREEMPT_LL=y/# CONFIG_PREEMPT_LL is not set/' ./.config
sed -i -e 's/# CONFIG_PREEMPT_VOLUNTARY is not set/CONFIG_PREEMPT_VOLUNTARY=y/' ./.config sed -i -e 's/# CONFIG_PREEMPT_VOLUNTARY is not set/CONFIG_PREEMPT_VOLUNTARY=y/' ./.config
@@ -697,7 +697,7 @@ _tkg_srcprep() {
plain "Enable Device Tree and Open Firmware support?" plain "Enable Device Tree and Open Firmware support?"
read -rp "`echo $' > N/y : '`" CONDITION6; read -rp "`echo $' > N/y : '`" CONDITION6;
fi fi
if [[ "$CONDITION6" =~ [yY] ]] || [ "$_OFenable" == "true" ]; then if [[ "$CONDITION6" =~ [yY] ]] || [ "$_OFenable" = "true" ]; then
sed -i -e 's/# CONFIG_OF is not set/CONFIG_OF=y/' ./.config sed -i -e 's/# CONFIG_OF is not set/CONFIG_OF=y/' ./.config
fi fi
@@ -708,7 +708,7 @@ _tkg_srcprep() {
plain "https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_.28ACS_override_patch.29" plain "https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_.28ACS_override_patch.29"
read -rp "`echo $' > N/y : '`" CONDITION7; read -rp "`echo $' > N/y : '`" CONDITION7;
fi fi
if [[ "$CONDITION7" =~ [yY] ]] || [ "$_acs_override" == "true" ]; then if [[ "$CONDITION7" =~ [yY] ]] || [ "$_acs_override" = "true" ]; then
msg2 "Patching ACS override" msg2 "Patching ACS override"
patch -Np1 -i "$srcdir"/0006-add-acs-overrides_iommu.patch patch -Np1 -i "$srcdir"/0006-add-acs-overrides_iommu.patch
fi fi
@@ -720,7 +720,7 @@ _tkg_srcprep() {
# plain "https://bcachefs.org/" # plain "https://bcachefs.org/"
# read -rp "`echo $' > N/y : '`" CONDITION8; # read -rp "`echo $' > N/y : '`" CONDITION8;
#fi #fi
#if [[ "$CONDITION8" =~ [yY] ]] || [ "$_bcachefs" == "true" ]; then #if [[ "$CONDITION8" =~ [yY] ]] || [ "$_bcachefs" = "true" ]; then
# msg2 "Patching Bcache filesystem support override" # msg2 "Patching Bcache filesystem support override"
# patch -Np1 -i "$srcdir"/0008-5.9-bcachefs.patch # patch -Np1 -i "$srcdir"/0008-5.9-bcachefs.patch
# echo "CONFIG_BCACHEFS_FS=m" >> ./.config # echo "CONFIG_BCACHEFS_FS=m" >> ./.config
@@ -738,7 +738,7 @@ _tkg_srcprep() {
# plain "https://steamcommunity.com/games/221410/announcements/detail/2957094910196249305" # plain "https://steamcommunity.com/games/221410/announcements/detail/2957094910196249305"
# read -rp "`echo $' > N/y : '`" CONDITION9; # read -rp "`echo $' > N/y : '`" CONDITION9;
#fi #fi
#if [[ "$CONDITION9" =~ [yY] ]] || [ "$_fsync" == "true" ]; then #if [[ "$CONDITION9" =~ [yY] ]] || [ "$_fsync" = "true" ]; then
# msg2 "Patching Fsync support" # msg2 "Patching Fsync support"
# patch -Np1 -i "$srcdir"/0007-v5.9-fsync.patch # patch -Np1 -i "$srcdir"/0007-v5.9-fsync.patch
#fi #fi
@@ -750,7 +750,7 @@ _tkg_srcprep() {
plain "https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch" plain "https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch"
read -rp "`echo $' > N/y : '`" CONDITION11; read -rp "`echo $' > N/y : '`" CONDITION11;
fi fi
if [[ "$CONDITION11" =~ [yY] ]] || [ "$_zfsfix" == "true" ]; then if [[ "$CONDITION11" =~ [yY] ]] || [ "$_zfsfix" = "true" ]; then
msg2 "Patching missing symbol for AES-NI/AVX support on ZFS" msg2 "Patching missing symbol for AES-NI/AVX support on ZFS"
patch -Np1 -i "$srcdir"/0011-ZFS-fix.patch patch -Np1 -i "$srcdir"/0011-ZFS-fix.patch
fi fi
@@ -767,7 +767,7 @@ _tkg_srcprep() {
fi fi
# userpatches # userpatches
if [ "$_user_patches" == "true" ]; then if [ "$_user_patches" = "true" ]; then
_userpatch_target="linux-${_basekernel}" _userpatch_target="linux-${_basekernel}"
_userpatch_ext="my" _userpatch_ext="my"
user_patcher user_patcher
@@ -778,7 +778,7 @@ _tkg_srcprep() {
rm -f "$_where"/$_p rm -f "$_where"/$_p
done done
if [ "$_distro" == "Arch" ]; then if [ "$_distro" = "Arch" ]; then
# don't run depmod on 'make install'. We'll do this ourselves in packaging # don't run depmod on 'make install'. We'll do this ourselves in packaging
sed -i '2iexit 0' scripts/depmod.sh sed -i '2iexit 0' scripts/depmod.sh
@@ -795,7 +795,7 @@ _tkg_srcprep() {
plain "!!!! Make sure to have a well populated db !!!!" plain "!!!! Make sure to have a well populated db !!!!"
read -rp "`echo $' > N/y : '`" CONDITIONMPDB; read -rp "`echo $' > N/y : '`" CONDITIONMPDB;
fi fi
if [[ "$CONDITIONMPDB" =~ [yY] ]] || [ "$_modprobeddb" == "true" ]; then if [[ "$CONDITIONMPDB" =~ [yY] ]] || [ "$_modprobeddb" = "true" ]; then
sudo modprobed-db recall sudo modprobed-db recall
make localmodconfig make localmodconfig
fi fi
@@ -884,7 +884,7 @@ _tkg_srcprep() {
rm .config.orig rm .config.orig
fi fi
if [ "$_distro" == "Arch" ]; then if [ "$_distro" = "Arch" ]; then
make -s kernelrelease > version make -s kernelrelease > version
msg2 "Prepared %s version %s" "$pkgbase" "$(<version)" msg2 "Prepared %s version %s" "$pkgbase" "$(<version)"
fi fi
@@ -960,7 +960,7 @@ exit_cleanup() {
rm -f "$srcdir"/linux-${_basekernel}/mm/uksm.c rm -f "$srcdir"/linux-${_basekernel}/mm/uksm.c
fi fi
if [ "${_distro}" == "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
remove_deps remove_deps
fi fi