Whamcloud - gitweb
LU-6467 test: skip s-l test_9 for interop with b2_5
[fs/lustre-release.git] / contrib / lbuild / lbuild-rhel6
1 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
2
3 # increment this if you have made a change that should force a new kernel
4 # to be built for this release of this distribution (only -- if you want to
5 # force a kernel build on all releases of this distribution, update the BUILD_GEN
6 # variable in build/lbuild-rhel and if you want to force kernel bulid for all
7 # distributions, update the BUILD_GEN variable in build/lbuild)
8 #BUILD_GEN+=".0"
9 #BUILD_GEN+=".1"                # added --with firmware to rpmbuild for rhel6
10 #BUILD_GEN+=".0"        # TT-107: don't cache the BUILD dir (reset major to 5)
11 BUILD_GEN+=".1" # LU-1361: enable kernel ABI
12
13 source ${LBUILD_DIR}/lbuild-rhel
14
15 SPEC_NAME="kernel.spec"
16 DEVEL_PATH_ARCH_DELIMETER="."
17 USE_KABI=true
18
19 patch_spec_6_5() {
20     sed -i -e '/^# empty final patch file to facilitate testing of kernel patches/i\
21 # adds Lustre patches\
22 Patch99995: linux-%{version}-lustre.patch' \
23            -e '/^ApplyOptionalPatch linux-kernel-test.patch/i\
24 \
25 # lustre patch\
26 ApplyOptionalPatch linux-%{version}-lustre.patch\
27 ' \
28            -e '/rm -f include\/generated\/kernel.cross/i\
29   # lustre kernel config.\
30   if [ -f %{_topdir}/lustre/lustre/kernel_patches/kernel_configs/kernel-%{version}-2.6-rhel6-%{_target_cpu}.config ]; then\
31     echo "# $Arch" > configs/kernel-%{version}-%{_target_cpu}.config\
32     cat %{_topdir}/lustre/lustre/kernel_patches/kernel_configs/kernel-%{version}-2.6-rhel6-%{_target_cpu}.config >> configs/kernel-%{version}-%{_target_cpu}.config\
33   fi'\
34            -e '/^# Dynamically generate kernel/a echo "CONFIG_BH_LRU_SIZE=16" >> config-generic'\
35           SPECS/$SPEC_NAME 2>&1 || \
36         fatal 1 "Error while editing SPECS/$SPEC_NAME"
37 }
38
39 patch_spec_6_6() {
40     sed -i -e '/^# empty final patch file to facilitate testing of kernel patches/i\
41 # adds Lustre patches\
42 Patch99995: linux-%{version}-lustre.patch' \
43            -e '/^ApplyOptionalPatch linux-kernel-test.patch/i\
44 \
45 # lustre patch\
46 ApplyOptionalPatch linux-%{version}-lustre.patch\
47 ' \
48            -e '/rm -f include\/generated\/kernel.cross/i\
49   # lustre kernel config.\
50   if [ -f %{_topdir}/lustre/lustre/kernel_patches/kernel_configs/kernel-%{version}-2.6-rhel6.6-%{_target_cpu}.config ]; then\
51     echo "# $Arch" > configs/kernel-%{version}-%{_target_cpu}.config\
52     cat %{_topdir}/lustre/lustre/kernel_patches/kernel_configs/kernel-%{version}-2.6-rhel6.6-%{_target_cpu}.config >> configs/kernel-%{version}-%{_target_cpu}.config\
53   fi'\
54            -e '/^# Dynamically generate kernel/a echo "CONFIG_BH_LRU_SIZE=16" >> config-generic'\
55           SPECS/$SPEC_NAME 2>&1 || \
56         fatal 1 "Error while editing SPECS/$SPEC_NAME"
57 }
58
59 patch_spec() {
60     local buildid="$1"
61
62     # edit the SPEC with our changes
63     patch_spec_common "$buildid"
64     if [ "$TARGET" = "2.6-rhel6.6" ]
65     then
66         patch_spec_6_6
67     else
68         patch_spec_6_5
69     fi
70
71     return 0
72
73 }
74
75 unpack_linux_devel_rpm-rhel6() {
76     local callers_rpm="$1"
77
78     unpack_linux_devel_rpm-rhel "$callers_rpm"
79
80
81     return 0
82
83 }
84
85 get_rpmbuildopts() {
86
87     if $KERNEL_LUSTRE_NAMING; then
88         echo -e "--define \"variant -lustre\" \c"
89     fi
90     echo "--with firmware"
91
92     return 0
93
94 }
95
96 find_linux_rpm-rhel6() {
97     local prefix="$1"
98     local wanted_kernel="$2"
99     local pathtorpms=${3:-"$KERNELRPMSBASE/$lnxmaj/$DISTROMAJ/$TARGET_ARCH"}
100
101     find_linux_rpm-rhel "$prefix" "$wanted_kernel" "$pathtorpms"
102
103 }
104
105 kernel_srpm_location() {
106
107     echo "http://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/"
108
109 }