Contents of /smage/trunk/core/busybox/busybox-1.27.2-r3.smage2
Parent Directory | Revision Log
Revision 10565 -
(show annotations)
(download)
Thu Aug 24 11:15:43 2017 UTC (6 years, 8 months ago) by niro
File size: 9647 byte(s)
Thu Aug 24 11:15:43 2017 UTC (6 years, 8 months ago) by niro
File size: 9647 byte(s)
-do not depend on virtual/sed but sys-apps/sed-4 to prevent dependency loops under some circumstances
1 | # $Id$ |
2 | |
3 | PNAME="busybox" |
4 | PVER="1.27.2" |
5 | PBUILD="r3" |
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/eject |
17 | virtual/grep |
18 | virtual/gzip |
19 | virtual/inetutils |
20 | virtual/kbd |
21 | virtual/less |
22 | virtual/net-tools |
23 | virtual/pciutils |
24 | virtual/procps |
25 | virtual/psmisc |
26 | virtual/shadow |
27 | virtual/sysvinit |
28 | virtual/sysvinit-tools |
29 | virtual/tar |
30 | virtual/unzip |
31 | virtual/usbutils |
32 | virtual/which |
33 | virtual/xz-utils" |
34 | |
35 | # busbox config revision |
36 | CFG_REV=1.21 |
37 | # udhcpc client script revision |
38 | UDHCPC_REV=1.1 |
39 | # busybox.tmpfilesd revision |
40 | TMP_REV=1.2 |
41 | # agetty emulation script revision |
42 | AGETTY_REV=1.3 |
43 | # loadkeys emulation script revision |
44 | LOADKEYS_REV=1.4 |
45 | # server services revisions |
46 | HTTPD_SVC_REV=1.2 |
47 | UDHCPD_SVC_REV=1.2 |
48 | TFTPD_SVC_REV=1.4 |
49 | TFTPD_CONFD_REV=1.2 |
50 | |
51 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
52 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
53 | |
54 | SDEPEND=">= virtual/sed" |
55 | |
56 | sminclude mtools systemd alx |
57 | |
58 | # shared busybox needs glibc and overwrite systemd dep pulled by systemd include |
59 | # we do not provide wget applet anymore, so depend on wget too |
60 | # we do not provide sed applet anymore, so depend on sed also but do not use virtual/sed |
61 | # or it results in an dependency loop if virtual/sed was previously installed as busybox |
62 | DEPEND=">= virtual/glibc |
63 | >= net-misc/wget-1.17 |
64 | >= sys-apps/sed-4" |
65 | |
66 | SRC_URI=( |
67 | http://www.busybox.net/downloads/${SRCFILE} |
68 | mirror://${PNAME}/${SRCFILE} |
69 | mirror://${PNAME}/config-${CFG_REV} |
70 | mirror://${PNAME}/udhcpc.sh-${UDHCPC_REV} |
71 | mirror://${PNAME}/de.kmap.gz |
72 | mirror://${PNAME}/zgrep.sh |
73 | mirror://${PNAME}/nologin.c |
74 | mirror://${PNAME}/crond.service |
75 | mirror://${PNAME}/busybox.tmpfilesd-${TMP_REV} |
76 | mirror://${PNAME}/loadkeys.sh-${LOADKEYS_REV} |
77 | mirror://${PNAME}/agetty.sh-${AGETTY_REV} |
78 | mirror://${PNAME}/autologin.sh |
79 | mirror://${PNAME}/lat9w-16.psfu.gz |
80 | mirror://${PNAME}/LatArCyrHeb-16.psfu.gz |
81 | mirror://${PNAME}/httpd.service-${HTTPD_SVC_REV} |
82 | mirror://${PNAME}/httpd.confd |
83 | mirror://${PNAME}/httpd.tmpfilesd |
84 | mirror://${PNAME}/udhcpd.service-${UDHCPD_SVC_REV} |
85 | mirror://${PNAME}/udhcpd.confd |
86 | mirror://${PNAME}/udhcpd.tmpfilesd |
87 | mirror://${PNAME}/tftpd.service-${TFTPD_SVC_REV} |
88 | mirror://${PNAME}/tftpd.socket |
89 | mirror://${PNAME}/tftpd.confd-${TFTPD_CONFD_REV} |
90 | mirror://${PNAME}/tftpd.tmpfilesd |
91 | mirror://${PNAME}/8859-1_to_uni.trans |
92 | mirror://${PNAME}/${PNAME}-1.25.1-cp-ignore-onefilesystem.patch |
93 | mirror://${PNAME}/${PNAME}-1.27.1-no-send-signals.patch |
94 | ) |
95 | |
96 | UP2DATE="updatecmd https://busybox.net/downloads/ | grep ${PNAME}-[0-9] | highesttarball" |
97 | |
98 | src_prepare() |
99 | { |
100 | munpack ${SRCFILE} || die |
101 | munpack de.kmap.gz ${SRCDIR} || die |
102 | munpack lat9w-16.psfu.gz ${SRCDIR} || die |
103 | munpack LatArCyrHeb-16.psfu.gz ${SRCDIR} || die |
104 | cd ${SRCDIR} |
105 | |
106 | # official patches |
107 | |
108 | # magellan patches |
109 | # let cp ignore the onefilesystem mode switch (cp -x prints an error) |
110 | mpatch ${PNAME}-1.25.1-cp-ignore-onefilesystem.patch || die |
111 | # do not send any signals on shutdown/reboot, we doing this via sendsignals rc |
112 | mpatch ${PNAME}-1.27.1-no-send-signals.patch || die |
113 | |
114 | # using a custom config |
115 | cp ${SOURCEDIR}/${PNAME}/config-${CFG_REV} .config || die |
116 | |
117 | # now included in config 1.19 |
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 | # now included in config 1.19 |
126 | # # use full blown wget to support ssl |
127 | # sed -i -e 's/.*\(CONFIG_WGET\).*/#\ \1 is not set/' \ |
128 | # -e 's/.*\(CONFIG_FEATURE_WGET_STATUSBAR\).*/#\ \1 is not set/' \ |
129 | # -e 's/.*\(CONFIG_FEATURE_WGET_AUTHENTICATION\).*/#\ \1 is not set/' \ |
130 | # -e 's/.*\(CONFIG_FEATURE_WGET_LONG_OPTIONS\).*/#\ \1 is not set/' \ |
131 | # -e 's/.*\(CONFIG_FEATURE_WGET_TIMEOUT\).*/#\ \1 is not set/' \ |
132 | # -e 's/.*\(CONFIG_FEATURE_WGET_OPENSSL\).*/#\ \1 is not set/' \ |
133 | # .config || die |
134 | |
135 | # now included in config 1.20 |
136 | # # do not use ifup/ifdown from busybox as dracut implements its own |
137 | # sed -i -e 's/.*\(CONFIG_IFUP\).*/#\ \1 is not set/' \ |
138 | # -e 's/.*\(CONFIG_IFDOWN\).*/#\ \1 is not set/' \ |
139 | # -e 's/.*\(CONFIG_IFUPDOWN_IFSTATE_PATH\).*/#\ \1 is not set/' \ |
140 | # -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_IP\).*/#\ \1 is not set/' \ |
141 | # -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_IPV4\).*/#\ \1 is not set/' \ |
142 | # -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_IPV6\).*/#\ \1 is not set/' \ |
143 | # -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_MAPPING\).*/#\ \1 is not set/' \ |
144 | # -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP\).*/#\ \1 is not set/' \ |
145 | # .config || die |
146 | |
147 | # now included in config 1.21 |
148 | # # use full blown losetup cmd from util-linux to fix dracuts losetup -f --show statements |
149 | # sed -i -e 's/.*\(CONFIG_LOSETUP\).*/#\ \1 is not set/' .config || die |
150 | # |
151 | # # use full blown ed to fix build issues with bc |
152 | # sed -i -e 's/.*\(CONFIG_ED\).*/#\ \1 is not set/' .config || die |
153 | # |
154 | # # use full blown tee from coreutils to fix build errors with smage while logging is enabled |
155 | # sed -i -e 's/.*\(CONFIG_TEE\).*/#\ \1 is not set/' .config || die |
156 | # |
157 | # # use full blown sed stat and date from coreutils to fix segfault issues with i686 and busybox 1.27.x |
158 | # sed -i -e 's/.*\(CONFIG_SED\).*/#\ \1 is not set/' .config || die |
159 | # sed -i -e 's/.*\(CONFIG_STAT\).*/#\ \1 is not set/' .config || die |
160 | # sed -i -e 's/.*\(CONFIG_DATE\).*/#\ \1 is not set/' .config || die |
161 | } |
162 | |
163 | src_compile() |
164 | { |
165 | cd ${SRCDIR} |
166 | |
167 | # fortify_source not supported |
168 | export CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/} |
169 | |
170 | make oldconfig || die |
171 | mmake || die |
172 | |
173 | # create a busybox.links file |
174 | HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die |
175 | |
176 | # now included in config 1.19 |
177 | # # do not use ash as default sh, we want bin/bash |
178 | # sed -i '/bin\/sh$/d' busybox.links || die |
179 | |
180 | # setfont resides in /bin on newer systems |
181 | sed -i 's:/sbin/setfont:/bin/setfont:' busybox.links || die |
182 | |
183 | # honor usr move |
184 | sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die |
185 | |
186 | # build nologin program |
187 | gcc ${CFLAGS} -o nologin ${SOURCEDIR}/${PNAME}/nologin.c || die |
188 | } |
189 | |
190 | src_install() |
191 | { |
192 | cd ${SRCDIR} |
193 | |
194 | minstallexec busybox || die |
195 | # set suid bit for suid applets like su |
196 | mchmod +s /usr/bin/busybox || die |
197 | |
198 | minstalldir /usr/share/busybox || die |
199 | minstallfile busybox.links /usr/share/busybox || die |
200 | |
201 | # systemd needs the keymaps in /usr/share/kbd/keymaps and no! symlinks are allowed |
202 | # keymaps must end with .map or .map.gz |
203 | # dracut uses /usr/share/kbd/keymaps too |
204 | minstalldir /usr/share/kbd/keymaps || die |
205 | minstallfile de.kmap /usr/share/kbd/keymaps/de.map || die |
206 | |
207 | minstalldir /usr/share/udhcpc || die |
208 | minstallexec -s udhcpc.sh-${UDHCPC_REV} /usr/share/udhcpc/default.script || die |
209 | |
210 | # install example udhcpd.conf |
211 | minstalletc examples/udhcp/udhcpd.conf || die |
212 | |
213 | # install initsystem services |
214 | minstallunit crond.service || die |
215 | minstalltmp busybox.tmpfilesd-${TMP_REV} busybox.conf || die |
216 | |
217 | # install server system services |
218 | # udhcpd |
219 | minstallunit udhcpd.service-${UDHCPD_SVC_REV} udhcpd.service || die |
220 | minstallconf udhcpd.confd udhcpd || die |
221 | minstalltmp udhcpd.tmpfilesd udhcpd.conf || die |
222 | # tftpd |
223 | minstallunit tftpd.service-${TFTPD_SVC_REV} tftpd.service || die |
224 | minstallunit tftpd.socket || die |
225 | minstallconf tftpd.confd-${TFTPD_CONFD_REV} tftpd || die |
226 | minstalltmp tftpd.tmpfilesd tftpd.conf || die |
227 | # httpd |
228 | minstallunit httpd.service-${HTTPD_SVC_REV} httpd.service || die |
229 | minstallconf httpd.confd httpd || die |
230 | minstalltmp httpd.tmpfilesd httpd.conf || die |
231 | |
232 | # loadkeys emulation script |
233 | minstallexec -s loadkeys.sh-${LOADKEYS_REV} /usr/bin/loadkeys || die |
234 | |
235 | # agetty emulation script |
236 | minstalldir /usr/sbin || die |
237 | minstallexec -s agetty.sh-${AGETTY_REV} /usr/sbin/agetty || die |
238 | |
239 | # autologin helper script |
240 | minstallexec -s autologin.sh /usr/sbin/autologin || die |
241 | |
242 | # install service configuration files and keep needed directories |
243 | mkeepdir /var/spool/cron/crontabs || die |
244 | |
245 | # install a busybox compilant zgrep script, at last needed by plymouth |
246 | minstallexec -s zgrep.sh /usr/bin/zgrep || die |
247 | |
248 | # install consolefont and trans from kbd-1.15.5 to fully emulate kbd |
249 | # for systemd without any configfile changes |
250 | # busybox cmds requires the base name without any extension, we provide symlinks for systemd |
251 | minstalldir /usr/share/kbd/consolefonts || die |
252 | minstallfile lat9w-16.psfu /usr/share/kbd/consolefonts/lat9w-16 || die |
253 | mlink lat9w-16 /usr/share/kbd/consolefonts/lat9w-16.psfu || die |
254 | minstallfile LatArCyrHeb-16.psfu /usr/share/kbd/consolefonts/LatArCyrHeb-16 || die |
255 | mlink LatArCyrHeb-16 /usr/share/kbd/consolefonts/LatArCyrHeb-16.psfu || die |
256 | minstalldir /usr/share/kbd/consoletrans || die |
257 | minstallfile -s 8859-1_to_uni.trans /usr/share/kbd/consoletrans/8859-1_to_uni || die |
258 | mlink 8859-1_to_uni /usr/share/kbd/consoletrans/8859-1_to_uni.trans || die |
259 | |
260 | # install nologin program |
261 | minstalldir /usr/sbin || die |
262 | minstallexec nologin /usr/sbin/nologin || die |
263 | |
264 | # install unimaps directory and a README to suppress warning messages by dracut |
265 | minstalldir /usr/share/kbd/unimaps || die |
266 | MCONFIG=/usr/share/kbd/unimaps/README || die |
267 | mclearconfig || die |
268 | maddconfig '# This directory only exist for compatibility reasons' || die |
269 | } |
270 | |
271 | postinstall() |
272 | { |
273 | if [ -x ${MROOT}/usr/bin/busybox ] |
274 | then |
275 | echo "Setting suid bit for ${MROOT}/usr/bin/busybox" |
276 | chmod +s ${MROOT}/usr/bin/busybox |
277 | fi |
278 | |
279 | if [ -f ${MROOT}/usr/share/busybox/busybox.links ] |
280 | then |
281 | echo "Setting up busybox links ... " |
282 | local i |
283 | for i in $(< ${MROOT}/usr/share/busybox/busybox.links) |
284 | do |
285 | ln -snf /usr/bin/busybox ${MROOT}/${i} |
286 | done |
287 | fi |
288 | } |