2010-09-27 14:44:05 +00:00
SUMMARY = " Tiny versions of many common UNIX utilities in a single small executable. "
2010-06-30 06:46:52 +00:00
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. "
2007-10-22 14:56:31 +00:00
HOMEPAGE = " http://www.busybox.net "
2010-06-30 06:46:52 +00:00
BUGTRACKER = " https://bugs.busybox.net/ "
2010-11-17 02:51:45 +00:00
2010-06-30 06:46:52 +00:00
# bzip2 applet in busybox is based on lightly-modified bzip2 source
2010-11-17 02:51:45 +00:00
# the GPL is version 2 only
LICENSE = " GPLv2 & bzip2 "
LIC_FILES_CHKSUM = " file://LICENSE;md5=de10de48642ab74318e893a61105afbb "
2007-10-22 14:56:31 +00:00
SECTION = " base "
PRIORITY = " required "
export EXTRA_CFLAGS = " ${ CFLAGS } "
2011-05-02 19:09:16 +00:00
PACKAGES =+ " ${ PN } -httpd ${ PN } -udhcpd ${ PN } -udhcpc ${ PN } -syslog ${ PN } -mdev "
2007-10-22 14:56:31 +00:00
FILES_ $ { PN } - httpd = " ${ sysconfdir } /init.d/busybox-httpd /srv/www "
2011-02-11 20:18:16 +00:00
FILES_ $ { PN } - syslog = " ${ sysconfdir } /init.d/syslog* ${ sysconfdir } /syslog.conf* "
2011-05-02 19:09:16 +00:00
FILES_ $ { PN } - mdev = " ${ sysconfdir } /init.d/mdev ${ sysconfdir } /mdev.conf "
2007-10-22 14:56:31 +00:00
FILES_ $ { PN } - udhcpd = " ${ sysconfdir } /init.d/busybox-udhcpd "
2011-02-11 20:18:16 +00:00
FILES_ $ { PN } - udhcpc = " ${ sysconfdir } /udhcpc.d ${ datadir } /udhcpc ${ sysconfdir } /init.d/busybox-udhcpc "
2007-10-22 14:56:31 +00:00
2011-05-02 19:09:16 +00:00
INITSCRIPT_PACKAGES = " ${ PN } -httpd ${ PN } -syslog ${ PN } -udhcpd ${ PN } -udhcpc ${ PN } -mdev "
2007-10-22 14:56:31 +00:00
INITSCRIPT_NAME_ $ { PN } - httpd = " busybox-httpd "
2011-02-11 20:18:16 +00:00
INITSCRIPT_NAME_ $ { PN } - syslog = " syslog "
2011-05-02 19:09:16 +00:00
INITSCRIPT_NAME_ $ { PN } - mdev = " mdev "
INITSCRIPT_PARAMS_ $ { PN } - mdev = " start 06 S . "
2007-10-22 14:56:31 +00:00
INITSCRIPT_NAME_ $ { PN } - udhcpd = " busybox-udhcpd "
2011-02-11 20:18:16 +00:00
INITSCRIPT_NAME_ $ { PN } - udhcpc = " busybox-udhcpc "
CONFFILES_ $ { PN } - syslog = " ${ sysconfdir}/syslog.conf.${PN } "
2011-05-02 19:09:16 +00:00
CONFFILES_ $ { PN } - mdev = " ${ sysconfdir } /mdev.conf "
2011-02-11 20:18:16 +00:00
RRECOMMENDS_ $ { PN } = " ${ PN } -syslog ${ PN } -udhcpc "
2007-10-22 14:56:31 +00:00
inherit cml1 update - rc . d
2010-05-25 14:36:14 +00:00
do_configure () {
install - m 0644 $ { WORKDIR } / defconfig $ { S } /. config
cml1_do_configure
}
2008-03-03 17:51:29 +00:00
do_compile () {
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
2007-10-22 14:56:31 +00:00
base_do_compile
}
2008-03-03 17:51:29 +00:00
do_install () {
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
install - d $ { D } $ { sysconfdir } / init . d
oe_runmake " PREFIX= ${ D } " install
cp - pPR $ { S } / _install /* $ { D } /
# Move everything to /busybox (not supposed to end up in any package)
install - d $ { D } / busybox
ls $ { D } - R
cp - dPr $ { D } $ { base_bindir } $ { D } $ { base_sbindir } $ { D } $ { prefix } $ { D } / busybox /
# Move the busybox binary back to /bin
install - d $ { D } $ { base_bindir }
mv $ { D } / busybox $ { base_bindir } / busybox $ { D } $ { base_bindir } /
# Move back the sh symlink
test - h $ { D } / busybox $ { base_bindir } / sh && mv $ { D } / busybox $ { base_bindir } / sh $ { D } $ { base_bindir } /
2010-10-19 07:15:17 +00:00
install - m 0755 $ { WORKDIR } / syslog $ { D } $ { sysconfdir } / init . d / syslog . $ { PN }
2010-10-20 19:50:50 +00:00
install - m 644 $ { WORKDIR } / syslog . conf $ { D } $ { sysconfdir } / syslog . conf . $ { PN }
2008-03-03 17:51:29 +00:00
if grep " CONFIG_CROND=y " $ { WORKDIR } / defconfig ; then
# Move crond back to /usr/sbin/crond
install - d $ { D } $ { sbindir }
mv $ { D } / busybox $ { sbindir } / crond $ { D } $ { sbindir } /
install - m 0755 $ { WORKDIR } / busybox - cron $ { D } $ { sysconfdir } / init . d /
fi
if grep " CONFIG_HTTPD=y " $ { WORKDIR } / defconfig ; then
# Move httpd back to /usr/sbin/httpd
install - d $ { D } $ { sbindir }
mv $ { D } / busybox $ { sbindir } / httpd $ { D } $ { sbindir } /
install - m 0755 $ { WORKDIR } / busybox - httpd $ { D } $ { sysconfdir } / init . d /
install - d $ { D } / srv / www
fi
2010-07-06 07:33:31 +00:00
if grep " CONFIG_UDHCPD=y " $ { WORKDIR } / defconfig ; then
2008-03-03 17:51:29 +00:00
# Move udhcpd back to /usr/sbin/udhcpd
install - d $ { D } $ { sbindir }
mv $ { D } / busybox $ { sbindir } / udhcpd $ { D } $ { sbindir } /
install - m 0755 $ { WORKDIR } / busybox - udhcpd $ { D } $ { sysconfdir } / init . d /
fi
if grep " CONFIG_HWCLOCK=y " $ { WORKDIR } / defconfig ; then
# Move hwclock back to /sbin/hwclock
install - d $ { D } $ { base_sbindir }
mv $ { D } / busybox $ { base_sbindir } / hwclock $ { D } $ { base_sbindir } /
install - m 0755 $ { WORKDIR } / hwclock . sh $ { D } $ { sysconfdir } / init . d /
fi
2010-07-06 07:33:31 +00:00
if grep " CONFIG_UDHCPC=y " $ { WORKDIR } / defconfig ; then
2008-03-03 17:51:29 +00:00
# Move dhcpc back to /usr/sbin/udhcpc
install - d $ { D } $ { base_sbindir }
mv $ { D } / busybox $ { base_sbindir } / udhcpc $ { D } $ { base_sbindir } /
install - d $ { D } $ { sysconfdir } / udhcpc . d
install - d $ { D } $ { datadir } / udhcpc
install - m 0755 $ { S } / examples / udhcp / simple . script $ { D } $ { sysconfdir } / udhcpc . d / 50 default
install - m 0755 $ { WORKDIR } / default . script $ { D } $ { datadir } / udhcpc / default . script
2011-02-04 01:29:50 +00:00
install - m 0755 $ { WORKDIR } / busybox - udhcpc $ { D } $ { sysconfdir } / init . d /
2008-03-03 17:51:29 +00:00
fi
2011-05-02 19:09:16 +00:00
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
2008-03-03 17:51:29 +00:00
install - m 0644 $ { S } / busybox . links $ { D } $ { sysconfdir }
2010-11-17 02:51:45 +00:00
# remove the temp dir to suppress warning, we are done with it
rm - rf $ { D } / busybox
2008-03-03 17:51:29 +00:00
}
2007-10-22 14:56:31 +00:00
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 </ etc / busybox . links ; fi
# This adds the links, remember that this has to work when building an image too, hence the $D
while read link ; do case " $link " in /*/*/ * ) to = " ../../bin/busybox " ;; / bin /*) to="busybox";; /*/ * ) to = " ../bin/busybox " ;; esac ; bn = `basename $link` ; update - alternatives -- install $link $bn $to 50 ; done < $D / etc / busybox . links
2011-02-11 20:18:16 +00:00
}
2010-10-19 07:15:17 +00:00
2011-02-11 20:18:16 +00:00
pkg_postinst_ $ { PN } - syslog () {
2010-10-19 07:15:17 +00:00
update - alternatives -- install $ { sysconfdir } / init . d / syslog syslog - init syslog . $ { PN } 50
2010-10-20 19:50:50 +00:00
update - alternatives -- install $ { sysconfdir } / syslog . conf syslog - conf syslog . conf . $ { PN } 50
2007-10-22 14:56:31 +00:00
}
2008-03-03 17:51:29 +00:00
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
# for syslog, httpd and/or udhcpd will fail if there is no other package providing sh
tmpdir = `mktemp -d /tmp/busyboxrm-XXXXXX`
ln - s / bin / busybox $tmpdir / [
ln - s / bin / busybox $tmpdir / test
ln - s / bin / busybox $tmpdir / head
ln - s / bin / busybox $tmpdir / sh
ln - s / bin / busybox $tmpdir / basename
ln - s / bin / busybox $tmpdir / echo
ln - s / bin / busybox $tmpdir / mv
ln - s / bin / busybox $tmpdir / ln
ln - s / bin / busybox $tmpdir / dirname
ln - s / bin / busybox $tmpdir / rm
ln - s / bin / busybox $tmpdir / sed
ln - s / bin / busybox $tmpdir / sort
export PATH = $PATH : $tmpdir
while read link
do
case " $link " in
/*/*/ * ) to = " ../../bin/busybox " ;;
/ bin /* ) to = " busybox " ;;
/*/* ) to = " ../bin/busybox " ;;
esac
bn = `basename $link`
sh / usr / bin / update - alternatives -- remove $bn $to
done </ etc / busybox . links
2011-02-11 20:18:16 +00:00
}
2010-10-19 07:15:17 +00:00
2011-02-11 20:18:16 +00:00
pkg_prerm_ $ { PN } - syslog () {
2010-10-19 07:15:17 +00:00
# remove 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 }
2010-10-20 19:50:50 +00:00
update - alternatives -- remove syslog - conf syslog . conf . $ { PN }
2008-03-03 17:51:29 +00:00
}
2010-10-20 19:50:50 +00:00