Whamcloud - gitweb
LU-5564 mdt: skip permission check for close
[fs/lustre-release.git] / contrib / lbuild / lbuild-rhel7
1 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
2
3 source ${LBUILD_DIR}/lbuild-rhel
4
5 # increment this if you have made a change that should force a new kernel
6 # to build built
7 BUILD_GEN+=".0"
8
9 SPEC_NAME="kernel.spec"
10 DEVEL_PATH_ARCH_DELIMETER="."
11 USE_KABI=true
12
13 # force local definition of %dist into ~/.rpmmacros
14 # to avoid verbose extended strings like ".el7.centos"
15 # in kernel version and rpm names
16 #
17 RMAC=$HOME/.rpmmacros
18 grep '%dist' $RMAC &> /dev/null || echo '%dist .el7' >> $RMAC
19
20 patch_spec() {
21     local buildid="$1"
22
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
27
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\
34 \
35 # lustre patch\
36 ApplyOptionalPatch patch-%{version}-lustre.patch\
37 ' \
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\
43   fi'\
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"
48
49
50     return 0
51
52 }
53
54 unpack_linux_devel_rpm-rhel7() {
55     local callers_rpm="$1"
56
57     unpack_linux_devel_rpm-rhel "$callers_rpm"
58
59
60     return 0
61
62 }
63
64 get_rpmbuildopts() {
65
66     if $KERNEL_LUSTRE_NAMING; then
67         echo -e "--define \"variant -lustre\" \c"
68     fi
69     echo "--with firmware"
70
71     return 0
72
73 }
74
75 find_linux_rpm-rhel7() {
76     local prefix="$1"
77     local wanted_kernel="$2"
78     local pathtorpms=${3:-"$KERNELRPMSBASE/$lnxmaj/$DISTROMAJ/$TARGET_ARCH"}
79
80     find_linux_rpm-rhel "$prefix" "$wanted_kernel" "$pathtorpms"
81
82 }
83
84 kernel_srpm_location() {
85
86     echo "http://vault.centos.org/centos/7/updates/Source/SPackages/"
87
88 }