diff options
Diffstat (limited to 'meta/packages/busybox/busybox_1.8.1.bb')
-rw-r--r-- | meta/packages/busybox/busybox_1.8.1.bb | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/meta/packages/busybox/busybox_1.8.1.bb b/meta/packages/busybox/busybox_1.8.1.bb new file mode 100644 index 0000000000..0cd757cc9b --- /dev/null +++ b/meta/packages/busybox/busybox_1.8.1.bb | |||
@@ -0,0 +1,113 @@ | |||
1 | require busybox.inc | ||
2 | |||
3 | PR = "r2" | ||
4 | |||
5 | DEFAULT_PREFERENCE = "-1" | ||
6 | |||
7 | SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \ | ||
8 | file://busybox-cron \ | ||
9 | file://busybox-httpd \ | ||
10 | file://busybox-udhcpd \ | ||
11 | file://default.script \ | ||
12 | file://hwclock.sh \ | ||
13 | file://mount.busybox \ | ||
14 | file://syslog \ | ||
15 | file://syslog.conf \ | ||
16 | file://udhcpscript.patch;patch=1 \ | ||
17 | file://umount.busybox \ | ||
18 | file://defconfig" | ||
19 | |||
20 | EXTRA_OEMAKE_append = " V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX}" | ||
21 | |||
22 | do_configure () { | ||
23 | install -m 0644 ${WORKDIR}/defconfig ${S}/.config | ||
24 | cml1_do_configure | ||
25 | } | ||
26 | |||
27 | do_compile () { | ||
28 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS | ||
29 | base_do_compile | ||
30 | } | ||
31 | |||
32 | do_install () { | ||
33 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS | ||
34 | install -d ${D}${sysconfdir}/init.d | ||
35 | oe_runmake "PREFIX=${D}" install | ||
36 | cp -pPR ${S}/_install/* ${D}/ | ||
37 | |||
38 | # Move everything to /busybox (not supposed to end up in any package) | ||
39 | install -d ${D}/busybox | ||
40 | ls ${D} -R | ||
41 | |||
42 | cp -dPr ${D}${base_bindir} ${D}${base_sbindir} ${D}${prefix} ${D}/busybox/ | ||
43 | # Move the busybox binary back to /bin | ||
44 | install -d ${D}${base_bindir} | ||
45 | mv ${D}/busybox${base_bindir}/busybox ${D}${base_bindir}/ | ||
46 | # Move back the sh symlink | ||
47 | test -h ${D}/busybox${base_bindir}/sh && mv ${D}/busybox${base_bindir}/sh ${D}${base_bindir}/ | ||
48 | |||
49 | install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/ | ||
50 | install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/ | ||
51 | if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then | ||
52 | # Move crond back to /usr/sbin/crond | ||
53 | install -d ${D}${sbindir} | ||
54 | mv ${D}/busybox${sbindir}/crond ${D}${sbindir}/ | ||
55 | |||
56 | install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/ | ||
57 | fi | ||
58 | if grep "CONFIG_HTTPD=y" ${WORKDIR}/defconfig; then | ||
59 | # Move httpd back to /usr/sbin/httpd | ||
60 | install -d ${D}${sbindir} | ||
61 | mv ${D}/busybox${sbindir}/httpd ${D}${sbindir}/ | ||
62 | |||
63 | install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/ | ||
64 | install -d ${D}/srv/www | ||
65 | fi | ||
66 | if grep "CONFIG_APP_UDHCPD=y" ${WORKDIR}/defconfig; then | ||
67 | # Move udhcpd back to /usr/sbin/udhcpd | ||
68 | install -d ${D}${sbindir} | ||
69 | mv ${D}/busybox${sbindir}/udhcpd ${D}${sbindir}/ | ||
70 | |||
71 | install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/ | ||
72 | fi | ||
73 | if grep "CONFIG_HWCLOCK=y" ${WORKDIR}/defconfig; then | ||
74 | # Move hwclock back to /sbin/hwclock | ||
75 | install -d ${D}${base_sbindir} | ||
76 | mv ${D}/busybox${base_sbindir}/hwclock ${D}${base_sbindir}/ | ||
77 | |||
78 | install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/ | ||
79 | fi | ||
80 | if grep "CONFIG_APP_UDHCPC=y" ${WORKDIR}/defconfig; then | ||
81 | # Move dhcpc back to /usr/sbin/udhcpc | ||
82 | install -d ${D}${base_sbindir} | ||
83 | mv ${D}/busybox${base_sbindir}/udhcpc ${D}${base_sbindir}/ | ||
84 | |||
85 | install -d ${D}${sysconfdir}/udhcpc.d | ||
86 | install -d ${D}${datadir}/udhcpc | ||
87 | install -m 0755 ${S}/examples/udhcp/simple.script ${D}${sysconfdir}/udhcpc.d/50default | ||
88 | install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script | ||
89 | fi | ||
90 | |||
91 | install -m 0644 ${S}/busybox.links ${D}${sysconfdir} | ||
92 | } | ||
93 | |||
94 | pkg_prerm_${PN} () { | ||
95 | # This is so you can make busybox commit suicide - removing busybox with no other packages | ||
96 | # providing its files, this will make update-alternatives work, but the update-rc.d part | ||
97 | # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh | ||
98 | tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX` | ||
99 | ln -s /bin/busybox $tmpdir/[ | ||
100 | ln -s /bin/busybox $tmpdir/test | ||
101 | ln -s /bin/busybox $tmpdir/head | ||
102 | ln -s /bin/busybox $tmpdir/sh | ||
103 | ln -s /bin/busybox $tmpdir/basename | ||
104 | ln -s /bin/busybox $tmpdir/echo | ||
105 | ln -s /bin/busybox $tmpdir/mv | ||
106 | ln -s /bin/busybox $tmpdir/ln | ||
107 | ln -s /bin/busybox $tmpdir/dirname | ||
108 | ln -s /bin/busybox $tmpdir/rm | ||
109 | ln -s /bin/busybox $tmpdir/sed | ||
110 | ln -s /bin/busybox $tmpdir/sort | ||
111 | export PATH=$PATH:$tmpdir | ||
112 | 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 | ||
113 | } | ||