summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lass2018-12-21 22:19:39 +0100
committerMichael Lass2018-12-21 22:19:39 +0100
commit7fabe8e4bfb14a91bf18305fba0f802143093c3a (patch)
tree1a026cd174bf81c2b9bdb4d82834b6b78e0c7771
parented966d88bcd78dfe268792c557189e072c9c16ff (diff)
downloadaur-7fabe8e4bfb14a91bf18305fba0f802143093c3a.tar.gz
Prepare for Linux 4.20
-rw-r--r--.SRCINFO6
-rw-r--r--0001-Linux-4.20-current_kernel_time-is-gone.patch71
-rw-r--r--0002-Linux-4.20-do_settimeofday-is-gone.patch68
-rw-r--r--PKGBUILD16
4 files changed, 156 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bf1414c377d..19cb25f9984 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = openafs-modules
pkgdesc = Kernel module for OpenAFS
pkgver = 1.8.2
- pkgrel = 1
+ pkgrel = 2
url = http://www.openafs.org
install = openafs-modules.install
arch = i686
@@ -15,7 +15,11 @@ pkgbase = openafs-modules
conflicts = openafs<1.6.6-2
options = !emptydirs
source = http://openafs.org/dl/openafs/1.8.2/openafs-1.8.2-src.tar.bz2
+ source = 0001-Linux-4.20-current_kernel_time-is-gone.patch
+ source = 0002-Linux-4.20-do_settimeofday-is-gone.patch
sha256sums = 25fd3e4261a72a2cbdd40367e5f981895d80c32aaf309a5842aecc739dd3138e
+ sha256sums = af5f65915c33a13311280ca5f1d52e49d954341d2b5d8939fc0ccb6a15663388
+ sha256sums = a4036be334ce54a4eb4a777621983e6535144d4c81d717e2045bb9040cf3ae8b
pkgname = openafs-modules
diff --git a/0001-Linux-4.20-current_kernel_time-is-gone.patch b/0001-Linux-4.20-current_kernel_time-is-gone.patch
new file mode 100644
index 00000000000..f353e3a5bfd
--- /dev/null
+++ b/0001-Linux-4.20-current_kernel_time-is-gone.patch
@@ -0,0 +1,71 @@
+From d2f3f96ad737c2c49c64fcf954dc96b63722c108 Mon Sep 17 00:00:00 2001
+From: Mark Vitale <mvitale@sinenomine.net>
+Date: Tue, 13 Nov 2018 11:20:09 -0500
+Subject: [PATCH 1/2] Linux 4.20: current_kernel_time is gone
+
+With Linux commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8 'y2038:
+remove unused time interfaces' (4.20-rc1), current_kernel_time() has
+been removed.
+
+Many y2038-compliant time APIs were introduced with Linux commit
+fb7fcc96a86cfaef0f6dcc0665516aa68611e736 'timekeeping: Standardize on
+ktime_get_*() naming' (4.18). According to
+Documentation/core-api/timekeeping.rst, a suitable replacement for:
+
+ struct timespec current_kernel_time(void)
+
+would be:
+
+ void ktime_get_coarse_real_ts64(struct timespec64 *ts))
+
+Add an autoconf test and equivalent logic to deal.
+
+Reviewed-on: https://gerrit.openafs.org/13391
+Tested-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 3c454b39d04f4886536267c211171dae30dc0344)
+
+Change-Id: I3f00cf4bd3a1ffb7c90e3920113964d74c6df403
+---
+ src/afs/LINUX/osi_machdep.h | 9 ++++++++-
+ src/cf/linux-kernel-func.m4 | 4 ++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h
+index ce8cabf6e..a1a2f57c0 100644
+--- a/src/afs/LINUX/osi_machdep.h
++++ b/src/afs/LINUX/osi_machdep.h
+@@ -75,7 +75,14 @@
+ #if defined(HAVE_LINUX_CRED_H)
+ #include "h/cred.h"
+ #endif
+-#if defined(HAVE_LINUX_CURRENT_KERNEL_TIME)
++
++#if defined(HAVE_LINUX_KTIME_GET_COARSE_REAL_TS64)
++static inline time_t osi_Time(void) {
++ struct timespec64 xtime;
++ ktime_get_coarse_real_ts64(&xtime);
++ return xtime.tv_sec;
++}
++#elif defined(HAVE_LINUX_CURRENT_KERNEL_TIME)
+ static inline time_t osi_Time(void) {
+ struct timespec xtime;
+ xtime = current_kernel_time();
+diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
+index 0b17e172e..62fd528d6 100644
+--- a/src/cf/linux-kernel-func.m4
++++ b/src/cf/linux-kernel-func.m4
+@@ -72,6 +72,10 @@ AC_CHECK_LINUX_FUNC([iter_file_splice_write],
+ AC_CHECK_LINUX_FUNC([kernel_setsockopt],
+ [#include <linux/net.h>],
+ [kernel_setsockopt(NULL, 0, 0, NULL, 0);])
++AC_CHECK_LINUX_FUNC([ktime_get_coarse_real_ts64],
++ [#include <linux/time.h>],
++ [struct timespec64 *s;
++ ktime_get_coarse_real_ts64(s);])
+ AC_CHECK_LINUX_FUNC([locks_lock_file_wait],
+ [#include <linux/fs.h>],
+ [locks_lock_file_wait(NULL, NULL);])
+--
+2.20.1
+
diff --git a/0002-Linux-4.20-do_settimeofday-is-gone.patch b/0002-Linux-4.20-do_settimeofday-is-gone.patch
new file mode 100644
index 00000000000..af1aa32ae82
--- /dev/null
+++ b/0002-Linux-4.20-do_settimeofday-is-gone.patch
@@ -0,0 +1,68 @@
+From fae55fbc736dc33e70e3eb2086993b4d3c37bd3f Mon Sep 17 00:00:00 2001
+From: Mark Vitale <mvitale@sinenomine.net>
+Date: Thu, 15 Nov 2018 15:31:37 -0500
+Subject: [PATCH 2/2] Linux 4.20: do_settimeofday is gone
+
+With Linux commit 976516404ff3fab2a8caa8bd6f5efc1437fed0b8 'y2038:
+remove unused time interfaces', do_settimeofday() is gone.
+
+However, OpenAFS only calls do_settimeofday() from afs_osi_SetTime(),
+which has been dead code since -settime support was removed from afsd
+with commit 1d9888be486198868983048eeffabdfef5afa94b 'Remove
+-settime/RXAFS_GetTime client support'.
+
+Instead of fixing afs_osi_SetTime() to use a current Linux API, remove
+it as dead code.
+
+No functional change is incurred by this commit. However, this change
+is required in order to build OpenAFS on Linux 4.20.
+
+Reviewed-on: https://gerrit.openafs.org/13392
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+Tested-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit aa80f892ec39e2984818090a6bb2047430836ee2)
+
+Change-Id: I7f5ee9c21bc87cd261d87126bc3848d941ff5409
+---
+ src/afs/LINUX/osi_misc.c | 12 ------------
+ src/afs/LINUX/osi_prototypes.h | 1 -
+ 2 files changed, 13 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c
+index 077d4edfb..655076779 100644
+--- a/src/afs/LINUX/osi_misc.c
++++ b/src/afs/LINUX/osi_misc.c
+@@ -28,18 +28,6 @@
+ int afs_osicred_initialized = 0;
+ afs_ucred_t afs_osi_cred;
+
+-void
+-afs_osi_SetTime(osi_timeval_t * tvp)
+-{
+- struct timespec tv;
+- tv.tv_sec = tvp->tv_sec;
+- tv.tv_nsec = tvp->tv_usec * NSEC_PER_USEC;
+-
+- AFS_STATCNT(osi_SetTime);
+-
+- do_settimeofday(&tv);
+-}
+-
+ void
+ osi_linux_mask(void)
+ {
+diff --git a/src/afs/LINUX/osi_prototypes.h b/src/afs/LINUX/osi_prototypes.h
+index 5002af1ca..70f6393f1 100644
+--- a/src/afs/LINUX/osi_prototypes.h
++++ b/src/afs/LINUX/osi_prototypes.h
+@@ -45,7 +45,6 @@ extern void osi_ioctl_init(void);
+ extern void osi_ioctl_clean(void);
+
+ /* osi_misc.c */
+-extern void afs_osi_SetTime(osi_timeval_t * tvp);
+ extern int osi_lookupname_internal(char *aname, int followlink,
+ struct vfsmount **mnt, struct dentry **dpp);
+ extern int osi_lookupname(char *aname, uio_seg_t seg, int followlink,
+--
+2.20.1
+
diff --git a/PKGBUILD b/PKGBUILD
index b3c1774a2fd..385ef097bfe 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@
pkgname=openafs-modules
_srcname=openafs
pkgver=1.8.2
-pkgrel=1
+pkgrel=2
pkgdesc="Kernel module for OpenAFS"
arch=('i686' 'x86_64' 'armv7h')
url="http://www.openafs.org"
@@ -15,9 +15,13 @@ depends=('openafs')
makedepends=('libelf' 'linux-headers')
conflicts=('openafs-features-libafs' 'openafs<1.6.6-2')
options=(!emptydirs)
-source=("http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2")
+source=("http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2"
+ 0001-Linux-4.20-current_kernel_time-is-gone.patch
+ 0002-Linux-4.20-do_settimeofday-is-gone.patch)
install=openafs-modules.install
-sha256sums=('25fd3e4261a72a2cbdd40367e5f981895d80c32aaf309a5842aecc739dd3138e')
+sha256sums=('25fd3e4261a72a2cbdd40367e5f981895d80c32aaf309a5842aecc739dd3138e'
+ 'af5f65915c33a13311280ca5f1d52e49d954341d2b5d8939fc0ccb6a15663388'
+ 'a4036be334ce54a4eb4a777621983e6535144d4c81d717e2045bb9040cf3ae8b')
# Heuristic to determine version of installed kernel
# You can modify this if the heuristic fails
@@ -27,8 +31,12 @@ _kernelver=$(cat ${_extramodules}/version)
prepare() {
cd "${srcdir}/${_srcname}-${pkgver}"
+ # Compatibility with Linux 4.20
+ patch -p1 < "${srcdir}/0001-Linux-4.20-current_kernel_time-is-gone.patch"
+ patch -p1 < "${srcdir}/0002-Linux-4.20-do_settimeofday-is-gone.patch"
+
# Only needed when changes to configure were made
- #./regen.sh -q
+ ./regen.sh -q
}
build() {