1 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
3 DEVEL_KERNEL_TYPE="source"
5 prepare_and_build_srpm() {
7 pushd $TOPDIR >/dev/null
8 # all of the specs but one are put into SOURCES, so let's just move
9 # the one lone one in SPECS into SOURCES and just reference them from
11 mv SPECS/*.spec SOURCES/
13 # generate our buildid
14 local buildid="lustre${EXTRA_VERSION##*_lustre}"
16 # do release specific spec editing
19 # XXX - need to flesh this out per the rhel5 method
21 for arch in $BUILD_ARCHS; do
22 targets="--target $arch $targets"
23 mkdir -p config/$(basearch $arch)
24 cp $CONFIG_FILE config/$(basearch $arch)/$RPMSMPTYPE
27 tar cjf SOURCES/config.tar.bz2 config
30 # do we need any special rpm build options
31 local rpmbuildopt="-bb"
36 # XXX - ignore the kabi changes. need to figure out what this is really
38 touch SOURCES/IGNORE-KABI-BADNESS
41 # XXX testing speedup hack - never let an inspection pass without this
42 # commented out! in fact it should be removed completely before a
46 if ! $RPMBUILD $rpmbuildopt $targets \
47 --define "_topdir $TOPDIR" \
48 $TOPDIR/SOURCES/kernel-$RPMSMPTYPE.spec 2>&1; then
49 fatal 1 "Failed to build kernel RPM"
53 # for SLES, we also need to build the kernel-source rpm
54 if ! $RPMBUILD $rpmbuildopt $targets \
55 --define "_topdir $TOPDIR" \
56 $TOPDIR/SOURCES/kernel-source.spec 2>&1; then
57 fatal 1 "Failed to build kernel source RPM"
63 local lustre=${1:-false}
66 echo "kernel-lustre-$DEVEL_KERNEL_TYPE"
68 echo "kernel-$DEVEL_KERNEL_TYPE"
73 rpm_BUILD_kernel_dirname() {
80 if $KERNEL_LUSTRE_NAMING; then
83 echo kernel${lustre}-${rpmsmptype}-${lnxmaj}${lnxmin}/linux-${lnxmaj}
86 find_linux_devel_paths() {
89 LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}${delimiter}${lnxrel##${lnxmin#.}-}
91 local objects=$TARGET_ARCH/$RPMSMPTYPE
92 if [ -d $path/usr/src/linux-${lnxmaj}${lnxmin}${delimiter}${lnxrel##${lnxmin#.}-}-obj/powerpc ]; then
93 objects="powerpc/$TARGET_ARCH"
94 elif [ $TARGET_ARCH == 'i686' ]; then
95 objects="i386/$RPMSMPTYPE"
98 LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}${delimiter}${lnxrel##${lnxmin#.}-}-obj/$objects
100 LINUXRELEASE=$(find_linux_release ${LINUXOBJ:-$LINUX})
101 if [ -z "$LINUXRELEASE" ]; then
102 echo "Failed to find linux release in ${LINUXOBJ:-$LINUX}"
107 mcpu_rpmbuild_opt() {
109 echo "--define \'jobs $(/usr/bin/getconf _NPROCESSORS_ONLN)\'"