Fix cpu-opt patch in "install.sh" and make "prepare" verbose about it (#439)

Closes: #438

Signed-off-by: Adel KARA SLIMANE <adel.ks@zegrapher.com>
This commit is contained in:
Adel Kara Slimane
2022-02-17 19:50:41 +01:00
committed by GitHub
parent 38513e05b4
commit 5f36c6353e
2 changed files with 27 additions and 43 deletions

View File

@@ -210,36 +210,16 @@ if [ "$1" = "install" ] || [ "$1" = "config" ]; then
cd "$_where" cd "$_where"
case "$_basever" in if [ "$_basever" = "54" ]; then
"57") opt_ver="4.19-5.4"
elif [ "$_basever" = "57" ]; then
opt_ver="5.7" opt_ver="5.7"
opt_alternative_url="true" opt_alternative_url="true"
;; elif [[ "$_basever" =~ ^(58|59|510|511|512|513|514)$ ]]; then
"58")
opt_ver="5.8-5.14" opt_ver="5.8-5.14"
;; else
"59")
opt_ver="5.8-5.14"
;;
"510")
opt_ver="5.8-5.14"
;;
"511")
opt_ver="5.8-5.14"
;;
"512")
opt_ver="5.8-5.14"
;;
"513")
opt_ver="5.8-5.14"
;;
"514")
opt_ver="5.8-5.14"
;;
"515")
opt_ver="5.15+" opt_ver="5.15+"
;; fi
esac
if [ -n "$opt_ver" ]; then if [ -n "$opt_ver" ]; then
msg2 "Downloading Graysky2's CPU optimisations patch" msg2 "Downloading Graysky2's CPU optimisations patch"

View File

@@ -385,10 +385,8 @@ _tkg_patcher() {
patch -Np1 -i "$tkgpatch" >> "$_where"/prepare.log || error "An error was encountered applying patches. It was logged to the prepare.log file." 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 echo -e "\n" >> "$_where"/prepare.log
else else
if [[ $_msg != *graysky* ]]; then
msg2 "Skipping patch ${tkgpatch##*/}...\n (unavailable for this kernel version)" msg2 "Skipping patch ${tkgpatch##*/}...\n (unavailable for this kernel version)"
fi fi
fi
} }
_tkg_srcprep() { _tkg_srcprep() {
@@ -438,6 +436,8 @@ _tkg_srcprep() {
if [ -z $_debug ]; then if [ -z $_debug ]; then
# graysky's cpu opts - https://github.com/graysky2/kernel_compiler_patch # graysky's cpu opts - https://github.com/graysky2/kernel_compiler_patch
if [ "$_basever" != "57" ]; then
# Newer version of the patches
if [ "${_distro}" = "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
tkgpatch="$srcdir/more-uarches-for-kernel-${opt_ver}.patch" tkgpatch="$srcdir/more-uarches-for-kernel-${opt_ver}.patch"
elif [ "${_distro}" = "Void" ]; then elif [ "${_distro}" = "Void" ]; then
@@ -447,6 +447,8 @@ _tkg_srcprep() {
fi fi
_msg="Applying graysky's cpu opts patch" && _tkg_patcher _msg="Applying graysky's cpu opts patch" && _tkg_patcher
else
# Edge case for 5.7
if [ "${_distro}" = "Arch" ]; then if [ "${_distro}" = "Arch" ]; then
tkgpatch="$srcdir/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v${opt_ver}.patch" tkgpatch="$srcdir/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v${opt_ver}.patch"
elif [ "${_distro}" = "Void" ]; then elif [ "${_distro}" = "Void" ]; then
@@ -456,6 +458,8 @@ _tkg_srcprep() {
fi fi
_msg="Applying graysky's cpu opts patch (legacy)" && _tkg_patcher _msg="Applying graysky's cpu opts patch (legacy)" && _tkg_patcher
fi
# PREEMPT_RT patch # PREEMPT_RT patch
if [ "${_preempt_rt}" = "1" ]; then if [ "${_preempt_rt}" = "1" ]; then
if [ ${_rt_subver_map[$_basekernel]+_} = "_" ]; then if [ ${_rt_subver_map[$_basekernel]+_} = "_" ]; then