SUMMARY = "Tiny versions of many common UNIX utilities in a single small executable." DESCRIPTION = "BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete POSIX environment for any small or embedded system." HOMEPAGE = "http://www.busybox.net" BUGTRACKER = "https://bugs.busybox.net/" # bzip2 applet in busybox is based on lightly-modified bzip2 source # the GPL is version 2 only LICENSE = "GPLv2 & bzip2" LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb" SECTION = "base" PRIORITY = "required" export EXTRA_CFLAGS = "${CFLAGS}" PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev" FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www" FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog.conf*" FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf" FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd" FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc ${sysconfdir}/init.d/busybox-udhcpc" INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-udhcpc ${PN}-mdev" INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd" INITSCRIPT_NAME_${PN}-syslog = "syslog" INITSCRIPT_NAME_${PN}-mdev = "mdev" INITSCRIPT_PARAMS_${PN}-mdev = "start 06 S ." INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" INITSCRIPT_NAME_${PN}-udhcpc = "busybox-udhcpc" CONFFILES_${PN}-syslog = "${sysconfdir}/syslog.conf.${PN}" CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf" RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc" inherit cml1 update-rc.d do_configure () { install -m 0644 ${WORKDIR}/defconfig ${S}/.config cml1_do_configure } do_compile() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS base_do_compile } do_install () { oe_runmake busybox.links if [ "${prefix}" != "/usr" ]; then sed "s:^/usr/:${prefix}/:" busybox.links > busybox.links.new mv busybox.links.new busybox.links fi if [ "${base_sbindir}" != "/sbin" ]; then sed "s:^/sbin/:${base_sbindir}/:" busybox.links > busybox.links.new mv busybox.links.new busybox.links fi install -d ${D}${sysconfdir}/init.d if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${WORKDIR}/defconfig; then # Install /bin/busybox, and the /bin/sh link so the postinst script # can run. Let update-alternatives handle the rest. install -d ${D}${base_bindir} if grep -q "CONFIG_FEATURE_SUID=y" ${WORKDIR}/defconfig; then install -m 4755 ${S}/busybox ${D}${base_bindir} else install -m 0755 ${S}/busybox ${D}${base_bindir} fi ln -sf busybox ${D}${base_bindir}/sh else install -d ${D}${base_bindir} ${D}${base_sbindir} install -d ${D}${libdir} ${D}${bindir} ${D}${sbindir} cat busybox.links | while read FILE; do NAME=`basename "$FILE"` install -m 0755 "0_lib/$NAME" "${D}$FILE.${PN}" done # add suid bit where needed for i in `grep -E "APPLET.*_BB_SUID_((MAYBE|REQUIRE))" include/applets.h | grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do find ${D} -name $i.${PN} -exec chmod a+s {} \; done install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV} ln -sf sh.${PN} ${D}${base_bindir}/sh ln -sf ln.${PN} ${D}${base_bindir}/ln ln -sf test.${PN} ${D}${bindir}/test if [ -f ${D}/linuxrc.${PN} ]; then mv ${D}/linuxrc.${PN} ${D}/linuxrc fi fi if grep -q "CONFIG_SYSLOGD=y" ${WORKDIR}/defconfig; then install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${PN} install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf.${PN} fi if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/ fi if grep "CONFIG_HTTPD=y" ${WORKDIR}/defconfig; then install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/ install -d ${D}/srv/www fi if grep "CONFIG_UDHCPD=y" ${WORKDIR}/defconfig; then install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/ fi if grep "CONFIG_HWCLOCK=y" ${WORKDIR}/defconfig; then install -d ${D}${sysconfdir}/default install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/ fi if grep "CONFIG_UDHCPC=y" ${WORKDIR}/defconfig; then install -d ${D}${sysconfdir}/udhcpc.d install -d ${D}${datadir}/udhcpc install -m 0755 ${WORKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script install -m 0755 ${WORKDIR}/busybox-udhcpc ${D}${sysconfdir}/init.d/ fi if grep "CONFIG_INETD=y" ${WORKDIR}/defconfig; then install -m 0755 ${WORKDIR}/inetd ${D}${sysconfdir}/init.d/inetd.${PN} install -m 0644 ${WORKDIR}/inetd.conf ${D}${sysconfdir}/ fi if grep "CONFIG_MDEV=y" ${WORKDIR}/defconfig; then install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev if grep "CONFIG_FEATURE_MDEV_CONF=y" ${WORKDIR}/defconfig; then install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf fi fi install -m 0644 ${S}/busybox.links ${D}${sysconfdir} } pkg_postinst_${PN} () { # If we are not making an image we create links for the utilities that doesn't exist # so the update-alternatives script will get the utilities it needs # (update-alternatives have no problem replacing links later anyway) test -n 2> /dev/null || alias test='busybox test' 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";; esac; busybox ln -s $to $link; fi; done