summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsayad2021-01-26 14:20:23 +0600
committersayad2021-01-26 14:20:23 +0600
commit8f5a1639a36be035fa65be71872365f783a7f535 (patch)
tree775d2977fd01ae40872608038e414f2afe331ea0
parent8dfd817807b1e5680d1a3cbc221ff062540c82ae (diff)
downloadaur-8f5a1639a36be035fa65be71872365f783a7f535.tar.gz
Bug fix
-rw-r--r--PKGBUILD3
-rw-r--r--prepare177
2 files changed, 118 insertions, 62 deletions
diff --git a/PKGBUILD b/PKGBUILD
index cd17974e9e64..83abb448b534 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -78,7 +78,8 @@ case $_basever in
"https://raw.githubusercontent.com/Frogging-Family/linux-tkg/master/linux-tkg-patches/5.10/0012-linux-hardened.patch"
"https://raw.githubusercontent.com/Frogging-Family/linux-tkg/master/linux-tkg-patches/5.10/0012-misc-additions.patch"
)
- sha256sums=('dcdf99e43e98330d925016985bfbc7b83c66d367b714b2de0cbbfcbf83d8ca43'
+
+sha256sums=('dcdf99e43e98330d925016985bfbc7b83c66d367b714b2de0cbbfcbf83d8ca43'
'f60f800329a7461e5ff542f7f19e24a073f1e49a74f96dfb5d45a899f6a9cad8'
'SKIP'
'458d1ca195f3fee5501683a4b61ef0ed0cfa7e5219eccab3390fb40c0289898a'
diff --git a/prepare b/prepare
index fe3586a793fb..03ffb5dde8c9 100644
--- a/prepare
+++ b/prepare
@@ -10,26 +10,82 @@ ver511=rc5
_tkg_initscript() {
# Load external configuration file if present. Available variable values will overwrite customization.cfg ones.
if [ -e "$_EXT_CONFIG_PATH" ]; then
- source "$_EXT_CONFIG_PATH" && msg2 "External configuration file $_EXT_CONFIG_PATH will be used to override customization.cfg values.\n"
+ source "$_EXT_CONFIG_PATH" && echo "External configuration file $_EXT_CONFIG_PATH will be used to override customization.cfg values.\n"
fi
# Default to Arch
if [ -z "$_distro" ] || [ "$_ispkgbuild" = "true" ]; then
- msg2 "Defaulting to Archlinux target\n"
_distro="Arch"
fi
- _path="${_where}"
+ # create build dir early
+ if [ "$_distro" = "Void" ]; then
+ _path="${XBPS_BUILDDIR}/${wrksrc}"
+ else
+ _path="${_where}"
+ fi
+
+ if [ -z "$_version" ] && [ ! -e "$_path"/versel ]; then
+ plain "Which kernel version do you want to install?"
+ read -rp _VERSEL;
+ case $_VERSEL in
+ *)
+ echo "_basever=510" > "$_path"/versel
+ echo "_basekernel=5.10" >> "$_path"/versel
+ echo "_sub=${ver510}" >> "$_path"/versel
+ ;;
+ esac
+ elif [ -n "$_version" ];then
+ case "$_version" in
+ "5.4")
+ echo "_basever=54" > "$_path"/versel
+ echo "_basekernel=5.4" >> "$_path"/versel
+ echo "_sub=${ver54}" >> "$_path"/versel
+ ;;
+ "5.7")
+ echo "_basever=57" > "$_path"/versel
+ echo "_basekernel=5.7" >> "$_path"/versel
+ echo "_sub=${ver57}" >> "$_path"/versel
+ ;;
+ "5.8")
+ echo "_basever=58" > "$_path"/versel
+ echo "_basekernel=5.8" >> "$_path"/versel
+ echo "_sub=${ver58}" >> "$_path"/versel
+ ;;
+ "5.9")
+ echo "_basever=59" > "$_path"/versel
+ echo "_basekernel=5.9" >> "$_path"/versel
+ echo "_sub=${ver59}" >> "$_path"/versel
+ ;;
+ "5.10")
+ echo "_basever=510" > "$_path"/versel
+ echo "_basekernel=5.10" >> "$_path"/versel
+ echo "_sub=${ver510}" >> "$_path"/versel
+ ;;
+ "5.11")
+ echo "_basever=511" > "$_path"/versel
+ echo "_basekernel=5.11" >> "$_path"/versel
+ echo "_sub=${ver511}" >> "$_path"/versel
+ ;;
+ *)
+ error "There is something wrong with your kernel version selection, exiting..."
+ exit 1
+ esac
+ fi
+
+ # source versel early if present
+ if [ -e "${_path}"/versel ]; then
+ source "${_path}"/versel
+ fi
if [ -z "$_OPTIPROFILE" ] && [ ! -e "$_path"/cpuschedset ]; then
# Prompt about optimized configurations. Available variable values will overwrite customization.cfg/external config ones.
- 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;
fi
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 && echo "Ryzen Desktop (Performance) profile will be used." && echo ""
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 && echo "Generic Desktop (Performance) profile will be used." && echo ""
fi
# source cpuschedset early if present
@@ -44,12 +100,13 @@ _tkg_initscript() {
# CPU SCHED selector
if [ -z "$_cpusched" ] && [ ! -e "${_path}"/cpuschedset ]; then
- plain "What CPU sched variant do you want to build/install?"
- prompt="`echo $' > 1.Undead PDS (TkG)\n 2.Project C / PDS\n 3.Project C / BMQ\n 4.MuQSS\n 5.CFS\nchoice[1-5?]: '`"
- read -rp "$prompt" CONDITION;
+ if [ "$_basever" = "510" ]; then
+ prompt="`echo $' 1.Undead PDS (TkG)\n 2.Project C / PDS\n 3.Project C / BMQ\n 4.MuQSS\n > 5.CFS\nchoice[1-5?]: '`"
+ fi
+read -rp "$prompt" CONDITION;
if [ "$CONDITION" = "1" ];then
echo "_cpusched=\"upds\"" > "${_path}"/cpuschedset
- if [ "$CONDITION" = "2" ];then
+ elif [ "$CONDITION" = "2" ];then
echo "_cpusched=\"pds\"" > "${_path}"/cpuschedset
elif [ "$CONDITION" = "3" ]; then
echo "_cpusched=\"bmq\"" > "${_path}"/cpuschedset
@@ -57,9 +114,8 @@ _tkg_initscript() {
echo "_cpusched=\"MuQSS\"" > "${_path}"/cpuschedset
elif [ "$CONDITION" = "5" ]; then
echo "_cpusched=\"cfs\"" > "${_path}"/cpuschedset
- else
- echo "_cpusched=\"cfs\"" > "${_path}"/cpuschedset
- fi
+ else
+ echo "_cpusched=\"upds\"" > "${_path}"/cpuschedset
fi
if [ -n "$_custom_pkgbase" ]; then
echo "_custom_pkgbase=\"${_custom_pkgbase}\"" >> "${_path}"/cpuschedset
@@ -104,7 +160,6 @@ _tkg_initscript() {
# Compiler selector
if [ -z "$_compiler" ] && [ ! -e "${_path}"/compilerset ]; then
- plain "Which compiler do you want to use?"
read -rp "`echo $' > 1.GCC (recommended)\n 2.Clang/LLVM\nchoice[1-2?]: '`" _CONDITION_CMPLR;
if [ "$_CONDITION_CMPLR" = "2" ];then
echo "_compiler_name=\"-llvm\"" > ${_path}/compilerset
@@ -133,6 +188,7 @@ _tkg_initscript() {
source "${_path}"/cpuschedset
source "${_path}"/compilerset
+ source "${_path}"/versel
}
user_patcher() {
@@ -148,18 +204,18 @@ user_patcher() {
local _patches=("$_where"/linux"$_basever"-tkg-userpatches/*."${_userpatch_ext}revert")
if [ ${#_patches[@]} -ge 2 ] || [ -e "${_patches}" ]; then
if [ "$_user_patches_no_confirm" != "true" ]; then
- msg2 "Found ${#_patches[@]} 'to revert' userpatches for ${_userpatch_target}:"
+ echo "Found ${#_patches[@]} 'to revert' userpatches for ${_userpatch_target}:"
printf '%s\n' "${_patches[@]}"
read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION;
fi
if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" = "true" ]; then
for _f in "${_patches[@]}"; do
if [ -e "${_f}" ]; then
- msg2 "######################################################"
- msg2 ""
- msg2 "Reverting your own ${_userpatch_target} patch ${_f}"
- msg2 ""
- msg2 "######################################################"
+ echo "######################################################"
+ echo ""
+ echo "Reverting your own ${_userpatch_target} patch ${_f}"
+ echo ""
+ echo "######################################################"
patch -Np1 -R < "${_f}"
echo "Reverted your own patch ${_f}" >> "$_where"/last_build_config.log
fi
@@ -170,18 +226,18 @@ user_patcher() {
_patches=("$_where"/linux"$_basever"-tkg-userpatches/*."${_userpatch_ext}patch")
if [ ${#_patches[@]} -ge 2 ] || [ -e "${_patches}" ]; then
if [ "$_user_patches_no_confirm" != "true" ]; then
- msg2 "Found ${#_patches[@]} userpatches for ${_userpatch_target}:"
+ echo "Found ${#_patches[@]} userpatches for ${_userpatch_target}:"
printf '%s\n' "${_patches[@]}"
read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION;
fi
if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" = "true" ]; then
for _f in "${_patches[@]}"; do
if [ -e "${_f}" ]; then
- msg2 "######################################################"
- msg2 ""
- msg2 "Applying your own ${_userpatch_target} patch ${_f}"
- msg2 ""
- msg2 "######################################################"
+ echo "######################################################"
+ echo ""
+ echo "Applying your own ${_userpatch_target} patch ${_f}"
+ echo ""
+ echo "######################################################"
patch -Np1 < "${_f}"
echo "Applied your own patch ${_f}" >> "$_where"/last_build_config.log
fi
@@ -196,14 +252,14 @@ _tkg_patcher() {
patch -Np1 -i "$tkgpatch" >> "$_where"/prepare.log || error "An error was encountered applying patches. It was logged to the prepare.log file."
echo -e "\n" >> "$_where"/prepare.log
else
- msg2 "Patch either not found, not available for this kernel version or not needed. Skipping..."
+ echo "Patch either not found, not available for this kernel version or not needed. Skipping..."
fi
}
_tkg_srcprep() {
if [ "${_distro}" = "Arch" ]; then
- msg2 "Setting version..."
+ echo "Setting version..."
scripts/setlocalversion --save-scmversion
echo "-$pkgrel-tkg-${_cpusched}${_compiler_name}" > localversion.10-pkgrel
echo -e "Version tail set to \"-$pkgrel-tkg-${_cpusched}${_compiler_name}\"\n" > "$_where"/prepare.log
@@ -211,13 +267,13 @@ _tkg_srcprep() {
# add upstream patch
if [ "$_sub" != "0" ]; then
- msg2 "Patching from $_basekernel to $pkgver"
+ echo "Patching from $_basekernel to $pkgver"
tkgpatch="$srcdir/patch-${pkgver}" && _tkg_patcher
fi
# ARCH Patches
if [ "${_configfile}" = "config_hardened.x86_64" ] && [ "${_cpusched}" = "cfs" ]; then
- msg2 "Using linux hardened patchset"
+ echo "Using linux hardened patchset"
tkgpatch="$srcdir/0012-linux-hardened.patch" && _tkg_patcher
else
tkgpatch="$srcdir/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch" && _tkg_patcher
@@ -226,7 +282,7 @@ _tkg_srcprep() {
# graysky's cpu opts - https://github.com/graysky2/kernel_gcc_patch
if [ "$_compiler_name" != "-llvm" ]; then
- msg2 "Applying graysky's cpu opts patch"
+ echo "Applying graysky's cpu opts patch"
if [ "${_distro}" = "Arch" ]; then
tkgpatch="$srcdir/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v${opt_ver}.patch" && _tkg_patcher
elif [ "${_distro}" = "Void" ]; then
@@ -237,10 +293,10 @@ _tkg_srcprep() {
fi
# TkG
- msg2 "Applying clear linux patches"
+ echo "Applying clear linux patches"
tkgpatch="$srcdir/0002-clear-patches.patch" && _tkg_patcher
- msg2 "Applying glitched base patch"
+ echo "Applying glitched base patch"
tkgpatch="$srcdir/0003-glitched-base.patch" && _tkg_patcher
if [ -z $_misc_adds ]; then
@@ -252,7 +308,7 @@ _tkg_srcprep() {
fi
if [ "$_misc_adds" = "true" ]; then
- msg2 "Applying misc additions patch"
+ echo "Applying misc additions patch"
tkgpatch="$srcdir/0012-misc-additions.patch" && _tkg_patcher
fi
@@ -261,15 +317,15 @@ _tkg_srcprep() {
if [ "${_cpusched}" = "MuQSS" ]; then
# MuQSS
- msg2 "Applying MuQSS base patch"
+ echo "Applying MuQSS base patch"
tkgpatch="$srcdir/0004-${_basekernel}-ck1.patch" && _tkg_patcher
if [ "${_aggressive_ondemand}" = "true" ]; then
- msg2 "Applying MuQSS agressive ondemand governor patch"
+ echo "Applying MuQSS agressive ondemand governor patch"
tkgpatch="$srcdir/0004-glitched-ondemand-muqss.patch" && _tkg_patcher
fi
- msg2 "Applying Glitched MuQSS patch"
+ echo "Applying Glitched MuQSS patch"
tkgpatch="$srcdir/0004-glitched-muqss.patch" && _tkg_patcher
elif [ "${_cpusched}" = "upds" ] || [ "${_cpusched}" = "pds" ]; then
@@ -280,27 +336,27 @@ _tkg_srcprep() {
fi
# PDS-mq
- msg2 "Applying PDS base patch"
+ echo "Applying PDS base patch"
if [ "${_cpusched}" = "upds" ] || ( [ "$_basever" = "54" ] || [ "$_basever" = "57" ] && [ "${_cpusched}" = "pds" ] ); then
tkgpatch="$srcdir/0005-v${_basekernel}_undead-pds099o.patch" && _tkg_patcher
if [ "${_aggressive_ondemand}" = "true" ]; then
- msg2 "Applying PDS agressive ondemand governor patch"
+ echo "Applying PDS agressive ondemand governor patch"
tkgpatch="$srcdir/0005${doa}-glitched-ondemand-pds.patch" && _tkg_patcher
fi
else
tkgpatch="$srcdir/0009-prjc_v${_basekernel}-r${rev}.patch" && _tkg_patcher
if [ "${_aggressive_ondemand}" = "true" ]; then
- msg2 "Applying prjc PDS/BMQ agressive ondemand governor patch"
+ echo "Applying prjc PDS/BMQ agressive ondemand governor patch"
tkgpatch="$srcdir/0009-glitched-ondemand-bmq.patch" && _tkg_patcher
fi
fi
- msg2 "Applying Glitched PDS patch"
+ echo "Applying Glitched PDS patch"
tkgpatch="$srcdir/0005${doa}-glitched-pds.patch" && _tkg_patcher
elif [ "${_cpusched}" = "bmq" ]; then
# Project C / BMQ
- msg2 "Applying Project C / BMQ base patch"
+ echo "Applying Project C / BMQ base patch"
if [ "$_basever" != "54" ]; then
tkgpatch="$srcdir/0009-prjc_v${_basekernel}-r${rev}.patch" && _tkg_patcher
else
@@ -308,15 +364,15 @@ _tkg_srcprep() {
fi
if [ "${_aggressive_ondemand}" = "true" ] && [ "$_basever" != "54" ]; then
- msg2 "Applying BMQ agressive ondemand governor patch"
+ echo "Applying BMQ agressive ondemand governor patch"
tkgpatch="$srcdir/0009-glitched-ondemand-bmq.patch" && _tkg_patcher
fi
- msg2 "Applying Glitched BMQ patch"
+ echo "Applying Glitched BMQ patch"
tkgpatch="$srcdir/0009-glitched-bmq.patch" && _tkg_patcher
elif [ "${_cpusched}" = "cfs" ]; then
- msg2 "Applying Glitched CFS patch"
+ echo "Applying Glitched CFS patch"
tkgpatch="$srcdir/0003-glitched-cfs.patch" && _tkg_patcher
fi
@@ -492,12 +548,12 @@ _tkg_srcprep() {
if [ "$CONDITION0" = "0" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/${_sched}.c
elif [ "$CONDITION0" = "1" ]; then
- msg2 "Using default CPU sched yield type (1)"
+ echo "Using default CPU sched yield type (1)"
elif [ "$CONDITION0" = "2" ]; then
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 2;/' ./kernel/sched/${_sched}.c
else
if [ "${_cpusched}" = "MuQSS" ]; then
- msg2 "Using default CPU sched yield type (1)"
+ echo "Using default CPU sched yield type (1)"
else
sed -i -e 's/int sched_yield_type __read_mostly = 1;/int sched_yield_type __read_mostly = 0;/' ./kernel/sched/${_sched}.c
fi
@@ -521,19 +577,19 @@ _tkg_srcprep() {
read -rp "`echo $'\n > 0.Keep defaults\n 1.2ms\n 2.4ms\n 3.6ms\n 4.8ms\n [0-4?]: '`" CONDITION1;
fi
if [ "$CONDITION1" = "1" ]; then
- msg2 "Using 2ms rr_interval"
+ echo "Using 2ms rr_interval"
_rrvalue="2"
elif [ "$CONDITION1" = "2" ]; then
- msg2 "Using 4ms rr_interval"
+ echo "Using 4ms rr_interval"
_rrvalue="4"
elif [ "$CONDITION1" = "3" ]; then
- msg2 "Using 6ms rr_interval"
+ echo "Using 6ms rr_interval"
_rrvalue="6"
elif [ "$CONDITION1" = "4" ]; then
- msg2 "Using 8ms rr_interval"
+ echo "Using 8ms rr_interval"
_rrvalue="8"
else
- msg2 "Using default rr_interval"
+ echo "Using default rr_interval"
_rrvalue="default"
fi
if [ "$_basever" != "54" ]; then
@@ -791,7 +847,7 @@ _tkg_srcprep() {
_custom_commandline+=" cpufreq.default_governor=ondemand"
sed -i -e 's/CONFIG_CPU_FREQ_GOV_ONDEMAND=m/CONFIG_CPU_FREQ_GOV_ONDEMAND=y/' ./.config
fi
- msg2 "Command line set to \"$_custom_commandline\""
+ echo "Command line set to \"$_custom_commandline\""
fi
# ACPI_CPUFREQ disablement
@@ -909,7 +965,7 @@ _tkg_srcprep() {
read -rp "`echo $' > N/y : '`" CONDITION7;
fi
if [[ "$CONDITION7" =~ [yY] ]] || [ "$_acs_override" = "true" ]; then
- msg2 "Patching ACS override"
+ echo "Patching ACS override"
tkgpatch="$srcdir/0006-add-acs-overrides_iommu.patch" && _tkg_patcher
fi
@@ -921,7 +977,7 @@ _tkg_srcprep() {
read -rp "`echo $' > N/y : '`" CONDITION8;
fi
if [[ "$CONDITION8" =~ [yY] ]] || [ "$_bcachefs" = "true" ]; then
- msg2 "Patching Bcache filesystem support override"
+ echo "Patching Bcache filesystem support override"
tkgpatch="$srcdir/0008-${_basekernel}-bcachefs.patch" && _tkg_patcher
echo "CONFIG_BCACHEFS_FS=m" >> ./.config
echo "CONFIG_BCACHEFS_QUOTA=y" >> ./.config
@@ -939,7 +995,7 @@ _tkg_srcprep() {
read -rp "`echo $' > N/y : '`" CONDITION9;
fi
if [[ "$CONDITION9" =~ [yY] ]] || [ "$_fsync" = "true" ]; then
- msg2 "Patching Fsync support"
+ echo "Patching Fsync support"
tkgpatch="$srcdir/0007-v${_basekernel}-fsync.patch" && _tkg_patcher
fi
@@ -952,7 +1008,7 @@ _tkg_srcprep() {
read -rp "`echo $' > N/y : '`" CONDITION11;
fi
if [[ "$CONDITION11" =~ [yY] ]] || [ "$_zfsfix" = "true" ]; then
- msg2 "Patching missing symbol for AES-NI/AVX support on ZFS"
+ echo "Patching missing symbol for AES-NI/AVX support on ZFS"
tkgpatch="$srcdir/0011-ZFS-fix.patch" && _tkg_patcher
fi
fi
@@ -1116,7 +1172,7 @@ _tkg_srcprep() {
if [ "$_distro" = "Arch" ]; then
make -s kernelrelease > version
- msg2 "Prepared %s version %s" "$pkgbase" "$(<version)"
+ echo "Prepared %s version %s" "$pkgbase" "$(<version)"
fi
}
@@ -1185,12 +1241,11 @@ exit_cleanup() {
fi
if [ "${_distro}" = "Arch" ]; then
- remove_deps || ( true && msg2 "remove_deps not found" )
+ remove_deps || ( true && echo "remove_deps not found" )
fi
- msg2 'exit cleanup done\n'
if [ -n "$_runtime" ]; then
- msg2 "compilation time : \n$_runtime"
+ echo "compilation time : \n$_runtime"
fi
}
if [ "$_distro" != "Void" ] && [ "$1" != "config" ]; then