Juan,
when making a preempt kernel for mandrakeclub I think I noticed some errors in 
the kernel spec and tried to correct them:
- fixed a nesting case in the spec which would not work on 8.2 boxes
- fixed a gcc 2.96 (also on 8.2 boxes) compile error in an atm driver
- fixed a place were a mv errored out because it couldn't overwrite 
directories (this always happened to me, do not know why it seems to work for 
others, perhaps because of my config options ). Changed it in to a cp -R and 
rm -rf
- fixed a link that seems to point to the wrong place
- 2 mandrake readme's were put in  %{target_source} but %doc only finds them 
when they are actually in %{_builddir}/%src_dir. As Buchan pointed out, 
errors of the doc macro are not fatal and you have to be watching to notice 
that something goes wrong.

If you feel any of these changes (see diff) are completely wrong, please let 
me know so I can make changes to the club rpms.

Also I included 3 patches from Andrey Borsenkov. One which fixes a spinlock 
which you forgot to unlock in supermount, a supermount NLS patch and the 
other fixes a scsi timeout issue.
Sadly the supermount spinlock patch only helps people on smp in theory, 
although for some reason I cannot reproduce the losing of files on mounted 
media with these patches applied, but I can without (maybe just good luck).

I attach a diff of my kernel spec against 2.4.19-17 my spec here. All preempt 
changes are preceeded by ###, so they disabled by default and you can quickly 
remove them after doing the diff. But I left them in because maybe you want 
to include them at one time? As far as testing goes: I had 27 downloads for 
9.0 and 29 downloads for 8.2 and nobody reported any problems. The downside 
is current included XFS is bugged (doesn't unlock spinlocks) and I had to 
disable it. But I hear cvs XFS is better.


Danny

--- kernel-2.4.spec.orig	Tue Oct 29 20:10:10 2002
+++ kernel-2.4.spec	Tue Oct 29 20:10:45 2002
@@ -57,12 +57,14 @@
 %ifarch %{ix86}
 %define build_secure 1
 %define build_BOOT 1
+###%define build_preempt 1
 %endif
 
 
 # End of user definitions
 %{?_without_up: %{expand: %%define build_up 0}}
 %{?_without_smp: %{expand: %%define build_smp 0}}
+###%{?_without_preempt: %{expand: %%define build_preempt 0}}
 %{?_without_secure: %{expand: %%define build_secure 0}}
 %{?_without_enterprise: %{expand: %%define build_enterprise 0}}
 %{?_without_BOOT: %{expand: %%define build_BOOT 0}}
@@ -78,6 +80,7 @@
 
 %{?_with_up: %{expand: %%define build_up 1}}
 %{?_with_smp: %{expand: %%define build_smp 1}}
+###%{?_with_preempt: %{expand: %%define build_preempt 1}}
 %{?_with_secure: %{expand: %%define build_secure 1}}
 %{?_with_enterprise: %{expand: %%define build_enterprise 1}}
 %{?_with_BOOT: %{expand: %%define build_BOOT 1}}
@@ -220,6 +223,12 @@
 Patch1: patch-%{pre_version}.bz2
 %endif
 
+###Patch101: preempt-kernel-rml-2.4.19-2.patch.bz2
+Patch102: 2.4.18-18mdk.scsi-error-timeout.patch.bz2
+Patch103: 2.4.18-18.supermount-NLS.patch.bz2
+Patch105: supermount-spinlock.patch.bz2
+###Patch106: supermount-preempt.patch.bz2
+###Patch107: preempt-config.patch.bz2
 #END
 ####################################################################
 
@@ -243,12 +252,21 @@
 Obsoletes: alsa, hackkernel
 Provides: alsa, hackkernel
 BuildRequires: libbinutils2-devel, bison, perl
+
+#Fix nesting (doesn't work on 8.2):
+%if !%build_82 && %{build_doc}
+BuildRequires: docbook-utils-pdf
+%endif
+
 %if %{build_doc}
 # welcome to make htmldocs psdocs pdfdocs
 BuildRequires: ghostscript sgml-tools jadetex
-%if !%build_82
-BuildRequires: docbook-utils-pdf
-%endif
+
+# nesting wouldn't work on 8.2:
+#%if !%{build_82}
+#BuildRequires: docbook-utils-pdf
+#%endif
+
 # yes, we need both
 BuildRequires: docbook-dtd41-sgml docbook-dtd41-sgml
 BuildRequires: tetex-dvips tetex-latex transfig 
@@ -312,6 +330,24 @@
 and other appropriate items.
 
 #
+### # kernel-preempt:  a preemptible kernel
+### #
+
+###%package -n kernel-preempt-%{mdkversion}
+###Summary: A preemptible Linux kernel, which reduces the latency of the kernel. 
+###Group: System/Kernel and hardware
+###Provides: %kprovides
+###Prereq: %prereq
+###Requires: %requires
+###Url:  http://www.tech9.net/rml/linux/
+
+###%description -n kernel-preempt-%{mdkversion}
+###This kernbel allows processes to be preempted even if in kernel mode. The design used
+###is to allow a task to be preempted anywhere within the kernel, using spinlocks
+###as markers for non-preemptibility regions. The resulting system response is
+###greatly increased, with measured average latencies under 1ms.
+
+#
 # kernel-boot: BOOT Kernel
 #
 
@@ -417,6 +453,23 @@
 ./%{patches_ver}/scripts/apply_patches -v ./%{patches_ver}/patches
 
 
+###Danny: I do my work separatly
+###%patch101 -p1 -b .preempt
+###%patch107 -p1 -b .preemptconfig
+
+%patch102 -p1 -b .scsitimeout
+%patch103 -p2 -b .supermountandrey
+%patch105 -p1 -b .spinlock
+
+###%patch106 -p1 -b .supermountpreempt
+
+#gcc 2.96 workaround (yes I know it is ugly):
+%if %{build_gcc296}
+ln -sf $RPM_BUILD_DIR/%src_dir/drivers/atm/atmsar11.start $RPM_BUILD_DIR/%src_dir/drivers/atm/atmsar11.\ start
+ln -sf $RPM_BUILD_DIR/%src_dir/drivers/atm/atmsar11.regions $RPM_BUILD_DIR/%src_dir/drivers/atm/atmsar11.\ regions
+ln -sf $RPM_BUILD_DIR/%src_dir/drivers/atm/atmsar11.data $RPM_BUILD_DIR/%src_dir/drivers/atm/atmsar11.\ data
+%endif
+
 # PATCH END
 #
 # Setup Begin
@@ -575,7 +628,10 @@
 	install -d $HeadersArch
 	install -m 644 include/linux/autoconf.h $HeadersArch/autoconf.h
 	install -m 644 include/linux/version.h $HeadersArch/version.h
-	mv include/linux/modules $HeadersArch
+	#changed mv in to rm and cp -R :
+	
+	cp -R include/linux/modules $HeadersArch
+	rm -rf include/linux/modules
     	echo "%{_target_cpu} $flavour %{_savedheaders}%{_target_cpu}/$flavour/" >> $HeadersRoot/list
 %endif
 }
