diff options
-rw-r--r-- | meta/recipes-core/busybox/busybox.inc | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc index fba956ee19..95411230b9 100644 --- a/meta/recipes-core/busybox/busybox.inc +++ b/meta/recipes-core/busybox/busybox.inc | |||
@@ -171,20 +171,20 @@ do_compile() { | |||
171 | } | 171 | } |
172 | 172 | ||
173 | do_install () { | 173 | do_install () { |
174 | if [ "${prefix}" != "/usr" ]; then | 174 | sed -i "s:^/bin/:BASE_BINDIR/:" busybox.links* |
175 | sed -i "s:^/usr/:${prefix}/:" busybox.links* | 175 | sed -i "s:^/sbin/:BASE_SBINDIR/:" busybox.links* |
176 | fi | 176 | sed -i "s:^/usr/bin/:BINDIR/:" busybox.links* |
177 | if [ "${base_sbindir}" != "/sbin" ]; then | 177 | sed -i "s:^/usr/sbin/:SBINDIR/:" busybox.links* |
178 | sed -i "s:^/sbin/:${base_sbindir}/:" busybox.links* | 178 | |
179 | fi | 179 | sed -i "s:^BASE_BINDIR/:${base_bindir}/:" busybox.links* |
180 | if [ "${base_bindir}" != "/bin" ]; then | 180 | sed -i "s:^BASE_SBINDIR/:${base_sbindir}/:" busybox.links* |
181 | sed -i "s:^/bin/:${base_bindir}/:" busybox.links* | 181 | sed -i "s:^BINDIR/:${bindir}/:" busybox.links* |
182 | fi | 182 | sed -i "s:^SBINDIR/:${sbindir}/:" busybox.links* |
183 | 183 | ||
184 | install -d ${D}${sysconfdir}/init.d | 184 | install -d ${D}${sysconfdir}/init.d |
185 | 185 | ||
186 | if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${B}/.config; then | 186 | if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${B}/.config; then |
187 | # Install /bin/busybox, and the /bin/sh link so the postinst script | 187 | # Install ${base_bindir}/busybox, and the ${base_bindir}/sh link so the postinst script |
188 | # can run. Let update-alternatives handle the rest. | 188 | # can run. Let update-alternatives handle the rest. |
189 | install -d ${D}${base_bindir} | 189 | install -d ${D}${base_bindir} |
190 | if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then | 190 | if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then |
@@ -212,7 +212,7 @@ do_install () { | |||
212 | # We make this symlink here to eliminate the error when upgrading together | 212 | # We make this symlink here to eliminate the error when upgrading together |
213 | # with busybox-syslog. Without this symlink, the opkg may think of the | 213 | # with busybox-syslog. Without this symlink, the opkg may think of the |
214 | # busybox.nosuid as obsolete and remove it, resulting in dead links like | 214 | # busybox.nosuid as obsolete and remove it, resulting in dead links like |
215 | # /bin/sed -> /bin/busybox.nosuid. This will make upgrading busybox-syslog fail. | 215 | # ${base_bindir}/sed -> ${base_bindir}/busybox.nosuid. This will make upgrading busybox-syslog fail. |
216 | # This symlink will be safely deleted in postinst, thus no negative effect. | 216 | # This symlink will be safely deleted in postinst, thus no negative effect. |
217 | ln -sf busybox ${D}${base_bindir}/busybox.nosuid | 217 | ln -sf busybox ${D}${base_bindir}/busybox.nosuid |
218 | fi | 218 | fi |
@@ -368,21 +368,10 @@ pkg_postinst_${PN} () { | |||
368 | if test -e ${sysconfdir}/busybox.links$suffix; then | 368 | if test -e ${sysconfdir}/busybox.links$suffix; then |
369 | while read link; do | 369 | while read link; do |
370 | if test ! -e "$link"; then | 370 | if test ! -e "$link"; then |
371 | case "$link" in | ||
372 | /*/*/*) | ||
373 | to="../..${base_bindir}/busybox$suffix" | ||
374 | ;; | ||
375 | /bin/*) | ||
376 | to="busybox$suffix" | ||
377 | ;; | ||
378 | /*/*) | ||
379 | to="..${base_bindir}/busybox$suffix" | ||
380 | ;; | ||
381 | esac | ||
382 | # we can use busybox here because even if we are using splitted busybox | 371 | # we can use busybox here because even if we are using splitted busybox |
383 | # we've made a symlink from /bin/busybox to /bin/busybox.nosuid. | 372 | # we've made a symlink from /bin/busybox to /bin/busybox.nosuid. |
384 | busybox rm -f $link | 373 | busybox rm -f $link |
385 | busybox ln -s $to $link | 374 | busybox ln -s "${base_bindir}/busybox$suffix" $link |
386 | fi | 375 | fi |
387 | done < ${sysconfdir}/busybox.links$suffix | 376 | done < ${sysconfdir}/busybox.links$suffix |
388 | fi | 377 | fi |