1 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
3 source ${LBUILD_DIR}/lbuild-rhel
5 # increment this if you have made a change that should force a new kernel
9 SPEC_NAME="kernel.spec"
10 DEVEL_PATH_ARCH_DELIMETER="."
13 # force local definition of %dist into ~/.rpmmacros
14 # to avoid verbose extended strings like ".el7.centos"
15 # in kernel version and rpm names
18 grep '%dist' $RMAC &> /dev/null || echo '%dist .el7' >> $RMAC
23 # the el7 .spec file requires patch names to begin with "patch-3."
24 # so rename the lustre patch from lbuild to one the .spec will like
25 mv $TOPDIR/SOURCES/linux-${lnxmaj}-lustre.patch \
26 $TOPDIR/SOURCES/patch-${lnxmaj}-lustre.patch
28 # edit the SPEC with our changes
29 patch_spec_common "$buildid"
30 sed -i -e '/^# empty final patch to facilitate testing of kernel patches/i\
31 # adds Lustre patches\
32 Patch99995: patch-%{version}-lustre.patch' \
33 -e '/^ApplyOptionalPatch linux-kernel-test.patch/i\
36 ApplyOptionalPatch patch-%{version}-lustre.patch\
38 -e '/rm -f include\/generated\/kernel.cross/i\
39 # lustre kernel config.\
40 if [ -f %{_topdir}/lustre/lustre/kernel_patches/kernel_configs/kernel-%{version}-3.10-rhel7-%{_target_cpu}.config ]; then\
41 echo "# $Arch" > configs/kernel-%{version}-%{_target_cpu}.config\
42 cat %{_topdir}/lustre/lustre/kernel_patches/kernel_configs/kernel-%{version}-3.10-rhel7-%{_target_cpu}.config >> configs/kernel-%{version}-%{_target_cpu}.config\
44 -e '/^# Dynamically generate kernel/a echo "CONFIG_BH_LRU_SIZE=16" >> config-generic'\
45 -e '/^%define listnewconfig_fail 1/s/1/0/'\
46 SPECS/$SPEC_NAME 2>&1 || \
47 fatal 1 "Error while editing SPECS/$SPEC_NAME"
54 unpack_linux_devel_rpm-rhel7() {
55 local callers_rpm="$1"
57 unpack_linux_devel_rpm-rhel "$callers_rpm"
66 if $KERNEL_LUSTRE_NAMING; then
67 echo -e "--define \"variant -lustre\" \c"
69 echo "--with firmware"
75 find_linux_rpm-rhel7() {
77 local wanted_kernel="$2"
78 local pathtorpms=${3:-"$KERNELRPMSBASE/$lnxmaj/$DISTROMAJ/$TARGET_ARCH"}
80 find_linux_rpm-rhel "$prefix" "$wanted_kernel" "$pathtorpms"
84 kernel_srpm_location() {
86 echo "http://vault.centos.org/centos/7/updates/Source/SPackages/"