Magellan Linux

Contents of /smage/branches/alx07x-stable/core/busybox/busybox-1.32.0-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 14936 - (show annotations) (download)
Thu Aug 6 12:52:07 2020 UTC (3 years, 8 months ago) by niro
File size: 10880 byte(s)
-release branches/alx07x-stable
1 # $Id$
2
3 PNAME="busybox"
4 PVER="1.32.0"
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/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/sed
27 virtual/shadow
28 virtual/sysvinit
29 virtual/sysvinit-tools
30 virtual/tar
31 virtual/unzip
32 virtual/usbutils
33 virtual/which
34 virtual/xz-utils"
35
36 # busbox config revision
37 CFG_REV=1.24
38 # udhcpc client script revision
39 UDHCPC_REV=1.1
40 # busybox.tmpfilesd revision
41 TMP_REV=1.2
42 # agetty emulation script revision
43 AGETTY_REV=1.3
44 # loadkeys emulation script revision
45 LOADKEYS_REV=1.4
46 # server services revisions
47 HTTPD_SVC_REV=1.2
48 UDHCPD_SVC_REV=1.2
49 TFTPD_SVC_REV=1.4
50 TFTPD_CONFD_REV=1.2
51
52 SRCFILE="${PNAME}-${PVER}.tar.bz2"
53 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
54
55 SDEPEND=">= virtual/sed"
56
57 sminclude mtools systemd alx
58
59 # we do not provide wget applet anymore, so depend on wget too
60 DEPEND=">= net-misc/wget-1.17"
61
62 SRC_URI=(
63 http://www.busybox.net/downloads/${SRCFILE}
64 mirror://${PNAME}/${SRCFILE}
65 mirror://${PNAME}/config-${CFG_REV}
66 mirror://${PNAME}/udhcpc.sh-${UDHCPC_REV}
67 mirror://${PNAME}/de.kmap.gz
68 mirror://${PNAME}/zgrep.sh
69 #mirror://${PNAME}/nologin.c
70 mirror://${PNAME}/crond.service
71 mirror://${PNAME}/busybox.tmpfilesd-${TMP_REV}
72 mirror://${PNAME}/loadkeys.sh-${LOADKEYS_REV}
73 mirror://${PNAME}/agetty.sh-${AGETTY_REV}
74 mirror://${PNAME}/autologin.sh
75 mirror://${PNAME}/lat9w-16.psfu.gz
76 mirror://${PNAME}/LatArCyrHeb-16.psfu.gz
77 mirror://${PNAME}/httpd.service-${HTTPD_SVC_REV}
78 mirror://${PNAME}/httpd.confd
79 mirror://${PNAME}/httpd.tmpfilesd
80 mirror://${PNAME}/udhcpd.service-${UDHCPD_SVC_REV}
81 mirror://${PNAME}/udhcpd.confd
82 mirror://${PNAME}/udhcpd.tmpfilesd
83 mirror://${PNAME}/tftpd.service-${TFTPD_SVC_REV}
84 mirror://${PNAME}/tftpd.socket
85 mirror://${PNAME}/tftpd.confd-${TFTPD_CONFD_REV}
86 mirror://${PNAME}/tftpd.tmpfilesd
87 mirror://${PNAME}/8859-1_to_uni.trans
88 mirror://${PNAME}/${PNAME}-1.29.2-cp-ignore-onefilesystem.patch
89 mirror://${PNAME}/${PNAME}-1.27.1-no-send-signals.patch
90 )
91
92 UP2DATE="updatecmd https://busybox.net/downloads/ | grep ${PNAME}-[0-9] | highesttarball"
93
94 src_prepare()
95 {
96 munpack ${SRCFILE} || die
97 munpack de.kmap.gz ${SRCDIR} || die
98 munpack lat9w-16.psfu.gz ${SRCDIR} || die
99 munpack LatArCyrHeb-16.psfu.gz ${SRCDIR} || die
100 cd ${SRCDIR}
101
102 # official patches
103
104 # magellan patches
105 # let cp ignore the onefilesystem mode switch (cp -x prints an error)
106 mpatch ${PNAME}-1.29.2-cp-ignore-onefilesystem.patch || die
107 # do not send any signals on shutdown/reboot, we doing this via sendsignals rc
108 mpatch ${PNAME}-1.27.1-no-send-signals.patch || die
109
110 # using a custom config
111 cp ${SOURCEDIR}/${PNAME}/config-${CFG_REV} .config || die
112
113 # not required for busybox-1.29 anymore
114 # # fix a missing include with linux-musl-headers
115 # sed -i '1i#include <sys/resource.h>' include/libbb.h || 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 # now included in config 1.22
163 # # re-enable date, stat, sed
164 # sed -i -e 's/#\ \(CONFIG_DATE\) is not set/\1=y/' \
165 # -e 's/#\ \(CONFIG_FEATURE_DATE_ISOFMT\) is not set/\1=y/' \
166 # -e 's/#\ \(CONFIG_FEATURE_DATE_NANO\) is not set/\1=y/' \
167 # -e 's/#\ \(CONFIG_FEATURE_DATE_COMPAT\) is not set/\1=y/' \
168 # .config || die
169 # sed -i -e 's/#\ \(CONFIG_STAT\) is not set/\1=y/' \
170 # -e 's/#\ \(CONFIG_FEATURE_STAT_FORMAT\) is not set/\1=y/' \
171 # -e 's/#\ \(CONFIG_FEATURE_STAT_FILESYSTEM\) is not set/\1=y/' \
172 # .config || die
173 # sed -i -e 's/#\ \(CONFIG_SED\) is not set/\1=y/' .config || die
174
175 # now included in config-1.22
176 # # build a static busybox with musl
177 # sed -i -e 's/#\ \(CONFIG_STATIC\) is not set/\1=y/' .config || die
178 #
179 # # these vi options breaks with musl-gcc
180 # sed -i -e 's/.*\(CONFIG_FEATURE_VI_8BIT\).*/#\ \1 is not set/' \
181 # -e 's/.*\(CONFIG_FEATURE_VI_REGEX_SEARCH\).*/#\ \1 is not set/' \
182 # .config || die
183
184 # now included in config-1.23
185 # # use solib busybox build with system gcc to try to fix some i686 segfaults
186 # sed -i -e 's/#\ \(CONFIG_STATIC\)=y/\1 is not set/' .config || die
187 }
188
189 src_compile()
190 {
191 cd ${SRCDIR}
192
193 # fortify_source not supported
194 export CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
195
196 make oldconfig || die
197 mmake -j1 V=1 || die
198
199 # create a busybox.links file
200 HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die
201
202 # now included in config 1.19
203 # # do not use ash as default sh, we want bin/bash
204 # sed -i '/bin\/sh$/d' busybox.links || die
205
206 # setfont resides in /bin on newer systems
207 sed -i 's:/sbin/setfont:/bin/setfont:' busybox.links || die
208
209 # honor usr move
210 sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die
211
212 # now provided by >= busybox-1.30.1
213 # # build nologin program
214 # gcc ${CFLAGS} -o nologin ${SOURCEDIR}/${PNAME}/nologin.c || die
215 }
216
217 src_install()
218 {
219 cd ${SRCDIR}
220
221 minstallexec busybox || die
222 # set suid bit for suid applets like su
223 mchmod +s /usr/bin/busybox || die
224
225 minstalldir /usr/share/busybox || die
226 minstallfile busybox.links /usr/share/busybox || die
227
228 # systemd needs the keymaps in /usr/share/kbd/keymaps and no! symlinks are allowed
229 # keymaps must end with .map or .map.gz
230 # dracut uses /usr/share/kbd/keymaps too
231 minstalldir /usr/share/kbd/keymaps || die
232 minstallfile de.kmap /usr/share/kbd/keymaps/de.map || die
233
234 minstalldir /usr/share/udhcpc || die
235 minstallexec -s udhcpc.sh-${UDHCPC_REV} /usr/share/udhcpc/default.script || die
236
237 # install example udhcpd.conf
238 minstalletc examples/udhcp/udhcpd.conf || die
239
240 # install initsystem services
241 minstallunit crond.service || die
242 minstalltmp busybox.tmpfilesd-${TMP_REV} busybox.conf || die
243
244 # install server system services
245 # udhcpd
246 minstallunit udhcpd.service-${UDHCPD_SVC_REV} udhcpd.service || die
247 minstallconf udhcpd.confd udhcpd || die
248 minstalltmp udhcpd.tmpfilesd udhcpd.conf || die
249 # tftpd
250 minstallunit tftpd.service-${TFTPD_SVC_REV} tftpd.service || die
251 minstallunit tftpd.socket || die
252 minstallconf tftpd.confd-${TFTPD_CONFD_REV} tftpd || die
253 minstalltmp tftpd.tmpfilesd tftpd.conf || die
254 # httpd
255 minstallunit httpd.service-${HTTPD_SVC_REV} httpd.service || die
256 minstallconf httpd.confd httpd || die
257 minstalltmp httpd.tmpfilesd httpd.conf || die
258
259 # loadkeys emulation script
260 minstallexec -s loadkeys.sh-${LOADKEYS_REV} /usr/bin/loadkeys || die
261
262 # agetty emulation script
263 minstalldir /usr/sbin || die
264 minstallexec -s agetty.sh-${AGETTY_REV} /usr/sbin/agetty || die
265
266 # autologin helper script
267 minstallexec -s autologin.sh /usr/sbin/autologin || die
268
269 # install service configuration files and keep needed directories
270 mkeepdir /var/spool/cron/crontabs || die
271
272 # install a busybox compilant zgrep script, at least needed by plymouth
273 minstallexec -s zgrep.sh /usr/bin/zgrep || die
274
275 # install consolefont and trans from kbd-1.15.5 to fully emulate kbd
276 # for systemd without any configfile changes
277 # busybox cmds requires the base name without any extension, we provide symlinks for systemd
278 minstalldir /usr/share/kbd/consolefonts || die
279 minstallfile lat9w-16.psfu /usr/share/kbd/consolefonts/lat9w-16 || die
280 mlink lat9w-16 /usr/share/kbd/consolefonts/lat9w-16.psfu || die
281 minstallfile LatArCyrHeb-16.psfu /usr/share/kbd/consolefonts/LatArCyrHeb-16 || die
282 mlink LatArCyrHeb-16 /usr/share/kbd/consolefonts/LatArCyrHeb-16.psfu || die
283 minstalldir /usr/share/kbd/consoletrans || die
284 minstallfile -s 8859-1_to_uni.trans /usr/share/kbd/consoletrans/8859-1_to_uni || die
285 mlink 8859-1_to_uni /usr/share/kbd/consoletrans/8859-1_to_uni.trans || die
286
287 # now provided by >= busybox-1.30.1
288 # # install nologin program
289 # minstalldir /usr/sbin || die
290 # minstallexec nologin /usr/sbin/nologin || die
291
292 # install unimaps directory and a README to suppress warning messages by dracut
293 minstalldir /usr/share/kbd/unimaps || die
294 MCONFIG=/usr/share/kbd/unimaps/README
295 mclearconfig || die
296 maddconfig '# This directory only exist for compatibility reasons' || die
297
298 # install login.defs to satisfy meson
299 minstalldir /etc || die
300 MCONFIG=/etc/login.defs
301 mclearconfig || die
302 maddconfig '# This file only exist for compatibility reasons' || die
303 }
304
305 postinstall()
306 {
307 if [ -x ${MROOT}/usr/bin/busybox ]
308 then
309 echo "Setting suid bit for ${MROOT}/usr/bin/busybox"
310 chmod +s ${MROOT}/usr/bin/busybox
311 fi
312
313 if [ -f ${MROOT}/usr/share/busybox/busybox.links ]
314 then
315 echo "Setting up busybox links ... "
316 local i
317 for i in $(< ${MROOT}/usr/share/busybox/busybox.links)
318 do
319 ln -snf /usr/bin/busybox ${MROOT}/${i}
320 done
321 fi
322 }