mirror of
https://git.yoctoproject.org/poky
synced 2026-05-02 18:32:15 +02:00
unfs3: upgrade to 0.11
Drop all of the patches that have been merged upstream. The build no longer needs the flex runtime library so remove flex from DEPENDS. License-Update: contributor list updated. (From OE-Core rev: 3370ef98b6fe74b56b9e6b42b915a536195094cd) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
872edf1865
commit
bc9d4c7d6b
@@ -1,28 +0,0 @@
|
||||
From 949db882e487d728c44bb68139682b38396dd275 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 14 Dec 2022 14:50:10 -0800
|
||||
Subject: [PATCH] Alias off64_t to off_t on linux if not defined
|
||||
|
||||
Musl C library does not define off64_t and has 64-bit default off_t
|
||||
therefore define off64_t as an alias on linux as well when configure
|
||||
detects that off64_t is not provided by a linux system
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/unfs3/unfs3/pull/29]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
nfs.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/nfs.h b/nfs.h
|
||||
index aded011..7996c67 100644
|
||||
--- a/nfs.h
|
||||
+++ b/nfs.h
|
||||
@@ -62,7 +62,7 @@ typedef int32_t int32;
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_OFF64_T
|
||||
-#ifdef __APPLE__
|
||||
+#if defined(__APPLE__) || defined(__linux__)
|
||||
typedef off_t off64_t;
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,88 +0,0 @@
|
||||
From 7e789895919d57d573ebb8faa147d1286104cd01 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Wang <rui.wang@windriver.com>
|
||||
Date: Mon, 24 Apr 2023 02:57:57 -0700
|
||||
Subject: [PATCH] attr: fix utime for symlink
|
||||
|
||||
unfs3 has an old defect that it can not change the timestamps of a
|
||||
symlink file because it only uses utime(), which will follow the
|
||||
symlink. This will not cause an error if the symlink points to an
|
||||
existent file. But under some special situation, such as installing
|
||||
a rpm package, rpm tool will create the symlink first and try to
|
||||
modify the timestamps of it, when the target file is non-existent.
|
||||
This will cause an ESTALE error. Making rpm tool ignore this error
|
||||
is a solution, but not the best one. An acceptable approach is
|
||||
Making unfs3 support lutimes(), which can modify the symlink file
|
||||
itself. Considering not every system support this function, so a
|
||||
function checking is necessary.
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/unfs3/unfs3/pull/35]
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
attr.c | 15 +++++++++++----
|
||||
backend_unix.h | 2 ++
|
||||
configure.ac | 1 +
|
||||
3 files changed, 14 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/attr.c b/attr.c
|
||||
index 0ce9375..930ce6e 100644
|
||||
--- a/attr.c
|
||||
+++ b/attr.c
|
||||
@@ -285,7 +285,7 @@ post_op_attr get_post_cached(struct svc_req * req)
|
||||
static nfsstat3 set_time(const char *path, backend_statstruct buf, sattr3 new)
|
||||
{
|
||||
time_t new_atime, new_mtime;
|
||||
- struct utimbuf utim;
|
||||
+ struct timeval stamps[2];
|
||||
int res;
|
||||
|
||||
/* set atime and mtime */
|
||||
@@ -307,10 +307,17 @@ static nfsstat3 set_time(const char *path, backend_statstruct buf, sattr3 new)
|
||||
else /* DONT_CHANGE */
|
||||
new_mtime = buf.st_mtime;
|
||||
|
||||
- utim.actime = new_atime;
|
||||
- utim.modtime = new_mtime;
|
||||
+ stamps[0].tv_sec = new_atime;
|
||||
+ stamps[0].tv_usec = 0;
|
||||
+ stamps[1].tv_sec = new_mtime;
|
||||
+ stamps[1].tv_usec = 0;
|
||||
+
|
||||
+#if HAVE_LUTIMES
|
||||
+ res = backend_lutimes(path, stamps);
|
||||
+#else
|
||||
+ res = backend_utimes(path, stamps);
|
||||
+#endif
|
||||
|
||||
- res = backend_utime(path, &utim);
|
||||
if (res == -1)
|
||||
return setattr_err();
|
||||
}
|
||||
diff --git a/backend_unix.h b/backend_unix.h
|
||||
index 4db72ae..9cce9ab 100644
|
||||
--- a/backend_unix.h
|
||||
+++ b/backend_unix.h
|
||||
@@ -61,6 +61,8 @@
|
||||
#define backend_symlink symlink
|
||||
#define backend_truncate truncate
|
||||
#define backend_utime utime
|
||||
+#define backend_utimes utimes
|
||||
+#define backend_lutimes lutimes
|
||||
#define backend_statstruct struct stat
|
||||
#define backend_dirstream DIR
|
||||
#define backend_statvfsstruct struct statvfs
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index d46c905..c21afe3 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -32,6 +32,7 @@ AC_CHECK_FUNCS(setresuid setresgid)
|
||||
AC_CHECK_FUNCS(vsyslog)
|
||||
AC_CHECK_FUNCS(lchown)
|
||||
AC_CHECK_FUNCS(setgroups)
|
||||
+AC_CHECK_FUNCS(lutimes)
|
||||
UNFS3_COMPILE_WARNINGS
|
||||
|
||||
PKG_CHECK_MODULES([TIRPC], [libtirpc])
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
From 212a947e776e7a25c1f2259615f461179bcb3663 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex@linutronix.de>
|
||||
Date: Wed, 23 Nov 2022 21:38:38 +0100
|
||||
Subject: [PATCH] daemon.c: Fix race window for writing of the pid file
|
||||
|
||||
The parent process should write the pid file such that the pid file
|
||||
will can be checked immediately following exit of the fork from the
|
||||
parent.
|
||||
|
||||
This allows external monitoring applications to watch the daemon
|
||||
without having to add sleep calls to wait for the pid file be written
|
||||
on a busy system.
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/unfs3/unfs3/pull/28]
|
||||
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
|
||||
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
|
||||
---
|
||||
daemon.c | 12 +++++++++---
|
||||
1 file changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/daemon.c b/daemon.c
|
||||
index ff53b7a..13b06a4 100644
|
||||
--- a/daemon.c
|
||||
+++ b/daemon.c
|
||||
@@ -166,7 +166,7 @@ int get_socket_type(struct svc_req *rqstp)
|
||||
/*
|
||||
* write current pid to a file
|
||||
*/
|
||||
-static void create_pid_file(void)
|
||||
+static void create_pid_file(int pid)
|
||||
{
|
||||
char buf[16];
|
||||
int fd, res, len;
|
||||
@@ -188,7 +188,7 @@ static void create_pid_file(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
- sprintf(buf, "%i\n", backend_getpid());
|
||||
+ sprintf(buf, "%i\n", pid);
|
||||
len = strlen(buf);
|
||||
|
||||
res = backend_pwrite(fd, buf, len, 0);
|
||||
@@ -1122,6 +1122,10 @@ int main(int argc, char **argv)
|
||||
fprintf(stderr, "could not fork into background\n");
|
||||
daemon_exit(0);
|
||||
}
|
||||
+ if (pid)
|
||||
+ create_pid_file(pid);
|
||||
+ } else {
|
||||
+ create_pid_file(backend_getpid());
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
|
||||
@@ -1161,8 +1165,10 @@ int main(int argc, char **argv)
|
||||
/* no umask to not screw up create modes */
|
||||
umask(0);
|
||||
|
||||
+#ifdef WIN32
|
||||
/* create pid file if wanted */
|
||||
- create_pid_file();
|
||||
+ create_pid_file(backend_getpid());
|
||||
+#endif
|
||||
|
||||
/* initialize internal stuff */
|
||||
fh_cache_init();
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
From 989b87ae46b3183a742031373fbb3e912ab9b666 Mon Sep 17 00:00:00 2001
|
||||
From: Andrey Filipenkov <decapitator@ukr.net>
|
||||
Date: Wed, 2 Nov 2022 13:38:40 +0300
|
||||
Subject: [PATCH] fix building on macOS
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Upstream-Status: Backport [https://github.com/unfs3/unfs3/commit/989b87ae46b3183a742031373fbb3e912ab9b666]
|
||||
---
|
||||
attr.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/attr.c b/attr.c
|
||||
index 6253e84..0ce9375 100644
|
||||
--- a/attr.c
|
||||
+++ b/attr.c
|
||||
@@ -18,6 +18,8 @@
|
||||
#include <utime.h>
|
||||
#include <errno.h>
|
||||
#include <dirent.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
|
||||
#include "backend.h"
|
||||
#include "nfs.h"
|
||||
--
|
||||
2.39.1
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
From 63e0785bb379a8f2c41f34f5cd938ca38555e605 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 13 Jan 2023 23:41:01 -0800
|
||||
Subject: [PATCH] locate.c: Include attr.h
|
||||
|
||||
Its needed for fix_dir_times() API declarations
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/unfs3/unfs3/pull/32]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
locate.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/locate.c b/locate.c
|
||||
index 6bbe71f..84e0fe5 100644
|
||||
--- a/locate.c
|
||||
+++ b/locate.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "nfs.h"
|
||||
#include "fh.h"
|
||||
#include "daemon.h"
|
||||
+#include "attr.h"
|
||||
|
||||
/*
|
||||
* these are the brute-force file searching routines that are used
|
||||
--
|
||||
2.39.0
|
||||
|
||||
@@ -5,22 +5,17 @@ are used by NFS clients for accessing files on the server."
|
||||
HOMEPAGE = "https://github.com/unfs3/unfs3"
|
||||
SECTION = "console/network"
|
||||
LICENSE = "BSD-3-Clause"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=9475885294e17c0cc0067820d042792e"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=c1c621cd2786a3a1344a60a0d608c910"
|
||||
|
||||
DEPENDS = "flex-native bison-native flex libtirpc"
|
||||
DEPENDS = "bison-native flex-native libtirpc"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SRC_URI = "git://github.com/unfs3/unfs3.git;protocol=https;branch=master \
|
||||
file://0001-daemon.c-Fix-race-window-for-writing-of-the-pid-file.patch \
|
||||
file://0001-Alias-off64_t-to-off_t-on-linux-if-not-defined.patch \
|
||||
file://0001-locate.c-Include-attr.h.patch \
|
||||
file://0001-fix-building-on-macOS.patch \
|
||||
file://0001-attr-fix-utime-for-symlink.patch \
|
||||
"
|
||||
SRCREV = "c8f2d2cd4529955419bad0e163f88d47ff176b8d"
|
||||
SRC_URI = "git://github.com/unfs3/unfs3.git;protocol=https;branch=master;tag=${BP}"
|
||||
SRCREV = "ec1660ba33c80d5c67131e163e68834c1a10e243"
|
||||
UPSTREAM_CHECK_GITTAGREGEX = "unfs3\-(?P<pver>\d+(\.\d+)+)"
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
|
||||
inherit autotools pkgconfig
|
||||
|
||||
EXTRA_OECONF:append:class-native = " --sbindir=${bindir}"
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
Reference in New Issue
Block a user