@@ -609,6 +665,10 @@
 CreateKernel BOOT
 %endif
 
+###%if %build_preempt
+###CreateKernel preempt
+###%endif
+
 %if %build_smp
 CreateKernel smp
 %endif
@@ -621,6 +681,10 @@
 CreateKernel enterprise
 %endif
 
+###%if %build_preempt
+###CreateKernel preempt
+###%endif
+
 %if %build_up
 CreateKernel up
 %endif
@@ -668,15 +732,16 @@
 %endif
 for i in %{target_modules}/*; do
   rm -f $i/build $i/modules.*
-  ln -sf %{_kerneldir} $i/build
+  ln -sf %{target_source} $i/build
 done
 
 %if %build_source
 tar cf - . | tar xf - -C %{target_source}
 ln -sf linux-%{KVERREL} %{buildroot}/usr/src/linux
-install -m 644 %{SOURCE4}  %{target_source}
-install -m 644 %{SOURCE5}  %{target_source}
 
+#put this in buildtree, otherwise doc macro fails
+install -m 644 %{SOURCE4}  %{_builddir}/%src_dir
+install -m 644 %{SOURCE5}  %{_builddir}/%src_dir
 # We need this to prevent someone doing a make *config without mrproper
 touch %{target_source}/.need_mrproper
 
@@ -851,6 +916,21 @@
 [[ -n $REMOVE ]] && /sbin/installkernel -a -R -c %{KVERREL}smp
 
 exit 0
+###%preun -n kernel-preempt-%{mdkversion}
+###/sbin/modprobe loop 2> /dev/null > /dev/null
+
+###REMOVE=
+###if [ -f /etc/sysconfig/system ];then
+###	        source /etc/sysconfig/system
+###                [[ "$CLASS" = "beginner" ]] && REMOVE=yes
+###fi
+###if [ -f /etc/sysconfig/installkernel ];then
+###                source /etc/sysconfig/installkernel
+###                [[ "$AUTOREMOVE" = [Yy][Ee][Ss] ]] && REMOVE=yes
+###                [[ "$AUTOREMOVE" = [Nn][Oo] ]] && REMOVE=
+###fi
+###[[ -n $REMOVE ]] && /sbin/installkernel -a -R -c %{KVERREL}preempt
+###exit 0
 
 %preun -n kernel-enterprise-%{mdkversion}
 /sbin/modprobe loop 2> /dev/null > /dev/null
@@ -960,6 +1040,18 @@
 		rm -f initrd-%{KVERREL}secure.img
 fi
 
+###%post -n kernel-preempt-%{mdkversion}
+###cd %{_bootdir}
+###if [ -x /sbin/installkernel ];then
+###              /sbin/installkernel -a -c %{KVERREL}preempt
+###	      fi
+###	      
+###%postun -n kernel-preempt-%{mdkversion}
+###cd %{_bootdir}
+###if [ -f initrd-%{KVERREL}preempt.img ];then
+###                 rm -f initrd-%{KVERREL}preempt.img
+###fi
+###		
 %post -n kernel-source
 cd /usr/src
 rm -f linux
@@ -1005,6 +1097,20 @@
 %doc README.kernel-sources
 %doc README.Mandrake
 %endif
+
+###%if %build_preempt
+###%files -n kernel-preempt-%{mdkversion}
+###%defattr(-,root,root)
+###%{_bootdir}/config-%{KVERREL}preempt
+###%{_bootdir}/vmlinuz-%{KVERREL}preempt
+###%{_bootdir}/System.map-%{KVERREL}preempt
+###%dir %{_modulesdir}/%{KVERREL}preempt/
+###%{_modulesdir}/%{KVERREL}preempt/kernel
+###%{_modulesdir}/%{KVERREL}preempt/build
+###%{_modulesdir}/%{KVERREL}preempt/modules.*
+###%doc README.kernel-sources
+###%doc README.Mandrake
+###%endif
 
 %if %build_enterprise
 %files -n kernel-enterprise-%{mdkversion}

Attachment: kernel-patches.tar.bz2
Description: application/tbz

Reply via email to