Annotation of /smage/trunk/core/busybox/busybox-1.27.1-r1.smage2
Parent Directory | Revision Log
Revision 9576 -
(hide annotations)
(download)
Wed Jul 26 13:08:44 2017 UTC (7 years, 2 months ago) by niro
File size: 8865 byte(s)
Wed Jul 26 13:08:44 2017 UTC (7 years, 2 months ago) by niro
File size: 8865 byte(s)
auto added: ver bump to 1.27.1-r1
1 | niro | 9576 | # $Id$ |
2 | |||
3 | PNAME="busybox" | ||
4 | PVER="1.27.1" | ||
5 | PBUILD="r1" | ||
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.19 | ||
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 | # we do not provide wget applet anymore, so depend on wget too | ||
62 | DEPEND=">= virtual/glibc | ||
63 | >= net-misc/wget-1.17" | ||
64 | |||
65 | SRC_URI=( | ||
66 | http://www.busybox.net/downloads/${SRCFILE} | ||
67 | mirror://${PNAME}/${SRCFILE} | ||
68 | mirror://${PNAME}/config-${CFG_REV} | ||
69 | mirror://${PNAME}/udhcpc.sh-${UDHCPC_REV} | ||
70 | mirror://${PNAME}/de.kmap.gz | ||
71 | mirror://${PNAME}/zgrep.sh | ||
72 | mirror://${PNAME}/nologin.c | ||
73 | mirror://${PNAME}/crond.service | ||
74 | mirror://${PNAME}/busybox.tmpfilesd-${TMP_REV} | ||
75 | mirror://${PNAME}/loadkeys.sh-${LOADKEYS_REV} | ||
76 | mirror://${PNAME}/agetty.sh-${AGETTY_REV} | ||
77 | mirror://${PNAME}/autologin.sh | ||
78 | mirror://${PNAME}/lat9w-16.psfu.gz | ||
79 | mirror://${PNAME}/LatArCyrHeb-16.psfu.gz | ||
80 | mirror://${PNAME}/httpd.service-${HTTPD_SVC_REV} | ||
81 | mirror://${PNAME}/httpd.confd | ||
82 | mirror://${PNAME}/httpd.tmpfilesd | ||
83 | mirror://${PNAME}/udhcpd.service-${UDHCPD_SVC_REV} | ||
84 | mirror://${PNAME}/udhcpd.confd | ||
85 | mirror://${PNAME}/udhcpd.tmpfilesd | ||
86 | mirror://${PNAME}/tftpd.service-${TFTPD_SVC_REV} | ||
87 | mirror://${PNAME}/tftpd.socket | ||
88 | mirror://${PNAME}/tftpd.confd-${TFTPD_CONFD_REV} | ||
89 | mirror://${PNAME}/tftpd.tmpfilesd | ||
90 | mirror://${PNAME}/8859-1_to_uni.trans | ||
91 | mirror://${PNAME}/${PNAME}-1.25.1-cp-ignore-onefilesystem.patch | ||
92 | mirror://${PNAME}/${PNAME}-1.20.2-no-send-signals.patch | ||
93 | ) | ||
94 | |||
95 | src_prepare() | ||
96 | { | ||
97 | munpack ${SRCFILE} || die | ||
98 | munpack de.kmap.gz ${SRCDIR} || die | ||
99 | munpack lat9w-16.psfu.gz ${SRCDIR} || die | ||
100 | munpack LatArCyrHeb-16.psfu.gz ${SRCDIR} || die | ||
101 | cd ${SRCDIR} | ||
102 | |||
103 | # official patches | ||
104 | |||
105 | # magellan patches | ||
106 | # let cp ignore the onefilesystem mode switch (cp -x prints an error) | ||
107 | mpatch ${PNAME}-1.25.1-cp-ignore-onefilesystem.patch || die | ||
108 | # do not send any signals on shutdown/reboot, we doing this via sendsignals rc | ||
109 | mpatch ${PNAME}-1.20.2-no-send-signals.patch || die | ||
110 | |||
111 | # using a custom config | ||
112 | cp ${SOURCEDIR}/${PNAME}/config-${CFG_REV} .config || die | ||
113 | |||
114 | # now included in config 1.19 | ||
115 | # # disable swapon & swapoff; systemd requires the util-linux version | ||
116 | # # because it depends on some options the busybox version does not provide | ||
117 | # sed -i -e 's/.*\(CONFIG_SWAPONOFF\).*/#\ \1 is not set/' \ | ||
118 | # -e 's/.*\(CONFIG_FEATURE_SWAPON_DISCARD\).*/#\ \1 is not set/' \ | ||
119 | # -e 's/.*\(CONFIG_FEATURE_SWAPON_PRI\).*/#\ \1 is not set/' \ | ||
120 | # .config || die | ||
121 | |||
122 | # now included in config 1.19 | ||
123 | # # use full blown wget to support ssl | ||
124 | # sed -i -e 's/.*\(CONFIG_WGET\).*/#\ \1 is not set/' \ | ||
125 | # -e 's/.*\(CONFIG_FEATURE_WGET_STATUSBAR\).*/#\ \1 is not set/' \ | ||
126 | # -e 's/.*\(CONFIG_FEATURE_WGET_AUTHENTICATION\).*/#\ \1 is not set/' \ | ||
127 | # -e 's/.*\(CONFIG_FEATURE_WGET_LONG_OPTIONS\).*/#\ \1 is not set/' \ | ||
128 | # -e 's/.*\(CONFIG_FEATURE_WGET_TIMEOUT\).*/#\ \1 is not set/' \ | ||
129 | # -e 's/.*\(CONFIG_FEATURE_WGET_OPENSSL\).*/#\ \1 is not set/' \ | ||
130 | # .config || die | ||
131 | |||
132 | # do not use ifup/ifdown from busybox as dracut implements its own | ||
133 | sed -i -e 's/.*\(CONFIG_IFUP\).*/#\ \1 is not set/' \ | ||
134 | -e 's/.*\(CONFIG_IFDOWN\).*/#\ \1 is not set/' \ | ||
135 | -e 's/.*\(CONFIG_IFUPDOWN_IFSTATE_PATH\).*/#\ \1 is not set/' \ | ||
136 | -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_IP\).*/#\ \1 is not set/' \ | ||
137 | -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_IPV4\).*/#\ \1 is not set/' \ | ||
138 | -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_IPV6\).*/#\ \1 is not set/' \ | ||
139 | -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_MAPPING\).*/#\ \1 is not set/' \ | ||
140 | -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP\).*/#\ \1 is not set/' \ | ||
141 | .config || die | ||
142 | |||
143 | # use full blown losetup cmd from util-linux to fix dracuts losetup -f --show statements | ||
144 | sed -i -e 's/.*\(CONFIG_LOSETUP\).*/#\ \1 is not set/' .config || die | ||
145 | } | ||
146 | |||
147 | src_compile() | ||
148 | { | ||
149 | cd ${SRCDIR} | ||
150 | |||
151 | make oldconfig || die | ||
152 | mmake || die | ||
153 | |||
154 | # create a busybox.links file | ||
155 | HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die | ||
156 | |||
157 | # now included in config 1.19 | ||
158 | # # do not use ash as default sh, we want bin/bash | ||
159 | # sed -i '/bin\/sh$/d' busybox.links || die | ||
160 | |||
161 | # use full blown tee from coreutils to fix build errors with smage while logging is enabled | ||
162 | sed -i '/bin\/tee$/d' busybox.links || die | ||
163 | |||
164 | # use full blown ed to fix build issues with bc | ||
165 | sed -i '/bin\/ed$/d' busybox.links || die | ||
166 | |||
167 | # setfont resides in /bin on newer systems | ||
168 | sed -i 's:/sbin/setfont:/bin/setfont:' busybox.links || die | ||
169 | |||
170 | # honor usr move | ||
171 | sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die | ||
172 | |||
173 | # build nologin program | ||
174 | gcc ${CFLAGS} -o nologin ${SOURCEDIR}/${PNAME}/nologin.c || die | ||
175 | } | ||
176 | |||
177 | src_install() | ||
178 | { | ||
179 | cd ${SRCDIR} | ||
180 | |||
181 | minstallexec busybox || die | ||
182 | # set suid bit for suid applets like su | ||
183 | mchmod +s /usr/bin/busybox || die | ||
184 | |||
185 | minstalldir /usr/share/busybox || die | ||
186 | minstallfile busybox.links /usr/share/busybox || die | ||
187 | |||
188 | # systemd needs the keymaps in /usr/share/kbd/keymaps and no! symlinks are allowed | ||
189 | # keymaps must end with .map or .map.gz | ||
190 | # dracut uses /usr/share/kbd/keymaps too | ||
191 | minstalldir /usr/share/kbd/keymaps || die | ||
192 | minstallfile de.kmap /usr/share/kbd/keymaps/de.map || die | ||
193 | |||
194 | minstalldir /usr/share/udhcpc || die | ||
195 | minstallexec -s udhcpc.sh-${UDHCPC_REV} /usr/share/udhcpc/default.script || die | ||
196 | |||
197 | # install example udhcpd.conf | ||
198 | minstalletc examples/udhcp/udhcpd.conf || die | ||
199 | |||
200 | # install initsystem services | ||
201 | minstallunit crond.service || die | ||
202 | minstalltmp busybox.tmpfilesd-${TMP_REV} busybox.conf || die | ||
203 | |||
204 | # install server system services | ||
205 | # udhcpd | ||
206 | minstallunit udhcpd.service-${UDHCPD_SVC_REV} udhcpd.service || die | ||
207 | minstallconf udhcpd.confd udhcpd || die | ||
208 | minstalltmp udhcpd.tmpfilesd udhcpd.conf || die | ||
209 | # tftpd | ||
210 | minstallunit tftpd.service-${TFTPD_SVC_REV} tftpd.service || die | ||
211 | minstallunit tftpd.socket || die | ||
212 | minstallconf tftpd.confd-${TFTPD_CONFD_REV} tftpd || die | ||
213 | minstalltmp tftpd.tmpfilesd tftpd.conf || die | ||
214 | # httpd | ||
215 | minstallunit httpd.service-${HTTPD_SVC_REV} httpd.service || die | ||
216 | minstallconf httpd.confd httpd || die | ||
217 | minstalltmp httpd.tmpfilesd httpd.conf || die | ||
218 | |||
219 | # loadkeys emulation script | ||
220 | minstallexec -s loadkeys.sh-${LOADKEYS_REV} /usr/bin/loadkeys || die | ||
221 | |||
222 | # agetty emulation script | ||
223 | minstalldir /usr/sbin || die | ||
224 | minstallexec -s agetty.sh-${AGETTY_REV} /usr/sbin/agetty || die | ||
225 | |||
226 | # autologin helper script | ||
227 | minstallexec -s autologin.sh /usr/sbin/autologin || die | ||
228 | |||
229 | # install service configuration files and keep needed directories | ||
230 | mkeepdir /var/spool/cron/crontabs || die | ||
231 | |||
232 | # install a busybox compilant zgrep script, at last needed by plymouth | ||
233 | minstallexec -s zgrep.sh /usr/bin/zgrep || die | ||
234 | |||
235 | # install consolefont and trans from kbd-1.15.5 to fully emulate kbd | ||
236 | # for systemd without any configfile changes | ||
237 | # busybox cmds requires the base name without any extension, we provide symlinks for systemd | ||
238 | minstalldir /usr/share/kbd/consolefonts || die | ||
239 | minstallfile lat9w-16.psfu /usr/share/kbd/consolefonts/lat9w-16 || die | ||
240 | mlink lat9w-16 /usr/share/kbd/consolefonts/lat9w-16.psfu || die | ||
241 | minstallfile LatArCyrHeb-16.psfu /usr/share/kbd/consolefonts/LatArCyrHeb-16 || die | ||
242 | mlink LatArCyrHeb-16 /usr/share/kbd/consolefonts/LatArCyrHeb-16.psfu || die | ||
243 | minstalldir /usr/share/kbd/consoletrans || die | ||
244 | minstallfile -s 8859-1_to_uni.trans /usr/share/kbd/consoletrans/8859-1_to_uni || die | ||
245 | mlink 8859-1_to_uni /usr/share/kbd/consoletrans/8859-1_to_uni.trans || die | ||
246 | |||
247 | # install nologin program | ||
248 | minstalldir /usr/sbin || die | ||
249 | minstallexec nologin /usr/sbin/nologin || die | ||
250 | |||
251 | # install unimaps directory and a README to suppress warning messages by dracut | ||
252 | minstalldir /usr/share/kbd/unimaps || die | ||
253 | MCONFIG=/usr/share/kbd/unimaps/README || die | ||
254 | mclearconfig || die | ||
255 | maddconfig '# This directory only exist for compatibility reasons' || die | ||
256 | } | ||
257 | |||
258 | postinstall() | ||
259 | { | ||
260 | if [ -x ${MROOT}/usr/bin/busybox ] | ||
261 | then | ||
262 | echo "Setting suid bit for ${MROOT}/usr/bin/busybox" | ||
263 | chmod +s ${MROOT}/usr/bin/busybox | ||
264 | fi | ||
265 | |||
266 | if [ -f ${MROOT}/usr/share/busybox/busybox.links ] | ||
267 | then | ||
268 | echo "Setting up busybox links ... " | ||
269 | local i | ||
270 | for i in $(< ${MROOT}/usr/share/busybox/busybox.links) | ||
271 | do | ||
272 | ln -snf /usr/bin/busybox ${MROOT}/${i} | ||
273 | done | ||
274 | fi | ||
275 | } |