Contents of /smage/trunk/core/busybox/busybox-1.20.2-r10.smage2
Parent Directory
|
Revision Log
Revision 4230 -
(show annotations)
(download)
Fri Nov 9 14:05:53 2012 UTC (11 years, 7 months ago) by niro
File size: 11804 byte(s)
Fri Nov 9 14:05:53 2012 UTC (11 years, 7 months ago) by niro
File size: 11804 byte(s)
-cleanup virtuals
1 | # $Id$ |
2 | |
3 | PNAME="busybox" |
4 | PVER="1.20.2" |
5 | PBUILD="r10" |
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 | # which bootsplash implemantation gets used |
13 | # fbsplash or plymouth |
14 | BOOTSPLASH="plymouth" |
15 | |
16 | # which initsystem should be supported |
17 | # systemd | sysvinit |
18 | INITSYSTEM="systemd" |
19 | |
20 | # needed in post/preinstall |
21 | SPECIAL_VARS+=" BOOTSPLASH INITSYSTEM" |
22 | |
23 | # shared busybox needs glibc |
24 | DEPEND=">= virtual/glibc" |
25 | |
26 | PROVIDE="virtual/bzip2 |
27 | virtual/cron |
28 | virtual/debianutils |
29 | virtual/dhcp |
30 | virtual/ed |
31 | virtual/eject |
32 | virtual/grep |
33 | virtual/gzip |
34 | virtual/inetutils |
35 | virtual/kbd |
36 | irtual/less |
37 | virtual/net-tools |
38 | virtual/pciutils |
39 | virtual/procps |
40 | virtual/psmisc |
41 | virtual/sed |
42 | virtual/shadow |
43 | virtual/syslog |
44 | virtual/sysvinit |
45 | virtual/sysvinit-tools |
46 | virtual/tar |
47 | virtual/unzip |
48 | virtual/usbutils |
49 | virtual/which |
50 | virtual/wget |
51 | virtual/xz-utils" |
52 | |
53 | # busbox config CVS revision |
54 | CFG_REV=1.15 |
55 | # udhcpc client script CVS revision |
56 | UDHCPC_REV=1.1 |
57 | # syslogd.rc cvs revision |
58 | SYSLOGD_REV=1.4 |
59 | |
60 | case ${BOOTSPLASH} in |
61 | fbsplash) |
62 | # splash.conf cvs revision |
63 | FBSPLASHCONF_REV=1.4 |
64 | # splash-functions.rc cvs revision |
65 | FBSPLASHRC_REV=1.6 |
66 | |
67 | MISC_PVER="0.1.8" |
68 | MISC_SRCFILE="miscsplashutils-${MISC_PVER}.tar.bz2" |
69 | MISC_SRCDIR="${BUILDDIR}/miscsplashutils-${MISC_PVER}" |
70 | |
71 | SPLASHTHEME_PVER="1.0" |
72 | SPLASHTHEME_SRCFILE="alx-theme-busybox-${SPLASHTHEME_PVER}.tar.bz2" |
73 | SPLASHTHEME_SRCDIR="${BUILDDIR}/alx-theme-busybox-${SPLASHTHEME_PVER}" |
74 | ;; |
75 | |
76 | plymouth) |
77 | PLYSPLASHRC_REV=1.3 |
78 | DEPEND="${DEPEND} |
79 | >= sys-apps/plymouth-0.8.5" |
80 | ;; |
81 | esac |
82 | |
83 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
84 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
85 | |
86 | sminclude mtools alx |
87 | |
88 | SRC_URI=( |
89 | http://www.busybox.net/downloads/${SRCFILE} |
90 | mirror://${PNAME}/${SRCFILE} |
91 | mirror://${PNAME}/config-${CFG_REV} |
92 | mirror://${PNAME}/udhcpc.sh-${UDHCPC_REV} |
93 | mirror://${PNAME}/de.kmap.gz |
94 | mirror://${PNAME}/syslogd.rc-${SYSLOGD_REV} |
95 | mirror://${PNAME}/syslogd.service |
96 | mirror://${PNAME}/syslog.conf |
97 | mirror://${PNAME}/syslogd.confd |
98 | mirror://${PNAME}/crond.rc |
99 | mirror://${PNAME}/crond.service |
100 | mirror://${PNAME}/zgrep.sh |
101 | mirror://${PNAME}/busybox.tmpfilesd |
102 | mirror://${PNAME}/${PNAME}-1.15.3-flags.patch |
103 | mirror://${PNAME}/${PNAME}-${PVER}-glibc216.patch |
104 | mirror://${PNAME}/${PNAME}-${PVER}-mv-ignore-verbose.patch |
105 | mirror://${PNAME}/${PNAME}-${PVER}-cp-ignore-onefilesystem.patch |
106 | mirror://${PNAME}/${PNAME}-${PVER}-tar-support-explicit-xz-compression-option.patch |
107 | mirror://${PNAME}/${PNAME}-${PVER}-use-common-bb_e2fs_defs.h-for-ext2_3_4-constants-and-structs.patch |
108 | mirror://${PNAME}/${PNAME}-${PVER}-set-up-RO-loop-device.patch |
109 | mirror://${PNAME}/${PNAME}-${PVER}-fix-the-wrongly-stored-fs-creation-time-3.patch |
110 | mirror://${PNAME}/${PNAME}-${PVER}-undo-recent-breakage-when-mount-flags-were-made-unsigned.patch |
111 | mirror://${PNAME}/${PNAME}-${PVER}-do-not-pass-comment_ANYTHING-mount-option-to-kernel.patch |
112 | mirror://${PNAME}/${PNAME}-${PVER}-support-strictatime-option.patch |
113 | mirror://${PNAME}/${PNAME}-${PVER}-no-send-signals.patch |
114 | mirror://${PNAME}/${PNAME}-${PVER}-kernel_ver.patch |
115 | mirror://${PNAME}/${PNAME}-${PVER}-pkg-config-selinux.patch |
116 | mirror://${PNAME}/${PNAME}-${PVER}-sys-resource.patch |
117 | ) |
118 | |
119 | case ${BOOTSPLASH} in |
120 | fbsplash) |
121 | SRC_URI+=( mirror://${PNAME}/splash-functions.rc-${FBSPLASHRC_REV} |
122 | mirror://${PNAME}/splash.conf-${FBSPLASHCONF_REV} |
123 | mirror://${PNAME}/${PNAME}-${PVER}-fbsplash-tykef-1.0.patch |
124 | mirror://${PNAME}/${PNAME}-1.17.4-fbsplash-reload-background-image.patch |
125 | http://dev.gentoo.org/~spock/projects/gensplash/current/${MISC_SRCFILE} |
126 | mirror://${PNAME}/${MISC_SRCFILE} |
127 | mirror://${PNAME}/${SPLASHTHEME_SRCFILE} ) |
128 | ;; |
129 | |
130 | plymouth) |
131 | SRC_URI+=( mirror://${PNAME}/splash-functions-plymouth.rc-${PLYSPLASHRC_REV} ) |
132 | ;; |
133 | esac |
134 | |
135 | src_prepare() |
136 | { |
137 | munpack ${SRCFILE} || die |
138 | munpack de.kmap.gz ${SRCDIR} || die |
139 | |
140 | if [[ ${BOOTSPLASH} = fbsplash ]] |
141 | then |
142 | munpack ${MISC_SRCFILE} || die |
143 | munpack ${SPLASHTHEME_SRCFILE} || die |
144 | fi |
145 | cd ${SRCDIR} |
146 | |
147 | # official patches |
148 | # tar: support xz -J --xz option |
149 | mpatch ${PNAME}-${PVER}-tar-support-explicit-xz-compression-option.patch || die |
150 | # use common defines, needed by mount patches |
151 | mpatch ${PNAME}-${PVER}-use-common-bb_e2fs_defs.h-for-ext2_3_4-constants-and-structs.patch || die |
152 | # fix missing loop device |
153 | mpatch ${PNAME}-${PVER}-set-up-RO-loop-device.patch || die |
154 | # fix ext2 breakage with ext4 drivers |
155 | mpatch ${PNAME}-${PVER}-fix-the-wrongly-stored-fs-creation-time-3.patch || die |
156 | # fix mount |
157 | mpatch ${PNAME}-${PVER}-undo-recent-breakage-when-mount-flags-were-made-unsigned.patch || die |
158 | # systemd adds comments to fstab |
159 | mpatch ${PNAME}-${PVER}-do-not-pass-comment_ANYTHING-mount-option-to-kernel.patch || die |
160 | # mount: support strictatime option (needed by dracut) |
161 | mpatch ${PNAME}-${PVER}-support-strictatime-option.patch || die |
162 | # fix uname |
163 | mpatch ${PNAME}-${PVER}-kernel_ver.patch || die |
164 | # fix build against newer selinux |
165 | mpatch ${PNAME}-${PVER}-pkg-config-selinux.patch || die |
166 | # fix build on android |
167 | mpatch ${PNAME}-${PVER}-sys-resource.patch || die |
168 | |
169 | # magellan patches |
170 | # remove broken cflags |
171 | mpatch ${PNAME}-1.15.3-flags.patch || die |
172 | # fix build against newer glibc (>=2.16) |
173 | mpatch ${PNAME}-${PVER}-glibc216.patch || die |
174 | # let mv ignore the verbose mode switch (mv -v prints an error) |
175 | mpatch ${PNAME}-${PVER}-mv-ignore-verbose.patch || die |
176 | # let cp ignore the onefilesystem mode switch (cp -x prints an error) |
177 | mpatch ${PNAME}-${PVER}-cp-ignore-onefilesystem.patch || die |
178 | # do not send any signals on shutdown/reboot, we doing this via sendsignals rc |
179 | mpatch ${PNAME}-${PVER}-no-send-signals.patch || die |
180 | |
181 | if [[ ${BOOTSPLASH} = fbsplash ]] |
182 | then |
183 | # enhanced fbsplash from tykef |
184 | # http://tykef.havlinda.net/programovani/fbsplash/ |
185 | mpatch ${PNAME}-${PVER}-fbsplash-tykef-1.0.patch || die |
186 | |
187 | # fbsplash: adds 'image:' cmd to be able to reload the background image |
188 | # requires the tykef patch |
189 | mpatch ${PNAME}-1.17.4-fbsplash-reload-background-image.patch || die |
190 | fi |
191 | |
192 | # using a custom config |
193 | cp ${SOURCEDIR}/${PNAME}/config-${CFG_REV} .config || die |
194 | |
195 | if [[ ${BOOTSPLASH} = plymouth ]] |
196 | then |
197 | # disable fbsplash |
198 | sed -i -e 's/.*\(CONFIG_FBSPLASH\).*/#\ \1 is not set/' .config \ |
199 | -e 's/.*\(CONFIG_FEATURE_FBSPLASH_8BPP\).*/#\ \1 is not set/' .config \ |
200 | -e 's/.*\(CONFIG_FEATURE_FBSPLASH_SPRITES\).*/#\ \1 is not set/' .config \ |
201 | -e 's/.*\(CONFIG_FEATURE_FBSPLASH_TEXT\).*/#\ \1 is not set/' .config \ |
202 | -e 's/.*\(CONFIG_FEATURE_FBSPLASH_FONTLOAD\).*/#\ \1 is not set/' .config || die |
203 | fi |
204 | |
205 | # socket activation support for syslogd |
206 | if [[ ${INITSYSTEM} = systemd ]] |
207 | then |
208 | echo "CONFIG_FEATURE_SYSTEMD=y" >> .config || die |
209 | else |
210 | echo "# CONFIG_FEATURE_SYSTEMD is not set" >> .config || die |
211 | fi |
212 | } |
213 | |
214 | src_compile() |
215 | { |
216 | cd ${SRCDIR} |
217 | |
218 | make oldconfig || die |
219 | mmake || die |
220 | |
221 | # create a busybox.links file |
222 | HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die |
223 | |
224 | # do not use ash as default sh, we want bin/bash |
225 | sed -i '/bin\/sh/d' busybox.links || die |
226 | |
227 | # use poweroff as default halt command |
228 | sed -i '/sbin\/halt/d' busybox.links || die |
229 | echo -e '#!/bin/sh\n/sbin/poweroff $*' > halt.sh || die |
230 | |
231 | # remove some applet symlinks which are provided by other packages |
232 | ### patch |
233 | sed -i '/usr\/bin\/patch/d' busybox.links || die |
234 | ### e2fsprogs |
235 | sed -i '/sbin\/fsck/d' busybox.links || die |
236 | sed -i '/sbin\/mke2fs/d' busybox.links || die |
237 | sed -i '/sbin\/mkfs.ext2/d' busybox.links || die |
238 | sed -i '/sbin\/tune2fs/d' busybox.links || die |
239 | ### binutils |
240 | sed -i '/usr\/bin\/ar/d' busybox.links || die |
241 | sed -i '/usr\/bin\/strings/d' busybox.links || die |
242 | ### diffutils |
243 | sed -i '/usr\/bin\/cmp/d' busybox.links || die |
244 | ### umount (use from util-linux, need -t option) |
245 | sed -i '/bin\/umount/d' busybox.links || die |
246 | |
247 | # honor usr move |
248 | sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die |
249 | |
250 | if [[ ${BOOTSPLASH} = fbsplash ]] |
251 | then |
252 | cd ${MISC_SRCDIR} |
253 | mmake fbres || die |
254 | fi |
255 | } |
256 | |
257 | src_install() |
258 | { |
259 | cd ${SRCDIR} |
260 | |
261 | minstallexec busybox || die |
262 | # set suid bit for suid applets like su |
263 | mchmod +s /usr/bin/busybox || die |
264 | |
265 | minstalldir /usr/sbin || die |
266 | minstallexec halt.sh /usr/sbin/halt || die |
267 | |
268 | minstalldir /usr/share/busybox || die |
269 | minstallfile busybox.links /usr/share/busybox || die |
270 | |
271 | minstalldir /usr/share/busybox/keymaps || die |
272 | minstallfile de.kmap /usr/share/busybox/keymaps || die |
273 | |
274 | minstalldir /usr/share/udhcpc || die |
275 | minstallexec -s udhcpc.sh-${UDHCPC_REV} /usr/share/udhcpc/default.script || die |
276 | |
277 | # install initsystem services |
278 | if [[ ${INITSYSTEM} = systemd ]] |
279 | then |
280 | minstallconf syslogd.confd syslogd || die |
281 | minstallunit syslogd.service || die |
282 | minstallunit crond.service || die |
283 | minstalltmp busybox.tmpfilesd busybox.conf || die |
284 | else |
285 | minstallrc syslogd.rc-${SYSLOGD_REV} syslogd || die |
286 | minstallrc crond.rc crond || die |
287 | fi |
288 | |
289 | # install service configuration files and keep needed directories |
290 | minstallfile -s syslog.conf /etc/syslog.conf || die |
291 | mkeepdir /var/spool/cron/crontabs || die |
292 | |
293 | # install a busybox compilant zgrep script, at last needed by plymouth |
294 | minstallexec -s zgrep.sh || die |
295 | |
296 | case ${BOOTSPLASH} in |
297 | fbsplash) |
298 | if [[ ${INITSYSTEM} = sysvinit ]] |
299 | then |
300 | # install splash-functions |
301 | minstallrc splash-functions.rc-${FBSPLASHRC_REV} splash-functions || die |
302 | fi |
303 | minstalldir /etc/splash || die |
304 | minstallfile -s splash.conf-${FBSPLASHCONF_REV} /etc/splash/splash.conf || die |
305 | minstalldir /dev || die |
306 | mkfifo ${BINDIR}/dev/splashfifo || die |
307 | |
308 | # install fbres for splash |
309 | minstallexec ${MISC_SRCDIR}/fbres || die |
310 | |
311 | # install fbsplash theme |
312 | cd ${SPLASHTHEME_SRCDIR} |
313 | make DESTDIR=${BINDIR} install || die |
314 | # set alx theme as default |
315 | mlink alx /etc/splash/themes/default || die |
316 | |
317 | # disable config_protection for themes |
318 | minstalldir /etc/env.d || die |
319 | echo "CONFIG_PROTECT_MASK=/etc/splash/themes" > ${BINDIR}/etc/env.d/15splash || die |
320 | |
321 | # use vt12 for bootsplash and enable SPLASH_X11_TTY for vt03 to supress flickers |
322 | sed -i 's:#SPLASH_X11_TTY=:SPLASH_X11_TTY=:' ${BINDIR}/etc/splash/splash.conf || die |
323 | sed -i 's:^\(SPLASH_X11_TTY=\).*:\1"3":' ${BINDIR}/etc/splash/splash.conf || die |
324 | sed -i 's:^\(SPLASH_TTY=\).*:\1"12":' ${BINDIR}/etc/splash/splash.conf || die |
325 | ;; |
326 | |
327 | plymouth) |
328 | if [[ ${INITSYSTEM} = sysvinit ]] |
329 | then |
330 | # install splash-functions |
331 | minstallrc splash-functions-plymouth.rc-${PLYSPLASHRC_REV} splash-functions || die |
332 | fi |
333 | ;; |
334 | esac |
335 | } |
336 | |
337 | preinstall() |
338 | { |
339 | case ${BOOTSPLASH} in |
340 | fbsplash) add_conf_prot_mask /etc/rc.d/init.d /etc/splash/themes /etc/splash/splash.conf /etc/env.d ;; |
341 | plymouth) add_conf_prot_mask /etc/rc.d/init.d;; |
342 | esac |
343 | } |
344 | |
345 | postinstall() |
346 | { |
347 | if [ -x ${MROOT}/usr/bin/busybox ] |
348 | then |
349 | echo "Setting suid bit for ${MROOT}/usr/bin/busybox" |
350 | chmod +s ${MROOT}/usr/bin/busybox |
351 | fi |
352 | |
353 | if [ -f ${MROOT}/usr/share/busybox/busybox.links ] |
354 | then |
355 | echo "Setting up busybox links ... " |
356 | local i |
357 | for i in $(< ${MROOT}/usr/share/busybox/busybox.links) |
358 | do |
359 | ln -snf /usr/bin/busybox ${MROOT}/${i} |
360 | done |
361 | fi |
362 | |
363 | # run syslogd *after* creating the busybox symlinks! |
364 | if [[ ${INITSYSTEM} = systemd ]] |
365 | then |
366 | mstartunit syslogd.service |
367 | mstartunit crond.service |
368 | else |
369 | mstartservice syslogd |
370 | mstartservice crond |
371 | fi |
372 | |
373 | if [[ ${BOOTSPLASH} = fbsplash ]] |
374 | then |
375 | if [[ ! -p ${MROOT}/dev/splashfifo ]] |
376 | then |
377 | mkfifo ${MROOT}/dev/splashfifo |
378 | fi |
379 | |
380 | # check if intel fb quirk is required |
381 | if [[ -x ${MROOT}/usr/sbin/alx-hwdetection ]] |
382 | then |
383 | local fbdev="$(${MROOT}/usr/sbin/alx-hwdetection intel-fb-quirk)" |
384 | if [[ ${fbdev} -ge 0 ]] |
385 | then |
386 | sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${MROOT}/etc/splash/splash.conf || die |
387 | fi |
388 | fi |
389 | fi |
390 | } |
391 | |
392 | postremove() |
393 | { |
394 | if [[ ${INITSYSTEM} = systemd ]] |
395 | then |
396 | mstopunit syslogd.service |
397 | mstopunit crond.service |
398 | else |
399 | mstopservice syslogd |
400 | mstopservice crond |
401 | fi |
402 | } |