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