kernel 6.8

This commit is contained in:
2024-03-11 20:52:03 +01:00
parent 6cc2f73ac6
commit 8fae847587
3 changed files with 99 additions and 60 deletions

View File

@ -1,19 +1,21 @@
#!/bin/bash
UPDATED="2024-03-02"
UPDATED="2024-03-11"
DISABLE=1 # disable some options
ENABLE=1 # enable some options
MITIGATIONS=0 # enable/disable all mitigations
UARCH=1 # apply more uarch patch
FKH=0 # apply fast kernel headers patch
TESTING=0 # add testing options
UNCOMPRESS=1 # perform uncompress if already exist
CLEANUP=1 # perform folder cleanup
CLANG=0 # use Clang compiler (if not, use GCC)
O3=1 # use -O3 vs -O2 (optimisation)
ARCH="x86-64-v4" # target architecture (uarch patch)
CONFIGCLOUD=1 # enable cloud 'from' config
CONFIGOLD=1 # enable old def config
CONFIGMOD=0 # enable all mod config
SCRATCH=0 # perform from scratch (remove preexisting content)
UNCOMPRESS=1 # perform uncompress if already exist
CLEANUP=1 # perform folder cleanup
TESTING=0 # add testing options
#
# Sources:
@ -30,7 +32,7 @@ CONFIGMOD=0 # enable all mod config
# more-uarches-for-kernel.patch:
# https://github.com/graysky2/kernel_compiler_patch
# more-uarches-for-kernel.patch : more-uarches-for-kernel-6.1.79-6.8-rc3.patch
# more-uarches-for-kernel.patch : more-uarches-for-kernel-6.8-rc4+.patch
#
#
@ -138,17 +140,29 @@ doEchoStep() {
echo "### $NOW - $1"
}
# Scratch
doScratch() {
if [ $SCRATCH == 1 ]; then
if [ -d $WORKDIR ]; then
doEchoStep "Scratch: remove existing content"
rm -rf $WORKDIR
else
doEchoStep "Scratch: existing previous content not found"
fi
fi
}
# Download
doDownload() {
if [ -d $WORKDIR ]; then
if [[ -d $WORKDIR && -f $WORKDIR/linux-$VERSION.tar.xz ]]; then
doEchoStep "$BRANCH/$VERSION already present (don't download)"
else
mkdir -p $WORKDIR
cd $WORKDIR
doEchoStep "Download branch '$BRANCH' version '$VERSION'"
wget --inet4-only https://cdn.kernel.org/pub/linux/kernel/v$BRANCH/linux-$VERSION.tar.sign
wget --inet4-only https://cdn.kernel.org/pub/linux/kernel/v$BRANCH/linux-$VERSION.tar.xz
wget --compression=auto --show-progress --no-verbose --inet4-only https://cdn.kernel.org/pub/linux/kernel/v$BRANCH/linux-$VERSION.tar.sign
wget --compression=auto --show-progress --no-verbose --inet4-only https://cdn.kernel.org/pub/linux/kernel/v$BRANCH/linux-$VERSION.tar.xz
doSync
result=$?
@ -367,6 +381,7 @@ doDefaultsDisable() {
if [ -f .config ]; then
cp .config .config.disable.before
fi
./scripts/config --disable CONFIG_WERROR
./scripts/config --disable CONFIG_ACCESSIBILITY
./scripts/config --disable CONFIG_ACORN_PARTITION
./scripts/config --disable CONFIG_ACPI_DEBUG
@ -680,6 +695,8 @@ doDefaultsDisable() {
./scripts/config --disable CONFIG_X86_UMIP
./scripts/config --disable CONFIG_X86_USER_SHADOW_STACK
./scripts/config --disable CONFIG_X86_SGX_KVM
./scripts/config --disable CONFIG_PRINTK
./scripts/config --disable CONFIG_BUG
cp .config .config.disable.after
fi
@ -875,7 +892,6 @@ doDefaultsEnable() {
./scripts/config --enable FAIR_GROUP_SCHED
./scripts/config --enable VIRTIO_MENU
./scripts/config --enable ZRAM_DEF_COMP_ZSTD
./scripts/config --enable CONFIG_WERROR
./scripts/config --enable CONFIG_ATA
./scripts/config --enable CONFIG_ATA_SFF
./scripts/config --enable CONFIG_ATA_BMDMA
@ -1076,6 +1092,7 @@ doDefaultsEnable() {
./scripts/config --enable CONFIG_STRICT_DEVMEM
./scripts/config --enable CONFIG_IO_STRICT_DEVMEM
./scripts/config --enable CONFIG_IPV6
./scripts/config --enable CONFIG_KSM
./scripts/config --enable CONFIG_COMPILE_TEST
case ${ARCH} in
@ -1245,15 +1262,28 @@ doCompile() {
doStripSig
doStripDebug
if [ $O3 == 1 ]; then
GCCO="3"
else
GCCO="2"
fi
doEchoStep "Compilation time... Be patient!"
export MAKEFLAGS="-j$((NPROC + 1)) -l${NPROC} -Werror=maybe-uninitialized -Werror=nonnull -Wno-maybe-uninitialized -Wno-uninitialized -Wno-free-nonheap-object -Wno-nonnull"
export CFLAGS="-march=${ARCH} -O2 -flto -pipe"
export CXXFLAGS="-march=${ARCH} -O2 -flto -pipe"
export KCFLAGS=" -march=${ARCH} -O2"
export KCPPFLAGS=" -march=${ARCH} -O2"
# export MAKEFLAGS="-j$((NPROC + 1)) -l${NPROC} -Werror=maybe-uninitialized -Werror=nonnull -Wno-maybe-uninitialized -Wno-uninitialized -Wno-free-nonheap-object -Wno-nonnull"
export MAKEFLAGS="-j$((NPROC + 1)) -l${NPROC} -Wno-error"
export CFLAGS="-march=${ARCH} -O${GCCO} -flto -pipe -msse -msse2 -msse3 -mmmx"
export CXXFLAGS="${CFLAGS}"
export KCFLAGS="-march=${ARCH} -O${GCCO}"
export KCPPFLAGS="${KCFLAGS}"
set CONFIG_SITE=/etc/dpkg-cross/cross-config.amd64
set DEB_BUILD_OPTIONS=nocheck
doEchoStep "MAKEFLAGS: $MAKEFLAGS"
doEchoStep "CFLAGS: $CFLAGS"
doEchoStep "CXXFLAGS: $CXXFLAGS"
doEchoStep "KCFLAGS: $KCFLAGS"
doEchoStep "KCPPFLAGS: $KCPPFLAGS"
doEchoStep "make bindeb-pkg"
if [ "$CLANG" == "1" ]; then
make \
@ -1289,8 +1319,15 @@ doCompile() {
doKernel() {
WORKDIR=$CURRENT/$BRANCH/$VERSION
doScratch
if [ ! -d $WORKDIR ]; then
mkdir -p $WORKDIR
fi
LOGFILE=$WORKDIR/$LOGNAME.$LOGEXT
rm -rf $LOGFILE
if [ -f $LOGFILE ]; then
rm -rf $LOGFILE
fi
touch $LOGFILE
if [ "$STEPS" != "compile" ]; then