[OpenAFS-devel] [PATCH] change OpenAFS-1.2.10 SRPM to work better with RedHat; try #4

Jan Iven jan.iven@cern.ch
Fri, 05 Sep 2003 17:57:31 +0200


--=-=-=

>>>>> "David" == David Howells <dhowells@redhat.com> writes:

 David> Hi,

 David> Here's the latest version of my patch against the OpenAFS-1.2.10 SRPM.
..


Hm. I tried this (slightly modified to build without Krb5, patch
against .spec is attached), and the modules are not being build
properly on RH10-beta :

* no kernel compilation on the machine:

  modules are built, but are apparently not versioned and fail
  dependency resolution ("depmod -a" on install fails, insmod as
  well):

# insmod -vp /lib/modules/2.4.21-20.1.2024.2.1.nptlsmp/kernel/fs/openafs/openafs.o
 Using /lib/modules/2.4.21-20.1.2024.2.1.nptlsmp/kernel/fs/openafs/openafs.o
Symbol version prefix 'smp_'
/lib/modules/2.4.21-20.1.2024.2.1.nptlsmp/kernel/fs/openafs/openafs.o: unresolved symbol inode_setattr
/lib/modules/2.4.21-20.1.2024.2.1.nptlsmp/kernel/fs/openafs/openafs.o: unresolved symbol dput
...

# grep inode_setattr /proc/ksyms
c016b790 inode_setattr_Rsmp_5b2ea65b


* existing ../linux-2.4.x/.config; "make dep" has been run on the
  kernel tree: 

  configure is unhappy:

checking for linux/syscall.h in kernel... no
configure: warning: Configured to build from a Red Hat SPEC file
checking for recalc_sigpending arg type... yes
checking for parent in struct task_struct... yes
checking for real_parent in struct task_struct... yes
checking for sig in struct task_struct... no
checking for sighand in struct task_struct... yes
checking for sigmask_lock in struct task_struct... no
checking for exported init_mm... no
checking for exported kallsyms_address_to_symbol... no
checking for exported kallsyms_symbol_to_address... no
checking for exported sys_call_table... no
checking for exported ia32_sys_call_table... no
checking for exported sys_chdir... no
checking for exported sys_close... yes
checking for exported sys_wait4... yes
configure: error: no available sys_call_table access method


Would you have any idea why / can you give me more information about
your build environment? We would like to rebuild eventually on ia64
and x86_64 as well (so your patches will be useful), but i686 seems
easiest to start with..

thanks in advance.
Jan


--=-=-=
Content-Disposition: attachment
Content-Description: Patch against OpenAFS .spec file

This patch 

* removes Krb5 from the build
* deals with the exec-shield functionality on RH10beta by marking insmod to be "safe for stack execution" -- otherwise insmod will die with the openafs module
* adds an AFS job killer script, otherwise AFS will not shut down properly 


--- openafs-1.2.10.spec	2003-09-05 16:04:01.000000000 +0200
+++ openafs-1.2.10.spec.cern	2003-09-05 16:24:41.000000000 +0200
@@ -34,7 +34,7 @@
 
 # Set 'krb5support' to 1 if you want to build the openafs-krb5 package
 # to distribute aklog and asetkey
-%define krb5support 1
+%define krb5support 0
 
 # Set 'bootkernelsupport' to 1 if you want to build the
 # kernel module for Red Hat BOOT Kernels on x86.
@@ -113,6 +114,10 @@
 BuildRequires: %{_includedir}/security/pam_modules.h
 %endif
 
+%ifarch i386
+Requires: /usr/sbin/chstk, /sbin/insmod
+%endif
+
 Source0: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-src.tar.bz2
 Source1: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-doc.tar.bz2
 Source2: openafs-ThisCell
@@ -125,20 +130,26 @@
 #Source10: http://www.openafs.org/dl/openafs/%{afsvers}/RELNOTES-%{afsvers}
 Source11: http://www.openafs.org/dl/openafs/%{afsvers}/ChangeLog
 
+%if %{krb5support}
 Source20: openafs-krb5-1.3.tar.gz
+%endif
 Source21: openafs-kernel-version.sh
-
+Source30: http://www.tu-chemnitz.de/urz/afs/openafs/download/suse-7.2/SOURCES/openafs-killafs
 Patch0: openafs-%{afsvers}-rc.patch
-
+%if %{krb5support}
 Patch20: openafs-krb5-1.3-1.2.1.diff.gz
 Patch21: openafs-krb5-1.3-configure.patch
+%endif
 
 Patch105: openafs-hashverify.patch
 Patch106: openafs-build.patch
 Patch107: openafs-module.patch
 
+%if %{krb5support}
 Patch200: openafs-krb5-1.3-krb5-1.3.patch
 Patch201: openafs-krb5-1.3-lib64.patch
+%endif
+
 Patch202: openafs-1.2.10-cflags.patch
 Patch203: openafs-1.2.10-pam-x86_64.patch
 
@@ -346,23 +357,31 @@
 : @@@ target cpu:         %{_target_cpu}
 : @@@
 : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-
+%if %{krb5support}
 %setup -q -b 1
 %setup -q -T -D -a 20
-
+%else
+%setup 
+%setup -T -D -b 1
+%endif
 %patch0 -p0 -b .rc
 
+%if %{krb5support}
 %patch20 -p0 -b .krb5
 %patch21 -p0 -b .config
+%endif
 
 %patch105 -p1 -b .hashverify
 %patch106 -p1 -b .build
 %patch107 -p1 -b .module
 
+%if %{krb5support}
 pushd openafs-krb5-1.3
 %patch200 -p0 -b .krb5-1.3
 %patch201 -p1 -b .lib64
 popd
+%endif
+
 %patch202 -p1 -b .cflags
 %patch203 -p1 -b .pam-x86_64
 
@@ -631,6 +650,8 @@
 install -p -m 644 %{SOURCE4} $uve/SuidCells
 install -p -m 644 %{SOURCE5} $uve/cacheinfo
 
+install -p -m 755 %{SOURCE30} $uve/killafs
+
 #
 # install kernel-source
 #
@@ -750,6 +771,9 @@
 
 %post
 chkconfig --add afs
+if [ -x /usr/sbin/chstk ]; then
+ /usr/sbin/chstk -e /sbin/insmod
+fi
 
 %post client
 if [ ! -d /afs ]; then
@@ -841,6 +867,7 @@
 %{_bindir}/cmdebug
 %{_bindir}/up
 %{_prefix}/vice/etc/afsd
+%{_prefix}/vice/etc/killafs
 %{pamdir}/pam_afs.krb.so.1
 %{pamdir}/pam_afs.krb.so
 %{pamdir}/pam_afs.so.1

--=-=-=--