linux57-tkg: Simplify various ubuntu build script interactions

Untested on buntu.

Following https://github.com/Frogging-Family/linux-tkg/pull/26
This commit is contained in:
Tk-Glitch
2020-08-06 21:58:24 +02:00
parent 3c7fd7b2e5
commit a580414742
4 changed files with 137 additions and 206 deletions

View File

@@ -25,69 +25,17 @@ plain ' `.-:///////:-.`'
_where="$PWD" # track basedir as different Arch based distros are moving srcdir around
cp "$_where"/linux57-tkg-patches/* "$_where" # copy patches inside the PKGBUILD's dir to preserve makepkg sourcing and md5sum checking
cp "$_where"/linux57-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
_tkg_initscript
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.MuQSS\n 3.Project C / BMQ\n 4.CFS\nchoice[1-4?]: '`" CONDITION;
if [ "$CONDITION" == "2" ]; then
echo "_cpusched=\"MuQSS\"" > "$_where"/cpuschedset
elif [ "$CONDITION" == "3" ]; then
echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset
elif [ "$CONDITION" == "4" ]; 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" == "muqss" ] || [ "$_cpusched" == "MuQSS" ]; then
echo "_cpusched=\"MuQSS\"" > "$_where"/cpuschedset
elif [ "$_cpusched" == "pds" ]; then
echo "_cpusched=\"pds\"" > "$_where"/cpuschedset
elif [ "$_cpusched" == "bmq" ]; then
echo "_cpusched=\"bmq\"" > "$_where"/cpuschedset
else
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
fi
source "$_where"/cpuschedset
_basever=57
if [ -n "$_custom_pkgbase" ]; then
pkgbase="${_custom_pkgbase}"
else
pkgbase=linux"${_basever}"-tkg-"${_cpusched}"
fi
pkgname=("${pkgbase}" "${pkgbase}-headers")
_basekernel=5.7
_sub=13
pkgver="${_basekernel}"."${_sub}"
pkgrel=25
pkgdesc='Linux-tkg'
@@ -164,7 +112,6 @@ prepare() {
cd "${srcdir}/linux-${_basekernel}"
source "$_where/linux$_basever-tkg-config/prepare"
_tkg_srcprep
}
@@ -325,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