Several improvements (#907)

* Make _llvm_ias="1" the default in customization.cfg

* Remove all git related files after copying source files

* Update PREEMPT_RT's supported kernel subversion and patch revision for 6.8

* Make _libunwind_replace a variable in customization.cfg

* Revise the description of native_intel

* Add ECHO CPU scheduler in customization.cfg
This commit is contained in:
Blackteahamburger 2024-04-08 13:12:35 +08:00 committed by GitHub
parent c81eeaec81
commit 2e887a2d8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 31 additions and 28 deletions

View File

@ -114,6 +114,7 @@ sudo grub-mkconfig -o /boot/grub/grub.cfg
- If you only want the script to patch the sources in `linux-src-git`, you can use `./install.sh config`
- `${kernel_flavor}` is a default naming scheme but can be customized with the variable `_kernel_localversion` in `customization.cfg`.
- `_dracut_options` is a variable that can be changed in `customization.cfg`.
- `_libunwind_replace` is a variable that can be changed in `customization.cfg` for replacing `libunwind` with `llvm-libunwind`.
- The script uses Arch's `.config` file as a base. A custom one can be provided through `_configfile` in `customization.cfg`.
- The installed files will not be tracked by your package manager and uninstalling requires manual intervention. `./install.sh uninstall-help` can help with useful information if your install procedure follows the `Generic` approach.
@ -125,8 +126,4 @@ cd linux-tkg
# Optional: edit the "customization.cfg" file
./install.sh install
```
**Notes:**
- If you're running openrc, you'll want to set `_configfile="running-kernel"` to use your current kernel's defconfig instead of Arch's. Else the resulting kernel won't boot.
- The script will prompt for using `llvm-libunwind`, it can only work with the `llvm-libunwind` `USE` flag in `sys-devel/clang` but it is experimental:
- Manual intervention is needed on the `net-fs/samba` EBUILD, see [here](https://bugs.gentoo.org/791349)
- The `-unwind` `USE` flag is needed in `app-emulation/wine*` EBUILDs
**Note:** If you're running openrc, you'll want to set `_configfile="running-kernel"` to use your current kernel's defconfig instead of Arch's. Else the resulting kernel won't boot.

View File

@ -74,7 +74,7 @@ _diffconfig=""
# Set to the file name where the generated config fragment should be written to. Only used if _diffconfig is active.
_diffconfig_name=""
# [install.sh: Generic and Gentoo specific] Dracut options when generating initramfs
# [Generic and Gentoo specific] Dracut options when generating initramfs
_dracut_options="--lz4"
#### KERNEL OPTIONS ####
@ -102,7 +102,7 @@ _STRIP="true"
# LEAVE AN EMPTY VALUE TO BE PROMPTED ABOUT FOLLOWING OPTIONS AT BUILD TIME
# CPU scheduler - Options are "pds", "bmq", "cacule", "tt", "bore", "bore-eevdf", "cfs" (linux 6.5-) or "eevdf" (kernel's default, 6.6+)
# CPU scheduler - Options are "pds", "bmq", "cacule", "tt", "bore", "bore-eevdf", "echo", "cfs" (linux 6.5-) or "eevdf" (kernel's default, 6.6+)
# "upds" (TkG's Undead PDS) and "muqss" are also available on legacy kernel revisions
_cpusched=""
@ -110,9 +110,15 @@ _cpusched=""
# For advanced users.
_compiler=""
# Force the use of the LLVM Integrated Assembler whether using LLVM, LTO or not.
# Set to "1" to enable.
_llvm_ias=""
# [Generic and Gentoo specific] Replace `libunwind` with `llvm-libunwind`.
# ! This is currently experimental.
# ! It can only work with the `llvm-libunwind` `USE` flag in `sys-devel/clang-common` for Gentoo.
# Set to "true" to enable.
_libunwind_replace=""
# Use the LLVM Integrated Assembler for a complete LLVM toolchain built kernel. Default is "1" when using LLVM.
# Set to "0" to disable if desired, otherwise stick to the default behavior.
_llvm_ias="1"
# Clang LTO mode, only available with the "llvm" compiler - options are "no", "full" or "thin".
# ! This is currently experimental and might result in an unbootable kernel - Not recommended !
@ -196,7 +202,7 @@ _compileroptlevel="1"
# Intel CPUs : "mpsc"(P4 & older Netburst based Xeon) "atom" "core2" "nehalem" "westmere" "silvermont" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylakex" "cannonlake" "icelake" "goldmont" "goldmontplus" "cascadelake" "cooperlake" "tigerlake" "sapphirerapids" "rocketlake" "alderlake" "raptorlake" "meteorlake" (raptorlake and meteorlake opt support require GCC13)
# Other options :
# - "native_amd" (use compiler autodetection - Selecting your arch manually in the list above is recommended instead of this option)
# - "native_intel" (use compiler autodetection and will prompt for P6_NOPS - Selecting your arch manually in the list above is recommended instead of this option)
# - "native_intel" (use compiler autodetection - Selecting your arch manually in the list above is recommended instead of this option)
# - "generic" (kernel's default - to share the package between machines with different CPU µarch as long as they are x86-64)
#
# https://en.wikipedia.org/wiki/X86-64#Microarchitecture_Levels)
@ -221,7 +227,7 @@ _smt_nice=""
# Trust the CPU manufacturer to initialize Linux's CRNG (RANDOM_TRUST_CPU) - Kernel default is "false"
_random_trust_cpu="true"
# Timer frequency - "100" "250" "300" "500" "750" "1000" ("2000" is available for cacule cpusched only) - More options available in kernel config prompt when left empty depending on selected cpusched with the default option pointed with a ">" (2000 for cacule, 100 for muqss and 1000 for other cpu schedulers)
# Timer frequency - "100" "250" "300" "500" "750" "1000" ("2000" is available for cacule cpusched only, "625" is available for echo cpusched only) - More options available in kernel config prompt when left empty depending on selected cpusched with the default option pointed with a ">" (2000 for cacule, 100 for muqss, 625 for echo and 1000 for other cpu schedulers)
_timer_freq=""
# Default CPU governor - "performance", "ondemand", "schedutil" or leave empty for default (schedutil)

View File

@ -112,9 +112,7 @@ if [ "$1" = "install" ] || [ "$1" = "config" ]; then
# Run init script that is also run in PKGBUILD, it will define some env vars that we will use
_tkg_initscript
if [[ "${_compiler}" = "llvm" && "${_distro}" =~ ^(Generic|Gentoo)$ ]]; then
read -p "Replace \"libunwind\" with \"llvm-libunwind\" ? Y/[n]:" _libunwind_replace
if [[ "${_libunwind_replace}" =~ ^(y|yes|Yes|Y)$ ]]; then
if [[ "${_compiler}" = "llvm" && "${_distro}" =~ ^(Generic|Gentoo)$ && "${_libunwind_replace}" = "true" ]]; then
export LDFLAGS_MODULE="-unwindlib=libunwind"
export HOSTLDFLAGS="-unwindlib=libunwind"
fi
@ -399,7 +397,7 @@ if [ "$1" = "install" ]; then
sudo rm -rf "/usr/src/$_headers_folder_name"
fi
sudo cp -R . "/usr/src/$_headers_folder_name"
sudo rm -rf "/usr/src/$_headers_folder_name/.git"
sudo rm -rf "/usr/src/$_headers_folder_name"/.git*
cd "/usr/src/$_headers_folder_name"
msg2 "Installing modules"

View File

@ -43,44 +43,46 @@ done
# PREEMPT_RT's supported kernel subversion
typeset -Ag _rt_subver_map
_rt_subver_map=(
["5.4"]="264"
["5.4"]="271"
["5.9"]="1"
["5.10"]="210"
["5.10"]="213"
["5.11"]="4"
["5.14"]="2"
["5.15"]="148"
["5.15"]="153"
["5.16"]="2"
["5.17"]="1"
["6.0"]="5"
["6.1"]="80"
["6.1"]="83"
["6.3"]="3"
["6.4"]="6"
["6.5"]="2"
["6.6"]="20"
["6.6"]="23"
["6.7"]="0"
["6.8"]="rc7"
["6.8"]="2"
["6.9"]="rc2"
)
# PREEMPT_RT's patch revision for the kernel
# We separated this to allow for forcing the application of the patch when _preempt_rt_force=1 on version mismatch
typeset -Ag _rt_rev_map
_rt_rev_map=(
["5.4"]="88"
["5.4"]="89"
["5.9"]="20"
["5.10"]="102"
["5.10"]="105"
["5.11"]="11"
["5.14"]="21"
["5.15"]="74"
["5.15"]="75"
["5.16"]="19"
["5.17"]="17"
["6.0"]="14"
["6.1"]="26"
["6.1"]="28"
["6.3"]="15"
["6.4"]="8"
["6.5"]="8"
["6.6"]="25"
["6.6"]="28"
["6.7"]="6"
["6.8"]="6"
["6.8"]="11"
["6.9"]="1"
)
_undefine() {