[openwrt/openwrt] Revert "refpolicy: add variant that builds modular policy"

LEDE Commits lede-commits at lists.infradead.org
Sun Nov 22 10:22:49 EST 2020


dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6e9b707ee2bd06c180e9acc5224a671f2177b57e

commit 6e9b707ee2bd06c180e9acc5224a671f2177b57e
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sun Nov 22 15:20:35 2020 +0000

    Revert "refpolicy: add variant that builds modular policy"
    
    This reverts commit 9eb9943f82e0b2d5e32ffe1c63f5a82caca5094d.
    Building the 'modular' variant requires 'semodule_package' from
    'selinux-python' to be installed on the buildhost.
    Apart from that, this change also broke the monolithic refpolicy
    'targeted' build.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 config/Config-build.in            |  6 ------
 package/system/refpolicy/Makefile | 35 ++---------------------------------
 2 files changed, 2 insertions(+), 39 deletions(-)

diff --git a/config/Config-build.in b/config/Config-build.in
index 178afbdb94..8e12199cbd 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -362,12 +362,6 @@ menu "Global build settings"
 			help
 			  SELinux Reference Policy (refpolicy)
 
-		config SELINUXTYPE_targeted-modular
-			bool "targeted-modular"
-			select PACKAGE_refpolicy-modular
-			help
-			  Modular SELinux Reference Policy (refpolicy-modular)
-
 		config SELINUXTYPE_dssp
 			bool "dssp"
 			select PACKAGE_selinux-policy
diff --git a/package/system/refpolicy/Makefile b/package/system/refpolicy/Makefile
index d9c8c90208..a431770955 100644
--- a/package/system/refpolicy/Makefile
+++ b/package/system/refpolicy/Makefile
@@ -24,7 +24,7 @@ TAR_OPTIONS:=--transform='s%^refpolicy%$(PKG_NAME)-$(PKG_VERSION)%' -xf -
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/refpolicy/Default
+define Package/refpolicy
   SECTION:=system
   CATEGORY:=Base system
   TITLE:=SELinux reference policy
@@ -32,19 +32,6 @@ define Package/refpolicy/Default
   PKGARCH:=all
 endef
 
-define Package/refpolicy
-  $(call Package/refpolicy/Default)
-  CONFLICTS:=refpolicy-modular
-  VARIANT:=default
-endef
-
-define Package/refpolicy-modular
-  $(call Package/refpolicy/Default)
-  TITLE += (modular)
-  VARIANT:=modular
-  PROVIDES:=refpolicy
-endef
-
 define Package/refpolicy/description
 	The SELinux Reference Policy project (refpolicy) is a
 	complete SELinux policy that can be used as the system
@@ -69,43 +56,25 @@ endef
 # builds is a small host tool that gets run as part of the build
 # process.
 MAKE_FLAGS += \
-	DESTDIR="$(PKG_INSTALL_DIR)"
 	SETFILES="$(STAGING_DIR_HOST)/bin/setfiles" \
 	CHECKPOLICY="$(STAGING_DIR_HOSTPKG)/bin/checkpolicy" \
 	CC="$(HOSTCC)" \
 	CFLAGS="$(HOST_CFLAGS)"
 
 define Build/Configure
-	$(SED) "/NAME/c\NAME = targeted" $(PKG_BUILD_DIR)/build.conf
-ifneq ($(BUILD_VARIANT),modular)
 	$(SED) "/MONOLITHIC/c\MONOLITHIC = y" $(PKG_BUILD_DIR)/build.conf
-endif
+	$(SED) "/NAME/c\NAME = targeted" $(PKG_BUILD_DIR)/build.conf
 	$(call Build/Compile/Default,conf)
 endef
 
-ifeq ($(BUILD_VARIANT),modular)
-define Build/Install
-	$(call Build/Compile/Default,install install-headers)
-endef
-endif
-
 define Package/refpolicy/conffiles
 /etc/selinux/config
 endef
 
-Package/refpolicy-modular/conffiles = $(Package/refpolicy/conffiles)
-
 define Package/refpolicy/install
 	$(INSTALL_DIR) $(1)/etc/selinux
 	$(CP) $(PKG_INSTALL_DIR)/etc/selinux/* $(1)/etc/selinux/
 	$(CP) ./files/selinux-config $(1)/etc/selinux/config
-ifeq ($(BUILD_VARIANT),modular)
-	$(INSTALL_DIR) $(1)/usr/share/selinux
-	$(CP) $(PKG_INSTALL_DIR)/usr/share/selinux/* $(1)/usr/share/selinux/
-endif
 endef
 
-Package/refpolicy-modular/install = $(Package/refpolicy/install)
-
 $(eval $(call BuildPackage,refpolicy))
-$(eval $(call BuildPackage,refpolicy-modular))



More information about the lede-commits mailing list