From 177de76b16ed421bba9222f1f548967ded2c9d4c Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 11 Mar 2024 17:09:33 +0100 Subject: [PATCH 1/5] Update buildtool.sh --- buildtool.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/buildtool.sh b/buildtool.sh index 0952ac9..d4a8956 100755 --- a/buildtool.sh +++ b/buildtool.sh @@ -75,8 +75,12 @@ special "|__/ |_|" empty # Print environment configuration -diagh "\$BUILDTOOL_DEBUG is set, debug mode is enabled" -diagh "\$BUILDTOOL_LOCALDIR is set, will build kernel package from current working directory" +if [ -n "${BUILDTOOL_DEBUG}" ]; then + warnh "\$BUILDTOOL_DEBUG is set, debug mode is enabled" +fi +if [ -n "${BUILDTOOL_LOCALDIR}" ]; then + warnh "\$BUILDTOOL_LOCALDIR is set, will build kernel package from current working directory" +fi # Checks ## Check for Arch Linux From 46d93e4bbac3b0afeab37b95dd00dc92825fec03 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 11 Mar 2024 17:24:09 +0100 Subject: [PATCH 2/5] Update versioning stuff --- PKGBUILD | 33 +++++++++++++++++---------------- PKGBUILD.buildtool | 33 +++++++++++++++++---------------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 7e9260f..f58eb15 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -91,13 +91,14 @@ ### BUILD OPTIONS END -_major=6.7 -_minor=9 -_srcname=linux-${_major} -_clr=${_major}.8-1413 +_kerneloptimized_version=ko1 +_kernel_major=6.7 +_kernel_minor=9 _gcc_more_v='20240221.2' +_srcname_linux=linux-${_kernel_major} +_srcname_clpatches=${_kernel_major}.8-1413 pkgbase=linux-jstm-optimized -pkgver=${_major}.${_minor} +pkgver=linux${_kernel_major}.${_kernel_minor}-clear${_srcname_clpatches}-${_kerneloptimized_version} pkgrel=1 pkgdesc="Optimized Linux kernel. Includes Clear Linux's kernel config and some tweaks made by JeremyStarTM." arch=('x86_64') @@ -109,10 +110,10 @@ if [ -n "$_use_llvm_lto" ]; then fi options=('!strip') source=( - "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${_major}.tar.xz" - "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${_major}.tar.sign" + "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${_kernel_major}.tar.xz" + "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${_kernel_major}.tar.sign" "https://cdn.kernel.org/pub/linux/kernel/v6.x/patch-${pkgver}.xz" - "cl-linux::git+https://github.com/clearlinux-pkgs/linux.git#tag=${_clr}" + "cl-linux::git+https://github.com/clearlinux-pkgs/linux.git#tag=${_srcname_clpatches}" "more-uarches-$_gcc_more_v.tar.gz::https://github.com/graysky2/kernel_compiler_patch/archive/$_gcc_more_v.tar.gz" ) @@ -129,8 +130,8 @@ export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EP prepare() { echo ":: prepare: prepare() called" - echo ":: prepare: cding into \"${_srcname}\"" - cd "${_srcname}" || exit 1 + echo ":: prepare: cding into \"${_srcname_linux}\"" + cd "${_srcname_linux}" || exit 1 ### Add upstream patches echo ":: prepare: adding upstream patches" @@ -238,8 +239,8 @@ prepare() { build() { echo ":: build: build() called" - echo ":: build: cding into \"${_srcname}\"" - cd "${_srcname}" || exit 1 + echo ":: build: cding into \"${_srcname_linux}\"" + cd "${_srcname_linux}" || exit 1 echo ":: build: starting compilation (make ${BUILD_FLAGS[*]} all)" make ${BUILD_FLAGS[*]} all echo ":: build: build() finished" @@ -256,8 +257,8 @@ _package() { provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE KSMBD-MODULE) install=linux.install - echo ":: _package: cding into \"${_srcname}\"" - cd "$_srcname" || exit 1 + echo ":: _package: cding into \"${_srcname_linux}\"" + cd "$_srcname_linux" || exit 1 local modulesdir="$pkgdir/usr/lib/modules/$( Date: Mon, 11 Mar 2024 17:26:02 +0100 Subject: [PATCH 3/5] Why makepkg why --- PKGBUILD | 2 +- PKGBUILD.buildtool | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index f58eb15..ba9c90d 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -98,7 +98,7 @@ _gcc_more_v='20240221.2' _srcname_linux=linux-${_kernel_major} _srcname_clpatches=${_kernel_major}.8-1413 pkgbase=linux-jstm-optimized -pkgver=linux${_kernel_major}.${_kernel_minor}-clear${_srcname_clpatches}-${_kerneloptimized_version} +pkgver=linux${_kernel_major}.${_kernel_minor}+clear${_srcname_clpatches}+${_kerneloptimized_version} pkgrel=1 pkgdesc="Optimized Linux kernel. Includes Clear Linux's kernel config and some tweaks made by JeremyStarTM." arch=('x86_64') diff --git a/PKGBUILD.buildtool b/PKGBUILD.buildtool index 19a5d58..d7490ff 100644 --- a/PKGBUILD.buildtool +++ b/PKGBUILD.buildtool @@ -14,7 +14,7 @@ _gcc_more_v='20240221.2' _srcname_linux=linux-${_kernel_major} _srcname_clpatches=${_kernel_major}.8-1413 pkgbase=linux-jstm-optimized -pkgver=linux${_kernel_major}.${_kernel_minor}-clear${_srcname_clpatches}-${_kerneloptimized_version} +pkgver=linux${_kernel_major}.${_kernel_minor}+clear${_srcname_clpatches}+${_kerneloptimized_version} pkgrel=1 pkgdesc="Optimized Linux kernel. Includes Clear Linux's kernel config and some tweaks made by JeremyStarTM." arch=('x86_64') From 690fd8f9812d3ec1eff95ed9ae5b06d699d16330 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 11 Mar 2024 17:28:52 +0100 Subject: [PATCH 4/5] Fix makepkg versioning error --- PKGBUILD | 2 +- PKGBUILD.buildtool | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index ba9c90d..238fd75 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -98,7 +98,7 @@ _gcc_more_v='20240221.2' _srcname_linux=linux-${_kernel_major} _srcname_clpatches=${_kernel_major}.8-1413 pkgbase=linux-jstm-optimized -pkgver=linux${_kernel_major}.${_kernel_minor}+clear${_srcname_clpatches}+${_kerneloptimized_version} +pkgver=linux${_kernel_major}.${_kernel_minor}+clear${_srcname_clpatches//-/_}+${_kerneloptimized_version} pkgrel=1 pkgdesc="Optimized Linux kernel. Includes Clear Linux's kernel config and some tweaks made by JeremyStarTM." arch=('x86_64') diff --git a/PKGBUILD.buildtool b/PKGBUILD.buildtool index d7490ff..10492ce 100644 --- a/PKGBUILD.buildtool +++ b/PKGBUILD.buildtool @@ -14,7 +14,7 @@ _gcc_more_v='20240221.2' _srcname_linux=linux-${_kernel_major} _srcname_clpatches=${_kernel_major}.8-1413 pkgbase=linux-jstm-optimized -pkgver=linux${_kernel_major}.${_kernel_minor}+clear${_srcname_clpatches}+${_kerneloptimized_version} +pkgver=linux${_kernel_major}.${_kernel_minor}+clear${_srcname_clpatches//-/_}+${_kerneloptimized_version} pkgrel=1 pkgdesc="Optimized Linux kernel. Includes Clear Linux's kernel config and some tweaks made by JeremyStarTM." arch=('x86_64') From 0b157c90b51f94cb17e234fb100acbaec3e090d5 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 11 Mar 2024 17:31:01 +0100 Subject: [PATCH 5/5] Fix makepkg versioning error (last try pls) --- PKGBUILD | 6 +++--- PKGBUILD.buildtool | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 238fd75..f3afc0b 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -112,7 +112,7 @@ options=('!strip') source=( "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${_kernel_major}.tar.xz" "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${_kernel_major}.tar.sign" - "https://cdn.kernel.org/pub/linux/kernel/v6.x/patch-${pkgver}.xz" + "https://cdn.kernel.org/pub/linux/kernel/v6.x/patch-${_kernel_major}.${_kernel_minor}.xz" "cl-linux::git+https://github.com/clearlinux-pkgs/linux.git#tag=${_srcname_clpatches}" "more-uarches-$_gcc_more_v.tar.gz::https://github.com/graysky2/kernel_compiler_patch/archive/$_gcc_more_v.tar.gz" ) @@ -135,7 +135,7 @@ prepare() { ### Add upstream patches echo ":: prepare: adding upstream patches" - patch -Np1 -i ../patch-${pkgver} || true + patch -Np1 -i ../patch-${_kernel_major}.${_kernel_minor} || true ### Setting version echo ":: prepare: updating version" @@ -232,7 +232,7 @@ prepare() { ### Save configuration for later reuse [[ -z "$_copyfinalconfig" ]] || ( echo ":: prepare: copying configuration file into kernel-optimized repository" - cp -Tf ./.config "${startdir}/finalconfig-${pkgver}-${pkgrel}${pkgbase#linux}" + cp -Tf ./.config "${startdir}/kconfig-final" ) echo ":: prepare: prepare() finished" } diff --git a/PKGBUILD.buildtool b/PKGBUILD.buildtool index 10492ce..5e619cf 100644 --- a/PKGBUILD.buildtool +++ b/PKGBUILD.buildtool @@ -28,7 +28,7 @@ options=('!strip') source=( "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${_kernel_major}.tar.xz" "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${_kernel_major}.tar.sign" - "https://cdn.kernel.org/pub/linux/kernel/v6.x/patch-${pkgver}.xz" + "https://cdn.kernel.org/pub/linux/kernel/v6.x/patch-${_kernel_major}.${_kernel_minor}.xz" "cl-linux::git+https://github.com/clearlinux-pkgs/linux.git#tag=${_srcname_clpatches}" "more-uarches-$_gcc_more_v.tar.gz::https://github.com/graysky2/kernel_compiler_patch/archive/$_gcc_more_v.tar.gz" ) @@ -51,7 +51,7 @@ prepare() { ### Add upstream patches echo ":: prepare: adding upstream patches" - patch -Np1 -i ../patch-${pkgver} || true + patch -Np1 -i ../patch-${_kernel_major}.${_kernel_minor} || true ### Setting version echo ":: prepare: updating version" @@ -148,7 +148,7 @@ prepare() { ### Save configuration for later reuse [[ -z "$_copyfinalconfig" ]] || ( echo ":: prepare: copying configuration file into kernel-optimized repository" - cp -Tf ./.config "${startdir}/finalconfig-${pkgver}-${pkgrel}${pkgbase#linux}" + cp -Tf ./.config "${startdir}/kconfig-final" ) echo ":: prepare: prepare() finished" }