All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] busybox: allow building when prefix is "", not "/usr".
@ 2009-05-26  3:35 Michael Smith
  2009-05-26  3:40 ` Michael Smith
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Michael Smith @ 2009-05-26  3:35 UTC (permalink / raw)
  To: openembedded-devel

There was code to handle this, but it needed a tweak to prevent copying
a directory on top of itself. Other prefixes (besides /usr) may also
work now, but this is untested.

busybox will also build when base_sbindir is "/bin" instead of "/sbin".

Signed-off-by: Michael Smith <msmith@cbnco.com>
---

For insane backwards compatibility reasons (my own fault) I would like
to be able to create packages with no /usr and /sbin == /bin. Most
autoconf packages are happy about this; busybox just needs a little
help.

btw, I have not yet figured out where ${layout_blah} vs. ${blah}
should be used (e.g. ${layout_prefix} and ${prefix}). I've tried to be
consistent, so I figure there's a 50% chance I guessed right.

 recipes/busybox/busybox.inc |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/recipes/busybox/busybox.inc b/recipes/busybox/busybox.inc
index acf47f2..04f2cf4 100644
--- a/recipes/busybox/busybox.inc
+++ b/recipes/busybox/busybox.inc
@@ -62,12 +62,15 @@ do_compile() {
 
 do_install () {
 	oe_runmake busybox.links
-	if [ "x${layout_prefix}" = "x" ]; then
-		sed 's:^/usr/:/:' < busybox.links >busybox.links.new
+	if [ "${prefix}" != "/usr" ]; then
+		sed "s:^/usr/:${prefix}/:" busybox.links > busybox.links.new
 		mv busybox.links.new busybox.links
-        elif [ "${layout_prefix}" != "/usr" ]; then
-		echo "warning, busybox.links will lose with this prefix"
 	fi
+	if [ "${base_sbindir}" != "/sbin" ]; then
+		sed "s:^/sbin/:${base_sbindir}/:" busybox.links > busybox.links.new
+		mv busybox.links.new busybox.links
+	fi
+
 	unset CFLAGS CPPFLAGS CXXFLAGS
 	install -d ${D}${sysconfdir}/init.d
 	oe_runmake "PREFIX=${D}" install
@@ -77,9 +80,11 @@ do_install () {
 	install -d ${D}/busybox
 	ls ${D} -R
 
-	for i in ${D}${base_bindir} ${D}${base_sbindir} ${D}${prefix} ; do
+	# Copy /bin and /sbin -- and /usr, if prefix is not "".
+	for i in ${D}${base_bindir} ${D}${base_sbindir} ${prefix:+${D}${prefix}}
+	do
 		if [ -d $i ]; then
-			cp -dPr $i ${D}/busybox/
+			cp -pPR $i ${D}/busybox/
 		fi
 	done
 	# Move the busybox binary back to /bin
-- 
1.5.6.5




^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2009-06-08 14:16 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-26  3:35 [PATCH] busybox: allow building when prefix is "", not "/usr" Michael Smith
2009-05-26  3:40 ` Michael Smith
2009-05-26  3:44   ` Michael Smith
2009-06-03 18:44     ` Phil Blundell
2009-06-03 19:50       ` Michael Smith
2009-06-03 20:14         ` Phil Blundell
2009-06-03 20:31           ` [PATCH 1/2] busybox: let update-alternatives create all symlinks, and use INC_PR Michael Smith
2009-06-03 20:31             ` [PATCH 2/2] busybox: Split syslog initscript into busybox-syslog Michael Smith
2009-06-05 11:27             ` [PATCH 1/2] busybox: let update-alternatives create all symlinks, and use INC_PR Phil Blundell
2009-05-26 16:01   ` [PATCH] busybox: allow building when prefix is "", not "/usr" Phil Blundell
2009-05-27  1:53     ` Michael Smith
2009-05-27 10:36       ` Phil Blundell
2009-05-26 16:16 ` Phil Blundell
2009-06-05 13:11 ` Phil Blundell
2009-06-05 13:29   ` Michael Smith
2009-06-05 13:57     ` Phil Blundell
2009-06-07 20:38       ` Michael Smith
2009-06-07 20:43         ` [PATCH] busybox: Split syslog initscript into busybox-syslog Michael Smith
2009-06-07 20:43           ` [PATCH] busybox: fix udhcpc default script location when prefix is not "/usr" Michael Smith
2009-06-08  9:39             ` Phil Blundell
2009-06-08  9:52           ` [PATCH] busybox: Split syslog initscript into busybox-syslog Phil Blundell
2009-06-08 13:24             ` Michael Smith
2009-06-08 14:06               ` Phil Blundell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.