mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH v2 1/3] busybox: don't install /sbin/init link if busybox is not the initmethod
Date: Wed, 22 Aug 2018 10:27:49 +0200	[thread overview]
Message-ID: <20180822082751.7486-2-m.grzeschik@pengutronix.de> (raw)
In-Reply-To: <20180822082751.7486-1-m.grzeschik@pengutronix.de>

This patch fixes the case where we use other initmethod then busybox and
want to enable the applet, but don't want to install the link. This is
useful to create busybox based lxc containers.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
v1 -> v2: - fixed typo in BUSYBOX_RM_TEMPLATE
          - made variable set early with :=

 rules/busybox.make | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/rules/busybox.make b/rules/busybox.make
index 28d61f5ef..4c5e19b14 100644
--- a/rules/busybox.make
+++ b/rules/busybox.make
@@ -92,6 +92,13 @@ endif
 # Target-Install
 # ----------------------------------------------------------------------------
 
+BUSYBOX_APPLETS_ = $(shell cat $(BUSYBOX_PKGDIR)/etc/busybox.links)
+
+ifndef PTXCONF_INITMETHOD_BBINIT
+BUSYBOX_RM_TEMPLATE := /sbin/init
+endif
+BUSYBOX_APPLETS = $(filter-out $(BUSYBOX_RM_TEMPLATE),$(BUSYBOX_APPLETS_))
+
 $(STATEDIR)/busybox.targetinstall:
 	@$(call targetinfo)
 
@@ -107,7 +114,7 @@ ifdef PTXCONF_BUSYBOX_FEATURE_INDIVIDUAL
 #
 	@$(call install_lib, busybox, 0, 0, 0644, libbusybox)
 
-	@cat $(BUSYBOX_PKGDIR)/etc/busybox.links | while read link; do \
+	@for link in $(BUSYBOX_APPLETS); do    \
 		$(call install_copy, busybox, 0, 0, 755, \
 		"$(BUSYBOX_PKGDIR)/usr/lib/busybox/$${link##*/}", "/usr$${link}"); \
 	done
@@ -123,7 +130,7 @@ endif
 else
 	@$(call install_copy, busybox, 0, 0, 755, -, /usr/bin/busybox)
 endif
-	@cat $(BUSYBOX_PKGDIR)/etc/busybox.links | while read link; do		\
+	@for link in $(BUSYBOX_APPLETS);  do					\
 		case "$${link}" in						\
 		/bin/*) to="busybox" ;;						\
 		/*/*)	 to="../bin/busybox" ;;					\
-- 
2.18.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2018-08-22  8:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-22  8:27 [ptxdist] [PATCH v2 0/3] lxc: add support Michael Grzeschik
2018-08-22  8:27 ` Michael Grzeschik [this message]
2018-08-22  9:20   ` [ptxdist] [PATCH v2 1/3] busybox: don't install /sbin/init link if busybox is not the initmethod Uwe Kleine-König
2018-08-22  8:27 ` [ptxdist] [PATCH v2 2/3] lxc: add new package Michael Grzeschik
2018-08-27  9:52   ` Michael Grzeschik
2018-08-22  8:27 ` [ptxdist] [PATCH v2 3/3] host-lxc: add new hostside package Michael Grzeschik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180822082751.7486-2-m.grzeschik@pengutronix.de \
    --to=m.grzeschik@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox