#
%define kversion @KERNEL_VERSION@
%define kextraver @KERNEL_EXTRA_VERSION@
+%define kextraverdelim @KERNEL_EXTRA_VERSION_DELIMITER@
%define release @KERNEL_RELEASE@
# /usr/src/%{kslnk} -> /usr/src/linux-%{KVERREL}
%define kslnk linux-2.4
%define kernel_glob vmlinu?-%{KVERREL}
%endif
-Name: kernel
+Name: kernel-lustre
Version: %{kversion}
Release: %{release}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg}
-%define KVERREL %{PACKAGE_VERSION}-%{kextraver}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg}
+%define KVERREL %{PACKAGE_VERSION}%{kextraverdelim}%{kextraver}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg}
License: GPL
Group: System Environment/Kernel
ExclusiveArch: %{all_x86} x86_64 ia64 ppc
Vendor: Cluster File Systems, Inc.
URL: http://www.kernel.org/
-Buildroot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root
+Buildroot: %{_tmppath}/%{name}-%{version}-root
Source0: @LUSTRE_SOURCE@
Source1: @KERNEL_SOURCE@
to configure, mount, and administer a Lustre filesystem. This package
is necessary if you want to access a Lustre filesystem.
-# the lustre-doc files are just included as %doc wiht
+# the lustre-doc files are just included as %doc with
# lustre-lite-utils
#%package -n lustre-doc
#The Lustre book, sample configurations, and other documentation for
#Lustre.
-%package -n lustre-ldap
-Summary: LDAP schema files for Lustre
-Group: System Environment/Daemons
-
-%description -n lustre-ldap
-LDAP schema files for Lustre. These are needed if you plan to store
-your Lustre configuration in LDAP, rather than on disk.
+# This is required in rpm >= 4.4.? and _should_ be set by the %setup macro
+# but isn't, at least for 4.4.2. Yay RPM.
+%define buildsubdir lustre-kernel-%{version}
+%define _buildsubdir lustre-kernel-%{version}
%prep
%setup -n lustre-kernel-%{version} -q -c
echo "fi" >> ${script}
;;
post)
+ # /sbin/update-modules.dep compares when the modules were built, rather
+ # than installed, so force modules.dep to be recreated
+ echo "rm -f /lib/modules/%{KVERREL}${flavor}/modules.dep" >> ${script}
echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}
sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE26} >> ${script}
[ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
[ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
if [ -x /sbin/new-kernel-pkg ] ; then
- /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}${flavor}
+ if /sbin/new-kernel-pkg 2>&1 | grep package >/dev/null ; then
+ PACKAGE_ARG="--package kernel-${flavor}"
+ fi
+ /sbin/new-kernel-pkg $PACKAGE_ARG --mkinitrd --depmod \
+ --install %{KVERREL}${flavor}
fi
EOF
;;
--kerneldir $RPM_SOURCE_DIR \
-j $RPM_BUILD_NCPUS \
--destdir $RPM_BUILD_ROOT \
- -- --enable-modules \
- --disable-doc --disable-tests \
- --disable-utils --disable-liblustre \
- --sysconfdir=%{_sysconfdir} \
- --mandir=%{_mandir} \
+ -- --enable-tests \
@CONFIGURE_FLAGS@
}
%endif
%if %{buildbase}
-BuildLustre
+# BuildLustre
%endif
popd >/dev/null
# specific
for i in $RPM_BUILD_ROOT/lib/modules/* ; do
rm -f $i/modules.*
- rm -f $i/build
- ln -sf ../../../usr/src/linux-%{KVERREL} $i/build
%ifarch %{ntplarchs}
# remove legacy pcmcia symlink that's no longer useful
rm -rf $i/pcmcia
flavext="-$flavor"
flavtgt="$flavor"
fi
- perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}${flavtgt}/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
+ perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{kextraverdelim}%{kextraver}${flavtgt}/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
c="$RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}"
o="${c}-obj/%{_target_cpu}/$flavor"
mkdir -p $o
- cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}${flavext}.config \
- $o/.config
+ # use the one we just built
+ #cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}${flavext}.config \
+ cp .config $o/.config
for oc in oldconfig_nonint silentoldconfig oldconfig ; do
if grep -q "$oc" Makefile ; then
OLDCONFIG="$oc"
$MAKE clean
rm -rf $o/.config.old $o/include/config
# Replace the Makefile in the object directory with a version
- # that has relative path names.
+ # that has relative path names. This is done by fixing the Makefile
+ # after the fact to work with 2.6.17 and newer mkmakefile.
read VERSION PATCHLEVEL SUBLEVEL <<-EOF
$(set -- 2.6.5 ; echo ${*//./ })
EOF
+ rm -f $o/Makefile
source scripts/mkmakefile \
../../../linux-%{KVERREL} \
- ../linux-%{KVERREL}-obj/%{_target_cpu}/$flavor \
+ $o \
$VERSION \
$PATCHLEVEL \
- > $o/Makefile
- zcat "$RPM_BUILD_ROOT/boot/symvers-%{KVERREL}-%{_target_cpu}${flavor}.gz" \
+ > $o/Makefile.in
+ if [ -f $o/Makefile ] ; then
+ # will exist only for 2.6.17 and newer because mkmakefile
+ # now writes the makefile to $o instead of stdout
+ mv -f $o/Makefile $o/Makefile.in
+ fi
+ sed -e "s^$o^../linux-%{KVERREL}-obj/%{_target_cpu}/$flavor^" \
+ $o/Makefile.in > $o/Makefile
+ zcat "$RPM_BUILD_ROOT/boot/symvers-%{KVERREL}-%{_target_cpu}${flavtgt}.gz" \
> $o/Module.symvers
}
if [ "%{buildup}" -ne 0 ] ; then
BuildObj up
fi
- perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
+ perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{kextraverdelim}%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
# Remove $RPM_BUILD_ROOT prefix from symlinks.
for link in $(find $objdir -type l); do
target=$(readlink $link)
ln -s ${target/$RPM_BUILD_ROOT/} $link
done
else # 2.4 rh-style
- perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
- cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
+ perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{kextraverdelim}%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
+ # get the one from the build we just completed as it might have picked
+ # up new options
+ #cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
+ cp .config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
for oc in oldconfig_nonint silentoldconfig oldconfig ; do
if grep -q "$oc" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile ; then
OLDCONFIG="$oc"
%endif
%post -n lustre-lite-utils
-if [ ! -e /dev/obd ]; then
- mknod /dev/obd c 10 241
-fi
-if [ ! -e /dev/portals ]; then
- mknod /dev/portals c 10 240
-fi
if [ -f /etc/init.d/lustre ] ; then
/sbin/chkconfig --add lustre
/sbin/chkconfig --add lustrefs
%endif
%if %{buildbase}
-
%files source -f kernel-source.files
-
-%files doc
-%defattr(-,root,root)
-%doc lustre/linux/Documentation/*
-
-%files -n lustre-lite-utils
-%defattr(-, root, root)
-%doc lustre/COPYING lustre/lustre/BUGS lustre/ChangeLog lustre/README
-/sbin/*
-/usr/sbin/*
-/usr/bin/*
-/usr/lib/lustre/python
-@ENABLE_INIT_SCRIPTS@/etc/init.d/lustre
-@ENABLE_INIT_SCRIPTS@/etc/init.d/lustrefs
-/usr/include/lustre/*
-/usr/include/linux/*
-/usr/lib/lib*.a
-/usr/share/man/man?/*
-
-#%files -n lustre-doc
-#%defattr(-, root, root)
-#/usr/share/doc/lustre/COPYING
-#/usr/share/doc/lustre/lustre.pdf
-#/usr/share/doc/lustre/COPYING
-
-/usr/share/lustre/examples
-
-%files -n lustre-ldap
-%defattr(-, root, root)
-/etc/openldap/slapd-lustre.conf
-/etc/openldap/schema/lustre.schema
-/usr/share/lustre/lustre2ldif.xsl
-/usr/share/lustre/top.ldif
-
-%endif # %{buildbase}
+%endif