diff options
| author | Joshua Lock <joshua.lock@collabora.co.uk> | 2015-09-04 15:59:39 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-06 15:26:19 +0100 |
| commit | cf5704eae78a0bba048a82bbaf6c125f52541641 (patch) | |
| tree | 901e2f11e602046089b7c045100c014a3aac0ccc | |
| parent | ef0fe3193eb546757f7c98274b88c4f2eafd7ad0 (diff) | |
| download | poky-cf5704eae78a0bba048a82bbaf6c125f52541641.tar.gz | |
busybox: fixes for when base_bindir != /bin
* Replace all hard-coded paths with variables
* Run sed over busybox.links.* to replace /bin with ${base_bindir}
(From OE-Core rev: c61463a45441315b0006a28bb9f6069a393a8309)
Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-core/busybox/busybox.inc | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc index 0769d92c50..ed8f9fe766 100644 --- a/meta/recipes-core/busybox/busybox.inc +++ b/meta/recipes-core/busybox/busybox.inc | |||
| @@ -178,6 +178,9 @@ do_install () { | |||
| 178 | if [ "${base_sbindir}" != "/sbin" ]; then | 178 | if [ "${base_sbindir}" != "/sbin" ]; then |
| 179 | sed -i "s:^/sbin/:${base_sbindir}/:" busybox.links* | 179 | sed -i "s:^/sbin/:${base_sbindir}/:" busybox.links* |
| 180 | fi | 180 | fi |
| 181 | if [ "${base_bindir}" != "/bin" ]; then | ||
| 182 | sed -i "s:^/bin/:${base_bindir}/:" busybox.links* | ||
| 183 | fi | ||
| 181 | 184 | ||
| 182 | install -d ${D}${sysconfdir}/init.d | 185 | install -d ${D}${sysconfdir}/init.d |
| 183 | 186 | ||
| @@ -338,10 +341,10 @@ python do_package_prepend () { | |||
| 338 | return | 341 | return |
| 339 | 342 | ||
| 340 | if os.path.exists('%s/etc/busybox.links' % (dvar)): | 343 | if os.path.exists('%s/etc/busybox.links' % (dvar)): |
| 341 | set_alternative_vars("/etc/busybox.links", "/bin/busybox") | 344 | set_alternative_vars("${sysconfdir}/busybox.links", "${base_bindir}/busybox") |
| 342 | else: | 345 | else: |
| 343 | set_alternative_vars("/etc/busybox.links.nosuid", "/bin/busybox.nosuid") | 346 | set_alternative_vars("${sysconfdir}/busybox.links.nosuid", "${base_bindir}/busybox.nosuid") |
| 344 | set_alternative_vars("/etc/busybox.links.suid", "/bin/busybox.suid") | 347 | set_alternative_vars("${sysconfdir}/busybox.links.suid", "${base_bindir}/busybox.suid") |
| 345 | } | 348 | } |
| 346 | 349 | ||
| 347 | pkg_postinst_${PN} () { | 350 | pkg_postinst_${PN} () { |
| @@ -353,22 +356,22 @@ pkg_postinst_${PN} () { | |||
| 353 | if test "x$D" = "x"; then | 356 | if test "x$D" = "x"; then |
| 354 | # Remove busybox.nosuid if it's a symlink, because this situation indicates | 357 | # Remove busybox.nosuid if it's a symlink, because this situation indicates |
| 355 | # that we're installing or upgrading to a one-binary busybox. | 358 | # that we're installing or upgrading to a one-binary busybox. |
| 356 | if test -h /bin/busybox.nosuid; then | 359 | if test -h ${base_bindir}/busybox.nosuid; then |
| 357 | rm -f /bin/busybox.nosuid | 360 | rm -f ${base_bindir}/busybox.nosuid |
| 358 | fi | 361 | fi |
| 359 | for suffix in "" ".nosuid" ".suid"; do | 362 | for suffix in "" ".nosuid" ".suid"; do |
| 360 | if test -e /etc/busybox.links$suffix; then | 363 | if test -e ${sysconfdir}/busybox.links$suffix; then |
| 361 | while read link; do | 364 | while read link; do |
| 362 | if test ! -e "$link"; then | 365 | if test ! -e "$link"; then |
| 363 | case "$link" in | 366 | case "$link" in |
| 364 | /*/*/*) | 367 | /*/*/*) |
| 365 | to="../../bin/busybox$suffix" | 368 | to="../..${base_bindir}/busybox$suffix" |
| 366 | ;; | 369 | ;; |
| 367 | /bin/*) | 370 | /bin/*) |
| 368 | to="busybox$suffix" | 371 | to="busybox$suffix" |
| 369 | ;; | 372 | ;; |
| 370 | /*/*) | 373 | /*/*) |
| 371 | to="../bin/busybox$suffix" | 374 | to="..${base_bindir}/busybox$suffix" |
| 372 | ;; | 375 | ;; |
| 373 | esac | 376 | esac |
| 374 | # we can use busybox here because even if we are using splitted busybox | 377 | # we can use busybox here because even if we are using splitted busybox |
| @@ -376,7 +379,7 @@ pkg_postinst_${PN} () { | |||
| 376 | busybox rm -f $link | 379 | busybox rm -f $link |
| 377 | busybox ln -s $to $link | 380 | busybox ln -s $to $link |
| 378 | fi | 381 | fi |
| 379 | done < /etc/busybox.links$suffix | 382 | done < ${sysconfdir}/busybox.links$suffix |
| 380 | fi | 383 | fi |
| 381 | done | 384 | done |
| 382 | fi | 385 | fi |
| @@ -387,19 +390,19 @@ pkg_prerm_${PN} () { | |||
| 387 | # providing its files, this will make update-alternatives work, but the update-rc.d part | 390 | # providing its files, this will make update-alternatives work, but the update-rc.d part |
| 388 | # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh | 391 | # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh |
| 389 | tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX` | 392 | tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX` |
| 390 | ln -s /bin/busybox $tmpdir/[ | 393 | ln -s ${base_bindir}/busybox $tmpdir/[ |
| 391 | ln -s /bin/busybox $tmpdir/test | 394 | ln -s ${base_bindir}/busybox $tmpdir/test |
| 392 | ln -s /bin/busybox $tmpdir/head | 395 | ln -s ${base_bindir}/busybox $tmpdir/head |
| 393 | ln -s /bin/busybox $tmpdir/sh | 396 | ln -s ${base_bindir}/busybox $tmpdir/sh |
| 394 | ln -s /bin/busybox $tmpdir/basename | 397 | ln -s ${base_bindir}/busybox $tmpdir/basename |
| 395 | ln -s /bin/busybox $tmpdir/echo | 398 | ln -s ${base_bindir}/busybox $tmpdir/echo |
| 396 | ln -s /bin/busybox $tmpdir/mv | 399 | ln -s ${base_bindir}/busybox $tmpdir/mv |
| 397 | ln -s /bin/busybox $tmpdir/ln | 400 | ln -s ${base_bindir}/busybox $tmpdir/ln |
| 398 | ln -s /bin/busybox $tmpdir/dirname | 401 | ln -s ${base_bindir}/busybox $tmpdir/dirname |
| 399 | ln -s /bin/busybox $tmpdir/rm | 402 | ln -s ${base_bindir}/busybox $tmpdir/rm |
| 400 | ln -s /bin/busybox $tmpdir/sed | 403 | ln -s ${base_bindir}/busybox $tmpdir/sed |
| 401 | ln -s /bin/busybox $tmpdir/sort | 404 | ln -s ${base_bindir}/busybox $tmpdir/sort |
| 402 | ln -s /bin/busybox $tmpdir/grep | 405 | ln -s ${base_bindir}/busybox $tmpdir/grep |
| 403 | export PATH=$PATH:$tmpdir | 406 | export PATH=$PATH:$tmpdir |
| 404 | } | 407 | } |
| 405 | 408 | ||
| @@ -407,7 +410,7 @@ pkg_prerm_${PN}-syslog () { | |||
| 407 | # remove syslog | 410 | # remove syslog |
| 408 | if test "x$D" = "x"; then | 411 | if test "x$D" = "x"; then |
| 409 | if test "$1" = "upgrade" -o "$1" = "remove"; then | 412 | if test "$1" = "upgrade" -o "$1" = "remove"; then |
| 410 | /etc/init.d/syslog stop | 413 | ${sysconfdir}/init.d/syslog stop |
| 411 | fi | 414 | fi |
| 412 | fi | 415 | fi |
| 413 | } | 416 | } |
