policycoreutils: fix host utils rpath and bin directory

'setfiles' and others should be installed to $(STAGING_DIR_HOSTPKG)/bin
rather than $(...)/sbin which isn't in PATH.
Also using -Wl,-rpath to set library search location instead of setting
LD_LIBRARY_PATH when calling setfiles in image.mk.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle 2020-09-27 17:10:34 +01:00
parent 96023cd4ba
commit e8b34880f9
2 changed files with 7 additions and 6 deletions

View File

@ -243,8 +243,7 @@ endef
ifeq ($(CONFIG_TARGET_ROOTFS_SECURITY_LABELS),y) ifeq ($(CONFIG_TARGET_ROOTFS_SECURITY_LABELS),y)
define Image/mkfs/squashfs define Image/mkfs/squashfs
echo "LD_LIBRARY_PATH=\$$LD_LIBRARY_PATH:$(STAGING_DIR_HOSTPKG)/lib" \ echo "$(STAGING_DIR_HOSTPKG)/bin/setfiles -r" \
"$(STAGING_DIR_HOSTPKG)/sbin/setfiles -r" \
"$(call mkfs_target_dir,$(1))" \ "$(call mkfs_target_dir,$(1))" \
"$(call mkfs_target_dir,$(1))/etc/selinux/targeted/contexts/files/file_contexts " \ "$(call mkfs_target_dir,$(1))/etc/selinux/targeted/contexts/files/file_contexts " \
"$(call mkfs_target_dir,$(1))" > $@.fakeroot-script "$(call mkfs_target_dir,$(1))" > $@.fakeroot-script

View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=policycoreutils PKG_NAME:=policycoreutils
PKG_VERSION:=3.1 PKG_VERSION:=3.1
PKG_RELEASE:=3 PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/20200710 PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/20200710
@ -67,9 +67,11 @@ MAKE_FLAGS += \
HOST_MAKE_FLAGS += \ HOST_MAKE_FLAGS += \
PAMH=$(CONFIG_BUSYBOX_CONFIG_PAM) \ PAMH=$(CONFIG_BUSYBOX_CONFIG_PAM) \
PREFIX=$(STAGING_DIR_HOSTPKG) \ DESTDIR=$(STAGING_DIR_HOSTPKG) \
SBINDIR=$(STAGING_DIR_HOSTPKG)/sbin \ PREFIX= \
ETCDIR=$(STAGING_DIR_HOSTPKG)/etc SBINDIR=/bin
HOST_LDFLAGS += -Wl,-rpath=$(STAGING_DIR_HOSTPKG)/lib
$(eval $(foreach a,$(DIR_SBIN),ALTS_$(a):=300:/sbin/$(a):/sbin/policycoreutils-$(a)$(newline))) $(eval $(foreach a,$(DIR_SBIN),ALTS_$(a):=300:/sbin/$(a):/sbin/policycoreutils-$(a)$(newline)))
$(eval $(foreach a,$(DIR_USR_BIN),ALTS_$(a):=300:/usr/bin/$(a):/usr/bin/policycoreutils-$(a)$(newline))) $(eval $(foreach a,$(DIR_USR_BIN),ALTS_$(a):=300:/usr/bin/$(a):/usr/bin/policycoreutils-$(a)$(newline)))