summaryrefslogtreecommitdiffstats
path: root/meta/packages/busybox/busybox.inc
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <hrw@openedhand.com>2008-03-03 17:51:29 +0000
committerMarcin Juszkiewicz <hrw@openedhand.com>2008-03-03 17:51:29 +0000
commit198a63fac56201ee520d94bf8345036e4927fce6 (patch)
treecf8acd5a45d75baa7b3e5828f47787aec287cb65 /meta/packages/busybox/busybox.inc
parent6314103003cef434c29d2133769195daf5cc9309 (diff)
downloadpoky-198a63fac56201ee520d94bf8345036e4927fce6.tar.gz
busybox: update from 1.8.2 to 1.9.1 (from OE)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3889 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/busybox/busybox.inc')
-rw-r--r--meta/packages/busybox/busybox.inc127
1 files changed, 111 insertions, 16 deletions
diff --git a/meta/packages/busybox/busybox.inc b/meta/packages/busybox/busybox.inc
index ab17d96db4..0fb3b5efff 100644
--- a/meta/packages/busybox/busybox.inc
+++ b/meta/packages/busybox/busybox.inc
@@ -11,19 +11,21 @@ LICENSE = "GPL"
11SECTION = "base" 11SECTION = "base"
12PRIORITY = "required" 12PRIORITY = "required"
13 13
14SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \ 14SRC_URI = "\
15 file://busybox-cron \ 15 http://www.busybox.net/downloads/busybox-${PV}.tar.gz \
16 file://busybox-httpd \ 16 file://busybox-cron \
17 file://busybox-udhcpd \ 17 file://busybox-httpd \
18 file://default.script \ 18 file://busybox-udhcpd \
19 file://dhcp-hostname.patch;patch=1 \ 19 file://default.script \
20 file://hwclock.sh \ 20 file://dhcp-hostname.patch;patch=1 \
21 file://ifupdown-spurious-environ.patch;patch=1 \ 21 file://hwclock.sh \
22 file://mount.busybox \ 22 file://ifupdown-spurious-environ.patch;patch=1 \
23 file://syslog \ 23 file://mount.busybox \
24 file://syslog.conf \ 24 file://syslog \
25 file://udhcpscript.patch;patch=1 \ 25 file://syslog.conf \
26 file://umount.busybox" 26 file://udhcpscript.patch;patch=1 \
27 file://umount.busybox \
28"
27 29
28SRC_URI_append_nylon = " file://xargs-double-size.patch;patch=1" 30SRC_URI_append_nylon = " file://xargs-double-size.patch;patch=1"
29 31
@@ -34,7 +36,7 @@ PACKAGES =+ "${PN}-httpd ${PN}-udhcpd"
34FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www" 36FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
35FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd" 37FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
36 38
37FILES_${PN} += " ${datadir}/udhcpc" 39FILES_${PN} += "${datadir}/udhcpc"
38 40
39INITSCRIPT_PACKAGES = "${PN} ${PN}-httpd ${PN}-udhcpd" 41INITSCRIPT_PACKAGES = "${PN} ${PN}-httpd ${PN}-udhcpd"
40INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd" 42INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
@@ -47,11 +49,73 @@ INITSCRIPT_PARAMS_${PN}_slugos = "start 20 ."
47 49
48inherit cml1 update-rc.d 50inherit cml1 update-rc.d
49 51
50do_compile () { 52do_compile() {
51 unset CFLAGS 53 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
52 base_do_compile 54 base_do_compile
53} 55}
54 56
57do_install () {
58 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
59 install -d ${D}${sysconfdir}/init.d
60 oe_runmake "PREFIX=${D}" install
61 cp -pPR ${S}/_install/* ${D}/
62
63 # Move everything to /busybox (not supposed to end up in any package)
64 install -d ${D}/busybox
65 ls ${D} -R
66
67 cp -dPr ${D}${base_bindir} ${D}${base_sbindir} ${D}${prefix} ${D}/busybox/
68 # Move the busybox binary back to /bin
69 install -d ${D}${base_bindir}
70 mv ${D}/busybox${base_bindir}/busybox ${D}${base_bindir}/
71 # Move back the sh symlink
72 test -h ${D}/busybox${base_bindir}/sh && mv ${D}/busybox${base_bindir}/sh ${D}${base_bindir}/
73
74 install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/
75 install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/
76 if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then
77 # Move crond back to /usr/sbin/crond
78 install -d ${D}${sbindir}
79 mv ${D}/busybox${sbindir}/crond ${D}${sbindir}/
80
81 install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
82 fi
83 if grep "CONFIG_HTTPD=y" ${WORKDIR}/defconfig; then
84 # Move httpd back to /usr/sbin/httpd
85 install -d ${D}${sbindir}
86 mv ${D}/busybox${sbindir}/httpd ${D}${sbindir}/
87
88 install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/
89 install -d ${D}/srv/www
90 fi
91 if grep "CONFIG_APP_UDHCPD=y" ${WORKDIR}/defconfig; then
92 # Move udhcpd back to /usr/sbin/udhcpd
93 install -d ${D}${sbindir}
94 mv ${D}/busybox${sbindir}/udhcpd ${D}${sbindir}/
95
96 install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/
97 fi
98 if grep "CONFIG_HWCLOCK=y" ${WORKDIR}/defconfig; then
99 # Move hwclock back to /sbin/hwclock
100 install -d ${D}${base_sbindir}
101 mv ${D}/busybox${base_sbindir}/hwclock ${D}${base_sbindir}/
102
103 install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/
104 fi
105 if grep "CONFIG_APP_UDHCPC=y" ${WORKDIR}/defconfig; then
106 # Move dhcpc back to /usr/sbin/udhcpc
107 install -d ${D}${base_sbindir}
108 mv ${D}/busybox${base_sbindir}/udhcpc ${D}${base_sbindir}/
109
110 install -d ${D}${sysconfdir}/udhcpc.d
111 install -d ${D}${datadir}/udhcpc
112 install -m 0755 ${S}/examples/udhcp/simple.script ${D}${sysconfdir}/udhcpc.d/50default
113 install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
114 fi
115
116 install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
117}
118
55pkg_postinst_${PN} () { 119pkg_postinst_${PN} () {
56 # If we are not making an image we create links for the utilities that doesn't exist 120 # If we are not making an image we create links for the utilities that doesn't exist
57 # so the update-alternatives script will get the utilities it needs 121 # so the update-alternatives script will get the utilities it needs
@@ -62,3 +126,34 @@ pkg_postinst_${PN} () {
62 # This adds the links, remember that this has to work when building an image too, hence the $D 126 # This adds the links, remember that this has to work when building an image too, hence the $D
63 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 127 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
64} 128}
129
130pkg_prerm_${PN} () {
131 # This is so you can make busybox commit suicide - removing busybox with no other packages
132 # providing its files, this will make update-alternatives work, but the update-rc.d part
133 # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh
134 tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX`
135 ln -s /bin/busybox $tmpdir/[
136 ln -s /bin/busybox $tmpdir/test
137 ln -s /bin/busybox $tmpdir/head
138 ln -s /bin/busybox $tmpdir/sh
139 ln -s /bin/busybox $tmpdir/basename
140 ln -s /bin/busybox $tmpdir/echo
141 ln -s /bin/busybox $tmpdir/mv
142 ln -s /bin/busybox $tmpdir/ln
143 ln -s /bin/busybox $tmpdir/dirname
144 ln -s /bin/busybox $tmpdir/rm
145 ln -s /bin/busybox $tmpdir/sed
146 ln -s /bin/busybox $tmpdir/sort
147 export PATH=$PATH:$tmpdir
148
149 while read link
150 do
151 case "$link" in
152 /*/*/*) to="../../bin/busybox";;
153 /bin/*) to="busybox";;
154 /*/*) to="../bin/busybox";;
155 esac
156 bn=`basename $link`
157 sh /usr/bin/update-alternatives --remove $bn $to
158 done </etc/busybox.links
159}