# increment this if you have made a change that should force a new kernel
# to build built
-BUILD_GEN+=".1" #LU-3337 add missing build files for sles11sp2 server
+BUILD_GEN+=".2" #LU-3337 add missing build files for sles11sp2 server
DEVEL_KERNEL_TYPE="default-devel"
RPM_HELPERS_DIR="/usr/lib/rpm"
+RMAC=$HOME/.rpmmacros
+SUSE_MACROS=/etc/rpm/macros.kernel-source
prepare_and_build_srpm() {
# generate our buildid
local buildid="lustre${EXTRA_VERSION##*_lustre}"
- # do release specific spec editing
- edit_specs
-
- # XXX - need to flesh this out per the rhel5 method
- local targets
- for arch in $BUILD_ARCHS; do
- targets="--target $arch $targets"
- mkdir -p config/$(basearch $arch)
- cp $CONFIG_FILE config/$(basearch $arch)/$RPMSMPTYPE
- done
-
- tar cjf SOURCES/config.tar.bz2 config
- rm -rf config
+ # do release specific spec editing
+ edit_specs
+ mkdir -p config/$(basearch $TARGET_ARCH)
+ cp $CONFIG_FILE config/$(basearch $TARGET_ARCH)/$RPMSMPTYPE
+ tar cjf SOURCES/config.tar.bz2 config
+ rm -rf config
# do we need any special rpm build options
local rpmbuildopt="-bb"
# all about.
touch SOURCES/IGNORE-KABI-BADNESS
-
-# XXX testing speedup hack - never let an inspection pass without this
-# commented out! in fact it should be removed completely before a
-# landing.
-#if false; then
- # now build it
- if ! $RPMBUILD $rpmbuildopt $targets \
- --define "_topdir $TOPDIR" \
- $TOPDIR/SOURCES/kernel-$RPMSMPTYPE.spec 2>&1; then
- fatal 1 "Failed to build kernel RPM"
- fi
-#fi
+ # now build it
+ if ! rpmbuild $rpmbuildopt --target ${TARGET_ARCH} \
+ --define "_topdir $TOPDIR" \
+ $TOPDIR/SOURCES/kernel-$RPMSMPTYPE.spec 2>&1; then
+ fatal 1 "Failed to build kernel RPM"
+ fi
# for SLES, we also need to build the kernel-source rpm
- if ! $RPMBUILD $rpmbuildopt $targets \
+ if ! rpmbuild $rpmbuildopt $targets \
--define "_topdir $TOPDIR" \
$TOPDIR/SOURCES/kernel-source.spec 2>&1; then
fatal 1 "Failed to build kernel source RPM"
fi
+ # for SLES, we also need to build the kernel-syms rpm
+ if ! rpmbuild $rpmbuildopt $targets \
+ --define "_topdir $TOPDIR" \
+ $TOPDIR/SOURCES/kernel-syms.spec 2>&1; then
+ fatal 1 "Failed to build kernel syms RPM"
+ fi
+
}
devel_kernel_name() {
}
find_linux_devel_paths() {
- local path="$1"
-
- LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}
- LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH $PATCHLESS)/$RPMSMPTYPE
-
- return 0
+ local path="$1"
+ local linuxobjpath=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH $PATCHLESS)/$RPMSMPTYPE
+
+ LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}
+ LINUXOBJ=$path/usr/src/linux-obj/$(resolve_arch $TARGET_ARCH $PATCHLESS)/$RPMSMPTYPE
+
+ # symlink the linux-obj to linux-version-obj
+ ln -s $linuxobjpath $LINUXOBJ
+ # We need to copy the headers from the source to the object tree for
+ # MOFED to be able to compile (a bug in ofed?)
+ if [ -e ${LINUX}/include ] && [ -e ${LINUXOBJ}/include ]; then
+ cp -rf ${LINUX}/include ${LINUXOBJ}
+ fi
+ # We modify %kernel_module_package macro to use the linux obj
+ # that lbuild install, not the OS installed /usr/src
+ sed -i -e "/^%kernel_module_package/,/^)}$/d" \
+ -e "/^# A few cross-distro definitions/d" $RMAC
+ sed -e "s/\/usr\/src/${path//\//\\/}\/usr\/src/" \
+ -e "s/\/boot/${path//\//\\/}\/boot/" ${SUSE_MACROS} >> $RMAC
+
+ return 0
}
mcpu_rpmbuild_opt() {
_find_linux_release $LINUXOBJ
}
-kernel_srpm_location() {
- local PLEV=$(sed -n -e 's/^PATCHLEVEL = //p' /etc/SuSE-release)
- local site="https://nu.novell.com/repo/\$RCE/SLES11-SP${PLEV}-Updates/sle-11-$(resolve_arch $TARGET_ARCH)/rpm/src/"
-
- echo $site
+# cleanup the modified/added rpmmacros
+cleanup_rpmmacros() {
+ sed -i -e "/^%kernel_module_package/,/^)}$/d" \
+ -e "/^# A few cross-distro definitions/d" $RMAC
}