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