aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/busybox/busybox.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/busybox/busybox.inc')
-rw-r--r--recipes/busybox/busybox.inc57
1 files changed, 49 insertions, 8 deletions
diff --git a/recipes/busybox/busybox.inc b/recipes/busybox/busybox.inc
index 1ee263ad90..8abda7c964 100644
--- a/recipes/busybox/busybox.inc
+++ b/recipes/busybox/busybox.inc
@@ -11,24 +11,24 @@ LICENSE = "GPLv2"
SECTION = "base"
PRIORITY = "required"
-INC_PR = "r26"
+INC_PR = "r29"
SRC_URI = "\
file://busybox-cron \
file://busybox-httpd \
file://busybox-udhcpd \
file://default.script file://simple.script \
- file://dhcp-hostname.patch;patch=1 \
+ file://dhcp-hostname.patch \
file://hwclock.sh \
- file://ifupdown-spurious-environ.patch;patch=1 \
+ file://ifupdown-spurious-environ.patch \
file://mount.busybox \
file://syslog \
file://syslog.conf \
- file://udhcpscript.patch;patch=1 \
+ file://udhcpscript.patch \
file://umount.busybox \
"
-SRC_URI_append_nylon = " file://xargs-double-size.patch;patch=1"
+SRC_URI_append_nylon = " file://xargs-double-size.patch"
export EXTRA_CFLAGS = "${CFLAGS}"
EXTRA_OEMAKE_append = " CROSS=${HOST_PREFIX}"
@@ -46,12 +46,14 @@ RDEPENDS_${PN} += "${PN}-mountall"
RRECOMMENDS_${PN} += "libgcc ${PN}-syslog"
FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
-FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog ${sysconfdir}/syslog.conf"
+FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog.${PN} ${sysconfdir}/syslog.conf"
FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
FILES_${PN} += "${datadir}/udhcpc"
-INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd"
+# syslog initscript is handled explicitly because order of
+# update-rc.d and update-alternatives is important (see below)
+INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-udhcpd"
INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
INITSCRIPT_NAME_${PN}-syslog = "syslog"
INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
@@ -78,6 +80,9 @@ do_configure () {
do_compile() {
unset CFLAGS CPPFLAGS CXXFLAGS
base_do_compile
+ # Busybox will force a strip, we do not want that. Future-proof
+ # in case later versions do this better.
+ cp busybox_unstripped busybox || true
}
do_install () {
@@ -104,7 +109,7 @@ do_install () {
ln -sf busybox ${D}${base_bindir}/sh
if grep -q "CONFIG_SYSLOGD=y" ${WORKDIR}/defconfig; then
- install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${PN}
install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/
fi
if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then
@@ -142,7 +147,9 @@ pkg_postinst_${PN} () {
if test "x$D" = "x"; then while read link; do if test ! -h "$link"; then case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; /*) to="/bin/busybox";; esac; busybox ln -s $to $link; fi; done </etc/busybox.links; fi
# This adds the links, remember that this has to work when building an image too, hence the $D
+ set +e
while read link; do case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; /*) to="/bin/busybox";; esac; bn=`basename $link`; update-alternatives --install $link $bn $to 50; done <$D/etc/busybox.links
+ set -e
}
pkg_postinst_${PN}-mountall () {
@@ -152,6 +159,40 @@ pkg_prerm_${PN}-mountall () {
update-alternatives --remove default_mountall mountall.${PN}
}
+pkg_postinst_${PN}-syslog () {
+ update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 50
+
+ if test "x$D" != "x"; then
+ OPT="-r $D"
+ else
+ OPT="-s"
+ fi
+ update-rc.d $OPT syslog defaults
+}
+
+pkg_prerm_${PN}-syslog () {
+ if test "x$D" = "x"; then
+ if test "$1" = "upgrade" -o "$1" = "remove"; then
+ /etc/init.d/syslog stop
+ fi
+ fi
+
+ update-alternatives --remove syslog-init syslog.${PN}
+}
+
+pkg_postrm_${PN}-syslog () {
+ if test "x$D" != "x"; then
+ OPT="-r $D"
+ else
+ OPT=""
+ fi
+ if test "$1" = "remove" -o "$1" = "purge"; then
+ if ! test -e "/etc/init.d/syslog"; then
+ update-rc.d $OPT syslog remove
+ fi
+ fi
+}
+
pkg_prerm_${PN} () {
# This is so you can make busybox commit suicide - removing busybox with no other packages
# providing its files, this will make update-alternatives work, but the update-rc.d part