From 25c49309c461b41d718f850f5a900ee8232bbec8 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Sat, 28 Oct 2006 08:40:40 +0000 Subject: busybox: add 1.2.2, needs further testing, so it has a negative default preference --- packages/busybox/busybox_1.2.2.bb | 163 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 packages/busybox/busybox_1.2.2.bb (limited to 'packages/busybox') diff --git a/packages/busybox/busybox_1.2.2.bb b/packages/busybox/busybox_1.2.2.bb new file mode 100644 index 0000000000..706e7ca3b5 --- /dev/null +++ b/packages/busybox/busybox_1.2.2.bb @@ -0,0 +1,163 @@ +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" +LICENSE = "GPL" +SECTION = "base" +PRIORITY = "required" +PR = "r0" + +DEFAULT_PREFERENCE = "-1" + +SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \ + file://dhcp-hostname.patch;patch=1 \ + file://ifupdown-spurious-environ.patch;patch=1 \ + file://udhcpscript.patch;patch=1 \ + file://wget-long-options.patch;patch=1 \ + file://defconfig \ + file://busybox-cron \ + file://busybox-httpd \ + file://busybox-udhcpd \ + file://syslog \ + file://hwclock.sh \ + file://default.script \ + file://syslog.conf \ + file://mount.busybox \ + file://umount.busybox" + +SRC_URI_append_nylon = " file://xargs-double-size.patch;patch=1" + +export EXTRA_CFLAGS = "${CFLAGS}" +EXTRA_OEMAKE_append = " CROSS=${HOST_PREFIX}" +PACKAGES =+ "${PN}-httpd ${PN}-udhcpd" + +FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www" +FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd" + +FILES_${PN} += " ${datadir}/udhcpc" + +INITSCRIPT_PACKAGES = "${PN} ${PN}-httpd ${PN}-udhcpd" +INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd" +INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" +INITSCRIPT_NAME_${PN} = "syslog" +CONFFILES_${PN} = "${sysconfdir}/syslog.conf" + +# This disables the syslog startup links in openslug (see openslug-init) +INITSCRIPT_PARAMS_${PN}_openslug = "start 20 ." + +inherit cml1 update-rc.d + +do_configure () { + install -m 0644 ${WORKDIR}/defconfig ${S}/.config.oe + + echo "CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"" > ${S}/.config + echo "USING_CROSS_COMPILER=y" >> ${S}/.config + + sed -e '/CROSS_COMPILER_PREFIX/d' \ + -e '/USING_CROSS_COMPILER/d' \ + '${S}/.config.oe' >>'${S}/.config' + cml1_do_configure +} + +do_compile () { + unset CFLAGS + base_do_compile +} + +do_install () { + 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}/ + + install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/ + install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/ + 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 + if grep "CONFIG_APP_UDHCPD=y" ${WORKDIR}/defconfig; then + # 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 + if grep "CONFIG_APP_UDHCPC=y" ${WORKDIR}/defconfig; then + # 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/50default + install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script + 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