Files

27 lines
1006 B
Bash
Raw Permalink Normal View History

2023-06-20 10:56:40 +05:30
#!/usr/bin/bash
set -e
KERNEL_VERSION=6.8.10-300.fc40
2024-04-06 20:45:11 -07:00
cd "$sourcedir"
koji download-build --quiet --arch=src "kernel-$KERNEL_VERSION"
2023-11-21 14:02:11 -08:00
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"
2023-06-22 15:27:40 +05:30
# Fedora devs are against merging kernel-local for all architectures when keys are not properly specified, so we have to patch it in.
2023-11-21 14:02:11 -08:00
sed -i "s@for i in %{all_arch_configs}@for i in *.config@g" "kernel.spec"
2023-06-22 15:27:40 +05:30
# Set buildid to .t2
2023-11-21 14:02:11 -08:00
sed -i 's/# define buildid .local/%define buildid .t2/g' "kernel.spec"
2023-06-22 15:27:40 +05:30
# Disable debug kernels
2023-11-21 14:02:11 -08:00
sed -i "/%define with_debug /c %define with_debug 0" "kernel.spec"
2023-06-22 15:27:40 +05:30
2023-11-21 14:02:11 -08:00
# Add our patches
sed -i "/Patch1:/a Patch2: t2linux-combined.patch" "kernel.spec"
2023-12-01 23:53:58 -08:00
sed -i "/ApplyOptionalPatch patch-%{patchversion}-redhat.patch/a ApplyOptionalPatch t2linux-combined.patch" "kernel.spec"
2023-06-22 15:27:40 +05:30
2023-11-21 14:02:11 -08:00
cat "linux-t2-patches/extra_config" > "kernel-local"
cat "linux-t2-patches"/*.patch > "t2linux-combined.patch"