Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5625 - (show annotations) (download)
Thu May 8 12:23:24 2014 UTC (10 years ago) by niro
File size: 6633 byte(s)
-state disabled wrt dracut, cpio/tar broken
1 # $Id$
2
3 PNAME="busybox"
4 PVER="1.22.1"
5 PBUILD="r4"
6
7 PCAT="sys-apps"
8 STATE="disabled"
9
10 DESCRIPTION="BusyBox combines tiny versions of many common UNIX utilities into a single small executable."
11 HOMEPAGE="http://www.busybox.net/"
12
13 # shared busybox needs glibc
14 DEPEND=">= virtual/glibc"
15
16 PROVIDE="virtual/bzip2
17 virtual/cpio
18 virtual/cron
19 virtual/debianutils
20 virtual/dhcp
21 virtual/ed
22 virtual/eject
23 virtual/grep
24 virtual/gzip
25 virtual/inetutils
26 virtual/kbd
27 virtual/less
28 virtual/net-tools
29 virtual/pciutils
30 virtual/procps
31 virtual/psmisc
32 virtual/sed
33 virtual/shadow
34 virtual/sysvinit
35 virtual/sysvinit-tools
36 virtual/tar
37 virtual/unzip
38 virtual/usbutils
39 virtual/which
40 virtual/wget
41 virtual/xz-utils"
42
43 # busbox config revision
44 CFG_REV=1.17
45 # udhcpc client script revision
46 UDHCPC_REV=1.1
47 # busybox.tmpfilesd revision
48 TMP_REV=1.2
49 # agetty emulation script revision
50 AGETTY_REV=1.3
51 # loadkeys emulation script revision
52 LOADKEYS_REV=1.4
53
54 SRCFILE="${PNAME}-${PVER}.tar.bz2"
55 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
56
57 sminclude mtools systemd alx
58
59 SRC_URI=(
60 http://www.busybox.net/downloads/${SRCFILE}
61 mirror://${PNAME}/${SRCFILE}
62 mirror://${PNAME}/config-${CFG_REV}
63 mirror://${PNAME}/udhcpc.sh-${UDHCPC_REV}
64 mirror://${PNAME}/de.kmap.gz
65 mirror://${PNAME}/zgrep.sh
66 mirror://${PNAME}/nologin.c
67 mirror://${PNAME}/crond.service
68 mirror://${PNAME}/busybox.tmpfilesd-${TMP_REV}
69 mirror://${PNAME}/loadkeys.sh-${LOADKEYS_REV}
70 mirror://${PNAME}/agetty.sh-${AGETTY_REV}
71 mirror://${PNAME}/autologin.sh
72 mirror://${PNAME}/lat9w-16.psfu.gz
73 mirror://${PNAME}/LatArCyrHeb-16.psfu.gz
74 mirror://${PNAME}/8859-1_to_uni.trans
75 mirror://${PNAME}/${PNAME}-${PVER}-ash.patch
76 mirror://${PNAME}/${PNAME}-${PVER}-date.patch
77 mirror://${PNAME}/${PNAME}-${PVER}-iplink.patch
78 mirror://${PNAME}/${PNAME}-${PVER}-nc.patch
79 mirror://${PNAME}/${PNAME}-1.20.2-cp-ignore-onefilesystem.patch
80 mirror://${PNAME}/${PNAME}-1.20.2-no-send-signals.patch
81 )
82
83 src_prepare()
84 {
85 munpack ${SRCFILE} || die
86 munpack de.kmap.gz ${SRCDIR} || die
87 munpack lat9w-16.psfu.gz ${SRCDIR} || die
88 munpack LatArCyrHeb-16.psfu.gz ${SRCDIR} || die
89 cd ${SRCDIR}
90
91 # official patches
92 mpatch ${PNAME}-${PVER}-ash.patch || die
93 mpatch ${PNAME}-${PVER}-date.patch || die
94 mpatch ${PNAME}-${PVER}-iplink.patch || die
95 mpatch ${PNAME}-${PVER}-nc.patch || die
96
97 # magellan patches
98 # let cp ignore the onefilesystem mode switch (cp -x prints an error)
99 mpatch ${PNAME}-1.20.2-cp-ignore-onefilesystem.patch || die
100 # do not send any signals on shutdown/reboot, we doing this via sendsignals rc
101 mpatch ${PNAME}-1.20.2-no-send-signals.patch || die
102
103 # using a custom config
104 cp ${SOURCEDIR}/${PNAME}/config-${CFG_REV} .config || die
105
106 # disable unicode support
107 sed -i -e 's/.*\(CONFIG_UNICODE_SUPPORT\).*/#\ \1 is not set/' \
108 -e 's/.*\(CONFIG_FEATURE_CHECK_UNICODE_IN_ENV\).*/#\ \1 is not set/' \
109 -e 's/.*\(CONFIG_SUBST_WCHAR\).*/\1=0/' \
110 -e 's/.*\(CONFIG_LAST_SUPPORTED_WCHAR\).*/\1=0/' \
111 .config || die
112
113 # enable cpio with archive creation and passtrough support
114 sed -i -e 's/.*\(CONFIG_CPIO\).*/\1=y/' \
115 -e 's/.*\(CONFIG_FEATURE_CPIO_O\).*/\1=y/' \
116 -e 's/.*\(CONFIG_FEATURE_CPIO_P\).*/\1=y/' \
117 .config || die
118 }
119
120 src_compile()
121 {
122 cd ${SRCDIR}
123
124 make oldconfig || die
125 mmake || die
126
127 # create a busybox.links file
128 HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die
129
130 # do not use ash as default sh, we want bin/bash
131 sed -i '/bin\/sh$/d' busybox.links || die
132
133 # use ln of coreutils to support --relative option
134 sed -i '/bin\/ln$/d' busybox.links || die
135
136 # setfont resides in /bin on newer systems
137 sed -i 's:/sbin/setfont:/bin/setfont:' busybox.links || die
138
139 # honor usr move
140 sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die
141
142 # build nologin program
143 gcc ${CFLAGS} -o nologin ${SOURCEDIR}/${PNAME}/nologin.c || die
144 }
145
146 src_install()
147 {
148 cd ${SRCDIR}
149
150 minstallexec busybox || die
151 # set suid bit for suid applets like su
152 mchmod +s /usr/bin/busybox || die
153
154 minstalldir /usr/share/busybox || die
155 minstallfile busybox.links /usr/share/busybox || die
156
157 # systemd needs the keymaps in /usr/share/kbd/keymaps and no! symlinks are allowed
158 # keymaps must end with .map or .map.gz
159 # dracut uses /usr/share/kbd/keymaps too
160 minstalldir /usr/share/kbd/keymaps || die
161 minstallfile de.kmap /usr/share/kbd/keymaps/de.map || die
162
163 minstalldir /usr/share/udhcpc || die
164 minstallexec -s udhcpc.sh-${UDHCPC_REV} /usr/share/udhcpc/default.script || die
165
166 # install initsystem services
167 minstallunit crond.service || die
168 minstalltmp busybox.tmpfilesd-${TMP_REV} busybox.conf || die
169
170 # loadkeys emulation script
171 minstallexec -s loadkeys.sh-${LOADKEYS_REV} /usr/bin/loadkeys || die
172
173 # agetty emulation script
174 minstalldir /usr/sbin || die
175 minstallexec -s agetty.sh-${AGETTY_REV} /usr/sbin/agetty || die
176
177 # autologin helper script
178 minstallexec -s autologin.sh /usr/sbin/autologin || die
179
180 # install service configuration files and keep needed directories
181 mkeepdir /var/spool/cron/crontabs || die
182
183 # install a busybox compilant zgrep script, at last needed by plymouth
184 minstallexec -s zgrep.sh /usr/bin/zgrep || die
185
186 # install nologin program
187 minstalldir /usr/sbin || die
188 minstallexec nologin /usr/sbin/nologin || die
189
190 # install consolefont and trans from kbd-1.15.5 to fully emulate kbd
191 # for systemd without any configfile changes
192 # busybox cmds requires the base name without any extension, we provide symlinks for systemd
193 minstalldir /usr/share/kbd/consolefonts || die
194 minstallfile lat9w-16.psfu /usr/share/kbd/consolefonts/lat9w-16 || die
195 mlink lat9w-16 /usr/share/kbd/consolefonts/lat9w-16.psfu || die
196 minstallfile LatArCyrHeb-16.psfu /usr/share/kbd/consolefonts/LatArCyrHeb-16 || die
197 mlink LatArCyrHeb-16 /usr/share/kbd/consolefonts/LatArCyrHeb-16.psfu || die
198 minstalldir /usr/share/kbd/consoletrans || die
199 minstallfile -s 8859-1_to_uni.trans /usr/share/kbd/consoletrans/8859-1_to_uni || die
200 mlink 8859-1_to_uni /usr/share/kbd/consoletrans/8859-1_to_uni.trans || die
201
202 # install unimaps directory and a README to suppress warning messages by dracut
203 minstalldir /usr/share/kbd/unimaps || die
204 MCONFIG=/usr/share/kbd/unimaps/README || die
205 mclearconfig || die
206 maddconfig '# This directory only exist for compatibility reasons' || die
207 }
208
209 postinstall()
210 {
211 if [ -x ${MROOT}/usr/bin/busybox ]
212 then
213 echo "Setting suid bit for ${MROOT}/usr/bin/busybox"
214 chmod +s ${MROOT}/usr/bin/busybox
215 fi
216
217 if [ -f ${MROOT}/usr/share/busybox/busybox.links ]
218 then
219 echo "Setting up busybox links ... "
220 local i
221 for i in $(< ${MROOT}/usr/share/busybox/busybox.links)
222 do
223 ln -snf /usr/bin/busybox ${MROOT}/${i}
224 done
225 fi
226 }