From b99c7563d0147ea95b7e176ffeacd42b0a21fece Mon Sep 17 00:00:00 2001 From: Kurt Van Dijck Date: Thu, 28 Dec 2017 20:45:55 +0100 Subject: [PATCH] nilfs-utils: new package nilfs-utils provides the user-space utilities for the nilfs2 filesystem. Signed-off-by: Kurt Van Dijck Signed-off-by: Thomas Petazzoni --- DEVELOPERS | 1 + package/Config.in | 1 + ...001-nilfs-utils-use-_POSIX_MAX_INPUT.patch | 32 +++++++++++++++++++ ...0002-nilfs_cleanerd-link-dynamically.patch | 32 +++++++++++++++++++ ...mount.nilfs-drop-include-rpc-types.h.patch | 32 +++++++++++++++++++ package/nilfs-utils/Config.in | 11 +++++++ package/nilfs-utils/nilfs-utils.hash | 3 ++ package/nilfs-utils/nilfs-utils.mk | 25 +++++++++++++++ 8 files changed, 137 insertions(+) create mode 100644 package/nilfs-utils/0001-nilfs-utils-use-_POSIX_MAX_INPUT.patch create mode 100644 package/nilfs-utils/0002-nilfs_cleanerd-link-dynamically.patch create mode 100644 package/nilfs-utils/0003-mount.nilfs-drop-include-rpc-types.h.patch create mode 100644 package/nilfs-utils/Config.in create mode 100644 package/nilfs-utils/nilfs-utils.hash create mode 100644 package/nilfs-utils/nilfs-utils.mk diff --git a/DEVELOPERS b/DEVELOPERS index 716363493c..50bc87a8e4 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -979,6 +979,7 @@ F: package/linuxconsoletools/ N: Kurt Van Dijck F: package/bcusdk/ F: package/libpthsem/ +F: package/nilfs-utils/ N: Laurent Cans F: package/aircrack-ng/ diff --git a/package/Config.in b/package/Config.in index abd082c92d..fe03e08292 100644 --- a/package/Config.in +++ b/package/Config.in @@ -189,6 +189,7 @@ menu "Filesystem and flash utilities" source "package/mtd/Config.in" source "package/mtools/Config.in" source "package/nfs-utils/Config.in" + source "package/nilfs-utils/Config.in" source "package/ntfs-3g/Config.in" source "package/sp-oops-extract/Config.in" source "package/squashfs/Config.in" diff --git a/package/nilfs-utils/0001-nilfs-utils-use-_POSIX_MAX_INPUT.patch b/package/nilfs-utils/0001-nilfs-utils-use-_POSIX_MAX_INPUT.patch new file mode 100644 index 0000000000..f14079a5c5 --- /dev/null +++ b/package/nilfs-utils/0001-nilfs-utils-use-_POSIX_MAX_INPUT.patch @@ -0,0 +1,32 @@ +From c6e5a79b130ac33093c36f972be49454f506be7e Mon Sep 17 00:00:00 2001 +From: Kurt Van Dijck +Date: Thu, 28 Dec 2017 20:06:38 +0100 +Subject: [PATCH] nilfs-utils: use _POSIX_MAX_INPUT + +musl does provide _POSIX_MAX_INPUT, but no MAX_INPUT out of the box. +This commit assigns _POSIX_MAX_INPUT to MAX_INPUT. + +Signed-off-by: Kurt Van Dijck +--- + bin/rmcp.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/bin/rmcp.c b/bin/rmcp.c +index 0140f56..6773912 100644 +--- a/bin/rmcp.c ++++ b/bin/rmcp.c +@@ -47,6 +47,11 @@ + #include + #endif /* HAVE_LIMITS_H */ + ++/* define MAX_INPUT for musl */ ++#ifndef MAX_INPUT ++#define MAX_INPUT _POSIX_MAX_INPUT ++#endif ++ + #include + #include "nilfs.h" + #include "parser.h" +-- +1.8.5.rc3 + diff --git a/package/nilfs-utils/0002-nilfs_cleanerd-link-dynamically.patch b/package/nilfs-utils/0002-nilfs_cleanerd-link-dynamically.patch new file mode 100644 index 0000000000..ab057b292e --- /dev/null +++ b/package/nilfs-utils/0002-nilfs_cleanerd-link-dynamically.patch @@ -0,0 +1,32 @@ +From 7888f8f24ec08cdfd51929cde4e177396d7504e7 Mon Sep 17 00:00:00 2001 +From: Kurt Van Dijck +Date: Thu, 28 Dec 2017 20:22:00 +0100 +Subject: [PATCH] nilfs_cleanerd: link dynamically + +When nilfs_cleanerd does not run due to shared object problems, +nilfs2 filesystems may run out of space soon. +This logic that justified linking nilfs_cleanerd statically +does IMO not apply to embedded systems built by buildroot. +This commit therefore drops the static linking. + +Signed-off-by: Kurt Van Dijck +--- + sbin/cleanerd/Makefile.am | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/sbin/cleanerd/Makefile.am b/sbin/cleanerd/Makefile.am +index 3a5335d..06f0847 100644 +--- a/sbin/cleanerd/Makefile.am ++++ b/sbin/cleanerd/Makefile.am +@@ -9,8 +9,6 @@ nilfs_cleanerd_SOURCES = cleanerd.c cldconfig.c \ + nilfs_cleanerd_CFLAGS = -Wall + nilfs_cleanerd_CPPFLAGS = -I$(top_srcdir)/include \ + -DSYSCONFDIR=\"$(sysconfdir)\" +-# Use -static option to make nilfs_cleanerd self-contained. +-nilfs_cleanerd_LDFLAGS = -static + + dist_sysconf_DATA = nilfs_cleanerd.conf + +-- +1.8.5.rc3 + diff --git a/package/nilfs-utils/0003-mount.nilfs-drop-include-rpc-types.h.patch b/package/nilfs-utils/0003-mount.nilfs-drop-include-rpc-types.h.patch new file mode 100644 index 0000000000..9d54c40fcc --- /dev/null +++ b/package/nilfs-utils/0003-mount.nilfs-drop-include-rpc-types.h.patch @@ -0,0 +1,32 @@ +From a924a05ea6fd8c5284983a09d1ea8993124b6b77 Mon Sep 17 00:00:00 2001 +From: Kurt Van Dijck +Date: Thu, 28 Dec 2017 20:26:09 +0100 +Subject: [PATCH] mount.nilfs: drop include rpc/types.h + +rpc/types.h does not exist on low-footprint musl toolchains, +and is only required for the boolean types, which musl provides +elsewhere. +This commit drops the include completely. + +Signed-off-by: Kurt Van Dijck +--- + sbin/mount/sundries.h | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/sbin/mount/sundries.h b/sbin/mount/sundries.h +index b3064a7..94d8ce4 100644 +--- a/sbin/mount/sundries.h ++++ b/sbin/mount/sundries.h +@@ -15,9 +15,6 @@ + #include + #include + #include +-#if !defined(bool_t) && !defined(__GLIBC__) +-#include +-#endif + + extern int mount_quiet; + +-- +1.8.5.rc3 + diff --git a/package/nilfs-utils/Config.in b/package/nilfs-utils/Config.in new file mode 100644 index 0000000000..2763af54fd --- /dev/null +++ b/package/nilfs-utils/Config.in @@ -0,0 +1,11 @@ +config BR2_PACKAGE_NILFS_UTILS + bool "nilfs-utils" + depends on BR2_USE_MMU # util-linux libmount, libblkid + select BR2_PACKAGE_UTIL_LINUX_LIBUUID + select BR2_PACKAGE_UTIL_LINUX_LIBBLKID + select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT + select BR2_PACKAGE_UTIL_LINUX + help + Tools for creating and managing NILFS2 filesystems. + + https://github.com/nilfs-dev/nilfs-utils diff --git a/package/nilfs-utils/nilfs-utils.hash b/package/nilfs-utils/nilfs-utils.hash new file mode 100644 index 0000000000..bf80367068 --- /dev/null +++ b/package/nilfs-utils/nilfs-utils.hash @@ -0,0 +1,3 @@ +# Locally calculated after checking pgp signature +sha512 8a73b807bbdb2dc56b100ab8fbffe8129c9db31a6cbceecf267bdeb726fc13dd6844ce8ef96690bd7786709cb884881a3cd6d3cf24290248c5abc457976e9487 nilfs-utils-v2.2.7.tar.gz +sha512 4fc92d3998910acb108f81b1aee70a55a572b661a2766d0e57a55e48e2b737eea41415356cbd62593f26aec5797ab9fbb40211d7782b5834b4855ff1ce6ad5f7 COPYING diff --git a/package/nilfs-utils/nilfs-utils.mk b/package/nilfs-utils/nilfs-utils.mk new file mode 100644 index 0000000000..35f5ffd8c5 --- /dev/null +++ b/package/nilfs-utils/nilfs-utils.mk @@ -0,0 +1,25 @@ +################################################################################ +# +# nilfs-utils +# +################################################################################ + +NILFS_UTILS_VERSION = v2.2.7 +NILFS_UTILS_SITE = $(call github,nilfs-dev,nilfs-utils,$(NILFS_UTILS_VERSION)) +NILFS_UTILS_LICENSE = GPL-2.0+ (programs), LGPL-2.1+ (libraries) +NILFS_UTILS_LICENSE_FILES = COPYING + +# need libuuid, libblkid, libmount +NILFS_UTILS_DEPENDENCIES = util-linux + +# we're fetching from github +NILFS_UTILS_AUTORECONF = YES + +ifeq ($(BR2_PACKAGE_LIBSELINUX),y) +NILFS_UTILS_CONF_OPTS += --with-selinux +NILFS_UTILS_DEPENDENCIES += libselinux +else +NILFS_UTILS_CONF_OPTS += --without-selinux +endif + +$(eval $(autotools-package)) -- 2.30.2