1 source ${LBUILD_DIR}/lbuild-rhel
3 # increment this if you have made a change that should force a new kernel
7 SPEC_NAME="kernel.spec"
8 DEVEL_PATH_ARCH_DELIMETER="."
11 # force local definition of %dist into ~/.rpmmacros
12 # to avoid verbose extended strings like ".el9.centos"
13 # in kernel version and rpm names
16 grep '^%dist' $RMAC &> /dev/null || echo '%dist .el9' >> $RMAC
19 sed -i -e '/Provides: kernel-uname-r =/a\
20 Provides: kernel-lustre = %{KVRA}%{?1:.%{1}}\\' \
21 -e '/Provides: kernel-devel-uname-r =/a\
22 Provides: kernel-devel-lustre = %{KVRA}%{?1:.%{1}}\\' \
23 -e '/^ find $RPM_BUILD_ROOT\/lib\/modules\/$KernelVer/a\
24 cp -a fs/ext4/* $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/fs/ext4\
25 rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/fs/ext4/ext4-inode-test*' \
26 SPECS/$SPEC_NAME 2>&1 ||
27 fatal 1 "Error while editing SPECS/$SPEC_NAME"
33 # the el9 .spec file requires patch names to begin with "patch-3."
34 # so rename the lustre patch from lbuild to one the .spec will like
35 mv $TOPDIR/SOURCES/linux-${lnxmaj}-lustre.patch \
36 $TOPDIR/SOURCES/patch-${lnxmaj}-lustre.patch
38 # edit the SPEC with our changes
39 patch_spec_rhel9 "$buildid"
40 sed -i -e '/^# empty final patch to facilitate testing of kernel patches/i\
41 # adds Lustre patches\
42 Patch99995: patch-%{version}-lustre.patch' \
43 -e '/^ApplyOptionalPatch linux-kernel-test.patch/i\
46 ApplyOptionalPatch patch-%{version}-lustre.patch\
48 -e '/^# Dynamically generate kernel/a echo "CONFIG_BH_LRU_SIZE=16" >> config-generic'\
49 SPECS/$SPEC_NAME 2>&1 ||
50 fatal 1 "Error while editing SPECS/$SPEC_NAME"
53 unpack_linux_devel_rpm-rhel9() {
54 local callers_rpm="$1"
56 unpack_linux_devel_rpm-rhel "$callers_rpm"
60 if $KERNEL_LUSTRE_NAMING; then
61 echo -e "--define \"variant -lustre\" \c"
64 echo "--with firmware --without debug"
67 find_linux_rpm-rhel9() {
69 local wanted_kernel="$2"
70 local pathtorpms=${3:-"$KERNELRPMSBASE/$lnxmaj/$DISTROMAJ/$TARGET_ARCH"}
72 find_linux_rpm-rhel "$prefix" "$wanted_kernel" "$pathtorpms"
75 kernel_srpm_location() {
76 local base_os="http://mirror.stream.centos.org/9-stream/BaseOS"
78 echo "$base_os/source/tree/Packages/"
81 kernel_debuginfo_location() {
82 local base_os="http://mirror.stream.centos.org/9-stream/BaseOS"
84 echo "$base_os/$TARGET_ARCH/debug/tree/Packages/"
87 apply_kmod_requires_conflicts() {
89 # don't allow the patched kernel to be considered as
90 # a valid kernel for the patchless client
91 echo "Conflicts: kernel-lustre" >> rpm/kmp-lustre.preamble