Files
fedora/kernel/kernel.sh
2024-05-20 23:55:45 -07:00

27 lines
1006 B
Bash
Executable File

#!/usr/bin/bash
set -e
KERNEL_VERSION=6.8.10-300.fc40
cd "$sourcedir"
koji download-build --quiet --arch=src "kernel-$KERNEL_VERSION"
rpmdev-extract -q "kernel-$KERNEL_VERSION.src.rpm"
mv -n "kernel-$KERNEL_VERSION.src"/* .
rm -r "kernel-$KERNEL_VERSION.src.rpm" "kernel-$KERNEL_VERSION.src"
# Fedora devs are against merging kernel-local for all architectures when keys are not properly specified, so we have to patch it in.
sed -i "s@for i in %{all_arch_configs}@for i in *.config@g" "kernel.spec"
# Set buildid to .t2
sed -i 's/# define buildid .local/%define buildid .t2/g' "kernel.spec"
# Disable debug kernels
sed -i "/%define with_debug /c %define with_debug 0" "kernel.spec"
# Add our patches
sed -i "/Patch1:/a Patch2: t2linux-combined.patch" "kernel.spec"
sed -i "/ApplyOptionalPatch patch-%{patchversion}-redhat.patch/a ApplyOptionalPatch t2linux-combined.patch" "kernel.spec"
cat "linux-t2-patches/extra_config" > "kernel-local"
cat "linux-t2-patches"/*.patch > "t2linux-combined.patch"