Magellan Linux

Contents of /smage/trunk/core/busybox/busybox-1.20.2-r4.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3968 - (show annotations) (download)
Thu Jul 26 09:59:06 2012 UTC (11 years, 10 months ago) by niro
File size: 8635 byte(s)
-added more upstream patches und use upstream xz support patch
1 # $Id$
2
3 PNAME="busybox"
4 PVER="1.20.2"
5 PBUILD="r4"
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 # shared busybox needs glibc
13 DEPEND=">= virtual/glibc"
14
15 PROVIDE="virtual/ed
16 virtual/sed
17 virtual/tar
18 virtual/usbutils
19 virtual/pciutils
20 virtual/debianutils
21 virtual/which
22 virtual/wget
23 virtual/grep
24 virtual/bzip2
25 virtual/gzip
26 virtual/syslog
27 virtual/less
28 virtual/net-tools
29 virtual/inetutils
30 virtual/kbd
31 virtual/procps
32 virtual/psmisc
33 virtual/dhcp
34 virtual/cron
35 virtual/xz-utils
36 virtual/sysvinit
37 virtual/sysvinit-tools
38 virtual/eject"
39
40 # busbox config CVS revision
41 CFG_CVS_REV=1.15
42 # udhcpc client script CVS revision
43 UDHCPC_CVS_REV=1.1
44 # syslogd.rc cvs revision
45 SYSLOGD_CVS_REV=1.4
46 # splash.conf cvs revision
47 SPLASHCONF_CVS_REV=1.4
48 # splash-functions.rc cvs revision
49 SPLASHRC_CVS_REV=1.6
50
51 SRCFILE="${PNAME}-${PVER}.tar.bz2"
52 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
53
54 MISC_PVER="0.1.8"
55 MISC_SRCFILE="miscsplashutils-${MISC_PVER}.tar.bz2"
56 MISC_SRCDIR="${BUILDDIR}/miscsplashutils-${MISC_PVER}"
57
58 SPLASHTHEME_PVER="1.0"
59 SPLASHTHEME_SRCFILE="alx-theme-busybox-${SPLASHTHEME_PVER}.tar.bz2"
60 SPLASHTHEME_SRCDIR="${BUILDDIR}/alx-theme-busybox-${SPLASHTHEME_PVER}"
61
62 sminclude mtools alx
63
64 SRC_URI=(
65 http://www.busybox.net/downloads/${SRCFILE}
66 mirror://${PNAME}/${SRCFILE}
67 mirror://${PNAME}/config-${CFG_CVS_REV}
68 mirror://${PNAME}/udhcpc.sh-${UDHCPC_CVS_REV}
69 mirror://${PNAME}/de.kmap.gz
70 mirror://${PNAME}/syslogd.rc-${SYSLOGD_CVS_REV}
71 mirror://${PNAME}/syslog.conf
72 mirror://${PNAME}/crond.rc
73 mirror://${PNAME}/${PNAME}-1.15.3-flags.patch
74 mirror://${PNAME}/splash-functions.rc-${SPLASHRC_CVS_REV}
75 mirror://${PNAME}/splash.conf-${SPLASHCONF_CVS_REV}
76 mirror://${PNAME}/${PNAME}-${PVER}-fbsplash-tykef-1.0.patch
77 mirror://${PNAME}/${PNAME}-1.17.4-fbsplash-reload-background-image.patch
78 mirror://${PNAME}/${PNAME}-${PVER}-glibc216.patch
79 mirror://${PNAME}/${PNAME}-${PVER}-mv-ignore-verbose.patch
80 mirror://${PNAME}/${PNAME}-${PVER}-cp-ignore-onefilesystem.patch
81 mirror://${PNAME}/${PNAME}-${PVER}-tar-support-explicit-xz-compression-option.patch
82 mirror://${PNAME}/${PNAME}-${PVER}-use-common-bb_e2fs_defs.h-for-ext2_3_4-constants-and-structs.patch
83 mirror://${PNAME}/${PNAME}-${PVER}-set-up-RO-loop-device.patch
84 mirror://${PNAME}/${PNAME}-${PVER}-fix-the-wrongly-stored-fs-creation-time-2.patch
85 mirror://${PNAME}/${PNAME}-${PVER}-undo-recent-breakage-when-mount-flags-were-made-unsigned.patch
86 mirror://${PNAME}/${PNAME}-${PVER}-do-not-pass-comment_ANYTHING-mount-option-to-kernel.patch
87 mirror://${PNAME}/${PNAME}-${PVER}-support-strictatime-option.patch
88 http://dev.gentoo.org/~spock/projects/gensplash/current/${MISC_SRCFILE}
89 mirror://${PNAME}/${MISC_SRCFILE}
90 mirror://${PNAME}/${SPLASHTHEME_SRCFILE}
91 )
92
93 src_prepare()
94 {
95 munpack ${SRCFILE} || die
96 munpack de.kmap.gz ${SRCDIR} || die
97 munpack ${MISC_SRCFILE} || die
98 munpack ${SPLASHTHEME_SRCFILE} || die
99 cd ${SRCDIR}
100
101 # official patches
102 # tar: support xz -J --xz option
103 mpatch ${PNAME}-${PVER}-tar-support-explicit-xz-compression-option.patch || die
104 # use common defines, needed by mount patches
105 mpatch ${PNAME}-${PVER}-use-common-bb_e2fs_defs.h-for-ext2_3_4-constants-and-structs.patch || die
106 # fix missing loop device
107 mpatch ${PNAME}-${PVER}-set-up-RO-loop-device.patch || die
108 # fix ext2 breakage with ext4 drivers
109 mpatch ${PNAME}-${PVER}-fix-the-wrongly-stored-fs-creation-time-2.patch || die
110 # fix mount
111 mpatch ${PNAME}-${PVER}-undo-recent-breakage-when-mount-flags-were-made-unsigned.patch || die
112 # systemd adds comments to fstab
113 mpatch ${PNAME}-${PVER}-do-not-pass-comment_ANYTHING-mount-option-to-kernel.patch || die
114 # mount: support strictatime option (needed by dracut)
115 mpatch ${PNAME}-${PVER}-support-strictatime-option.patch || die
116
117 # magellan patches
118 # remove broken cflags
119 mpatch ${PNAME}-1.15.3-flags.patch || die
120 # fix build against newer glibc (>=2.16)
121 mpatch ${PNAME}-${PVER}-glibc216.patch || die
122 # let mv ignore the verbose mode switch (mv -v prints an error)
123 mpatch ${PNAME}-${PVER}-mv-ignore-verbose.patch || die
124 # let cp ignore the onefilesystem mode switch (cp -x prints an error)
125 mpatch ${PNAME}-${PVER}-cp-ignore-onefilesystem.patch || die
126
127 # enhanced fbsplash from tykef
128 # http://tykef.havlinda.net/programovani/fbsplash/
129 mpatch ${PNAME}-${PVER}-fbsplash-tykef-1.0.patch || die
130
131 # fbsplash: adds 'image:' cmd to be able to reload the background image
132 # requires the tykef patch
133 mpatch ${PNAME}-1.17.4-fbsplash-reload-background-image.patch || die
134
135 # using a custom config
136 cp ${SOURCEDIR}/${PNAME}/config-${CFG_CVS_REV} .config || die
137 }
138
139 src_compile()
140 {
141 cd ${SRCDIR}
142
143 make oldconfig || die
144 mmake || die
145
146 # create a busybox.links file
147 HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die
148
149 # do not use ash as default sh, we want bin/bash
150 sed -i '/bin\/sh/d' busybox.links || die
151
152 # use poweroff as default halt command
153 sed -i '/sbin\/halt/d' busybox.links || die
154 echo -e '#!/bin/sh\n/sbin/poweroff $*' > halt.sh || die
155
156 # remove some applet symlinks which are provided by other packages
157 ### patch
158 sed -i '/usr\/bin\/patch/d' busybox.links || die
159 ### e2fsprogs
160 sed -i '/sbin\/fsck/d' busybox.links || die
161 sed -i '/sbin\/mke2fs/d' busybox.links || die
162 sed -i '/sbin\/mkfs.ext2/d' busybox.links || die
163 sed -i '/sbin\/tune2fs/d' busybox.links || die
164 ### binutils
165 sed -i '/usr\/bin\/ar/d' busybox.links || die
166 sed -i '/usr\/bin\/strings/d' busybox.links || die
167 ### diffutils
168 sed -i '/usr\/bin\/cmp/d' busybox.links || die
169 ### umount (use from util-linux, need -t option)
170 sed -i '/bin\/umount/d' busybox.links || die
171
172 # honor usr move
173 sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die
174
175 cd ${MISC_SRCDIR}
176 mmake fbres || die
177 }
178
179 src_install()
180 {
181 cd ${SRCDIR}
182
183 minstallexec busybox || die
184 # set suid bit for suid applets like su
185 mchmod +s /usr/bin/busybox || die
186
187 minstalldir /usr/sbin || die
188 minstallexec halt.sh /usr/sbin/halt || die
189
190 minstalldir /usr/share/busybox || die
191 minstallfile busybox.links /usr/share/busybox || die
192
193 minstalldir /usr/share/busybox/keymaps || die
194 minstallfile de.kmap /usr/share/busybox/keymaps || die
195
196 minstalldir /usr/share/udhcpc || die
197 minstallexec -s udhcpc.sh-${UDHCPC_CVS_REV} /usr/share/udhcpc/default.script || die
198
199 # install syslogd rc script and config
200 minstallrc syslogd.rc-${SYSLOGD_CVS_REV} syslogd || die
201 minstallfile -s syslog.conf /etc/syslog.conf || die
202
203 # install crond rc script and keep needed directories
204 minstallrc crond.rc crond || die
205 mkeepdir /var/spool/cron/crontabs || die
206
207 # install splash-functions
208 minstallrc splash-functions.rc-${SPLASHRC_CVS_REV} splash-functions || die
209 minstalldir /etc/splash || die
210 minstallfile -s splash.conf-${SPLASHCONF_CVS_REV} /etc/splash/splash.conf || die
211 minstalldir /dev || die
212 mkfifo ${BINDIR}/dev/splashfifo || die
213
214 # install fbres for splash
215 minstallexec ${MISC_SRCDIR}/fbres || die
216
217 # install fbsplash theme
218 cd ${SPLASHTHEME_SRCDIR}
219 make DESTDIR=${BINDIR} install || die
220 # set alx theme as default
221 mlink alx /etc/splash/themes/default || die
222
223 # disable config_protection for themes
224 minstalldir /etc/env.d || die
225 echo "CONFIG_PROTECT_MASK=/etc/splash/themes" > ${BINDIR}/etc/env.d/15splash || die
226
227 # use vt12 for bootsplash and enable SPLASH_X11_TTY for vt03 to supress flickers
228 sed -i 's:#SPLASH_X11_TTY=:SPLASH_X11_TTY=:' ${BINDIR}/etc/splash/splash.conf || die
229 sed -i 's:^\(SPLASH_X11_TTY=\).*:\1"3":' ${BINDIR}/etc/splash/splash.conf || die
230 sed -i 's:^\(SPLASH_TTY=\).*:\1"12":' ${BINDIR}/etc/splash/splash.conf || die
231 }
232
233 preinstall()
234 {
235 add_conf_prot_mask /etc/rc.d/init.d /etc/splash/themes /etc/splash/splash.conf /etc/env.d
236 }
237
238 postinstall()
239 {
240 if [ -x ${MROOT}/usr/bin/busybox ]
241 then
242 echo "Setting suid bit for ${MROOT}/usr/bin/busybox"
243 chmod +s ${MROOT}/usr/bin/busybox
244 fi
245
246 if [ -f ${MROOT}/usr/share/busybox/busybox.links ]
247 then
248 echo "Setting up busybox links ... "
249 local i
250 for i in $(< ${MROOT}/usr/share/busybox/busybox.links)
251 do
252 ln -snf /usr/bin/busybox ${MROOT}/${i}
253 done
254 fi
255
256 if [[ ! -p ${MROOT}/dev/splashfifo ]]
257 then
258 mkfifo ${MROOT}/dev/splashfifo
259 fi
260
261 # run syslogd *after* creating the busybox symlinks!
262 mstartservice syslogd
263
264 # check if intel fb quirk is required
265 if [[ -x ${MROOT}/usr/sbin/alx-hwdetection ]]
266 then
267 local fbdev="$(${MROOT}/usr/sbin/alx-hwdetection intel-fb-quirk)"
268 if [[ ${fbdev} -ge 0 ]]
269 then
270 sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${MROOT}/etc/splash/splash.conf || die
271 fi
272 fi
273 }
274
275 postremove()
276 {
277 mstopservice syslogd
278 }