4 SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \
7 file://busybox-udhcpd \
8 file://default.script \
10 file://mount.busybox \
14 file://udhcpscript.patch;patch=1 \
15 file://busybox-appletlib-dependency.patch;patch=1 \
16 file://umount.busybox \
19 SRC_URI += "http://busybox.net/downloads/fixes-1.7.2/busybox-1.7.2-ash.patch;patch=1 \
20 http://busybox.net/downloads/fixes-1.7.2/busybox-1.7.2-iptun.patch;patch=1 \
21 http://busybox.net/downloads/fixes-1.7.2/busybox-1.7.2-logger.patch;patch=1 \
22 http://busybox.net/downloads/fixes-1.7.2/busybox-1.7.2-tail.patch;patch=1 \
25 EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX}"
28 cp ${WORKDIR}/run_parts.c ${S}/debianutils/
29 install -m 0644 ${WORKDIR}/defconfig ${S}/.config
34 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
39 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
40 install -d ${D}${sysconfdir}/init.d
41 oe_runmake "PREFIX=${D}" install
42 cp -pPR ${S}/_install/* ${D}/
44 # Move everything to /busybox (not supposed to end up in any package)
45 install -d ${D}/busybox
48 cp -dPr ${D}${base_bindir} ${D}${base_sbindir} ${D}${prefix} ${D}/busybox/
49 # Move the busybox binary back to /bin
50 install -d ${D}${base_bindir}
51 mv ${D}/busybox${base_bindir}/busybox ${D}${base_bindir}/
52 # Move back the sh symlink
53 test -h ${D}/busybox${base_bindir}/sh && mv ${D}/busybox${base_bindir}/sh ${D}${base_bindir}/
55 install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/
56 install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/
57 if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then
58 # Move crond back to /usr/sbin/crond
59 install -d ${D}${sbindir}
60 mv ${D}/busybox${sbindir}/crond ${D}${sbindir}/
62 install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
64 if grep "CONFIG_HTTPD=y" ${WORKDIR}/defconfig; then
65 # Move httpd back to /usr/sbin/httpd
66 install -d ${D}${sbindir}
67 mv ${D}/busybox${sbindir}/httpd ${D}${sbindir}/
69 install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/
70 install -d ${D}/srv/www
72 if grep "CONFIG_APP_UDHCPD=y" ${WORKDIR}/defconfig; then
73 # Move udhcpd back to /usr/sbin/udhcpd
74 install -d ${D}${sbindir}
75 mv ${D}/busybox${sbindir}/udhcpd ${D}${sbindir}/
77 install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/
79 if grep "CONFIG_HWCLOCK=y" ${WORKDIR}/defconfig; then
80 # Move hwclock back to /sbin/hwclock
81 install -d ${D}${base_sbindir}
82 mv ${D}/busybox${base_sbindir}/hwclock ${D}${base_sbindir}/
84 install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/
86 if grep "CONFIG_APP_UDHCPC=y" ${WORKDIR}/defconfig; then
87 # Move dhcpc back to /usr/sbin/udhcpc
88 install -d ${D}${base_sbindir}
89 mv ${D}/busybox${base_sbindir}/udhcpc ${D}${base_sbindir}/
91 install -d ${D}${sysconfdir}/udhcpc.d
92 install -d ${D}${datadir}/udhcpc
93 install -m 0755 ${S}/examples/udhcp/simple.script ${D}${sysconfdir}/udhcpc.d/50default
94 install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
97 install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
101 # This is so you can make busybox commit suicide - removing busybox with no other packages
102 # providing its files, this will make update-alternatives work, but the update-rc.d part
103 # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh
104 tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX`
105 ln -s /bin/busybox $tmpdir/[
106 ln -s /bin/busybox $tmpdir/test
107 ln -s /bin/busybox $tmpdir/head
108 ln -s /bin/busybox $tmpdir/sh
109 ln -s /bin/busybox $tmpdir/basename
110 ln -s /bin/busybox $tmpdir/echo
111 ln -s /bin/busybox $tmpdir/mv
112 ln -s /bin/busybox $tmpdir/ln
113 ln -s /bin/busybox $tmpdir/dirname
114 ln -s /bin/busybox $tmpdir/rm
115 ln -s /bin/busybox $tmpdir/sed
116 ln -s /bin/busybox $tmpdir/sort
117 export PATH=$PATH:$tmpdir
118 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