summaryrefslogtreecommitdiffstats
path: root/meta/packages/busybox/busybox_1.01.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/busybox/busybox_1.01.bb')
-rw-r--r--meta/packages/busybox/busybox_1.01.bb169
1 files changed, 169 insertions, 0 deletions
diff --git a/meta/packages/busybox/busybox_1.01.bb b/meta/packages/busybox/busybox_1.01.bb
new file mode 100644
index 0000000000..996b5418a4
--- /dev/null
+++ b/meta/packages/busybox/busybox_1.01.bb
@@ -0,0 +1,169 @@
1DESCRIPTION = "BusyBox combines tiny versions of many common UNIX utilities into a single \
2small executable. It provides minimalist replacements for most of the \
3utilities you usually find in GNU fileutils, shellutils, etc. The utilities \
4in BusyBox generally have fewer options than their full-featured GNU \
5cousins; however, the options that are included provide the expected \
6functionality and behave very much like their GNU counterparts. BusyBox \
7provides a fairly complete POSIX environment for any small or embedded \
8system."
9HOMEPAGE = "http://www.busybox.net"
10LICENSE = "GPL"
11SECTION = "base"
12PRIORITY = "required"
13PR = "r11"
14
15SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \
16 file://udhcppidfile.patch;patch=1 \
17 file://udhcppidfile-breakage.patch;patch=1 \
18 file://add-getkey-applet.patch;patch=1 \
19 file://below.patch;patch=1 \
20 file://dhcp-hostname.patch;patch=1 \
21 file://dhcpretrytime.patch;patch=1 \
22 file://fbset.patch;patch=1 \
23 file://hdparm_M.patch;patch=1 \
24 file://ifupdown-spurious-environ.patch;patch=1 \
25 file://iproute-flush-cache.patch;patch=1;pnum=0 \
26 file://mount-all-type.patch;patch=1 \
27 file://readlink.patch;patch=1 \
28 file://rmmod.patch;patch=1 \
29 file://udhcpscript.patch;patch=1 \
30 file://thumb-bsdlabel.patch;patch=1 \
31 file://uclibc_posix.patch;patch=1 \
32 file://glibc2.4-icmp6.patch;patch=1 \
33 file://defconfig \
34 file://busybox-cron \
35 file://busybox-httpd \
36 file://busybox-udhcpd \
37 file://syslog \
38 file://hwclock.sh \
39 file://default.script \
40 file://syslog.conf \
41 file://mount.busybox \
42 file://umount.busybox"
43SRC_URI_append_slugos += " file://sysctl.conf "
44
45S = "${WORKDIR}/busybox-${PV}"
46
47export EXTRA_CFLAGS = "${CFLAGS}"
48EXTRA_OEMAKE_append = " CROSS=${HOST_PREFIX}"
49PACKAGES =+ "${PN}-httpd ${PN}-udhcpd"
50
51FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
52FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
53
54FILES_${PN} += " ${datadir}/udhcpc"
55
56INITSCRIPT_PACKAGES = "${PN} ${PN}-httpd ${PN}-udhcpd"
57INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
58INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
59INITSCRIPT_NAME_${PN} = "syslog"
60CONFFILES_${PN} = "${sysconfdir}/syslog.conf"
61
62# This disables the syslog startup links in slugos (see slugos-init)
63INITSCRIPT_PARAMS_${PN}_slugos = "start 20 ."
64
65inherit cml1 update-rc.d
66
67do_configure () {
68 install -m 0644 ${WORKDIR}/defconfig ${S}/.config
69 cml1_do_configure
70}
71
72do_compile () {
73 unset CFLAGS
74 base_do_compile
75}
76
77do_install () {
78 install -d ${D}${sysconfdir}/init.d
79 oe_runmake 'PREFIX=${D}' install
80
81 # Move everything to /busybox (not supposed to end up in any package)
82 install -d ${D}/busybox
83 mv ${D}${base_bindir} ${D}${base_sbindir} ${D}${prefix} ${D}/busybox/
84 # Move the busybox binary back to /bin
85 install -d ${D}${base_bindir}
86 mv ${D}/busybox${base_bindir}/busybox ${D}${base_bindir}/
87 # Move back the sh symlink
88 mv ${D}/busybox${base_bindir}/sh ${D}${base_bindir}/
89
90 install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/
91 install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/
92 if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then
93 # Move crond back to /usr/sbin/crond
94 install -d ${D}${sbindir}
95 mv ${D}/busybox${sbindir}/crond ${D}${sbindir}/
96
97 install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
98 fi
99 if grep "CONFIG_HTTPD=y" ${WORKDIR}/defconfig; then
100 # Move httpd back to /usr/sbin/httpd
101 install -d ${D}${sbindir}
102 mv ${D}/busybox${sbindir}/httpd ${D}${sbindir}/
103
104 install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/
105 install -d ${D}/srv/www
106 fi
107 if grep "CONFIG_UDHCPD=y" ${WORKDIR}/defconfig; then
108 # Move udhcpd back to /usr/sbin/udhcpd
109 install -d ${D}${sbindir}
110 mv ${D}/busybox${sbindir}/udhcpd ${D}${sbindir}/
111
112 install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/
113 fi
114 if grep "CONFIG_HWCLOCK=y" ${WORKDIR}/defconfig; then
115 # Move hwclock back to /sbin/hwclock
116 install -d ${D}${base_sbindir}
117 mv ${D}/busybox${base_sbindir}/hwclock ${D}${base_sbindir}/
118
119 install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/
120 fi
121 if grep "CONFIG_UDHCPC=y" ${WORKDIR}/defconfig; then
122 # Move dhcpc back to /usr/sbin/udhcpc
123 install -d ${D}${base_sbindir}
124 mv ${D}/busybox${base_sbindir}/udhcpc ${D}${base_sbindir}/
125
126 install -d ${D}${sysconfdir}/udhcpc.d
127 install -d ${D}${datadir}/udhcpc
128 install -m 0755 ${S}/examples/udhcp/simple.script ${D}${sysconfdir}/udhcpc.d/50default
129 install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
130 fi
131
132 install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
133}
134
135do_install_append_slugos() {
136 install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}
137}
138
139pkg_postinst_${PN} () {
140 # If we are not making an image we create links for the utilities that doesn't exist
141 # so the update-alternatives script will get the utilities it needs
142 # (update-alternatives have no problem replacing links later anyway)
143 test -n 2> /dev/null || alias test='busybox test'
144 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
145
146 # This adds the links, remember that this has to work when building an image too, hence the $D
147 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
148}
149
150pkg_prerm_${PN} () {
151 # This is so you can make busybox commit suicide - removing busybox with no other packages
152 # providing its files, this will make update-alternatives work, but the update-rc.d part
153 # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh
154 tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX`
155 ln -s /bin/busybox $tmpdir/[
156 ln -s /bin/busybox $tmpdir/test
157 ln -s /bin/busybox $tmpdir/head
158 ln -s /bin/busybox $tmpdir/sh
159 ln -s /bin/busybox $tmpdir/basename
160 ln -s /bin/busybox $tmpdir/echo
161 ln -s /bin/busybox $tmpdir/mv
162 ln -s /bin/busybox $tmpdir/ln
163 ln -s /bin/busybox $tmpdir/dirname
164 ln -s /bin/busybox $tmpdir/rm
165 ln -s /bin/busybox $tmpdir/sed
166 ln -s /bin/busybox $tmpdir/sort
167 export PATH=$PATH:$tmpdir
168 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
169}