Contents of /smage/trunk/core/busybox/busybox-1.20.2-r24.smage2
Parent Directory | Revision Log
Revision 5364 -
(show annotations)
(download)
Thu Jan 9 10:24:11 2014 UTC (10 years, 8 months ago) by niro
File size: 10316 byte(s)
Thu Jan 9 10:24:11 2014 UTC (10 years, 8 months ago) by niro
File size: 10316 byte(s)
-fixed broken virtual/less provide
1 | # $Id$ |
2 | |
3 | PNAME="busybox" |
4 | PVER="1.20.2" |
5 | PBUILD="r24" |
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/ed |
17 | virtual/eject |
18 | virtual/grep |
19 | virtual/gzip |
20 | virtual/inetutils |
21 | virtual/kbd |
22 | virtual/less |
23 | virtual/net-tools |
24 | virtual/pciutils |
25 | virtual/procps |
26 | virtual/psmisc |
27 | virtual/sed |
28 | virtual/shadow |
29 | virtual/sysvinit |
30 | virtual/sysvinit-tools |
31 | virtual/tar |
32 | virtual/unzip |
33 | virtual/usbutils |
34 | virtual/which |
35 | virtual/wget |
36 | virtual/xz-utils" |
37 | |
38 | # busbox config revision |
39 | CFG_REV=1.16 |
40 | # udhcpc client script revision |
41 | UDHCPC_REV=1.1 |
42 | # busybox.tmpfilesd revision |
43 | TMP_REV=1.2 |
44 | # agetty emulation script revision |
45 | AGETTY_REV=1.3 |
46 | # loadkeys emualtion script revision |
47 | LOADKEYS_REV=1.3 |
48 | |
49 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
50 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
51 | |
52 | sminclude mtools systemd alx |
53 | |
54 | # shared busybox needs glibc and overwrite systemd dep pulled by systemd include |
55 | DEPEND=">= virtual/glibc" |
56 | |
57 | SRC_URI=( |
58 | http://www.busybox.net/downloads/${SRCFILE} |
59 | mirror://${PNAME}/${SRCFILE} |
60 | mirror://${PNAME}/config-${CFG_REV} |
61 | mirror://${PNAME}/udhcpc.sh-${UDHCPC_REV} |
62 | mirror://${PNAME}/de.kmap.gz |
63 | mirror://${PNAME}/zgrep.sh |
64 | mirror://${PNAME}/nologin.c |
65 | mirror://${PNAME}/crond.service |
66 | mirror://${PNAME}/busybox.tmpfilesd-${TMP_REV} |
67 | mirror://${PNAME}/loadkeys.sh-${LOADKEYS_REV} |
68 | mirror://${PNAME}/agetty.sh-${AGETTY_REV} |
69 | mirror://${PNAME}/autologin.sh |
70 | mirror://${PNAME}/lat9w-16.psfu.gz |
71 | mirror://${PNAME}/LatArCyrHeb-16.psfu.gz |
72 | mirror://${PNAME}/8859-1_to_uni.trans |
73 | mirror://${PNAME}/${PNAME}-1.15.3-flags.patch |
74 | mirror://${PNAME}/${PNAME}-${PVER}-mv-ignore-verbose.patch |
75 | mirror://${PNAME}/${PNAME}-${PVER}-cp-ignore-onefilesystem.patch |
76 | mirror://${PNAME}/${PNAME}-${PVER}-tar-support-explicit-xz-compression-option.patch |
77 | mirror://${PNAME}/${PNAME}-${PVER}-use-common-bb_e2fs_defs.h-for-ext2_3_4-constants-and-structs.patch |
78 | mirror://${PNAME}/${PNAME}-${PVER}-set-up-RO-loop-device.patch |
79 | mirror://${PNAME}/${PNAME}-${PVER}-fix-the-wrongly-stored-fs-creation-time-3.patch |
80 | mirror://${PNAME}/${PNAME}-${PVER}-undo-recent-breakage-when-mount-flags-were-made-unsigned.patch |
81 | mirror://${PNAME}/${PNAME}-${PVER}-do-not-pass-comment_ANYTHING-mount-option-to-kernel.patch |
82 | mirror://${PNAME}/${PNAME}-${PVER}-support-strictatime-option.patch |
83 | mirror://${PNAME}/${PNAME}-${PVER}-no-send-signals.patch |
84 | mirror://${PNAME}/${PNAME}-${PVER}-kernel_ver.patch |
85 | mirror://${PNAME}/${PNAME}-${PVER}-pkg-config-selinux.patch |
86 | mirror://${PNAME}/${PNAME}-${PVER}-sys-resource.patch |
87 | mirror://${PNAME}/${PNAME}-${PVER}-ntpd.patch |
88 | mirror://${PNAME}/${PNAME}-${PVER}-f2fs.patch |
89 | ) |
90 | |
91 | src_prepare() |
92 | { |
93 | munpack ${SRCFILE} || die |
94 | munpack de.kmap.gz ${SRCDIR} || die |
95 | munpack lat9w-16.psfu.gz ${SRCDIR} || die |
96 | munpack LatArCyrHeb-16.psfu.gz ${SRCDIR} || die |
97 | cd ${SRCDIR} |
98 | |
99 | # official patches |
100 | # tar: support xz -J --xz option |
101 | mpatch ${PNAME}-${PVER}-tar-support-explicit-xz-compression-option.patch || die |
102 | # use common defines, needed by mount patches |
103 | mpatch ${PNAME}-${PVER}-use-common-bb_e2fs_defs.h-for-ext2_3_4-constants-and-structs.patch || die |
104 | # fix missing loop device |
105 | mpatch ${PNAME}-${PVER}-set-up-RO-loop-device.patch || die |
106 | # fix ext2 breakage with ext4 drivers |
107 | mpatch ${PNAME}-${PVER}-fix-the-wrongly-stored-fs-creation-time-3.patch || die |
108 | # fix mount |
109 | mpatch ${PNAME}-${PVER}-undo-recent-breakage-when-mount-flags-were-made-unsigned.patch || die |
110 | # systemd adds comments to fstab |
111 | mpatch ${PNAME}-${PVER}-do-not-pass-comment_ANYTHING-mount-option-to-kernel.patch || die |
112 | # mount: support strictatime option (needed by dracut) |
113 | mpatch ${PNAME}-${PVER}-support-strictatime-option.patch || die |
114 | # fix uname |
115 | mpatch ${PNAME}-${PVER}-kernel_ver.patch || die |
116 | # fix build against newer selinux |
117 | mpatch ${PNAME}-${PVER}-pkg-config-selinux.patch || die |
118 | # fix build against newer glibc (>=2.16) / official patch |
119 | mpatch ${PNAME}-${PVER}-sys-resource.patch || die |
120 | # fix ntpd issues |
121 | mpatch ${PNAME}-${PVER}-ntpd.patch || die |
122 | |
123 | # magellan patches |
124 | # remove broken cflags |
125 | mpatch ${PNAME}-1.15.3-flags.patch || die |
126 | # let mv ignore the verbose mode switch (mv -v prints an error) |
127 | mpatch ${PNAME}-${PVER}-mv-ignore-verbose.patch || die |
128 | # let cp ignore the onefilesystem mode switch (cp -x prints an error) |
129 | mpatch ${PNAME}-${PVER}-cp-ignore-onefilesystem.patch || die |
130 | # do not send any signals on shutdown/reboot, we doing this via sendsignals rc |
131 | mpatch ${PNAME}-${PVER}-no-send-signals.patch || die |
132 | # fix libvolume_id to support f2fs |
133 | mpatch ${PNAME}-${PVER}-f2fs.patch || die |
134 | |
135 | # using a custom config |
136 | cp ${SOURCEDIR}/${PNAME}/config-${CFG_REV} .config || die |
137 | |
138 | # disable fbsplash |
139 | sed -i -e 's/.*\(CONFIG_FBSPLASH\).*/#\ \1 is not set/' \ |
140 | -e 's/.*\(CONFIG_FEATURE_FBSPLASH_8BPP\).*/#\ \1 is not set/' \ |
141 | -e 's/.*\(CONFIG_FEATURE_FBSPLASH_SPRITES\).*/#\ \1 is not set/' \ |
142 | -e 's/.*\(CONFIG_FEATURE_FBSPLASH_TEXT\).*/#\ \1 is not set/' \ |
143 | -e 's/.*\(CONFIG_FEATURE_FBSPLASH_FONTLOAD\).*/#\ \1 is not set/' \ |
144 | .config || die |
145 | |
146 | # socket activation support |
147 | echo "CONFIG_FEATURE_SYSTEMD=y" >> .config || die |
148 | |
149 | # setfont should use kbd resources in /usr/share (consolefonts, consoletrans etc) |
150 | sed -i 's:.*\(CONFIG_DEFAULT_SETFONT_DIR\).*:\1="/usr/share":' .config || die |
151 | |
152 | # disable syslogd in favor of journald |
153 | sed -i -e 's/.*\(CONFIG_SYSLOGD\).*/#\ \1 is not set/' \ |
154 | -e 's/.*\(CONFIG_FEATURE_ROTATE_LOGFILE\).*/#\ \1 is not set/' \ |
155 | -e 's/.*\(CONFIG_FEATURE_REMOTE_LOG\).*/#\ \1 is not set/' \ |
156 | -e 's/.*\(CONFIG_FEATURE_SYSLOGD_DUP\).*/#\ \1 is not set/' \ |
157 | -e 's/.*\(CONFIG_FEATURE_SYSLOGD_CFG\).*/#\ \1 is not set/' \ |
158 | -e 's/.*\(CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE\).*/\1=0/' \ |
159 | -e 's/.*\(CONFIG_FEATURE_IPC_SYSLOG\).*/#\ \1 is not set/' \ |
160 | -e 's/.*\(CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE\).*/\1=0/' \ |
161 | -e 's/.*\(CONFIG_LOGREAD\).*/#\ \1 is not set/' \ |
162 | -e 's/.*\(CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING\).*/#\ \1 is not set/' \ |
163 | .config || die |
164 | } |
165 | |
166 | src_compile() |
167 | { |
168 | cd ${SRCDIR} |
169 | |
170 | make oldconfig || die |
171 | mmake || die |
172 | |
173 | # create a busybox.links file |
174 | HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die |
175 | |
176 | # do not use ash as default sh, we want bin/bash |
177 | sed -i '/bin\/sh$/d' busybox.links || die |
178 | |
179 | # remove some applet symlinks which are provided by other packages |
180 | ### patch |
181 | sed -i '/usr\/bin\/patch$/d' busybox.links || die |
182 | ### e2fsprogs |
183 | sed -i '/sbin\/fsck$/d' busybox.links || die |
184 | sed -i '/sbin\/mke2fs$/d' busybox.links || die |
185 | sed -i '/sbin\/mkfs.ext2$/d' busybox.links || die |
186 | sed -i '/sbin\/tune2fs$/d' busybox.links || die |
187 | ### binutils |
188 | sed -i '/usr\/bin\/ar$/d' busybox.links || die |
189 | sed -i '/usr\/bin\/strings$/d' busybox.links || die |
190 | ### diffutils |
191 | sed -i '/usr\/bin\/cmp$/d' busybox.links || die |
192 | ### umount (use from util-linux, need -t option) |
193 | sed -i '/bin\/umount$/d' busybox.links || die |
194 | ### mount (systemd needs a full featured version) |
195 | sed -i '/bin\/mount$/d' busybox.links || die |
196 | |
197 | # provided by systemd |
198 | sed -i '/sbin\/init$/d' busybox.links || die |
199 | sed -i '/sbin\/reboot$/d' busybox.links || die |
200 | sed -i '/sbin\/halt$/d' busybox.links || die |
201 | sed -i '/sbin\/poweroff$/d' busybox.links || die |
202 | sed -i '/sbin\/runlevel$/d' busybox.links || die |
203 | |
204 | # setfont resides in /bin on newer systems |
205 | sed -i 's:/sbin/setfont:/bin/setfont:' busybox.links || die |
206 | |
207 | # honor usr move |
208 | sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die |
209 | |
210 | # build nologin program |
211 | gcc ${CFLAGS} -o nologin ${SOURCEDIR}/${PNAME}/nologin.c || die |
212 | } |
213 | |
214 | src_install() |
215 | { |
216 | cd ${SRCDIR} |
217 | |
218 | minstallexec busybox || die |
219 | # set suid bit for suid applets like su |
220 | mchmod +s /usr/bin/busybox || die |
221 | |
222 | minstalldir /usr/share/busybox || die |
223 | minstallfile busybox.links /usr/share/busybox || die |
224 | |
225 | # systemd needs the keymaps in /usr/share/keymaps and no! symlinks are allowed |
226 | # keymaps must end with .map or .map.gz |
227 | # dracut uses /usr/share/keymaps too |
228 | minstalldir /usr/share/keymaps || die |
229 | minstallfile de.kmap /usr/share/keymaps/de.map || die |
230 | |
231 | minstalldir /usr/share/udhcpc || die |
232 | minstallexec -s udhcpc.sh-${UDHCPC_REV} /usr/share/udhcpc/default.script || die |
233 | |
234 | # install initsystem services |
235 | minstallunit crond.service || die |
236 | minstalltmp busybox.tmpfilesd-${TMP_REV} busybox.conf || die |
237 | |
238 | # loadkeys emulation script |
239 | minstallexec -s loadkeys.sh-${LOADKEYS_REV} /usr/bin/loadkeys || die |
240 | |
241 | # agetty emulation script |
242 | minstalldir /usr/sbin || die |
243 | minstallexec -s agetty.sh-${AGETTY_REV} /usr/sbin/agetty || die |
244 | |
245 | # autologin helper script |
246 | minstallexec -s autologin.sh /usr/sbin/autologin || die |
247 | |
248 | # install service configuration files and keep needed directories |
249 | mkeepdir /var/spool/cron/crontabs || die |
250 | |
251 | # install a busybox compilant zgrep script, at last needed by plymouth |
252 | minstallexec -s zgrep.sh /usr/bin/zgrep || die |
253 | |
254 | # install consolefont and trans from kbd-1.15.5 to fully emulate kbd |
255 | # for systemd without any configfile changes |
256 | # busybox cmds requires the base name without any extension, we provide symlinks for systemd |
257 | minstalldir /usr/share/consolefonts || die |
258 | minstallfile lat9w-16.psfu /usr/share/consolefonts/lat9w-16 || die |
259 | mlink lat9w-16 /usr/share/consolefonts/lat9w-16.psfu || die |
260 | minstallfile LatArCyrHeb-16.psfu /usr/share/consolefonts/LatArCyrHeb-16 || die |
261 | mlink LatArCyrHeb-16 /usr/share/consolefonts/LatArCyrHeb-16.psfu || die |
262 | minstalldir /usr/share/consoletrans || die |
263 | minstallfile -s 8859-1_to_uni.trans /usr/share/consoletrans/8859-1_to_uni || die |
264 | mlink 8859-1_to_uni /usr/share/consoletrans/8859-1_to_uni.trans || die |
265 | |
266 | # install nologin program |
267 | minstalldir /usr/sbin || die |
268 | minstallexec nologin /usr/sbin/nologin || die |
269 | |
270 | # install unimaps directory and a README to suppress warning messages by dracut |
271 | minstalldir /usr/share/unimaps || die |
272 | MCONFIG=/usr/share/unimaps/README || die |
273 | mclearconfig || die |
274 | maddconfig '# This directory only exist for compatibility reasons' || die |
275 | } |
276 | |
277 | postinstall() |
278 | { |
279 | if [ -x ${MROOT}/usr/bin/busybox ] |
280 | then |
281 | echo "Setting suid bit for ${MROOT}/usr/bin/busybox" |
282 | chmod +s ${MROOT}/usr/bin/busybox |
283 | fi |
284 | |
285 | if [ -f ${MROOT}/usr/share/busybox/busybox.links ] |
286 | then |
287 | echo "Setting up busybox links ... " |
288 | local i |
289 | for i in $(< ${MROOT}/usr/share/busybox/busybox.links) |
290 | do |
291 | ln -snf /usr/bin/busybox ${MROOT}/${i} |
292 | done |
293 | fi |
294 | } |