These tools are intended for development and thus required on demand only.
'scmp_app_inspector' is a shell script which requires some additional
tools from Busybox or Coreutils at run-time. Since both variants work,
it up to the user to select one variant. Which tools are required and
must be enabled in the menu is mentioned in the help text.

Signed-off-by: Juergen Borleis <[email protected]>
---
 ...-run-time-use-a-supported-shell-interpreter.patch | 19 +++++++++++++++++++
 patches/libseccomp-2.3.2/series                      |  4 ++++
 rules/libseccomp.in                                  | 20 ++++++++++++++++++--
 rules/libseccomp.make                                |  4 ++++
 4 files changed, 45 insertions(+), 2 deletions(-)
 create mode 100644 
patches/libseccomp-2.3.2/0001-run-time-use-a-supported-shell-interpreter.patch
 create mode 100644 patches/libseccomp-2.3.2/series

diff --git 
a/patches/libseccomp-2.3.2/0001-run-time-use-a-supported-shell-interpreter.patch
 
b/patches/libseccomp-2.3.2/0001-run-time-use-a-supported-shell-interpreter.patch
new file mode 100644
index 000000000..9e4b6d350
--- /dev/null
+++ 
b/patches/libseccomp-2.3.2/0001-run-time-use-a-supported-shell-interpreter.patch
@@ -0,0 +1,19 @@
+From: Juergen Borleis <[email protected]>
+Date: Fri, 25 Aug 2017 16:03:15 +0200
+Subject: [PATCH] run-time: use a broadly supported shell interpreter
+
+Signed-off-by: Juergen Borleis <[email protected]>
+---
+ tools/scmp_app_inspector | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/scmp_app_inspector b/tools/scmp_app_inspector
+index 45b86b2ca0c5..14f3dfc07387 100755
+--- a/tools/scmp_app_inspector
++++ b/tools/scmp_app_inspector
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ #
+ # Runtime syscall inspector
diff --git a/patches/libseccomp-2.3.2/series b/patches/libseccomp-2.3.2/series
new file mode 100644
index 000000000..522fa2141
--- /dev/null
+++ b/patches/libseccomp-2.3.2/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-run-time-use-a-supported-shell-interpreter.patch
+# a24fa8dfff373b7689e92bc6cfdbb0cd  - git-ptx-patches magic
diff --git a/rules/libseccomp.in b/rules/libseccomp.in
index ece48a2eb..d3708c952 100644
--- a/rules/libseccomp.in
+++ b/rules/libseccomp.in
@@ -1,8 +1,11 @@
 ## SECTION=system_libraries
 
-config LIBSECCOMP
+menuconfig LIBSECCOMP
        bool
-       prompt "libseccomp"
+       prompt "libseccomp                    "
+       select SED if LIBSECCOMP_UTILS && RUNTIME
+       select STRACE if LIBSECCOMP_UTILS && RUNTIME
+       select WHICH if LIBSECCOMP_UTILS && RUNTIME
        help
          An Enhanced Seccomp (mode 2) Helper Library
 
@@ -11,3 +14,16 @@ config LIBSECCOMP
          designed to abstract away the underlying BPF based syscall filter 
language and
          present a more conventional function-call based filtering interface 
that should
          be familiar to, and easily adopted by, application developers.
+
+if LIBSECCOMP
+
+config LIBSECCOMP_UTILS
+       bool
+       prompt "install utils"
+       help
+         Install some utils, useful for development.
+         Note: in order to run some of these utils the tools 'uniq', 'sort',
+         'expr' and 'mktemp' from the 'Busybox' *or* 'Coreutils' package is
+         required.
+
+endif
diff --git a/rules/libseccomp.make b/rules/libseccomp.make
index 4b9e953dc..108969b81 100644
--- a/rules/libseccomp.make
+++ b/rules/libseccomp.make
@@ -53,6 +53,10 @@ $(STATEDIR)/libseccomp.targetinstall:
 
        @$(call install_lib, libseccomp, 0, 0, 0644, libseccomp)
 
+ifdef PTXCONF_LIBSECCOMP_UTILS
+       @$(call install_copy, libseccomp, 0, 0, 0755, -, 
/usr/bin/scmp_sys_resolver)
+       @$(call install_copy, libseccomp, 0, 0, 0755, 
$(LIBSECCOMP_DIR)/tools/scmp_app_inspector, /usr/bin/scmp_app_inspector)
+endif
        @$(call install_finish, libseccomp)
 
        @$(call touch)
-- 
2.11.0


_______________________________________________
ptxdist mailing list
[email protected]

Reply via email to