Whamcloud - gitweb
LU-9083: Add scripts to collect and analyze Lustre RPC traces
[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() {
20     local buildid="$1"
21
22     # edit the SPEC with our changes
23     patch_spec_common "$buildid"
24     sed -i -e '/^# empty final patch file to facilitate testing of kernel patches/i\
25 # adds Lustre patches\
26 Patch99995: linux-%{version}-lustre.patch' \
27            -e '/^ApplyOptionalPatch linux-kernel-test.patch/i\
28 \
29 # lustre patch\
30 ApplyOptionalPatch linux-%{version}-lustre.patch\
31 ' \
32            -e "/rm -f include\/generated\/kernel.cross/i\\
33   # lustre kernel config.\\
34   if [ -f %{_topdir}/lustre/lustre/kernel_patches/kernel_configs/kernel-%{version}-$TARGET-%{_target_cpu}.config ]; then\\
35     echo \"# \$Arch\" > configs/kernel-%{version}-%{_target_cpu}.config\\
36     cat %{_topdir}/lustre/lustre/kernel_patches/kernel_configs/kernel-%{version}-$TARGET-%{_target_cpu}.config >> configs/kernel-%{version}-%{_target_cpu}.config\\
37   fi"\
38           SPECS/$SPEC_NAME 2>&1 || \
39         fatal 1 "Error while editing SPECS/$SPEC_NAME"
40
41     return 0
42
43 }
44
45 unpack_linux_devel_rpm-rhel6() {
46     local callers_rpm="$1"
47
48     unpack_linux_devel_rpm-rhel "$callers_rpm"
49
50
51     return 0
52
53 }
54
55 get_rpmbuildopts() {
56
57     if $KERNEL_LUSTRE_NAMING; then
58         echo -e "--define \"variant -lustre\" \c"
59     fi
60     echo "--with firmware"
61
62     return 0
63
64 }
65
66 find_linux_rpm-rhel6() {
67     local prefix="$1"
68     local wanted_kernel="$2"
69     local pathtorpms=${3:-"$KERNELRPMSBASE/$lnxmaj/$DISTROMAJ/$TARGET_ARCH"}
70
71     find_linux_rpm-rhel "$prefix" "$wanted_kernel" "$pathtorpms"
72
73 }
74
75 kernel_srpm_location() {
76
77     echo "http://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/"
78
79 }