Whamcloud - gitweb
LU-831 header: struct bit field should be unsigned type
[fs/lustre-release.git] / build / lbuild-sles11
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 build built for this distribution (only -- if you want to force a kernel
5 # build on all distributions, update the BUILD_GEN variable in build/lbuild)
6 BUILD_GEN+=".0"
7
8 source ${0%/*}/lbuild-sles
9
10 edit_specs() {
11
12     # edit the SPECs with our changes
13     local spec
14     for spec in $RPMSMPTYPE source; do
15         #cp $TOPDIR/SOURCES/kernel-$spec.spec{,.orig}
16         sed -i -e "s/^\(Release: *\).*$/\1${lnxrel}_${buildid}/" \
17                -e "s/^ExclusiveArch:.*/& ppc ppc64/" \
18                -e '/^%setup /a\
19 cp  %_sourcedir/linux-2.6.27-lustre.patch %_builddir/%{name}-%{version}/lustre.patch\
20 ! grep -q lustre.patch %_sourcedir/series.conf && echo -e "\\n\\tlustre.patch" >> %_sourcedir/series.conf' \
21                -e "/flavor=\${config/a\
22     [ \"\$flavor\" == \"$RPMSMPTYPE\" ] || continue" \
23                -e "s/^\(BuildRequires:  kernel-dummy\)/# \1/" \
24           SOURCES/kernel-${spec}.spec || \
25             fatal 1 "Error while editing SOURCES/kernel-${spec}.spec"
26
27         if $KERNEL_LUSTRE_NAMING; then
28             # these are all of the changes needed because we change the package names
29             # to kernel-lustre-*.  these should all go away when we stop this insanity
30             sed -i -e 's/^\(Name:.*kernel-\)\(.*\)/\1lustre-\2/' \
31                    -e "/^Provides:  *kernel = /a\
32 Provides:       kernel-$spec = %{version}-%{release}
33 " \
34                    -e 's/^\([   ][      ]*-i %_builddir\/kernel-\)\(source-2.6.27.21\/\$patch; then\)/\1lustre-\2/' \
35                    -e '/^%build/,/^%changelog/s/\(kernel-\)\(source\.files\)/\1lustre-\2/g' \
36                    -e '/--no-backup-if-mismatch/,/fi/s/kernel-source-/kernel-lustre-source-/g' \
37                    -e "s/^\(%package -n kernel-\)\(.*\)/\1lustre-\2/" \
38                    -e "s/^\(%description -n kernel-\)\(.*\)/\1lustre-\2/" \
39                    -e "s/^\(%files -n kernel-\)\(.*\)/\1lustre-\2/" \
40                    -e "s/^\(Provides:.*kernel-\)\(.*\)/\1lustre-\2/" \
41                    -e "s/^\(Requires:.*kernel-\)\(.*\)/\1lustre-\2/" \
42                    -e "s/^\(Supplements:.*kernel-\)\(.*\)/\1lustre-\2/" \
43                 SOURCES/kernel-${spec}.spec || \
44                 fatal 1 "Error while editing SOURCES/kernel-${spec}.spec"
45         fi
46
47         # XXX - a building-on-Ubuntu hack
48         if grep -q "Ubuntu" /etc/issue; then
49             sed -i -e '/^%_sourcedir\/install-configs %_sourcedir .*/i\
50 curl ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17/2.6.17-mm1/broken-out/i386-use-c-code-for-current_thread_info.patch | patch -p1' \
51                    -e 's/^\(BuildRequires: .*\)$/#NOU \1/g' \
52                    -e 's/%(\(chmod .*\))$/%(bash -c "\1")/' \
53                    -e 's/ -a 109//' \
54               SOURCES/kernel-${spec}.spec || \
55             fatal 1 "Error while editing SOURCES/kernel-${spec}.spec"
56         fi
57     done
58 }
59
60 unpack_linux_devel_rpm-sles11() {
61     local callers_rpm="$1"
62
63     local rpmdir="${callers_rpm%/*}"
64
65     local kernelrpm
66     local wanted_kernel="${lnxmaj}${lnxmin}-${lnxrel}"
67
68     # this is a hack that should go away when the modified lustre kernel
69     # Provides kernel-default-base                        vvvvvvvvv
70     if ! kernelrpm=$(find_rpm "$rpmdir" provides "^kernel-(lustre-)?default-base = $wanted_kernel"); then
71         fatal 1 "Could not find the kernel-default-base in $rpmdir/"
72     fi
73
74     if ! rpm2cpio < "$rpmdir/$kernelrpm" | cpio -id > /dev/null 2>&1; then
75         fatal 1 "Unpack error for $kernelrpm"
76     fi
77
78     if ! kernelrpm=$(find_rpm "$rpmdir" provides "^kernel-(lustre-)?default-devel = $wanted_kernel"); then
79         fatal 1 "Could not find the kernel-default-devel in $rpmdir/"
80     fi
81
82     if ! rpm2cpio < "$rpmdir/$kernelrpm" | cpio -id > /dev/null 2>&1; then
83         fatal 1 "Unpack error for $kernelrpm"
84     fi
85
86 }
87
88 find_linux_rpm-sles11() {
89     local prefix="$1"
90     local wanted_kernel="$2"
91     local pathtorpms=${3:-"${KERNELRPMSBASE}/${lnxmaj}/${DISTRO}/${TARGET_ARCH}"}
92
93     # what, oh what, do we do for sles11?
94     # if anyone knows how we get an arbitrary (kernel-source and
95     # kernel-default-base in this case) from the Suse update mechanism,
96     # please feel free to fix this
97
98     fatal 1 "I don't know how to get packages for SLES11"
99
100     return 0
101
102 }