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+=".0" # TT-107: don't cache the BUILD dir (reset major to 5)
7 DEVEL_KERNEL_TYPE="source"
8 RPM_HELPERS_DIR="/usr/lib/rpm"
10 prepare_and_build_srpm() {
12 pushd $TOPDIR >/dev/null
13 # all of the specs but one are put into SOURCES, so let's just move
14 # the one lone one in SPECS into SOURCES and just reference them from
16 mv SPECS/*.spec SOURCES/
18 # generate our buildid
19 local buildid="lustre${EXTRA_VERSION##*_lustre}"
21 # do release specific spec editing
24 # XXX - need to flesh this out per the rhel5 method
26 for arch in $BUILD_ARCHS; do
27 targets="--target $arch $targets"
28 mkdir -p config/$(basearch $arch)
29 cp $CONFIG_FILE config/$(basearch $arch)/$RPMSMPTYPE
32 tar cjf SOURCES/config.tar.bz2 config
35 # do we need any special rpm build options
36 local rpmbuildopt="-bb"
41 # XXX - ignore the kabi changes. need to figure out what this is really
43 touch SOURCES/IGNORE-KABI-BADNESS
46 # XXX testing speedup hack - never let an inspection pass without this
47 # commented out! in fact it should be removed completely before a
51 if ! $RPMBUILD $rpmbuildopt $targets \
52 --define "_topdir $TOPDIR" \
53 $TOPDIR/SOURCES/kernel-$RPMSMPTYPE.spec 2>&1; then
54 fatal 1 "Failed to build kernel RPM"
58 # for SLES, we also need to build the kernel-source rpm
59 if ! $RPMBUILD $rpmbuildopt $targets \
60 --define "_topdir $TOPDIR" \
61 $TOPDIR/SOURCES/kernel-source.spec 2>&1; then
62 fatal 1 "Failed to build kernel source RPM"
68 local lustre=${1:-false}
71 echo "kernel-lustre-$DEVEL_KERNEL_TYPE"
73 echo "kernel-$DEVEL_KERNEL_TYPE"
78 rpm_BUILD_kernel_dirname() {
85 if $KERNEL_LUSTRE_NAMING; then
88 echo kernel${lustre}-${rpmsmptype}-${lnxmaj}${lnxmin}/linux-${lnxmaj}
93 # because we build an i686 kernel, we need to know if the arch we are
94 # resolving for is for the patched or patchless kernel (which is i586)
95 # we really should be building an i586 kernel to match what Novell does
96 local for_patchless=${2:-true}
97 local canonical=${3:-false}
102 i?86) if $canonical; then
104 elif $(eval $for_patchless); then
114 find_linux_devel_paths() {
117 LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}
118 LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH $PATCHLESS)/$RPMSMPTYPE
119 # XXX this has been commented out in th rhel5 build file for a while
120 # as it says there, it's probably not needed anymore and can be deleted
121 #LINUXRELEASE=$(find_linux_release "$LINUXOBJ")
122 #if [ -z "$LINUXRELEASE" ]; then
123 # echo "Failed to find linux release in $LINUXOBJ"
130 mcpu_rpmbuild_opt() {
132 echo "--define \'jobs $(/usr/bin/getconf _NPROCESSORS_ONLN)\'"