1 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
3 # increment this if you have made a change that should force a new kernel
5 BUILD_GEN+=".1" #LU-3337 add missing build files for sles11sp2 server
7 DEVEL_KERNEL_TYPE="default-devel"
8 RPM_HELPERS_DIR="/usr/lib/rpm"
10 prepare_and_build_srpm() {
12 pushd $TOPDIR >/dev/null
14 # generate our buildid
15 local buildid="lustre${EXTRA_VERSION##*_lustre}"
17 # do release specific spec editing
20 # XXX - need to flesh this out per the rhel5 method
22 for arch in $BUILD_ARCHS; do
23 targets="--target $arch $targets"
24 mkdir -p config/$(basearch $arch)
25 cp $CONFIG_FILE config/$(basearch $arch)/$RPMSMPTYPE
28 tar cjf SOURCES/config.tar.bz2 config
31 # do we need any special rpm build options
32 local rpmbuildopt="-bb"
37 # XXX - ignore the kabi changes. need to figure out what this is really
39 touch SOURCES/IGNORE-KABI-BADNESS
42 # XXX testing speedup hack - never let an inspection pass without this
43 # commented out! in fact it should be removed completely before a
47 if ! rpmbuild $rpmbuildopt $targets \
48 --define "_topdir $TOPDIR" \
49 $TOPDIR/SOURCES/kernel-$RPMSMPTYPE.spec 2>&1; then
50 fatal 1 "Failed to build kernel RPM"
54 # for SLES, we also need to build the kernel-source rpm
55 if ! rpmbuild $rpmbuildopt $targets \
56 --define "_topdir $TOPDIR" \
57 $TOPDIR/SOURCES/kernel-source.spec 2>&1; then
58 fatal 1 "Failed to build kernel source RPM"
64 local lustre=${1:-false}
67 echo "kernel-lustre-$DEVEL_KERNEL_TYPE"
69 echo "kernel-$DEVEL_KERNEL_TYPE"
74 rpm_BUILD_kernel_dirname() {
81 if $KERNEL_LUSTRE_NAMING; then
84 echo kernel${lustre}-${rpmsmptype}-${lnxmaj}${lnxmin}/linux-${lnxmaj}
89 # because we build an i686 kernel, we need to know if the arch we are
90 # resolving for is for the patched or patchless kernel (which is i586)
91 # we really should be building an i586 kernel to match what Novell does
92 local for_patchless=${2:-true}
93 local canonical=${3:-false}
98 i?86) if $canonical; then
100 elif $(eval $for_patchless); then
110 find_linux_devel_paths() {
113 LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}
114 LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH $PATCHLESS)/$RPMSMPTYPE
119 mcpu_rpmbuild_opt() {
121 echo "--define \'jobs $(/usr/bin/getconf _NPROCESSORS_ONLN)\'"
125 # This function digs out the linux release from a linux-obj tree
126 find_linux_release() {
127 _find_linux_release $LINUXOBJ