diff mbox

Busybox libselinux dependency.

Message ID CAJ9_1op-4Ztin9kfON97ktjEiXaCXUaNiDwqzmu6gr_=xDBk8g@mail.gmail.com
State Superseded
Headers show

Commit Message

Christopher Stone March 22, 2015, 4:02 p.m. UTC
If you select the selinux applets when configuring busybox then the busybox
build fails due to a missing selinux.h file. This is because there is no
dependency on libselinux in the busybox make. The lack of dependency is
completely understandable, since there is no such dependency when a user
does not configure in the selinux applets. The attached patch adds a
libselinux dependency to the busybox make when the libselinux package has
been selected for the target. It is not unreasonable to assume that if a
user selects libselinux, then he may also select the busybox selinux
applets. Additionally, if the user has already selected libselinux for the
target, then adding a dependency to libselinx to busybox does no harm, even
if the user does not configure in the selinux applet, yet the build will
not fail if the user does select those applets.

Thus, I submit the attached patch for your consideration.

Cheers,
   Chris Stone.

Comments

Arnout Vandecappelle March 22, 2015, 4:21 p.m. UTC | #1
On 22/03/15 17:02, Christopher Stone wrote:
> If you select the selinux applets when configuring busybox then the busybox
> build fails due to a missing selinux.h file. This is because there is no
> dependency on libselinux in the busybox make. The lack of dependency is
> completely understandable, since there is no such dependency when a user does
> not configure in the selinux applets. The attached patch adds a libselinux
> dependency to the busybox make when the libselinux package has been selected for
> the target. It is not unreasonable to assume that if a user selects libselinux,
> then he may also select the busybox selinux applets. Additionally, if the user
> has already selected libselinux for the target, then adding a dependency to
> libselinx to busybox does no harm, even if the user does not configure in the
> selinux applet, yet the build will not fail if the user does select those applets.
> 
> Thus, I submit the attached patch for your consideration.

 Hi Christopher,

 Thank you for your patch. However, you have not followed the patch submission
guidelines [1] which makes the patch harder to review. I'll indicate a few
points here, but there will probably be more.

 The patch title should be:

busybox: add conditional dependency on libselinux


 The explanation you give in your mail above should be put in the commit message.


 The comment you added is a bit long, perhaps:

# The user may select the selinux support applets.
# We'll assume he's smart enough to select libselinux in that case.
ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
BUSYBOX_DEPENDENCIES += libselinux
BUSYBOX_LDFLAGS += -lselinux
endif


 Regards,
 Arnout


[1] http://nightly.buildroot.org/manual.html#submitting-patches
diff mbox

Patch

From 57aeddb884ecfc8bff18e59ae5c591e0e6280c2e Mon Sep 17 00:00:00 2001
From: Chris Stone <christopher.stone@outlook.com>
Date: Sun, 22 Mar 2015 11:34:02 -0400
Subject: [PATCH] Fix for busybox libselinux dependency.

---
 package/busybox/busybox.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index a3ac7e7..4642a0d 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -25,6 +25,14 @@  BUSYBOX_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc/
 # the non-final link of modules as well.
 BUSYBOX_CFLAGS_busybox += -ltirpc
 endif
+# If the libselinux package has been selected, then add a dependency
+# from busybox to libselinux, so that if the selinux applets are
+# selected in busybox, then libselinux will build first. This avoids
+# a missing selinux.h build time error.
+ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
+BUSYBOX_DEPENDENCIES += libselinux
+BUSYBOX_LDFLAGS += -lselinux
+endif
 
 BUSYBOX_BUILD_CONFIG = $(BUSYBOX_DIR)/.config
 # Allows the build system to tweak CFLAGS
-- 
1.9.1