linux58-tkg: Bring Ubuntu install script and related changes initially introduced with https://github.com/Frogging-Family/linux-tkg/pull/26
This commit is contained in:
parent
4a6b1ef584
commit
2a56141bbf
@ -25,83 +25,30 @@ plain ' `.-:///////:-.`'
|
||||
|
||||
_where="$PWD" # track basedir as different Arch based distros are moving srcdir around
|
||||
|
||||
cp "$_where"/linux58-tkg-patches/* "$_where" # copy patches inside the PKGBUILD's dir to preserve makepkg sourcing and md5sum checking
|
||||
cp "$_where"/linux58-tkg-config/* "$_where" # copy config files and hooks inside the PKGBUILD's dir to preserve makepkg sourcing and md5sum checking
|
||||
|
||||
source "$_where"/customization.cfg # load default configuration from file
|
||||
source "$_where"/linux*-tkg-config/prepare
|
||||
|
||||
# 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." && msg2 ""
|
||||
fi
|
||||
|
||||
if [ -z "$_OPTIPROFILE" ] && [ ! -e "$_where"/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 ""
|
||||
elif [ "$_OPTIPROFILE" == "3" ]; then
|
||||
source "$_where"/generic-desktop-profile.cfg && msg2 "Generic Desktop (Performance) profile will be used." && msg2 ""
|
||||
fi
|
||||
|
||||
# source cpuschedset early if present
|
||||
if [ -e "$_where"/cpuschedset ]; then
|
||||
source "$_where"/cpuschedset
|
||||
fi
|
||||
|
||||
# CPU SCHED selector
|
||||
if [ -z "$_cpusched" ] && [ ! -e "$_where"/cpuschedset ]; then
|
||||
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;
|
||||
if [ "$CONDITION" == "2" ]; then
|
||||
echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset
|
||||
elif [ "$CONDITION" == "3" ]; then
|
||||
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
|
||||
if [[ "$_sub" = rc* ]]; then
|
||||
_srcpath="linux-${_basekernel}-${_sub}"
|
||||
else
|
||||
echo "_cpusched=\"pds\"" > "$_where"/cpuschedset
|
||||
fi
|
||||
if [ -n "$_custom_pkgbase" ]; then
|
||||
echo "_custom_pkgbase=\"${_custom_pkgbase}\"" >> "$_where"/cpuschedset
|
||||
fi
|
||||
elif [ "$_cpusched" == "pds" ]; then
|
||||
echo "_cpusched=\"pds\"" > "$_where"/cpuschedset
|
||||
elif [ "$_cpusched" == "cfs" ]; then
|
||||
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
|
||||
elif [ "$_cpusched" == "bmq" ]; then
|
||||
echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset
|
||||
else
|
||||
if [ "$_nofallback" != "true" ]; then
|
||||
warning "Something is wrong with your cpusched selection. Do you want to fallback to CFS (default)?"
|
||||
read -rp "`echo $' > N/y : '`" _fallback;
|
||||
fi
|
||||
if [[ "$_fallback" =~ [yY] ]] || [ "$_nofallback" == "true" ]; then
|
||||
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
|
||||
else
|
||||
error "Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
_srcpath="linux-${_basekernel}"
|
||||
fi
|
||||
|
||||
source "$_where"/cpuschedset
|
||||
_tkg_initscript
|
||||
|
||||
_basever=58
|
||||
if [ -n "$_custom_pkgbase" ]; then
|
||||
pkgbase="${_custom_pkgbase}"
|
||||
else
|
||||
pkgbase=linux"${_basever}"-tkg-"${_cpusched}"
|
||||
fi
|
||||
pkgname=("${pkgbase}" "${pkgbase}-headers")
|
||||
_basekernel=5.8
|
||||
_sub=1
|
||||
pkgver="${_basekernel}"."${_sub}"
|
||||
pkgrel=2
|
||||
pkgdesc='Linux-tkg'
|
||||
arch=('x86_64') # no i686 in here
|
||||
url="http://www.kernel.org/"
|
||||
license=('GPL2')
|
||||
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'libelf' 'patchutils' 'pahole' 'flex' 'python-sphinx' 'python-sphinx_rtd_theme' 'graphviz' 'imagemagick' 'git')
|
||||
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'libelf' 'pahole' 'patchutils' 'flex' 'python-sphinx' 'python-sphinx_rtd_theme' 'graphviz' 'imagemagick' 'git')
|
||||
optdepends=('schedtool')
|
||||
options=('!strip')
|
||||
source=("https://www.kernel.org/pub/linux/kernel/v5.x/linux-${_basekernel}.tar.xz"
|
||||
@ -158,66 +105,18 @@ export KBUILD_BUILD_HOST=archlinux
|
||||
export KBUILD_BUILD_USER=$pkgbase
|
||||
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"
|
||||
|
||||
user_patcher() {
|
||||
# To patch the user because all your base are belong to us
|
||||
local _patches=("$_where"/*."${_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}:"
|
||||
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 "######################################################"
|
||||
patch -Np1 -R < "${_f}"
|
||||
echo "Reverted your own patch ${_f}" >> "$_where"/last_build_config.log
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
_patches=("$_where"/*."${_userpatch_ext}patch")
|
||||
if [ ${#_patches[@]} -ge 2 ] || [ -e "${_patches}" ]; then
|
||||
if [ "$_user_patches_no_confirm" != "true" ]; then
|
||||
msg2 "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 "######################################################"
|
||||
patch -Np1 < "${_f}"
|
||||
echo "Applied your own patch ${_f}" >> "$_where"/last_build_config.log
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
prepare() {
|
||||
rm -rf $pkgdir # Nuke the entire pkg folder so it'll get regenerated clean on next build
|
||||
|
||||
ln -s "${_where}/customization.cfg" "${srcdir}" # workaround
|
||||
|
||||
cd "${srcdir}/linux-${_basekernel}"
|
||||
cd "${srcdir}/${_srcpath}"
|
||||
|
||||
source "$_where/linux$_basever-tkg-config/prepare"
|
||||
_tkg_srcprep
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/linux-${_basekernel}"
|
||||
cd "${srcdir}/${_srcpath}"
|
||||
|
||||
# Use custom compiler paths if defined
|
||||
if [ -n "${CUSTOM_GCC_PATH}" ]; then
|
||||
@ -255,7 +154,7 @@ hackbase() {
|
||||
provides=("linux=${pkgver}" "${pkgbase}" VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE)
|
||||
replaces=(virtualbox-guest-modules-arch wireguard-arch)
|
||||
|
||||
cd "${srcdir}/linux-${_basekernel}"
|
||||
cd "${srcdir}/${_srcpath}"
|
||||
|
||||
# get kernel version
|
||||
local _kernver="$(<version)"
|
||||
@ -285,7 +184,7 @@ hackheaders() {
|
||||
pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel"
|
||||
provides=("linux-headers=${pkgver}" "${pkgbase}-headers=${pkgver}")
|
||||
|
||||
cd "${srcdir}/linux-${_basekernel}"
|
||||
cd "${srcdir}/${_srcpath}"
|
||||
local builddir="${pkgdir}/usr/lib/modules/$(<version)/build"
|
||||
|
||||
msg2 "Installing build files..."
|
||||
@ -373,83 +272,3 @@ package_${pkgbase}-headers() {
|
||||
hackheaders
|
||||
}
|
||||
EOF
|
||||
|
||||
function exit_cleanup {
|
||||
# Remove state tracker
|
||||
rm -f "$_where"/cpuschedset
|
||||
|
||||
# Remove temporarily copied files
|
||||
rm -rf "$_where"/*.patch
|
||||
rm -rf "$_where"/*-profile.cfg
|
||||
rm -f "$_where"/config*
|
||||
rm -f "$_where"/*.hook
|
||||
rm -f "$_where"/cleanup
|
||||
rm -f "$_where"/prepare
|
||||
|
||||
# Community patches removal in case of failure
|
||||
for _p in ${_community_patches[@]}; do
|
||||
rm -f "$_where"/"$_p"
|
||||
done
|
||||
|
||||
if [ "$_NUKR" == "true" ]; then
|
||||
rm -rf "$_where"/src/*
|
||||
# Double tap
|
||||
rm -rf "$srcdir"/linux-*
|
||||
rm -rf "$srcdir"/*.xz
|
||||
rm -rf "$srcdir"/*.patch
|
||||
rm -rf "$srcdir"/*-profile.cfg
|
||||
rm -f "$srcdir"/config.x86_64
|
||||
rm -f "$srcdir"/customization.cfg
|
||||
else
|
||||
# Meh
|
||||
rm -rf "$srcdir"/linux-${_basekernel}/Documentation/filesystems/aufs/*
|
||||
rm -f "$srcdir"/linux-${_basekernel}/Documentation/ABI/testing/*-aufs
|
||||
rm -rf "$srcdir"/linux-${_basekernel}/fs/aufs/*
|
||||
rm -f "$srcdir"/linux-${_basekernel}/include/uapi/linux/aufs*
|
||||
|
||||
rm -f "$srcdir"/linux-${_basekernel}/mm/prfile.c
|
||||
|
||||
rm -f "$srcdir"/linux-${_basekernel}/block/bfq*
|
||||
|
||||
rm -rf "$srcdir"/linux-${_basekernel}/drivers/scsi/vhba/*
|
||||
|
||||
rm -rf "$srcdir"/linux-${_basekernel}/fs/exfat/*
|
||||
rm -f "$srcdir"/linux-${_basekernel}/include/trace/events/fs.h
|
||||
|
||||
rm -f "$srcdir"/linux-${_basekernel}/Documentation/scheduler/sched-PDS-mq.txt
|
||||
rm -f "$srcdir"/linux-${_basekernel}/include/linux/skip_list.h
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/sched/pds.c
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/sched/pds_sched.h
|
||||
|
||||
rm -f "$srcdir"/linux-${_basekernel}/Documentation/scheduler/sched-BMQ.txt
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/sched/alt_core.c
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/sched/sched/alt_debug.c
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/sched/alt_sched.h
|
||||
|
||||
rm -f "$srcdir"/linux-${_basekernel}/Documentation/scheduler/sched-BFS.txt
|
||||
rm -f "$srcdir"/linux-${_basekernel}/Documentation/scheduler/sched-MuQSS.txt
|
||||
rm -rf "$srcdir"/linux-${_basekernel}/arch/blackfin/*
|
||||
rm -f "$srcdir"/linux-${_basekernel}/arch/powerpc/configs/c2k_defconfig
|
||||
rm -f "$srcdir"/linux-${_basekernel}/arch/score/configs/spct6600_defconfig
|
||||
rm -f "$srcdir"/linux-${_basekernel}/arch/tile/configs/tilegx_defconfig
|
||||
rm -f "$srcdir"/linux-${_basekernel}/arch/tile/configs/tilepro_defconfig
|
||||
rm -f "$srcdir"/linux-${_basekernel}/drivers/staging/lustre/lnet/lnet/lib-eq.c
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/sched/MuQSS*
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/skip_list.c
|
||||
|
||||
rm -f "$srcdir"/linux-${_basekernel}/Documentation/vm/uksm.txt
|
||||
rm -f "$srcdir"/linux-${_basekernel}/include/linux/sradix-tree.h
|
||||
rm -f "$srcdir"/linux-${_basekernel}/include/linux/uksm.h
|
||||
rm -f "$srcdir"/linux-${_basekernel}/lib/sradix-tree.c
|
||||
rm -f "$srcdir"/linux-${_basekernel}/mm/uksm.c
|
||||
fi
|
||||
|
||||
remove_deps
|
||||
|
||||
msg2 'exit cleanup done\n'
|
||||
if [ -n "$_runtime" ]; then
|
||||
msg2 "compilation time : \n$_runtime"
|
||||
fi
|
||||
}
|
||||
|
||||
trap exit_cleanup EXIT
|
||||
|
@ -1,12 +1,14 @@
|
||||
# linux58-TkG config file
|
||||
|
||||
# Linux distribution you are using, options are "Arch" (default), "Ubuntu"
|
||||
_distro="Arch"
|
||||
|
||||
#### MISC OPTIONS ####
|
||||
|
||||
# External config file to use - If the given file exists in path, it will override default config (customization.cfg) - Default is ~/.config/frogminer/linux52-tkg.cfg
|
||||
_EXT_CONFIG_PATH=~/.config/frogminer/linux58-tkg.cfg
|
||||
|
||||
# Set to anything else than "true" to limit cleanup operations and keep source and files generated during compilation.
|
||||
# [Arch specific] Set to anything else than "true" to limit cleanup operations and keep source and files generated during compilation.
|
||||
# Default is "true".
|
||||
_NUKR="true"
|
||||
|
||||
@ -30,7 +32,7 @@ _noccache="false"
|
||||
# !!!! Make sure to have a well populated db !!!! - Leave empty to be asked about it at build time
|
||||
_modprobeddb="false"
|
||||
|
||||
# Set to "1" to call make menuconfig or "2" to call make nconfig before building the kernel. Set to false to disable and skip the prompt.
|
||||
# Set to "1" to call make menuconfig, "2" to call make nconfig, "3" to call make xconfig, before building the kernel. Set to false to disable and skip the prompt.
|
||||
_menunconfig=""
|
||||
|
||||
# Set to true to generate a kernel config fragment from your changes in menuconfig/nconfig. Set to false to disable and skip the prompt.
|
||||
@ -41,7 +43,7 @@ _diffconfig_name=""
|
||||
|
||||
#### KERNEL OPTIONS ####
|
||||
|
||||
# Name of the default config file to use from the linux???-tkg-config folder. Arch default is "config.x86_64" and Arch hardened is "config_hardened.x86_64".
|
||||
# [Arch specific] Name of the default config file to use from the linux???-tkg-config folder, use "distro" to use the config file of the kernel you are currently using. Arch default is "config.x86_64" and Arch hardened is "config_hardened.x86_64".
|
||||
# To get a complete hardened setup, you have to use "cfs" as _cpusched
|
||||
_configfile="config.x86_64"
|
||||
|
||||
@ -67,7 +69,7 @@ _sched_yield_type="0"
|
||||
# to the rr_interval in addition to a virtual deadline. When using yield_type 2, a low value can help offset the disadvantages of rescheduling a process that has yielded.
|
||||
# MuQSS default: 6ms"
|
||||
# PDS default: 4ms"
|
||||
# BMQ default: 4ms"
|
||||
# BMQ default: 2ms"
|
||||
# Set to "1" for 2ms, "2" for 4ms, "3" for 6ms, "4" for 8ms, or "default" to keep the chosen scheduler defaults.
|
||||
_rr_interval=""
|
||||
|
||||
@ -150,6 +152,9 @@ _custom_commandline="intel_pstate=passive"
|
||||
# !!! It will also change pkgname - If you don't explicitely need this, don't use it !!!
|
||||
_custom_pkgbase=""
|
||||
|
||||
# [non-Arch specific] Kernel localversion. Putting it to "Mario" will make for example the kernel version be 5.7.0-Mario (given by uname -r)
|
||||
# If left empty, it will use -tkg-"${_cpusched}" where "${_cpusched}" will be replaced by the user chosen scheduler
|
||||
_kernel_localversion=""
|
||||
|
||||
#### USER PATCHES ####
|
||||
|
||||
|
203
linux58-tkg/install.sh
Executable file
203
linux58-tkg/install.sh
Executable file
@ -0,0 +1,203 @@
|
||||
#!/bin/bash
|
||||
|
||||
msg2() {
|
||||
echo -e " \033[1;34m->\033[1;0m \033[1;1m$1\033[1;0m" >&2
|
||||
}
|
||||
|
||||
error() {
|
||||
echo -e " \033[1;31m==> ERROR: $1\033[1;0m" >&2
|
||||
}
|
||||
|
||||
warning() {
|
||||
echo -e " \033[1;33m==> WARNING: $1\033[1;0m" >&2
|
||||
}
|
||||
|
||||
plain() {
|
||||
echo "$1" >&2
|
||||
}
|
||||
|
||||
# alias plain=echo
|
||||
set -e
|
||||
|
||||
_where=`pwd`
|
||||
srcdir="$_where"
|
||||
|
||||
_cpu_opt_patch_link="https://raw.githubusercontent.com/graysky2/kernel_gcc_patch/master/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v5.8%2B.patch"
|
||||
|
||||
source customization.cfg
|
||||
|
||||
if [ "$1" != "install" ] && [ "$1" != "config" ] && [ "$1" != "uninstall" ]; then
|
||||
echo "Command not recognised, options are:
|
||||
- config : shallow clones the linux 5.7.x git tree into the folder linux-5.7, then applies on it the extra patches and prepares the .config file by copying the one from the current linux system in /boot/config-`uname -r` and updates it.
|
||||
- install : [Debian-like only (Debian, Ubuntu, Pop_os!...)], does the config step, proceeds to compile, then prompts to install
|
||||
- uninstall : [Debian-like only (Debian, Ubuntu, Pop_os!...)], lists the installed custom kernels through this script, then prompts for which one to uninstall."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Load external configuration file if present. Available variable values will overwrite customization.cfg ones.
|
||||
if [ -e "$_EXT_CONFIG_PATH" ]; then
|
||||
msg2 "External configuration file $_EXT_CONFIG_PATH will be used and will override customization.cfg values."
|
||||
source "$_EXT_CONFIG_PATH"
|
||||
fi
|
||||
|
||||
if [ "$1" == "install" ] || [ "$1" == "config" ]; then
|
||||
|
||||
source linux*-tkg-config/prepare
|
||||
|
||||
if [ $1 == "install" ] && [ "$_distro" != "Ubuntu" ]; then
|
||||
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..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$_distro" == "Ubuntu" ]; then
|
||||
msg2 "Installing dependencies"
|
||||
sudo apt install git build-essential kernel-package fakeroot libncurses5-dev libssl-dev ccache bison flex
|
||||
else
|
||||
msg2 "Dependencies are unknown for the target linux distribution."
|
||||
fi
|
||||
|
||||
# Force prepare script to avoid Arch specific commands if the user didn't change _distro from "Arch"
|
||||
if [ "$1" == "config" ]; then
|
||||
_distro=""
|
||||
fi
|
||||
|
||||
if [ -d linux-${_basekernel}.orig ]; then
|
||||
rm -rf linux-${_basekernel}.orig
|
||||
fi
|
||||
|
||||
if [ -d linux-${_basekernel} ]; then
|
||||
msg2 "Reseting files in linux-$_basekernel to their original state and getting latest updates"
|
||||
cd "$_where"/linux-${_basekernel}
|
||||
git checkout --force linux-$_basekernel.y
|
||||
git clean -f -d -x
|
||||
git pull
|
||||
msg2 "Done"
|
||||
cd "$_where"
|
||||
else
|
||||
msg2 "Shallow git cloning linux $_basekernel"
|
||||
git clone --branch linux-$_basekernel.y --single-branch --depth=1 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-${_basekernel}
|
||||
msg2 "Done"
|
||||
fi
|
||||
|
||||
# Define current kernel subversion
|
||||
if [ -z $_kernel_subver ]; then
|
||||
cd "$_where"/linux-${_basekernel}
|
||||
_kernelverstr=`git describe`
|
||||
_kernel_subver=${_kernelverstr:5}
|
||||
cd "$_where"
|
||||
fi
|
||||
|
||||
|
||||
# Run init script that is also run in PKGBUILD, it will define some env vars that we will use
|
||||
_tkg_initscript
|
||||
|
||||
cd "$_where"
|
||||
msg2 "Downloading Graysky2's CPU optimisations patch"
|
||||
wget "$_cpu_opt_patch_link"
|
||||
|
||||
# Follow Ubuntu install isntructions in https://wiki.ubuntu.com/KernelTeam/GitKernelBuild
|
||||
|
||||
# cd in linux folder, copy Ubuntu's current config file, update with new params
|
||||
cd "$_where"/linux-${_basekernel}
|
||||
|
||||
msg2 "Copying current kernel's config and running make oldconfig..."
|
||||
cp /boot/config-`uname -r` .config
|
||||
yes '' | make oldconfig
|
||||
msg2 "Done"
|
||||
|
||||
# apply linux-tkg patching script
|
||||
_tkg_srcprep
|
||||
|
||||
msg2 "Configuration done."
|
||||
fi
|
||||
|
||||
if [ "$1" == "install" ]; then
|
||||
|
||||
# Use custom compiler paths if defined
|
||||
if [ -n "${CUSTOM_GCC_PATH}" ]; then
|
||||
PATH=${CUSTOM_GCC_PATH}/bin:${CUSTOM_GCC_PATH}/lib:${CUSTOM_GCC_PATH}/include:${PATH}
|
||||
fi
|
||||
|
||||
if [ "$_force_all_threads" == "true" ]; then
|
||||
_thread_num=`nproc`
|
||||
else
|
||||
_thread_num=`expr \`nproc\` / 4`
|
||||
if [ "$_thread_num" = "0" ]; then
|
||||
_thread_num=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# ccache
|
||||
if [ "$_noccache" != "true" ]; then
|
||||
if [ "$_distro" == "Ubuntu" ] && dpkg -l ccache > /dev/null; then
|
||||
export PATH="/usr/lib/ccache/bin/:$PATH"
|
||||
export CCACHE_SLOPPINESS="file_macro,locale,time_macros"
|
||||
export CCACHE_NOHASHDIR="true"
|
||||
msg2 'ccache was found and will be used'
|
||||
fi
|
||||
fi
|
||||
|
||||
_kernel_flavor="${_kernel_localversion}"
|
||||
if [ -z $_kernel_localversion ]; then
|
||||
_kernel_flavor="tkg-${_cpusched}"
|
||||
fi
|
||||
|
||||
if [ "$_distro" == "Ubuntu" ]; then
|
||||
if make -j ${_thread_num} deb-pkg LOCALVERSION=-${_kernel_flavor}; then
|
||||
msg2 "Building successfully finished!"
|
||||
read -p "Do you want to install the new Kernel ? y/[n]: " _install
|
||||
if [[ $_install =~ [yY] ]] || [[ $_install =~ [yY] ]] || [ $_install == "yes" ] || [ $_install == "Yes" ]; then
|
||||
cd "$_where"
|
||||
_kernelname=$_basekernel.$_kernel_subver-$_kernel_flavor
|
||||
_headers_deb=linux-headers-${_kernelname}*.deb
|
||||
_image_deb=linux-image-${_kernelname}_*.deb
|
||||
|
||||
sudo dpkg -i $_headers_deb $_image_deb
|
||||
|
||||
# Add to the list of installed kernels, used for uninstall
|
||||
if ! { [ -f installed-kernels ] && grep -Fxq "$_kernelname" installed-kernels; }; then
|
||||
echo $_kernelname >> installed-kernels
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" == "uninstall" ]; then
|
||||
|
||||
cd "$_where"
|
||||
|
||||
if [ ! -f installed-kernels ] || [ ! -s installed-kernels ]; then
|
||||
echo "No custom kernel has been installed yet"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
i=1
|
||||
declare -a _custom_kernels
|
||||
msg2 "Installed custom kernel versions: "
|
||||
while read p; do
|
||||
echo " $i) $p"
|
||||
_custom_kernels+=($p)
|
||||
i=$((i+1))
|
||||
done < installed-kernels
|
||||
|
||||
i=$((i-1))
|
||||
_delete_index=0
|
||||
read -p "Which one would you like to delete ? [1-$i]: " _delete_index
|
||||
|
||||
if [ $_delete_index -ge 1 ] && [ $_delete_index -le $i ]; then
|
||||
_delete_index=$((_delete_index-1))
|
||||
sudo dpkg -r linux-headers-${_custom_kernels[$_delete_index]} linux-image-${_custom_kernels[$_delete_index]}
|
||||
fi
|
||||
|
||||
rm -f installed-kernels
|
||||
i=0
|
||||
for kernel in "${_custom_kernels[@]}"; do
|
||||
if [ $_delete_index != $i ]; then
|
||||
echo "$kernel" >> installed-kernels
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
|
||||
fi
|
@ -1,68 +1,220 @@
|
||||
#!/bin/bash
|
||||
|
||||
_basever=58
|
||||
_basekernel=5.8
|
||||
_sub=1
|
||||
|
||||
_tkg_initscript() {
|
||||
|
||||
cp "$_where"/linux"$_basever"-tkg-patches/* "$_where" # copy patches inside the PKGBUILD's dir to preserve makepkg sourcing and md5sum checking
|
||||
cp "$_where"/linux"$_basever"-tkg-config/* "$_where" # copy config files and hooks inside the PKGBUILD's dir to preserve makepkg sourcing and md5sum checking
|
||||
|
||||
# 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." && msg2 ""
|
||||
fi
|
||||
|
||||
if [ -z "$_OPTIPROFILE" ] && [ ! -e "$_where"/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 ""
|
||||
elif [ "$_OPTIPROFILE" == "3" ]; then
|
||||
source "$_where"/generic-desktop-profile.cfg && msg2 "Generic Desktop (Performance) profile will be used." && msg2 ""
|
||||
fi
|
||||
|
||||
# source cpuschedset early if present
|
||||
if [ -e "$_where"/cpuschedset ]; then
|
||||
source "$_where"/cpuschedset
|
||||
fi
|
||||
|
||||
# CPU SCHED selector
|
||||
if [ -z "$_cpusched" ] && [ ! -e "$_where"/cpuschedset ]; then
|
||||
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;
|
||||
if [ "$CONDITION" == "2" ]; then
|
||||
echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset
|
||||
elif [ "$CONDITION" == "3" ]; then
|
||||
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
|
||||
else
|
||||
echo "_cpusched=\"pds\"" > "$_where"/cpuschedset
|
||||
fi
|
||||
if [ -n "$_custom_pkgbase" ]; then
|
||||
echo "_custom_pkgbase=\"${_custom_pkgbase}\"" >> "$_where"/cpuschedset
|
||||
fi
|
||||
elif [ "$_cpusched" == "pds" ]; then
|
||||
echo "_cpusched=\"pds\"" > "$_where"/cpuschedset
|
||||
elif [ "$_cpusched" == "cfs" ]; then
|
||||
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
|
||||
elif [ "$_cpusched" == "bmq" ]; then
|
||||
echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset
|
||||
else
|
||||
if [ "$_nofallback" != "true" ]; then
|
||||
warning "Something is wrong with your cpusched selection. Do you want to fallback to CFS (default)?"
|
||||
read -rp "`echo $' > N/y : '`" _fallback;
|
||||
fi
|
||||
if [[ "$_fallback" =~ [yY] ]] || [ "$_nofallback" == "true" ]; then
|
||||
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
|
||||
else
|
||||
error "Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
source "$_where"/cpuschedset
|
||||
}
|
||||
|
||||
user_patcher() {
|
||||
# To patch the user because all your base are belong to us
|
||||
local _patches=("$_where"/*."${_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}:"
|
||||
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 "######################################################"
|
||||
patch -Np1 -R < "${_f}"
|
||||
echo "Reverted your own patch ${_f}" >> "$_where"/last_build_config.log
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
_patches=("$_where"/*."${_userpatch_ext}patch")
|
||||
if [ ${#_patches[@]} -ge 2 ] || [ -e "${_patches}" ]; then
|
||||
if [ "$_user_patches_no_confirm" != "true" ]; then
|
||||
msg2 "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 "######################################################"
|
||||
patch -Np1 < "${_f}"
|
||||
echo "Applied your own patch ${_f}" >> "$_where"/last_build_config.log
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
_tkg_srcprep() {
|
||||
|
||||
if [ "${_distro}" == "Arch" ]; then
|
||||
msg2 "Setting version..."
|
||||
scripts/setlocalversion --save-scmversion
|
||||
echo "-$pkgrel-tkg-${_cpusched}" > localversion.10-pkgrel
|
||||
echo "" > localversion.20-pkgname
|
||||
|
||||
# add upstream patch
|
||||
patch -p1 -i ../patch-"${pkgver}"
|
||||
msg2 "Patching from $_basekernel to $pkgver"
|
||||
patch -p1 -i "$srcdir"/patch-"${pkgver}"
|
||||
|
||||
# ARCH Patches
|
||||
if [ "${_configfile}" == "config_hardened.x86_64" ] && [ "${_cpusched}" == "cfs" ]; then
|
||||
msg2 "Using linux hardened patchset"
|
||||
patch -Np1 -i ../0012-linux-hardened.patch
|
||||
patch -Np1 -i "$srcdir"/0012-linux-hardened.patch
|
||||
else
|
||||
patch -Np1 -i ../0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
|
||||
patch -Np1 -i "$srcdir"/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
|
||||
fi
|
||||
fi
|
||||
|
||||
# graysky's cpu opts - https://github.com/graysky2/kernel_gcc_patch
|
||||
msg2 "Applying graysky's cpu opts patch"
|
||||
patch -Np1 -i ../enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v5.8%2B.patch
|
||||
if [ "${_distro}" == "Arch" ]; then
|
||||
patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1%2B_kernel_v5.8%2B.patch
|
||||
else
|
||||
patch -Np1 -i "$srcdir"/enable_additional_cpu_optimizations_for_gcc_v10.1+_kernel_v5.8+.patch
|
||||
fi
|
||||
|
||||
# TkG
|
||||
msg2 "Applying clear linux patches"
|
||||
patch -Np1 -i ../0002-clear-patches.patch
|
||||
patch -Np1 -i "$srcdir"/0002-clear-patches.patch
|
||||
|
||||
msg2 "Applying glitched base patch"
|
||||
patch -Np1 -i ../0003-glitched-base.patch
|
||||
patch -Np1 -i "$srcdir"/0003-glitched-base.patch
|
||||
|
||||
if [ "$_misc_adds" = "true" ]; then
|
||||
if [ -z $_misc_adds ]; then
|
||||
plain "Enable misc additions ? May contain temporary fixes pending upstream or changes that can break on non-Arch. "
|
||||
read -rp "`echo $' > [Y]/n : '`" _interactive_misc_adds;
|
||||
if [ "$_interactive_misc_adds" != "n" ] && [ "$_interactive_misc_adds" != "N" ]; then
|
||||
_misc_adds="true"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$_misc_adds" == "true" ]; then
|
||||
msg2 "Applying misc additions patch"
|
||||
patch -Np1 -i ../0012-misc-additions.patch
|
||||
patch -Np1 -i "$srcdir"/0012-misc-additions.patch
|
||||
fi
|
||||
|
||||
if [ "${_cpusched}" == "MuQSS" ]; then
|
||||
# MuQSS
|
||||
patch -Np1 -i ../0004-5.8-ck1.patch
|
||||
msg2 "Applying MuQSS base patch"
|
||||
patch -Np1 -i "$srcdir"/0004-5.8-ck1.patch
|
||||
|
||||
if [ "${_aggressive_ondemand}" == "true" ]; then
|
||||
patch -Np1 -i ../0004-glitched-ondemand-muqss.patch
|
||||
fi
|
||||
patch -Np1 -i ../0004-glitched-muqss.patch
|
||||
elif [ "${_cpusched}" == "pds" ]; then
|
||||
# PDS-mq
|
||||
patch -Np1 -i ../0005-v5.8_undead-pds099o.patch
|
||||
if [ "${_aggressive_ondemand}" == "true" ]; then
|
||||
patch -Np1 -i ../0005-glitched-ondemand-pds.patch
|
||||
fi
|
||||
patch -Np1 -i ../0005-glitched-pds.patch
|
||||
elif [ "${_cpusched}" == "bmq" ]; then
|
||||
# Project C / BMQ
|
||||
patch -Np1 -i ../0009-prjc_v5.8-r0.patch
|
||||
if [ "${_aggressive_ondemand}" == "true" ]; then
|
||||
patch -Np1 -i ../0009-glitched-ondemand-bmq.patch
|
||||
fi
|
||||
patch -Np1 -i ../0009-glitched-bmq.patch
|
||||
elif [ "${_cpusched}" == "cfs" ]; then
|
||||
patch -Np1 -i ../0003-glitched-cfs.patch
|
||||
msg2 "Applying MuQSS agressive ondemand governor patch"
|
||||
patch -Np1 -i "$srcdir"/0004-glitched-ondemand-muqss.patch
|
||||
fi
|
||||
|
||||
msg2 "Applying Glitched MuQSS patch"
|
||||
patch -Np1 -i "$srcdir"/0004-glitched-muqss.patch
|
||||
|
||||
elif [ "${_cpusched}" == "pds" ]; then
|
||||
# PDS-mq
|
||||
msg2 "Applying PDS base patch"
|
||||
patch -Np1 -i "$srcdir"/0005-v5.8_undead-pds099o.patch
|
||||
|
||||
if [ "${_aggressive_ondemand}" == "true" ]; then
|
||||
msg2 "Applying PDS agressive ondemand governor patch"
|
||||
patch -Np1 -i "$srcdir"/0005-glitched-ondemand-pds.patch
|
||||
fi
|
||||
|
||||
msg2 "Applying Glitched PDS patch"
|
||||
patch -Np1 -i "$srcdir"/0005-glitched-pds.patch
|
||||
|
||||
elif [ "${_cpusched}" == "bmq" ]; then
|
||||
# Project C / BMQ
|
||||
msg2 "Applying Project C / BMQ base patch"
|
||||
|
||||
patch -Np1 -i "$srcdir"/0009-prjc_v5.8-r0.patch
|
||||
|
||||
if [ "${_aggressive_ondemand}" == "true" ]; then
|
||||
msg2 "Applying BMQ agressive ondemand governor patch"
|
||||
patch -Np1 -i "$srcdir"/0009-glitched-ondemand-bmq.patch
|
||||
fi
|
||||
|
||||
msg2 "Applying Glitched BMQ patch"
|
||||
patch -Np1 -i "$srcdir"/0009-glitched-bmq.patch
|
||||
|
||||
elif [ "${_cpusched}" == "cfs" ]; then
|
||||
msg2 "Applying Glitched CFS patch"
|
||||
patch -Np1 -i "$srcdir"/0003-glitched-cfs.patch
|
||||
fi
|
||||
|
||||
if [ "${_distro}" == "Arch" ]; then
|
||||
if [ -z "${_configfile}" ]; then
|
||||
_configfile="config.x86_64"
|
||||
fi
|
||||
|
||||
cat "${srcdir}/${_configfile}" > ./.config
|
||||
fi
|
||||
|
||||
|
||||
# Set some -tkg defaults
|
||||
echo "# CONFIG_DYNAMIC_FAULT is not set" >> ./.config
|
||||
@ -81,9 +233,11 @@ _tkg_srcprep() {
|
||||
sed -i -e 's/# CONFIG_CMDLINE_BOOL is not set/CONFIG_CMDLINE_BOOL=y/' ./.config
|
||||
echo "CONFIG_CMDLINE=\"${_custom_commandline}\"" >> ./.config
|
||||
echo "# CONFIG_CMDLINE_OVERRIDE is not set" >> ./.config
|
||||
if [ "$_noccache" != "true" ] && pacman -Qq ccache &> /dev/null; then
|
||||
if [ "$_noccache" != "true" ]; 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
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$_font_autoselect" != "false" ]; then
|
||||
sed -i -e 's/CONFIG_FONT_TER16x32=y/# CONFIG_FONT_TER16x32 is not set\nCONFIG_FONT_AUTOSELECT=y/' ./.config
|
||||
@ -557,7 +711,8 @@ _tkg_srcprep() {
|
||||
read -rp "`echo $' > N/y : '`" CONDITION7;
|
||||
fi
|
||||
if [[ "$CONDITION7" =~ [yY] ]] || [ "$_acs_override" == "true" ]; then
|
||||
patch -Np1 -i ../0006-add-acs-overrides_iommu.patch
|
||||
msg2 "Patching ACS override"
|
||||
patch -Np1 -i "$srcdir"/0006-add-acs-overrides_iommu.patch
|
||||
fi
|
||||
|
||||
# bcachefs
|
||||
@ -568,7 +723,8 @@ _tkg_srcprep() {
|
||||
# read -rp "`echo $' > N/y : '`" CONDITION8;
|
||||
#fi
|
||||
#if [[ "$CONDITION8" =~ [yY] ]] || [ "$_bcachefs" == "true" ]; then
|
||||
# patch -Np1 -i ../0008-5.8-bcachefs.patch
|
||||
# msg2 "Patching Bcache filesystem support override"
|
||||
# patch -Np1 -i "$srcdir"/0008-5.8-bcachefs.patch
|
||||
# echo "CONFIG_BCACHEFS_FS=m" >> ./.config
|
||||
# echo "CONFIG_BCACHEFS_QUOTA=y" >> ./.config
|
||||
# echo "CONFIG_BCACHEFS_POSIX_ACL=y" >> ./.config
|
||||
@ -585,7 +741,8 @@ _tkg_srcprep() {
|
||||
read -rp "`echo $' > N/y : '`" CONDITION9;
|
||||
fi
|
||||
if [[ "$CONDITION9" =~ [yY] ]] || [ "$_fsync" == "true" ]; then
|
||||
patch -Np1 -i ../0007-v5.8-fsync.patch
|
||||
msg2 "Patching Fsync support"
|
||||
patch -Np1 -i "$srcdir"/0007-v5.8-fsync.patch
|
||||
fi
|
||||
|
||||
# ZFS fix
|
||||
@ -596,17 +753,18 @@ _tkg_srcprep() {
|
||||
read -rp "`echo $' > N/y : '`" CONDITION11;
|
||||
fi
|
||||
if [[ "$CONDITION11" =~ [yY] ]] || [ "$_zfsfix" == "true" ]; then
|
||||
patch -Np1 -i ../0011-ZFS-fix.patch
|
||||
msg2 "Patching missing symbol for AES-NI/AVX support on ZFS"
|
||||
patch -Np1 -i "$srcdir"/0011-ZFS-fix.patch
|
||||
fi
|
||||
|
||||
# Community patches
|
||||
if [ -n "$_community_patches" ]; then
|
||||
if [ ! -d "$_where/../../community-patches" ]; then
|
||||
cd "$_where/../.." && git clone https://github.com/Frogging-Family/community-patches.git && cd "${srcdir}/linux-${_basekernel}"
|
||||
cd "$_where/../.." && git clone https://github.com/Frogging-Family/community-patches.git && cd "${srcdir}/${_srcpath}"
|
||||
fi
|
||||
_community_patches=($_community_patches)
|
||||
for _p in ${_community_patches[@]}; do
|
||||
ln -s "$_where"/../../community-patches/linux58-tkg/$_p "$_where"/
|
||||
ln -s "$_where"/../../community-patches/linux"$_basever"-tkg/$_p "$_where"/
|
||||
done
|
||||
fi
|
||||
|
||||
@ -622,11 +780,13 @@ _tkg_srcprep() {
|
||||
rm -f "$_where"/$_p
|
||||
done
|
||||
|
||||
if [ "$_distro" == "Arch" ]; then
|
||||
# don't run depmod on 'make install'. We'll do this ourselves in packaging
|
||||
sed -i '2iexit 0' scripts/depmod.sh
|
||||
|
||||
# get kernel version
|
||||
make prepare
|
||||
fi
|
||||
|
||||
# modprobed-db
|
||||
if [ -z "$_modprobeddb" ]; then
|
||||
@ -678,7 +838,7 @@ _tkg_srcprep() {
|
||||
plain "to configure the kernel before building it?"
|
||||
plain "If you do, make sure your terminal is currently"
|
||||
plain "at least 19 lines by 80 columns large or you'll get an error :D"
|
||||
read -rp "`echo $' > 0. nope\n 1. menuconfig\n 2. nconfig\n choice[0-2?]: '`" CONDITIONMNC;
|
||||
read -rp "`echo $' > 0. nope\n 1. menuconfig\n 2. nconfig\n 3. xconfig\n choice[0-3?]: '`" CONDITIONMNC;
|
||||
_menunconfig="$CONDITIONMNC"
|
||||
fi
|
||||
if [ 1 = "$_menunconfig" ]; then
|
||||
@ -687,11 +847,14 @@ _tkg_srcprep() {
|
||||
elif [ 2 = "$_menunconfig" ]; then
|
||||
cp .config .config.orig
|
||||
make nconfig
|
||||
elif [ 3 = "$_menunconfig" ]; then
|
||||
cp .config .config.orig
|
||||
make xconfig
|
||||
else
|
||||
# rewrite configuration
|
||||
yes "" | make config >/dev/null
|
||||
fi
|
||||
if [ 1 = "$_menunconfig" ] || [ 2 = "$_menunconfig" ]; then
|
||||
if [ 1 = "$_menunconfig" ] || [ 2 = "$_menunconfig" ] || [ 3 = "$_menunconfig" ]; then
|
||||
if [ -z "${_diffconfig}" ]; then
|
||||
while true; do
|
||||
read -r -p 'Generate a config fragment from your changes? [y/N] ' CONDITIONF
|
||||
@ -723,6 +886,90 @@ _tkg_srcprep() {
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
if [ "$_distro" == "Arch" ]; then
|
||||
make -s kernelrelease > version
|
||||
msg2 "Prepared %s version %s" "$pkgbase" "$(<version)"
|
||||
fi
|
||||
}
|
||||
|
||||
exit_cleanup() {
|
||||
# Remove state tracker
|
||||
rm -f "$_where"/cpuschedset
|
||||
|
||||
# Remove temporarily copied files
|
||||
rm -rf "$_where"/*.patch
|
||||
rm -rf "$_where"/*-profile.cfg
|
||||
rm -f "$_where"/config*
|
||||
rm -f "$_where"/*.hook
|
||||
rm -f "$_where"/cleanup
|
||||
rm -f "$_where"/prepare
|
||||
|
||||
# Community patches removal in case of failure
|
||||
for _p in ${_community_patches[@]}; do
|
||||
rm -f "$_where"/"$_p"
|
||||
done
|
||||
|
||||
if [ "$_NUKR" = "true" ] && [ "$_where" != "$srcdir" ]; then
|
||||
rm -rf "$_where"/src/*
|
||||
# Double tap
|
||||
rm -rf "$srcdir"/linux-*
|
||||
rm -rf "$srcdir"/*.xz
|
||||
rm -rf "$srcdir"/*.patch
|
||||
rm -rf "$srcdir"/*-profile.cfg
|
||||
rm -f "$srcdir"/config.x86_64
|
||||
rm -f "$srcdir"/customization.cfg
|
||||
else
|
||||
# Meh
|
||||
rm -rf "$srcdir"/linux-${_basekernel}/Documentation/filesystems/aufs/*
|
||||
rm -f "$srcdir"/linux-${_basekernel}/Documentation/ABI/testing/*-aufs
|
||||
rm -rf "$srcdir"/linux-${_basekernel}/fs/aufs/*
|
||||
rm -f "$srcdir"/linux-${_basekernel}/include/uapi/linux/aufs*
|
||||
|
||||
rm -f "$srcdir"/linux-${_basekernel}/mm/prfile.c
|
||||
|
||||
rm -f "$srcdir"/linux-${_basekernel}/block/bfq*
|
||||
|
||||
rm -rf "$srcdir"/linux-${_basekernel}/drivers/scsi/vhba/*
|
||||
|
||||
rm -rf "$srcdir"/linux-${_basekernel}/fs/exfat/*
|
||||
rm -f "$srcdir"/linux-${_basekernel}/include/trace/events/fs.h
|
||||
|
||||
rm -f "$srcdir"/linux-${_basekernel}/Documentation/scheduler/sched-PDS-mq.txt
|
||||
rm -f "$srcdir"/linux-${_basekernel}/include/linux/skip_list.h
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/sched/pds.c
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/sched/pds_sched.h
|
||||
|
||||
rm -f "$srcdir"/linux-${_basekernel}/Documentation/scheduler/sched-BMQ.txt
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/sched/alt_core.c
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/sched/sched/alt_debug.c
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/sched/alt_sched.h
|
||||
|
||||
rm -f "$srcdir"/linux-${_basekernel}/Documentation/scheduler/sched-BFS.txt
|
||||
rm -f "$srcdir"/linux-${_basekernel}/Documentation/scheduler/sched-MuQSS.txt
|
||||
rm -rf "$srcdir"/linux-${_basekernel}/arch/blackfin/*
|
||||
rm -f "$srcdir"/linux-${_basekernel}/arch/powerpc/configs/c2k_defconfig
|
||||
rm -f "$srcdir"/linux-${_basekernel}/arch/score/configs/spct6600_defconfig
|
||||
rm -f "$srcdir"/linux-${_basekernel}/arch/tile/configs/tilegx_defconfig
|
||||
rm -f "$srcdir"/linux-${_basekernel}/arch/tile/configs/tilepro_defconfig
|
||||
rm -f "$srcdir"/linux-${_basekernel}/drivers/staging/lustre/lnet/lnet/lib-eq.c
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/sched/MuQSS*
|
||||
rm -f "$srcdir"/linux-${_basekernel}/kernel/skip_list.c
|
||||
|
||||
rm -f "$srcdir"/linux-${_basekernel}/Documentation/vm/uksm.txt
|
||||
rm -f "$srcdir"/linux-${_basekernel}/include/linux/sradix-tree.h
|
||||
rm -f "$srcdir"/linux-${_basekernel}/include/linux/uksm.h
|
||||
rm -f "$srcdir"/linux-${_basekernel}/lib/sradix-tree.c
|
||||
rm -f "$srcdir"/linux-${_basekernel}/mm/uksm.c
|
||||
fi
|
||||
|
||||
if [ "${_distro}" == "Arch" ]; then
|
||||
remove_deps
|
||||
fi
|
||||
|
||||
msg2 'exit cleanup done\n'
|
||||
if [ -n "$_runtime" ]; then
|
||||
msg2 "compilation time : \n$_runtime"
|
||||
fi
|
||||
}
|
||||
|
||||
trap exit_cleanup EXIT
|
||||
|
Loading…
Reference in New Issue
Block a user