83875effcf
SELinux requires a config file in /etc/selinux which controls the state of SELinux on the system. This config file has two options set in it: SELINUX which set's the state of selinux on boot. SELINUXTYPE which should equal the name of the policy. In this case, the default name is targeted. This patch adds: - A choice menu on Config.in that allows the user to select a default SELinux state. - A basic config file that will be installed to target/etc/selinux and will set SELINUX= to the selected state. Signed-off-by: Adam Duskett <Adamduskett@outlook.com> Acked-by: Matt Weber <matthew.weber@rockwellcollins.com> [Thomas: - rename option to BR2_PACKAGE_REFPOLICY_POLICY_STATE - qstrip the variable - drop unused REFPOLICY_NAME variable.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
62 lines
1.8 KiB
Makefile
62 lines
1.8 KiB
Makefile
################################################################################
|
|
#
|
|
# refpolicy
|
|
#
|
|
################################################################################
|
|
|
|
REFPOLICY_VERSION = RELEASE_2_20170204
|
|
|
|
# Do not use GitHub helper as git submodules are needed for refpolicy-contrib
|
|
REFPOLICY_SITE = https://github.com/TresysTechnology/refpolicy.git
|
|
REFPOLICY_SITE_METHOD = git
|
|
REFPOLICY_GIT_SUBMODULES = y # Required for refpolicy-contrib
|
|
REFPOLICY_LICENSE = GPL-2.0
|
|
REFPOLICY_LICENSE_FILES = COPYING
|
|
REFPOLICY_INSTALL_STAGING = YES
|
|
REFPOLICY_DEPENDENCIES = \
|
|
host-m4 \
|
|
host-checkpolicy \
|
|
host-policycoreutils \
|
|
host-setools \
|
|
host-gawk \
|
|
host-python \
|
|
policycoreutils
|
|
|
|
# Cannot use multiple threads to build the reference policy
|
|
REFPOLICY_MAKE = \
|
|
TEST_TOOLCHAIN=$(HOST_DIR) \
|
|
PYTHON="$(HOST_DIR)/usr/bin/python2" \
|
|
$(TARGET_MAKE_ENV) \
|
|
$(MAKE1)
|
|
|
|
REFPOLICY_POLICY_VERSION = \
|
|
$(call qstrip,$(BR2_PACKAGE_REFPOLICY_POLICY_VERSION))
|
|
REFPOLICY_POLICY_STATE = \
|
|
$(call qstrip,$(BR2_PACKAGE_REFPOLICY_POLICY_STATE))
|
|
|
|
define REFPOLICY_CONFIGURE_CMDS
|
|
$(SED) "/OUTPUT_POLICY/c\OUTPUT_POLICY = $(REFPOLICY_POLICY_VERSION)" \
|
|
$(@D)/build.conf
|
|
$(SED) "/MONOLITHIC/c\MONOLITHIC = y" $(@D)/build.conf
|
|
$(SED) "/NAME/c\NAME = targeted" $(@D)/build.conf
|
|
endef
|
|
|
|
define REFPOLICY_BUILD_CMDS
|
|
$(REFPOLICY_MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) bare conf
|
|
endef
|
|
|
|
define REFPOLICY_INSTALL_STAGING_CMDS
|
|
$(REFPOLICY_MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) \
|
|
install-src install-headers
|
|
endef
|
|
|
|
define REFPOLICY_INSTALL_TARGET_CMDS
|
|
$(REFPOLICY_MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
|
|
$(INSTALL) -m 0755 -D package/refpolicy/config \
|
|
$(TARGET_DIR)/etc/selinux/config
|
|
$(SED) "/^SELINUX=/c\SELINUX=$(REFPOLICY_POLICY_STATE)" \
|
|
$(TARGET_DIR)/etc/selinux/config
|
|
endef
|
|
|
|
$(eval $(generic-package))
|