Magellan Linux

Contents of /smage/branches/alx-0_6_0/core/busybox/busybox-1.17.4-r12.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8040 - (show annotations) (download)
Tue Dec 29 16:28:08 2015 UTC (8 years, 5 months ago) by niro
File size: 6955 byte(s)
-drop udhcpc, we use dhcpcd instead of udhcdc as dhcp-client
1 # $Id$
2
3 PNAME="busybox"
4 PVER="1.17.4"
5 PBUILD="r12"
6
7 PCATEGORIE="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/sed
16 virtual/tar
17 virtual/usbutils
18 virtual/pciutils
19 virtual/debianutils
20 virtual/which
21 virtual/wget
22 virtual/grep
23 virtual/bzip2
24 virtual/gzip
25 virtual/syslog
26 virtual/less
27 virtual/net-tools
28 virtual/inetutils
29 virtual/kbd
30 virtual/procps
31 virtual/psmisc
32 virtual/dhcp
33 virtual/cron"
34
35 # busbox config CVS revision
36 CFG_CVS_REV=1.13
37 # udhcpc client script CVS revision
38 UDHCPC_CVS_REV=1.1
39 # syslogd.rc cvs revision
40 SYSLOGD_CVS_REV=1.4
41 # splash.conf cvs revision
42 SPLASHCONF_CVS_REV=1.4
43 # splash-functions.rc cvs revision
44 SPLASHRC_CVS_REV=1.6
45
46 SRCFILE="${PNAME}-${PVER}.tar.bz2"
47 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
48
49 MISC_PVER="0.1.8"
50 MISC_SRCFILE="miscsplashutils-${MISC_PVER}.tar.bz2"
51 MISC_SRCDIR="${BUILDDIR}/miscsplashutils-${MISC_PVER}"
52
53 SPLASHTHEME_PVER="1.0"
54 SPLASHTHEME_SRCFILE="alx-theme-busybox-${SPLASHTHEME_PVER}.tar.bz2"
55 SPLASHTHEME_SRCDIR="${BUILDDIR}/alx-theme-busybox-${SPLASHTHEME_PVER}"
56
57 sminclude mtools alx
58
59 SRC_URI=(
60 http://www.busybox.net/downloads/${SRCFILE}
61 mirror://${PNAME}/${SRCFILE}
62 mirror://${PNAME}/config-${CFG_CVS_REV}
63 mirror://${PNAME}/udhcpc.sh-${UDHCPC_CVS_REV}
64 mirror://${PNAME}/de.kmap.gz
65 mirror://${PNAME}/syslogd.rc-${SYSLOGD_CVS_REV}
66 mirror://${PNAME}/crond.rc
67 mirror://${PNAME}/${PNAME}-1.15.3-flags.patch
68 mirror://${PNAME}/${PNAME}-1.18.2-tar.patch
69 mirror://${PNAME}/splash-functions.rc-${SPLASHRC_CVS_REV}
70 mirror://${PNAME}/splash.conf-${SPLASHCONF_CVS_REV}
71 mirror://${PNAME}/${PNAME}-${PVER}-fbsplash-tykef-1.0.patch
72 mirror://${PNAME}/${PNAME}-${PVER}-fbsplash-reload-background-image.patch
73 http://dev.gentoo.org/~spock/projects/gensplash/current/${MISC_SRCFILE}
74 mirror://${PNAME}/${MISC_SRCFILE}
75 mirror://${PNAME}/${SPLASHTHEME_SRCFILE}
76 )
77
78 src_prepare()
79 {
80 munpack ${SRCFILE} || die
81 munpack de.kmap.gz ${SRCDIR} || die
82 munpack ${MISC_SRCFILE} || die
83 munpack ${SPLASHTHEME_SRCFILE} || die
84 cd ${SRCDIR}
85
86 # official patches
87 # fix tar issues: autodetection of compression modes - fixed with 1.18.3
88 # see: http://lists.busybox.net/pipermail/busybox/2011-February/074737.html
89 mpatch ${PNAME}-1.18.2-tar.patch || die
90
91 # magellan patches
92 # remove broken cflags
93 mpatch ${PNAME}-1.15.3-flags.patch || die
94
95 # enhanced fbsplash from tykef
96 # http://tykef.havlinda.net/programovani/fbsplash/
97 mpatch ${PNAME}-${PVER}-fbsplash-tykef-1.0.patch || die
98
99 # fbsplash: adds 'image:' cmd to be able to reload the background image
100 # requires the tykef patch
101 mpatch ${PNAME}-${PVER}-fbsplash-reload-background-image.patch || die
102
103 # using a custom config
104 cp ${SOURCEDIR}/${PNAME}/config-${CFG_CVS_REV} .config || die
105
106 # disable static linking atm, broken with glibc-2.12
107 sed -i 's/.*\(CONFIG_STATIC\).*/#\ \1 is not set/' .config || die
108 }
109
110 src_compile()
111 {
112 cd ${SRCDIR}
113
114 make oldconfig || die
115 mmake || die
116
117 # create a busybox.links file
118 HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die
119
120 # fix missing applet symlinks
121 echo "/bin/du" >> busybox.links || die
122
123 # do not use ash as default sh, we want bin/bash
124 sed -i '/bin\/sh/d' busybox.links || die
125
126 # use poweroff as default halt command
127 sed -i '/sbin\/halt/d' busybox.links || die
128 echo -e '#!/bin/sh\n/sbin/poweroff $*' > halt.sh || die
129
130 # remove some applet symlinks which are provided by other packages
131 ### patch
132 sed -i '/usr\/bin\/patch/d' busybox.links || die
133 ### e2fsprogs
134 sed -i '/sbin\/fsck/d' busybox.links || die
135 sed -i '/sbin\/mke2fs/d' busybox.links || die
136 sed -i '/sbin\/mkfs.ext2/d' busybox.links || die
137 sed -i '/sbin\/tune2fs/d' busybox.links || die
138 ### binutils
139 sed -i '/usr\/bin\/ar/d' busybox.links || die
140 sed -i '/usr\/bin\/strings/d' busybox.links || die
141 ### diffutils
142 sed -i '/usr\/bin\/cmp/d' busybox.links || die
143 ### umount (use from util-linux, need -t option)
144 sed -i '/bin\/umount/d' busybox.links || die
145
146 # we use dhcpcd from now on
147 sed -i '/sbin\/udhpc/d' busybox.links || die
148
149 cd ${MISC_SRCDIR}
150 mmake fbres || die
151 }
152
153 src_install()
154 {
155 cd ${SRCDIR}
156
157 minstalldir /bin || die
158 minstallexec busybox /bin || die
159 # set suid bit for suid applets like su
160 mchmod +s /bin/busybox || die
161
162 minstalldir /sbin || die
163 minstallexec halt.sh /sbin/halt || die
164
165 minstalldir /usr/share/busybox || die
166 minstallfile busybox.links /usr/share/busybox || die
167
168 minstalldir /usr/share/busybox/keymaps || die
169 minstallfile de.kmap /usr/share/busybox/keymaps || die
170
171 minstalldir /usr/share/udhcpc || die
172 minstallexec -s udhcpc.sh-${UDHCPC_CVS_REV} /usr/share/udhcpc/default.script || die
173
174 # install syslogd rc script
175 minstallrc syslogd.rc-${SYSLOGD_CVS_REV} syslogd || die
176
177 # install crond rc script and keep needed directories
178 minstallrc crond.rc crond || die
179 mkeepdir /var/spool/cron/crontabs || die
180
181 # install splash-functions
182 minstallrc splash-functions.rc-${SPLASHRC_CVS_REV} splash-functions || die
183 minstalldir /etc/splash || die
184 minstallfile -s splash.conf-${SPLASHCONF_CVS_REV} /etc/splash/splash.conf || die
185 minstalldir /dev || die
186 mkfifo ${BINDIR}/dev/splashfifo || die
187
188 # install fbres for splash
189 minstallexec ${MISC_SRCDIR}/fbres || die
190
191 # install fbsplash theme
192 cd ${SPLASHTHEME_SRCDIR}
193 make DESTDIR=${BINDIR} install || die
194 # set alx theme as default
195 mlink alx /etc/splash/themes/default || die
196
197 # disable config_protection for themes
198 minstalldir /etc/env.d || die
199 echo "CONFIG_PROTECT_MASK=/etc/splash/themes" > ${BINDIR}/etc/env.d/15splash || die
200
201 # use vt12 for bootsplash and enable SPLASH_X11_TTY for vt03 to supress flickers
202 sed -i 's:#SPLASH_X11_TTY=:SPLASH_X11_TTY=:' ${BINDIR}/etc/splash/splash.conf || die
203 sed -i 's:^\(SPLASH_X11_TTY=\).*:\1"3":' ${BINDIR}/etc/splash/splash.conf || die
204 sed -i 's:^\(SPLASH_TTY=\).*:\1"12":' ${BINDIR}/etc/splash/splash.conf || die
205 }
206
207 preinstall()
208 {
209 add_conf_prot_mask /etc/rc.d/init.d /etc/splash/themes /etc/splash/splash.conf /etc/env.d
210 }
211
212 postinstall()
213 {
214 if [ -x ${MROOT}/bin/busybox ]
215 then
216 echo "Setting suid bit for ${MROOT}/bin/busybox"
217 chmod +s ${MROOT}/bin/busybox
218 fi
219
220 if [ -f ${MROOT}/usr/share/busybox/busybox.links ]
221 then
222 echo "Setting up busybox links ... "
223 local i
224 for i in $(< ${MROOT}/usr/share/busybox/busybox.links)
225 do
226 ln -snf /bin/busybox ${MROOT}/${i}
227 done
228 fi
229
230 if [[ ! -p ${MROOT}/dev/splashfifo ]]
231 then
232 mkfifo ${MROOT}/dev/splashfifo
233 fi
234
235 # run syslogd *after* creating the busybox symlinks!
236 mstartservice syslogd
237
238 # check if intel fb quirk is required
239 if [[ -x ${MROOT}/usr/sbin/alx-hwdetection ]]
240 then
241 local fbdev="$(${MROOT}/usr/sbin/alx-hwdetection intel-fb-quirk)"
242 if [[ ${fbdev} -ge 0 ]]
243 then
244 sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${MROOT}/etc/splash/splash.conf || die
245 fi
246 fi
247
248 alx_postinstall
249 }
250
251 postremove()
252 {
253 mstopservice syslogd
254 }