Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/config-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: config changes checker
on:
schedule:
- cron: '47 0 * * 6' # "At 12:47 AM, only on Saturday"
workflow_dispatch:

env:
_distro: Ubuntu
_logging_use_script: "no"
_git_mirror: "gregkh"

jobs:

check-patches:
runs-on: ubuntu-latest

steps:
- name: Checkout linux-tkg
uses: actions/checkout@v4

- name: Install dependencies
id: unclean-print
run: ./install.sh install-deps

- name: List failed config changes for all kernel versions
run: ./linux-tkg-config/config-checker > $GITHUB_STEP_SUMMARY
5 changes: 1 addition & 4 deletions customization.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ _smt_nice=""
# Default is 2000000
_bore_min_base_slice_ns="2000000"

# 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" - More options available in kernel config prompt when left empty depending on selected cpusched with the default option pointed with a ">" (100 for muqss and 1000 for other cpu schedulers)
_timer_freq=""

Expand All @@ -218,7 +215,7 @@ _default_cpu_gov="ondemand"
# It still requires you to either set ondemand as default governor or to select it in some way at runtime.
_aggressive_ondemand="true"

# [Advanced] Default TCP IPv4 algorithm to use. Options are: "yeah", "bbr", "cubic", "reno", "vegas" and "westwood". Leave empty if unsure.
# [Advanced] Default TCP IPv4 algorithm to use. Options are: "yeah", "bbr", "cubic", "vegas" and "westwood". Leave empty if unsure.
# This config option will not be prompted
# Can be changed at runtime with the command line `# echo "$name" > /proc/sys/net/ipv4/tcp_congestion_control` where $name is one of the options above.
# Default (empty) and fallback : cubic
Expand Down
30 changes: 16 additions & 14 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

# Stop the script at any ecountered error
# Stop the script at any encountered error
set -e

###################### Definition of helper variables and functions

_where=`pwd`
_where=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
srcdir="$_where"

# Command used for superuser privileges (`sudo`, `doas`, `su`)
Expand Down Expand Up @@ -41,17 +41,17 @@ plain() {
# we don't export the environment in the script sub-command so sourcing current_env will
# get us the actual environment
if [[ -z "$SCRIPT" ]]; then
declare -p -x > current_env
declare -p -x > "$_where"/current_env
fi

source customization.cfg
source "$_where"/customization.cfg

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

. current_env
. "$_where"/current_env

if [[ "$_logging_use_script" =~ ^(Y|y|Yes|yes)$ && -z "$SCRIPT" ]]; then
# using script is enabled, but we are not within the script sub-command
Expand All @@ -61,7 +61,7 @@ if [[ "$_logging_use_script" =~ ^(Y|y|Yes|yes)$ && -z "$SCRIPT" ]]; then
exit
fi

source linux-tkg-config/prepare
source "$_where"/linux-tkg-config/prepare

####################################################################

Expand All @@ -82,13 +82,16 @@ _install_dependencies() {
elif [ "$_distro" = "Suse" ]; then
msg2 "Installing dependencies"
sudo zypper install -y hostname bc bison ccache dwarves elfutils flex gcc-c++ git libXi-devel libelf-devel libqt5-qtbase-common-devel libqt5-qtbase-devel lz4 make ncurses-devel openssl-devel patch pesign rpm-build rpmdevtools schedtool python3 rsync zstd libdw-devel llvm clang lld
else
msg2 "Installing dependencies on this distro is unsupported, assume them installed and continue"
fi
}

if [ "$1" != "install" ] && [ "$1" != "config" ] && [ "$1" != "uninstall-help" ]; then
if [[ ! "$1" =~ ^(install|install-deps|config|uninstall-help)$ ]]; then
msg2 "Argument not recognised, options are:
- config : interactive script that shallow clones the linux kernel git tree into the folder \$_kernel_work_folder, then applies extra patches and prepares the .config file
by copying the one from the currently running linux system and updates it.
- install-deps: install dependencies only
- install : does the config step, proceeds to compile, then prompts to install
- 'DEB' distros: it creates .deb packages that will be installed then stored in the DEBS folder.
- 'RPM' distros: it creates .rpm packages that will be installed then stored in the RPMS folder.
Expand All @@ -97,13 +100,18 @@ if [ "$1" != "install" ] && [ "$1" != "config" ] && [ "$1" != "uninstall-help" ]
exit 0
fi

if [ "$1" = "install" ] || [ "$1" = "config" ]; then
if [[ "$1" =~ ^(install|install-deps)$ ]]; then

if [[ -z "$_distro" || ! "$_distro" =~ ^(Ubuntu|Debian|Fedora|Suse|Gentoo|Generic)$ ]]; then
msg2 "Variable \"_distro\" in \"customization.cfg\" has been set to an unkown value. Prompting..."
_distro_prompt
fi

_install_dependencies
fi

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

Expand All @@ -112,12 +120,6 @@ if [ "$1" = "install" ] || [ "$1" = "config" ]; then
export HOSTLDFLAGS="-unwindlib=libunwind"
fi

# Install the needed dependencies if the user wants to install the kernel
# Not needed if the user asks for install.sh config
if [ "$1" == "install" ]; then
_install_dependencies
fi

_tkg_srcprep

_build_dir="$_kernel_work_folder_abs/.."
Expand Down
57 changes: 57 additions & 0 deletions linux-tkg-config/config-checker
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env bash

# Goes through every kernel version and selects defaults
# then prints which CONFIG options were not honored even though the 'prepare' script tried to set them

set -e

_conf_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

cd "$_conf_dir"

typeset -Ag _failed_configs

_md_output=""

_kernel_versions=$(echo 5.? 5.?? 6.? 6.??)

_install_script=$(realpath "$_conf_dir"/../install.sh)
for _kver in $_kernel_versions ; do
echo "Checking kernel $_kver" >&2
yes "" | _logging_use_script="no" _version="${_kver}-latest" _distro=Generic "$_install_script" config 1>&2
if [[ -f "$_conf_dir"/../logs/tkg-failed-config-diffs.md.txt ]]; then
while read -r _config; do
_no_prefix_config="${_config#'CONFIG_'}"
_failed_configs[$_no_prefix_config]+=" $_kver"
done < "$_conf_dir"/../logs/tkg-failed-configs.txt
_md_output+="\n\n## Kernel $_kver\n\n"
_md_output+="$(cat "$_conf_dir"/../logs/tkg-failed-config-diffs.md.txt)"
fi
done

_summary_table="| |"
_under_header="| --- |"
for _kver in $_kernel_versions ; do
_summary_table+=" $_kver |"
_under_header+=" --- |"
done

_summary_table+="\n$_under_header\n"

for _config in "${!_failed_configs[@]}"; do
_summary_table+="| $_config |"
for _kver in $_kernel_versions ; do
if [[ ${_failed_configs[$_config]} =~ "$_kver" ]]; then
_summary_table+="❌ |"
else
_summary_table+="✅ |"
fi
done
_summary_table+="\n"
done

echo "## Summary"
echo
echo -e "$_summary_table"
echo
echo -e "$_md_output"
Loading