package/audit: Allow Host compilation.
PATCH 1/4 package/audit: Allow Host compilation.
Policycoreutils requires audit as a host package.
--- package/audit/audit.mk | 9 +++++++++ 1 file changed, 9 insertions(+)
package/audit/audit.mk +9 -0
@@ -58,4 +58,13 @@ define AUDIT_INSTALL_CLEANUP endef AUDIT_POST_INSTALL_TARGET_HOOKS += AUDIT_INSTALL_CLEANUP +HOST_AUDIT_CONF_OPTS = --without-python --without-python3 --disable-zos-remote +ifeq ($(BR2_PACKAGE_LIBCAP_NG),y) +HOST_AUDIT_DEPENDENCIES += host-libcap-ng +HOST_AUDIT_CONF_OPTS += --with-libcap-ng=yes +else +HOST_AUDIT_CONF_OPTS += --with-libcap-ng=no +endif + $(eval $(autotools-package)) +$(eval $(host-autotools-package))
Signature · 1 line
2.7.4
PATCH 2/4 libcap-ng: Allow host compilation.
Audit may require libcap-ng as a dependency, this allows libcap-ng to compile as a host package.
--- package/libcap-ng/libcap-ng.mk | 4 ++++ 1 file changed, 4 insertions(+)
package/libcap-ng/libcap-ng.mk +4 -0
@@ -13,4 +13,8 @@ LIBCAP_NG_INSTALL_STAGING = YES LIBCAP_NG_CONF_ENV = ac_cv_prog_swig_found=no LIBCAP_NG_CONF_OPTS = --without-python +HOST_LIBCAP_NG_CONF_ENV = ac_cv_prog_swig_found=no +HOST_LIBCAP_NG_CONF_OPTS = --without-python + $(eval $(autotools-package)) +$(eval $(host-autotools-package))
Signature · 1 line
2.7.4
PATCH 2/4 libcap-ng: Allow host compilation.
Hello,
Quoted 7 lines · Adam Duskett
Audit may require libcap-ng as a dependency, this allows libcap-ng to compile as a host package.
Signed-off-by Adam Duskett <[email protected]>--- package/libcap-ng/libcap-ng.mk | 4 ++++ 1 file changed, 4 insertions(+)
Following my comments on PATCH 1/4, not sure if this patch is still needed. If it is still needed, then this patch must appear *before* it is used.
Imagine I apply only PATCH 1/4, but not PATCH 2/4: PATCH 1/4 might lead to host-libcap-ng being used, but this package doesn't exist.
Please make sure that the *order* of the patches in your series is correct.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 3/4 package/libsemanage: Add host-audit as a dependency.
In reply to Adam Duskettpolicycoreutils requires libsemanage to be compiled as a host package.
--- package/libsemanage/libsemanage.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/libsemanage/libsemanage.mk +1 -1
@@ -27,7 +27,7 @@ define LIBSEMANAGE_INSTALL_TARGET_CMDS $(MAKE) -C $(@D) $(LIBSEMANAGE_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install endef -HOST_LIBSEMANAGE_DEPENDENCIES = host-bison host-libsepol host-libselinux \ +HOST_LIBSEMANAGE_DEPENDENCIES = host-bison host-audit host-libsepol host-libselinux \ host-ustr host-bzip2 host-swig HOST_LIBSEMANAGE_MAKE_OPTS += $(HOST_CONFIGURE_OPTS) \ SWIG_LIB="$(HOST_DIR)/usr/share/swig/$(SWIG_VERSION)/"
Signature · 1 line
2.7.4
PATCH 3/4 package/libsemanage: Add host-audit as a dependency.
Hi Adam,
Quoted 1 line · Adam Duskett
policycoreutils requires libsemanage to be compiled as a host package.
This does not explain why you add host-audit as a dependency of host-libsemanage.
baruch
Quoted 18 lines
Signed-off-by Adam Duskett <[email protected]>--- package/libsemanage/libsemanage.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/libsemanage/libsemanage.mk +1
-1@@ -27,7 +27,7 @@ define LIBSEMANAGE_INSTALL_TARGET_CMDS $(MAKE) -C $(@D) $(LIBSEMANAGE_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install endef -HOST_LIBSEMANAGE_DEPENDENCIES = host-bison host-libsepol host-libselinux \ +HOST_LIBSEMANAGE_DEPENDENCIES = host-bison host-audit host-libsepol host-libselinux \ host-ustr host-bzip2 host-swig HOST_LIBSEMANAGE_MAKE_OPTS += $(HOST_CONFIGURE_OPTS) \ SWIG_LIB="$(HOST_DIR)/usr/share/swig/$(SWIG_VERSION)/"
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -PATCH 3/4 package/libsemanage: Add host-audit as a dependency.
Quoted 10 lines · Baruch Siach
Hi Adam,
Quoted 1 line · Adam Duskett
policycoreutils requires libsemanage to be compiled as a host package.
This does not explain why you add host-audit as a dependency of host-libsemanage.
baruch
libsemanage requires audit as a dependency.
Thus; host-libsemanage requires host-audit as a dependency.
Quoted 23 lines
Quoted 10 lines
Signed-off-by Adam Duskett <[email protected]>--- package/libsemanage/libsemanage.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/libsemanage/libsemanage.mk +0
-0package/libsemanage/libsemanage.mk define LIBSEMANAGE_INSTALL_TARGET_CMDS · line 33
Quoted 8 lines
package/libsemanage/libsemanage.mk +1
-1@@ -27,7 +27,7 @@ define LIBSEMANAGE_INSTALL_TARGET_CMDS $(MAKE) -C $(@D) $(LIBSEMANAGE_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install endef -HOST_LIBSEMANAGE_DEPENDENCIES = host-bison host-libsepol host-libselinux \ +HOST_LIBSEMANAGE_DEPENDENCIES = host-bison host-audit host-libsepol host-libselinux \ host-ustr host-bzip2 host-swig HOST_LIBSEMANAGE_MAKE_OPTS += $(HOST_CONFIGURE_OPTS) \ SWIG_LIB="$(HOST_DIR)/usr/share/swig/$(SWIG_VERSION)/"--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
PATCH 3/4 package/libsemanage: Add host-audit as a dependency.
Hello,
Quoted 7 lines · Adam Duskett
Quoted 5 lines
This does not explain why you add host-audit as a dependency of host-libsemanage.
baruch
libsemanage requires audit as a dependency.
Thus; host-libsemanage requires host-audit as a dependency.
This is not that clear: for numerous packages we have different dependencies between the target variant and the host variant. For the target variant, we provide the possibility of using numerous features. However, for the host variant, we generally enable the minimal amount of features.
So we really need a better justification.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v13 4/4 policycoreutils: new package
In reply to Adam DuskettThis package contains the core policy utilities that are required for basic operation of an SELinux system.
This package was updated to work with version 2.5.
---
Changes v12 - v13:
- Updated to work with version 2.5
Changes v11 -> v12:
- splitted DESTDIR and CFLAGS patches into three patches( DESTDIR,PREFIX and removal of ARCH).
Changes v10 -> v11:
- Removed LDFLAGS="-Wl,-rpath,$(HOST_DIR)/usr/lib" as it is overriding LDFLAGS.
- Removed patch PREFIX number in the subject line .
- Replaced line LDFLAGS="-Wl,-rpath,$(HOST_DIR)/usr/lib" with LDFLAGS="$(HOST_LDFLAGS)".
- Added patch to disable dbuslib flags in policycoreutils .
- Added libglib2 dependency for restorecond.
Changes v9 -> v10:
- Added LDFLAGS for HOST_POLICYCOREUTILS_MAKE_OPTS:LDFLAGS="-Wl,-rpath,$(HOST_DIR)/usr/lib"
Changes v8 -> v9:
- Cleaned up DESTDIR references in patches to use PREFIX instead (suggested by Samuel)
- Added the use of the ARCH to pass the host and target architectures to the build (Suggested by Samuel)
Changes v7 -> v8:
- Cleaned up indentations in policycoreutils.mk (Suggested by Thomas P.)
- Fixed sed separator (Suggested by Thomas P.)
- Cleaned up cross compile patches and make options (Suggested by Thomas P.)
- Changed dbus-glib dependency to a select and cleaned up the dependencies (Suggested by Thomas P.)
Changes v6 -> v7:
- No changes
Changes v5 -> v6:
- No changes
Changes v4 -> v5:
- Updated depends and removed glibc dependency (Matt W.)
- Updated site to github (Matt W.)
- Added host python 2/3 support (Matt W.)
- Removed sandbox and mctrans support (Matt W.)
- Removed restorcon init script (Matt W.)
- Agree as optional settings were removed so menu isn't needed (Suggested by Ryan B. and Thomas P.)
- added Config.in select for LIBCAP_NG (Suggested by Thomas P.)
- cleaned up pam/audit ifeq (Suggested by Thomas P.)
- fixed CFLAGS to include target_cflags instead of += (Suggested by Thomas P.)
- Refactored lists of build/install steps into loops (Suggested by Thomas P.)
- Removed += on first host depends assignment (Suggested by Thomas P.)
- Refactored host make opts assignments (Suggested by Thomas P.)
- Limited to glibc because of fts.h, some uclibc toolchains have it others don't. Eventually this would be good to fix with the updated method of file traversal. (Matt W.)
- Gettext fixups for uclibc support. Counter productive as we now limit to glibc only. (Matt W.)
- Added musl as possible lib type (Matt W.)
- Removed largefile dependency (Clayton S.)
- Changed dbus-glib select to a depends on in the Config.in (suggested by Ryan B.)
Changes v3 -> v4:
- Add a select for the libselinux Python bindings when debugging is enabled. This will cause Python to be built for the target (suggested by Thomas P.)
- Cleaned up the configure comments (suggested by Thomas).
- Added a dependency on BR2_USE_MMU for the debugging option because python requires it (suggested by Thomas P.)
- Removed the dependencies on audit and linux-pam. Both packages are now optional dependencies based on whether or not the package has been selected
- Moved the dependency on dbus-glib to only the restorecond option where it is used
- Added a INSTALL_INIT_SYSV for the restorecond daemon rather than just installing it directly
- Adding a dependency on glibc
- Removed the clean commands
Changes v2 -> v3:
- Added dependencies on BR2_TOOLCHAIN_HAS_THREADS and BR2_LARGEFILE (suggested by Thomas P.)
- Changes patch naming convention (suggested by Thomas P.)
- Added selects for linux-pam and audit
Changes v1 -> v2:
- General cleanup to the mk file to conform to the standard format
- Fixed the patch naming to avoid using the version number
- Cleaned up the patch to include a signed-off-by line
- Changed package dependencies into selects in the config
...IR-to-all-paths-that-use-an-absolute-path.patch | 131 +++++++++++++ .../0002-Add-PREFIX-to-host-paths.patch | 211 +++++++++++++++++++++ .../0003-Remove-hardcoded-arch-variable.patch | 43 +++++ ...licy-python-install-arguments-to-be-a-var.patch | 42 ++++ .../0005-Check-to-see-if-DBUS-is-enabled.patch | 56 ++++++ package/policycoreutils/Config.in | 59 ++++++ package/policycoreutils/policycoreutils.hash | 2 + package/policycoreutils/policycoreutils.mk | 111 +++++++++++ 8 files changed, 655 insertions(+) create mode 100644 package/policycoreutils/0001-Add-DESTDIR-to-all-paths-that-use-an-absolute-path.patch create mode 100644 package/policycoreutils/0002-Add-PREFIX-to-host-paths.patch create mode 100644 package/policycoreutils/0003-Remove-hardcoded-arch-variable.patch create mode 100644 package/policycoreutils/0004-Change-sepolicy-python-install-arguments-to-be-a-var.patch create mode 100644 package/policycoreutils/0005-Check-to-see-if-DBUS-is-enabled.patch create mode 100644 package/policycoreutils/Config.in create mode 100644 package/policycoreutils/policycoreutils.hash create mode 100644 package/policycoreutils/policycoreutils.mk
package/policycoreutils/0001-Add-DESTDIR-to-all-paths-that-use-an-absolute-path.patch new file +131 -0
@@ -0,0 +1,131 @@ +The addition of this patch makes the use of DESTDIR +mandatory as there are conditional checks which would fail if it's not +defined. + +This patch was updated from the patch provided by Niranjan Reddy to +accomodate version 2.5 + +Signed-off-by: Clayton Shotwell <[email protected]> +Signed-off-by: Niranjan Reddy <[email protected]> +Signed-off-by: Adam Duskett <[email protected]> +Signed-off-by: Adam Duskett <[email protected]> +--- + policycoreutils/Makefile | 2 +- + policycoreutils/newrole/Makefile | 4 ++-- + policycoreutils/restorecond/Makefile | 5 +++-- + policycoreutils/run_init/Makefile | 4 ++-- + policycoreutils/sepolicy/Makefile | 2 +- + policycoreutils/sestatus/Makefile | 2 +- + policycoreutils/setfiles/Makefile | 4 ++-- + 7 files changed, 12 insertions(+), 11 deletions(-) + +diff --git a/Makefile b/Makefile +index 962ac12..0634a2a 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init sandbox secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll + +-INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null) ++INOTIFYH = $(shell ls $(DESTDIR)/usr/include/sys/inotify.h 2>/dev/null) + + ifeq (${INOTIFYH}, /usr/include/sys/inotify.h) + SUBDIRS += restorecond +diff --git a/newrole/Makefile b/newrole/Makefile +index 646cd4d..f124a6a 100644 +--- a/newrole/Makefile ++++ b/newrole/Makefile +@@ -4,8 +4,8 @@ BINDIR ?= $(PREFIX)/bin + MANDIR ?= $(PREFIX)/share/man + ETCDIR ?= $(DESTDIR)/etc + LOCALEDIR = /usr/share/locale +-PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null) +-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null) ++PAMH = $(shell ls $(DESTDIR)/usr/include/security/pam_appl.h 2>/dev/null) ++AUDITH = $(shell ls $(DESTDIR)/usr/include/libaudit.h 2>/dev/null) + # Enable capabilities to permit newrole to generate audit records. + # This will make newrole a setuid root program. + # The capabilities used are: CAP_AUDIT_WRITE. +diff --git a/restorecond/Makefile b/restorecond/Makefile +index f99e1e7..92a4a4d 100644 +--- a/restorecond/Makefile ++++ b/restorecond/Makefile +@@ -11,11 +11,12 @@ autostart_DATA = sealertauto.desktop + INITDIR ?= $(DESTDIR)/etc/rc.d/init.d + SELINUXDIR = $(DESTDIR)/etc/selinux + +-DBUSFLAGS = -DHAVE_DBUS -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/lib/dbus-1.0/include ++DBUSFLAGS = -DHAVE_DBUS -I$(DESTDIR)/usr/include/dbus-1.0 -I$(DESTDIR)/usr/lib64/dbus-1.0/include -I$(DESTDIR)/usr/lib/dbus-1.0/include + DBUSLIB = -ldbus-glib-1 -ldbus-1 + + CFLAGS ?= -g -Werror -Wall -W +-override CFLAGS += -I$(PREFIX)/include $(DBUSFLAGS) -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib/glib-2.0/include ++override CFLAGS += -I$(DESTDIR)/usr/include $(DBUSFLAGS) -I$(DESTDIR)/usr/include/glib-2.0 \ ++-I$(DESTDIR)/usr/lib64/glib-2.0/include -I$(DESTDIR)/usr/lib/glib-2.0/include + + LDLIBS += -lselinux $(DBUSLIB) -lglib-2.0 -L$(LIBDIR) + +diff --git a/run_init/Makefile b/run_init/Makefile +index 5815a08..c81179b 100644 +--- a/run_init/Makefile ++++ b/run_init/Makefile +@@ -5,8 +5,8 @@ SBINDIR ?= $(PREFIX)/sbin + MANDIR ?= $(PREFIX)/share/man + ETCDIR ?= $(DESTDIR)/etc + LOCALEDIR ?= /usr/share/locale +-PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null) +-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null) ++PAMH = $(shell ls $(DESTDIR)/usr/include/security/pam_appl.h 2>/dev/null) ++AUDITH = $(shell ls $(DESTDIR)/usr/include/libaudit.h 2>/dev/null) + + CFLAGS ?= -Werror -Wall -W + override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\"" +diff --git a/sepolicy/Makefile b/sepolicy/Makefile +index 39d46e8..6624373 100644 +--- a/sepolicy/Makefile ++++ b/sepolicy/Makefile +@@ -12,7 +12,7 @@ LOCALEDIR ?= /usr/share/locale + BASHCOMPLETIONDIR ?= $(DESTDIR)/usr/share/bash-completion/completions + SHAREDIR ?= $(PREFIX)/share/sandbox + CFLAGS ?= -Wall -Werror -Wextra -W +-override CFLAGS += -I$(PREFIX)/include -DPACKAGE="policycoreutils" -DSHARED -shared ++override CFLAGS = $(LDFLAGS) -I$(DESTDIR)/usr/include -DPACKAGE="policycoreutils" -Wall -Werror -Wextra -W -DSHARED -shared + + BASHCOMPLETIONS=sepolicy-bash-completion.sh + +diff --git a/sestatus/Makefile b/sestatus/Makefile +index c04ff00..e10c32c 100644 +--- a/sestatus/Makefile ++++ b/sestatus/Makefile +@@ -6,7 +6,7 @@ ETCDIR ?= $(DESTDIR)/etc + LIBDIR ?= $(PREFIX)/lib + + CFLAGS ?= -Werror -Wall -W +-override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64 ++override CFLAGS += -I$(DESTDIR)/usr/include -D_FILE_OFFSET_BITS=64 + LDLIBS = -lselinux -L$(LIBDIR) + + all: sestatus +diff --git a/setfiles/Makefile b/setfiles/Makefile +index 98f4f7d..eb26ed0 100644 +--- a/setfiles/Makefile ++++ b/setfiles/Makefile +@@ -3,13 +3,13 @@ PREFIX ?= $(DESTDIR)/usr + SBINDIR ?= $(DESTDIR)/sbin + MANDIR = $(PREFIX)/share/man + LIBDIR ?= $(PREFIX)/lib +-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null) ++AUDITH = $(shell ls $(DESTDIR)/usr/include/libaudit.h 2>/dev/null) + + PROGRESS_STEP=$(shell grep "^\#define STAR_COUNT" restore.h | awk -S '{ print $$3 }') + ABORT_ON_ERRORS=$(shell grep "^\#define ABORT_ON_ERRORS" setfiles.c | awk -S '{ print $$3 }') + + CFLAGS ?= -g -Werror -Wall -W +-override CFLAGS += -I$(PREFIX)/include ++override CFLAGS += -I$(DESTDIR)/usr/include + LDLIBS = -lselinux -lsepol -L$(LIBDIR) + + ifeq ($(AUDITH), /usr/include/libaudit.h) +-- +2.7.4 +
package/policycoreutils/0002-Add-PREFIX-to-host-paths.patch new file +211 -0
211 lines not on this page · raw message
package/policycoreutils/0003-Remove-hardcoded-arch-variable.patch new file +43 -0
43 lines not on this page · raw message
package/policycoreutils/0004-Change-sepolicy-python-install-arguments-to-be-a-var.patch new file +42 -0
42 lines not on this page · raw message
package/policycoreutils/0005-Check-to-see-if-DBUS-is-enabled.patch new file +56 -0
56 lines not on this page · raw message
package/policycoreutils/Config.in new file +59 -0
59 lines not on this page · raw message
package/policycoreutils/policycoreutils.hash new file +2 -0
@@ -0,0 +1,2 @@ +# https://github.com/SELinuxProject/selinux/wiki/Releases +sha256 329382cfe9fa977678abf541dcd8fe3847cf0c83b24654c8f7322343907078a1 policycoreutils-2.5.tar.gz
package/policycoreutils/policycoreutils.mk new file +111 -0
111 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 1/4 package/audit: Allow Host compilation.
In reply to Adam DuskettHello,
Quoted 3 lines · Adam Duskett
Policycoreutils requires audit as a host package.
Signed-off-by Adam Duskett <[email protected]>
Please use lower-case in the commit title:
package/audit: allow host compilation
or better:
package/audit: add support for host variant
package/audit/audit.mk define AUDIT_INSTALL_CLEANUP · line 63
Quoted 3 lines
package/audit/audit.mk +3
-0+HOST_AUDIT_CONF_OPTS = --without-python --without-python3 --disable-zos-remote +ifeq ($(BR2_PACKAGE_LIBCAP_NG),y) +HOST_AUDIT_DEPENDENCIES += host-libcap-ng
This is just plain wrong, and I already explained why. BR2_PACKAGE_LIBCAP_NG indicates if the *target* variant of libcap-ng is enabled or not. It doesn't say anything about whether you should or not use the host variant.
So basically, you should choose if host-audit should unconditionally use host-libcap-ng, or if it should not use it at all.
Unless there is a link between the availability of libcap-ng on the target and the need to have libcap-ng support in host-audit. But in this case, a big comment in the .mk file is needed to explain this link.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com