Magellan Linux

Contents of /smage/trunk/core/busybox/busybox-1.27.2-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10461 - (show annotations) (download)
Tue Aug 22 14:36:37 2017 UTC (6 years, 9 months ago) by niro
File size: 9528 byte(s)
-use updated busybox configuration
1 # $Id$
2
3 PNAME="busybox"
4 PVER="1.27.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/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
61 DEPEND=">= virtual/glibc
62 >= net-misc/wget-1.17
63 >= virtual/sed"
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.27.1-no-send-signals.patch
93 )
94
95 UP2DATE="updatecmd https://busybox.net/downloads/ | grep ${PNAME}-[0-9] | highesttarball"
96
97 src_prepare()
98 {
99 munpack ${SRCFILE} || die
100 munpack de.kmap.gz ${SRCDIR} || die
101 munpack lat9w-16.psfu.gz ${SRCDIR} || die
102 munpack LatArCyrHeb-16.psfu.gz ${SRCDIR} || die
103 cd ${SRCDIR}
104
105 # official patches
106
107 # magellan patches
108 # let cp ignore the onefilesystem mode switch (cp -x prints an error)
109 mpatch ${PNAME}-1.25.1-cp-ignore-onefilesystem.patch || die
110 # do not send any signals on shutdown/reboot, we doing this via sendsignals rc
111 mpatch ${PNAME}-1.27.1-no-send-signals.patch || die
112
113 # using a custom config
114 cp ${SOURCEDIR}/${PNAME}/config-${CFG_REV} .config || die
115
116 # now included in config 1.19
117 # # disable swapon & swapoff; systemd requires the util-linux version
118 # # because it depends on some options the busybox version does not provide
119 # sed -i -e 's/.*\(CONFIG_SWAPONOFF\).*/#\ \1 is not set/' \
120 # -e 's/.*\(CONFIG_FEATURE_SWAPON_DISCARD\).*/#\ \1 is not set/' \
121 # -e 's/.*\(CONFIG_FEATURE_SWAPON_PRI\).*/#\ \1 is not set/' \
122 # .config || die
123
124 # now included in config 1.19
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 # now included in config 1.20
135 # # do not use ifup/ifdown from busybox as dracut implements its own
136 # sed -i -e 's/.*\(CONFIG_IFUP\).*/#\ \1 is not set/' \
137 # -e 's/.*\(CONFIG_IFDOWN\).*/#\ \1 is not set/' \
138 # -e 's/.*\(CONFIG_IFUPDOWN_IFSTATE_PATH\).*/#\ \1 is not set/' \
139 # -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_IP\).*/#\ \1 is not set/' \
140 # -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_IPV4\).*/#\ \1 is not set/' \
141 # -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_IPV6\).*/#\ \1 is not set/' \
142 # -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_MAPPING\).*/#\ \1 is not set/' \
143 # -e 's/.*\(CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP\).*/#\ \1 is not set/' \
144 # .config || die
145
146 # now included in config 1.21
147 # # use full blown losetup cmd from util-linux to fix dracuts losetup -f --show statements
148 # sed -i -e 's/.*\(CONFIG_LOSETUP\).*/#\ \1 is not set/' .config || die
149 #
150 # # use full blown ed to fix build issues with bc
151 # sed -i -e 's/.*\(CONFIG_ED\).*/#\ \1 is not set/' .config || die
152 #
153 # # use full blown tee from coreutils to fix build errors with smage while logging is enabled
154 # sed -i -e 's/.*\(CONFIG_TEE\).*/#\ \1 is not set/' .config || die
155 #
156 # # use full blown sed stat and date from coreutils to fix segfault issues with i686 and busybox 1.27.x
157 # sed -i -e 's/.*\(CONFIG_SED\).*/#\ \1 is not set/' .config || die
158 # sed -i -e 's/.*\(CONFIG_STAT\).*/#\ \1 is not set/' .config || die
159 # sed -i -e 's/.*\(CONFIG_DATE\).*/#\ \1 is not set/' .config || die
160 }
161
162 src_compile()
163 {
164 cd ${SRCDIR}
165
166 # fortify_source not supported
167 export CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
168
169 make oldconfig || die
170 mmake || die
171
172 # create a busybox.links file
173 HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die
174
175 # now included in config 1.19
176 # # do not use ash as default sh, we want bin/bash
177 # sed -i '/bin\/sh$/d' busybox.links || die
178
179 # setfont resides in /bin on newer systems
180 sed -i 's:/sbin/setfont:/bin/setfont:' busybox.links || die
181
182 # honor usr move
183 sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die
184
185 # build nologin program
186 gcc ${CFLAGS} -o nologin ${SOURCEDIR}/${PNAME}/nologin.c || die
187 }
188
189 src_install()
190 {
191 cd ${SRCDIR}
192
193 minstallexec busybox || die
194 # set suid bit for suid applets like su
195 mchmod +s /usr/bin/busybox || die
196
197 minstalldir /usr/share/busybox || die
198 minstallfile busybox.links /usr/share/busybox || die
199
200 # systemd needs the keymaps in /usr/share/kbd/keymaps and no! symlinks are allowed
201 # keymaps must end with .map or .map.gz
202 # dracut uses /usr/share/kbd/keymaps too
203 minstalldir /usr/share/kbd/keymaps || die
204 minstallfile de.kmap /usr/share/kbd/keymaps/de.map || die
205
206 minstalldir /usr/share/udhcpc || die
207 minstallexec -s udhcpc.sh-${UDHCPC_REV} /usr/share/udhcpc/default.script || die
208
209 # install example udhcpd.conf
210 minstalletc examples/udhcp/udhcpd.conf || die
211
212 # install initsystem services
213 minstallunit crond.service || die
214 minstalltmp busybox.tmpfilesd-${TMP_REV} busybox.conf || die
215
216 # install server system services
217 # udhcpd
218 minstallunit udhcpd.service-${UDHCPD_SVC_REV} udhcpd.service || die
219 minstallconf udhcpd.confd udhcpd || die
220 minstalltmp udhcpd.tmpfilesd udhcpd.conf || die
221 # tftpd
222 minstallunit tftpd.service-${TFTPD_SVC_REV} tftpd.service || die
223 minstallunit tftpd.socket || die
224 minstallconf tftpd.confd-${TFTPD_CONFD_REV} tftpd || die
225 minstalltmp tftpd.tmpfilesd tftpd.conf || die
226 # httpd
227 minstallunit httpd.service-${HTTPD_SVC_REV} httpd.service || die
228 minstallconf httpd.confd httpd || die
229 minstalltmp httpd.tmpfilesd httpd.conf || die
230
231 # loadkeys emulation script
232 minstallexec -s loadkeys.sh-${LOADKEYS_REV} /usr/bin/loadkeys || die
233
234 # agetty emulation script
235 minstalldir /usr/sbin || die
236 minstallexec -s agetty.sh-${AGETTY_REV} /usr/sbin/agetty || die
237
238 # autologin helper script
239 minstallexec -s autologin.sh /usr/sbin/autologin || die
240
241 # install service configuration files and keep needed directories
242 mkeepdir /var/spool/cron/crontabs || die
243
244 # install a busybox compilant zgrep script, at last needed by plymouth
245 minstallexec -s zgrep.sh /usr/bin/zgrep || die
246
247 # install consolefont and trans from kbd-1.15.5 to fully emulate kbd
248 # for systemd without any configfile changes
249 # busybox cmds requires the base name without any extension, we provide symlinks for systemd
250 minstalldir /usr/share/kbd/consolefonts || die
251 minstallfile lat9w-16.psfu /usr/share/kbd/consolefonts/lat9w-16 || die
252 mlink lat9w-16 /usr/share/kbd/consolefonts/lat9w-16.psfu || die
253 minstallfile LatArCyrHeb-16.psfu /usr/share/kbd/consolefonts/LatArCyrHeb-16 || die
254 mlink LatArCyrHeb-16 /usr/share/kbd/consolefonts/LatArCyrHeb-16.psfu || die
255 minstalldir /usr/share/kbd/consoletrans || die
256 minstallfile -s 8859-1_to_uni.trans /usr/share/kbd/consoletrans/8859-1_to_uni || die
257 mlink 8859-1_to_uni /usr/share/kbd/consoletrans/8859-1_to_uni.trans || die
258
259 # install nologin program
260 minstalldir /usr/sbin || die
261 minstallexec nologin /usr/sbin/nologin || die
262
263 # install unimaps directory and a README to suppress warning messages by dracut
264 minstalldir /usr/share/kbd/unimaps || die
265 MCONFIG=/usr/share/kbd/unimaps/README || die
266 mclearconfig || die
267 maddconfig '# This directory only exist for compatibility reasons' || die
268 }
269
270 postinstall()
271 {
272 if [ -x ${MROOT}/usr/bin/busybox ]
273 then
274 echo "Setting suid bit for ${MROOT}/usr/bin/busybox"
275 chmod +s ${MROOT}/usr/bin/busybox
276 fi
277
278 if [ -f ${MROOT}/usr/share/busybox/busybox.links ]
279 then
280 echo "Setting up busybox links ... "
281 local i
282 for i in $(< ${MROOT}/usr/share/busybox/busybox.links)
283 do
284 ln -snf /usr/bin/busybox ${MROOT}/${i}
285 done
286 fi
287 }