Contents of /smage/trunk/core/busybox/busybox-1.24.2-r2.smage2
Parent Directory | Revision Log
Revision 8940 -
(show annotations)
(download)
Fri Apr 8 07:49:56 2016 UTC (8 years ago) by niro
File size: 8018 byte(s)
Fri Apr 8 07:49:56 2016 UTC (8 years ago) by niro
File size: 8018 byte(s)
auto added: ver bump to 1.24.2-r2
1 | # $Id$ |
2 | |
3 | PNAME="busybox" |
4 | PVER="1.24.2" |
5 | PBUILD="r2" |
6 | |
7 | PCAT="sys-apps" |
8 | |
9 | DESCRIPTION="BusyBox combines tiny versions of many common UNIX utilities into a single small executable." |
10 | HOMEPAGE="http://www.busybox.net/" |
11 | |
12 | PROVIDE="virtual/bzip2 |
13 | virtual/cron |
14 | virtual/debianutils |
15 | virtual/dhcp |
16 | virtual/ed |
17 | virtual/eject |
18 | virtual/grep |
19 | virtual/gzip |
20 | virtual/inetutils |
21 | virtual/kbd |
22 | virtual/less |
23 | virtual/net-tools |
24 | virtual/pciutils |
25 | virtual/procps |
26 | virtual/psmisc |
27 | virtual/sed |
28 | virtual/shadow |
29 | virtual/sysvinit |
30 | virtual/sysvinit-tools |
31 | virtual/tar |
32 | virtual/unzip |
33 | virtual/usbutils |
34 | virtual/which |
35 | virtual/xz-utils" |
36 | |
37 | # busbox config revision |
38 | CFG_REV=1.18 |
39 | # udhcpc client script revision |
40 | UDHCPC_REV=1.1 |
41 | # busybox.tmpfilesd revision |
42 | TMP_REV=1.2 |
43 | # agetty emulation script revision |
44 | AGETTY_REV=1.3 |
45 | # loadkeys emulation script revision |
46 | LOADKEYS_REV=1.4 |
47 | # server services revisions |
48 | HTTPD_SVC_REV=1.2 |
49 | UDHCPD_SVC_REV=1.2 |
50 | TFTPD_SVC_REV=1.4 |
51 | TFTPD_CONFD_REV=1.2 |
52 | |
53 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
54 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
55 | |
56 | SDEPEND=">= virtual/sed" |
57 | |
58 | sminclude mtools systemd alx |
59 | |
60 | # shared busybox needs glibc and overwrite systemd dep pulled by systemd include |
61 | DEPEND=">= virtual/glibc" |
62 | |
63 | SRC_URI=( |
64 | http://www.busybox.net/downloads/${SRCFILE} |
65 | mirror://${PNAME}/${SRCFILE} |
66 | mirror://${PNAME}/config-${CFG_REV} |
67 | mirror://${PNAME}/udhcpc.sh-${UDHCPC_REV} |
68 | mirror://${PNAME}/de.kmap.gz |
69 | mirror://${PNAME}/zgrep.sh |
70 | mirror://${PNAME}/nologin.c |
71 | mirror://${PNAME}/crond.service |
72 | mirror://${PNAME}/busybox.tmpfilesd-${TMP_REV} |
73 | mirror://${PNAME}/loadkeys.sh-${LOADKEYS_REV} |
74 | mirror://${PNAME}/agetty.sh-${AGETTY_REV} |
75 | mirror://${PNAME}/autologin.sh |
76 | mirror://${PNAME}/lat9w-16.psfu.gz |
77 | mirror://${PNAME}/LatArCyrHeb-16.psfu.gz |
78 | mirror://${PNAME}/httpd.service-${HTTPD_SVC_REV} |
79 | mirror://${PNAME}/httpd.confd |
80 | mirror://${PNAME}/httpd.tmpfilesd |
81 | mirror://${PNAME}/udhcpd.service-${UDHCPD_SVC_REV} |
82 | mirror://${PNAME}/udhcpd.confd |
83 | mirror://${PNAME}/udhcpd.tmpfilesd |
84 | mirror://${PNAME}/tftpd.service-${TFTPD_SVC_REV} |
85 | mirror://${PNAME}/tftpd.socket |
86 | mirror://${PNAME}/tftpd.confd-${TFTPD_CONFD_REV} |
87 | mirror://${PNAME}/tftpd.tmpfilesd |
88 | mirror://${PNAME}/8859-1_to_uni.trans |
89 | mirror://${PNAME}/${PNAME}-1.24.1-cp-ignore-onefilesystem.patch |
90 | mirror://${PNAME}/${PNAME}-1.20.2-no-send-signals.patch |
91 | mirror://${PNAME}/${PNAME}-1.24.2-ash-recursive-heredocs.patch |
92 | mirror://${PNAME}/${PNAME}-1.24.2-CVE-2016-2147.patch |
93 | mirror://${PNAME}/${PNAME}-1.24.2-CVE-2016-2148.patch |
94 | ) |
95 | |
96 | src_prepare() |
97 | { |
98 | munpack ${SRCFILE} || die |
99 | munpack de.kmap.gz ${SRCDIR} || die |
100 | munpack lat9w-16.psfu.gz ${SRCDIR} || die |
101 | munpack LatArCyrHeb-16.psfu.gz ${SRCDIR} || die |
102 | cd ${SRCDIR} |
103 | |
104 | # official patches |
105 | mpatch ${PNAME}-1.24.2-ash-recursive-heredocs.patch || die |
106 | mpatch ${PNAME}-1.24.2-CVE-2016-2147.patch || die |
107 | mpatch ${PNAME}-1.24.2-CVE-2016-2148.patch || die |
108 | |
109 | # magellan patches |
110 | # let cp ignore the onefilesystem mode switch (cp -x prints an error) |
111 | mpatch ${PNAME}-1.24.1-cp-ignore-onefilesystem.patch || die |
112 | # do not send any signals on shutdown/reboot, we doing this via sendsignals rc |
113 | mpatch ${PNAME}-1.20.2-no-send-signals.patch || die |
114 | |
115 | # using a custom config |
116 | cp ${SOURCEDIR}/${PNAME}/config-${CFG_REV} .config || die |
117 | |
118 | # disable swapon & swapoff; systemd requires the util-linux version |
119 | # because it depends on some options the busybox version does not provide |
120 | sed -i -e 's/.*\(CONFIG_SWAPONOFF\).*/#\ \1 is not set/' \ |
121 | -e 's/.*\(CONFIG_FEATURE_SWAPON_DISCARD\).*/#\ \1 is not set/' \ |
122 | -e 's/.*\(CONFIG_FEATURE_SWAPON_PRI\).*/#\ \1 is not set/' \ |
123 | .config || die |
124 | |
125 | # use full blown wget to support ssl |
126 | sed -i -e 's/.*\(CONFIG_WGET\).*/#\ \1 is not set/' \ |
127 | -e 's/.*\(CONFIG_FEATURE_WGET_STATUSBAR\).*/#\ \1 is not set/' \ |
128 | -e 's/.*\(CONFIG_FEATURE_WGET_AUTHENTICATION\).*/#\ \1 is not set/' \ |
129 | -e 's/.*\(CONFIG_FEATURE_WGET_LONG_OPTIONS\).*/#\ \1 is not set/' \ |
130 | -e 's/.*\(CONFIG_FEATURE_WGET_TIMEOUT\).*/#\ \1 is not set/' \ |
131 | -e 's/.*\(CONFIG_FEATURE_WGET_OPENSSL\).*/#\ \1 is not set/' \ |
132 | .config || die |
133 | } |
134 | |
135 | src_compile() |
136 | { |
137 | cd ${SRCDIR} |
138 | |
139 | make oldconfig || die |
140 | mmake || die |
141 | |
142 | # create a busybox.links file |
143 | HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die |
144 | |
145 | # do not use ash as default sh, we want bin/bash |
146 | sed -i '/bin\/sh$/d' busybox.links || die |
147 | |
148 | # setfont resides in /bin on newer systems |
149 | sed -i 's:/sbin/setfont:/bin/setfont:' busybox.links || die |
150 | |
151 | # honor usr move |
152 | sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die |
153 | |
154 | # build nologin program |
155 | gcc ${CFLAGS} -o nologin ${SOURCEDIR}/${PNAME}/nologin.c || die |
156 | } |
157 | |
158 | src_install() |
159 | { |
160 | cd ${SRCDIR} |
161 | |
162 | minstallexec busybox || die |
163 | # set suid bit for suid applets like su |
164 | mchmod +s /usr/bin/busybox || die |
165 | |
166 | minstalldir /usr/share/busybox || die |
167 | minstallfile busybox.links /usr/share/busybox || die |
168 | |
169 | # systemd needs the keymaps in /usr/share/kbd/keymaps and no! symlinks are allowed |
170 | # keymaps must end with .map or .map.gz |
171 | # dracut uses /usr/share/kbd/keymaps too |
172 | minstalldir /usr/share/kbd/keymaps || die |
173 | minstallfile de.kmap /usr/share/kbd/keymaps/de.map || die |
174 | |
175 | minstalldir /usr/share/udhcpc || die |
176 | minstallexec -s udhcpc.sh-${UDHCPC_REV} /usr/share/udhcpc/default.script || die |
177 | |
178 | # install example udhcpd.conf |
179 | minstalletc examples/udhcp/udhcpd.conf || die |
180 | |
181 | # install initsystem services |
182 | minstallunit crond.service || die |
183 | minstalltmp busybox.tmpfilesd-${TMP_REV} busybox.conf || die |
184 | |
185 | # install server system services |
186 | # udhcpd |
187 | minstallunit udhcpd.service-${UDHCPD_SVC_REV} udhcpd.service || die |
188 | minstallconf udhcpd.confd udhcpd || die |
189 | minstalltmp udhcpd.tmpfilesd udhcpd.conf || die |
190 | # tftpd |
191 | minstallunit tftpd.service-${TFTPD_SVC_REV} tftpd.service || die |
192 | minstallunit tftpd.socket || die |
193 | minstallconf tftpd.confd-${TFTPD_CONFD_REV} tftpd || die |
194 | minstalltmp tftpd.tmpfilesd tftpd.conf || die |
195 | # httpd |
196 | minstallunit httpd.service-${HTTPD_SVC_REV} httpd.service || die |
197 | minstallconf httpd.confd httpd || die |
198 | minstalltmp httpd.tmpfilesd httpd.conf || die |
199 | |
200 | # loadkeys emulation script |
201 | minstallexec -s loadkeys.sh-${LOADKEYS_REV} /usr/bin/loadkeys || die |
202 | |
203 | # agetty emulation script |
204 | minstalldir /usr/sbin || die |
205 | minstallexec -s agetty.sh-${AGETTY_REV} /usr/sbin/agetty || die |
206 | |
207 | # autologin helper script |
208 | minstallexec -s autologin.sh /usr/sbin/autologin || die |
209 | |
210 | # install service configuration files and keep needed directories |
211 | mkeepdir /var/spool/cron/crontabs || die |
212 | |
213 | # install a busybox compilant zgrep script, at last needed by plymouth |
214 | minstallexec -s zgrep.sh /usr/bin/zgrep || die |
215 | |
216 | # install consolefont and trans from kbd-1.15.5 to fully emulate kbd |
217 | # for systemd without any configfile changes |
218 | # busybox cmds requires the base name without any extension, we provide symlinks for systemd |
219 | minstalldir /usr/share/kbd/consolefonts || die |
220 | minstallfile lat9w-16.psfu /usr/share/kbd/consolefonts/lat9w-16 || die |
221 | mlink lat9w-16 /usr/share/kbd/consolefonts/lat9w-16.psfu || die |
222 | minstallfile LatArCyrHeb-16.psfu /usr/share/kbd/consolefonts/LatArCyrHeb-16 || die |
223 | mlink LatArCyrHeb-16 /usr/share/kbd/consolefonts/LatArCyrHeb-16.psfu || die |
224 | minstalldir /usr/share/kbd/consoletrans || die |
225 | minstallfile -s 8859-1_to_uni.trans /usr/share/kbd/consoletrans/8859-1_to_uni || die |
226 | mlink 8859-1_to_uni /usr/share/kbd/consoletrans/8859-1_to_uni.trans || die |
227 | |
228 | # install nologin program |
229 | minstalldir /usr/sbin || die |
230 | minstallexec nologin /usr/sbin/nologin || die |
231 | |
232 | # install unimaps directory and a README to suppress warning messages by dracut |
233 | minstalldir /usr/share/kbd/unimaps || die |
234 | MCONFIG=/usr/share/kbd/unimaps/README || die |
235 | mclearconfig || die |
236 | maddconfig '# This directory only exist for compatibility reasons' || die |
237 | } |
238 | |
239 | postinstall() |
240 | { |
241 | if [ -x ${MROOT}/usr/bin/busybox ] |
242 | then |
243 | echo "Setting suid bit for ${MROOT}/usr/bin/busybox" |
244 | chmod +s ${MROOT}/usr/bin/busybox |
245 | fi |
246 | |
247 | if [ -f ${MROOT}/usr/share/busybox/busybox.links ] |
248 | then |
249 | echo "Setting up busybox links ... " |
250 | local i |
251 | for i in $(< ${MROOT}/usr/share/busybox/busybox.links) |
252 | do |
253 | ln -snf /usr/bin/busybox ${MROOT}/${i} |
254 | done |
255 | fi |
256 | } |