5 DEFAULT_PREFERENCE
= "-1"
8 http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
10 file://wget-long-options.patch;patch=1 \
12 SRC_URI
[tarball.md5sum
] = "ae8a4c65b9464c8ece3483a3d3b9544c"
13 SRC_URI
[tarball.sha256sum
] = "4de9fb2bb018e381e64199b38d90cb25e71366c37a8995e9ab5ed206ebcb972f"
16 install
-m
0644 $
{WORKDIR
}/defconfig $
{S
}/.config.oe
18 echo
"CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"" > $
{S
}/.config
19 echo
"USING_CROSS_COMPILER=y" >> $
{S
}/.config
21 sed
-e '
/CROSS_COMPILER_PREFIX
/d' \
22 -e '
/USING_CROSS_COMPILER
/d' \
23 '$
{S
}/.config.oe'
>>'$
{S
}/.config'
28 install
-d $
{D
}$
{sysconfdir
}/init.d
29 oe_runmake
"PREFIX=${D}" install
30 cp
-pPR $
{S
}/_install
/* $
{D
}/
32 # Move everything
to /busybox
(not supposed
to end up in any package
)
33 install
-d $
{D
}/busybox
36 cp
-dPr $
{D
}$
{base_bindir
} $
{D
}$
{base_sbindir
} $
{D
}$
{prefix
} $
{D
}/busybox
/
37 # Move the busybox binary back
to /bin
38 install
-d $
{D
}$
{base_bindir
}
39 mv $
{D
}/busybox$
{base_bindir
}/busybox $
{D
}$
{base_bindir
}/
40 # Move back the sh symlink
41 test
-h $
{D
}/busybox$
{base_bindir
}/sh
&& mv $
{D
}/busybox$
{base_bindir
}/sh $
{D
}$
{base_bindir
}/
43 install
-m
0755 $
{WORKDIR
}/syslog $
{D
}$
{sysconfdir
}/init.d
/
44 install
-m
644 $
{WORKDIR
}/syslog.conf $
{D
}$
{sysconfdir
}/
45 if grep
"CONFIG_CROND=y" $
{WORKDIR
}/defconfig
; then
46 # Move crond back
to /usr
/sbin
/crond
47 install
-d $
{D
}$
{sbindir
}
48 mv $
{D
}/busybox$
{sbindir
}/crond $
{D
}$
{sbindir
}/
50 install
-m
0755 $
{WORKDIR
}/busybox
-cron $
{D
}$
{sysconfdir
}/init.d
/
52 if grep
"CONFIG_HTTPD=y" $
{WORKDIR
}/defconfig
; then
53 # Move httpd back
to /usr
/sbin
/httpd
54 install
-d $
{D
}$
{sbindir
}
55 mv $
{D
}/busybox$
{sbindir
}/httpd $
{D
}$
{sbindir
}/
57 install
-m
0755 $
{WORKDIR
}/busybox
-httpd $
{D
}$
{sysconfdir
}/init.d
/
58 install
-d $
{D
}/srv
/www
60 if grep
"CONFIG_APP_UDHCPD=y" $
{WORKDIR
}/defconfig
; then
61 # Move udhcpd back
to /usr
/sbin
/udhcpd
62 install
-d $
{D
}$
{sbindir
}
63 mv $
{D
}/busybox$
{sbindir
}/udhcpd $
{D
}$
{sbindir
}/
65 install
-m
0755 $
{WORKDIR
}/busybox
-udhcpd $
{D
}$
{sysconfdir
}/init.d
/
67 if grep
"CONFIG_HWCLOCK=y" $
{WORKDIR
}/defconfig
; then
68 # Move hwclock back
to /sbin
/hwclock
69 install
-d $
{D
}$
{base_sbindir
}
70 mv $
{D
}/busybox$
{base_sbindir
}/hwclock $
{D
}$
{base_sbindir
}/
72 install
-m
0755 $
{WORKDIR
}/hwclock.sh $
{D
}$
{sysconfdir
}/init.d
/
74 if grep
"CONFIG_APP_UDHCPC=y" $
{WORKDIR
}/defconfig
; then
75 # Move dhcpc back
to /usr
/sbin
/udhcpc
76 install
-d $
{D
}$
{base_sbindir
}
77 mv $
{D
}/busybox$
{base_sbindir
}/udhcpc $
{D
}$
{base_sbindir
}/
79 install
-d $
{D
}$
{sysconfdir
}/udhcpc.d
80 install
-d $
{D
}$
{datadir
}/udhcpc
81 install
-m
0755 $
{S
}/examples
/udhcp
/simple.script $
{D
}$
{sysconfdir
}/udhcpc.d
/50default
82 install
-m
0755 $
{WORKDIR
}/default.script $
{D
}$
{datadir
}/udhcpc
/default.script
85 install
-m
0644 $
{S
}/busybox.links $
{D
}$
{sysconfdir
}
89 # This is so you can make busybox commit suicide
- removing busybox with no other packages
90 # providing its files
, this will make update
-alternatives work
, but the update
-rc.d part
91 #
for syslog
, httpd
and/or udhcpd will fail
if there is no other package providing sh
92 tmpdir
=`mktemp
-d
/tmp
/busyboxrm
-XXXXXX`
93 ln
-s
/bin/busybox $tmpdir
/[
94 ln
-s
/bin/busybox $tmpdir
/test
95 ln
-s
/bin/busybox $tmpdir
/head
96 ln
-s
/bin/busybox $tmpdir
/sh
97 ln
-s
/bin/busybox $tmpdir
/basename
98 ln
-s
/bin/busybox $tmpdir
/echo
99 ln
-s
/bin/busybox $tmpdir
/mv
100 ln
-s
/bin/busybox $tmpdir
/ln
101 ln
-s
/bin/busybox $tmpdir
/dirname
102 ln
-s
/bin/busybox $tmpdir
/rm
103 ln
-s
/bin/busybox $tmpdir
/sed
104 ln
-s
/bin/busybox $tmpdir
/sort
105 export PATH
=$PATH
:$tmpdir
106 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