Magellan Linux

Contents of /smage/trunk/core/busybox/busybox-1.24.1-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8567 - (show annotations) (download)
Tue Feb 9 10:45:53 2016 UTC (8 years, 2 months ago) by niro
File size: 7564 byte(s)
-tftpd.service: fixed tftpd path which changed with busybox-1.24
1 # $Id$
2
3 PNAME="busybox"
4 PVER="1.24.1"
5 PBUILD="r3"
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.18
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 emulation script revision
47 LOADKEYS_REV=1.4
48 # server services revisions
49 HTTPD_SVC_REV=1.2
50 UDHCPD_SVC_REV=1.2
51 TFTPD_SVC_REV=1.4
52 TFTPD_CONFD_REV=1.2
53
54 SRCFILE="${PNAME}-${PVER}.tar.bz2"
55 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
56
57 SDEPEND=">= virtual/sed"
58
59 sminclude mtools systemd alx
60
61 # shared busybox needs glibc and overwrite systemd dep pulled by systemd include
62 DEPEND=">= virtual/glibc"
63
64 SRC_URI=(
65 http://www.busybox.net/downloads/${SRCFILE}
66 mirror://${PNAME}/${SRCFILE}
67 mirror://${PNAME}/config-${CFG_REV}
68 mirror://${PNAME}/udhcpc.sh-${UDHCPC_REV}
69 mirror://${PNAME}/de.kmap.gz
70 mirror://${PNAME}/zgrep.sh
71 mirror://${PNAME}/nologin.c
72 mirror://${PNAME}/crond.service
73 mirror://${PNAME}/busybox.tmpfilesd-${TMP_REV}
74 mirror://${PNAME}/loadkeys.sh-${LOADKEYS_REV}
75 mirror://${PNAME}/agetty.sh-${AGETTY_REV}
76 mirror://${PNAME}/autologin.sh
77 mirror://${PNAME}/lat9w-16.psfu.gz
78 mirror://${PNAME}/LatArCyrHeb-16.psfu.gz
79 mirror://${PNAME}/httpd.service-${HTTPD_SVC_REV}
80 mirror://${PNAME}/httpd.confd
81 mirror://${PNAME}/httpd.tmpfilesd
82 mirror://${PNAME}/udhcpd.service-${UDHCPD_SVC_REV}
83 mirror://${PNAME}/udhcpd.confd
84 mirror://${PNAME}/udhcpd.tmpfilesd
85 mirror://${PNAME}/tftpd.service-${TFTPD_SVC_REV}
86 mirror://${PNAME}/tftpd.socket
87 mirror://${PNAME}/tftpd.confd-${TFTPD_CONFD_REV}
88 mirror://${PNAME}/tftpd.tmpfilesd
89 mirror://${PNAME}/8859-1_to_uni.trans
90 mirror://${PNAME}/${PNAME}-1.24.1-cp-ignore-onefilesystem.patch
91 mirror://${PNAME}/${PNAME}-1.20.2-no-send-signals.patch
92 mirror://${PNAME}/${PNAME}-1.24.1-truncate-open-mode.patch
93 mirror://${PNAME}/${PNAME}-1.24.1-unzip.patch
94 mirror://${PNAME}/${PNAME}-1.24.1-unzip-regression.patch
95 )
96
97 src_prepare()
98 {
99 munpack ${SRCFILE} || die
100 munpack de.kmap.gz ${SRCDIR} || die
101 munpack lat9w-16.psfu.gz ${SRCDIR} || die
102 munpack LatArCyrHeb-16.psfu.gz ${SRCDIR} || die
103 cd ${SRCDIR}
104
105 # official patches
106 mpatch ${PNAME}-1.24.1-unzip.patch || die
107 mpatch ${PNAME}-1.24.1-unzip-regression.patch || die
108 mpatch ${PNAME}-1.24.1-truncate-open-mode.patch || die
109
110 # magellan patches
111 # let cp ignore the onefilesystem mode switch (cp -x prints an error)
112 mpatch ${PNAME}-1.24.1-cp-ignore-onefilesystem.patch || die
113 # do not send any signals on shutdown/reboot, we doing this via sendsignals rc
114 mpatch ${PNAME}-1.20.2-no-send-signals.patch || die
115
116 # using a custom config
117 cp ${SOURCEDIR}/${PNAME}/config-${CFG_REV} .config || die
118
119 # disable swapon & swapoff; systemd requires the util-linux version
120 # because it depends on some options the busybox version does not provide
121 sed -i -e 's/.*\(CONFIG_SWAPONOFF\).*/#\ \1 is not set/' \
122 -e 's/.*\(CONFIG_FEATURE_SWAPON_DISCARD\).*/#\ \1 is not set/' \
123 -e 's/.*\(CONFIG_FEATURE_SWAPON_PRI\).*/#\ \1 is not set/' \
124 .config || die
125 }
126
127 src_compile()
128 {
129 cd ${SRCDIR}
130
131 make oldconfig || die
132 mmake || die
133
134 # create a busybox.links file
135 HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die
136
137 # do not use ash as default sh, we want bin/bash
138 sed -i '/bin\/sh$/d' busybox.links || die
139
140 # setfont resides in /bin on newer systems
141 sed -i 's:/sbin/setfont:/bin/setfont:' busybox.links || die
142
143 # honor usr move
144 sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die
145
146 # build nologin program
147 gcc ${CFLAGS} -o nologin ${SOURCEDIR}/${PNAME}/nologin.c || die
148 }
149
150 src_install()
151 {
152 cd ${SRCDIR}
153
154 minstallexec busybox || die
155 # set suid bit for suid applets like su
156 mchmod +s /usr/bin/busybox || die
157
158 minstalldir /usr/share/busybox || die
159 minstallfile busybox.links /usr/share/busybox || die
160
161 # systemd needs the keymaps in /usr/share/kbd/keymaps and no! symlinks are allowed
162 # keymaps must end with .map or .map.gz
163 # dracut uses /usr/share/kbd/keymaps too
164 minstalldir /usr/share/kbd/keymaps || die
165 minstallfile de.kmap /usr/share/kbd/keymaps/de.map || die
166
167 minstalldir /usr/share/udhcpc || die
168 minstallexec -s udhcpc.sh-${UDHCPC_REV} /usr/share/udhcpc/default.script || die
169
170 # install example udhcpd.conf
171 minstalletc examples/udhcp/udhcpd.conf || die
172
173 # install initsystem services
174 minstallunit crond.service || die
175 minstalltmp busybox.tmpfilesd-${TMP_REV} busybox.conf || die
176
177 # install server system services
178 # udhcpd
179 minstallunit udhcpd.service-${UDHCPD_SVC_REV} udhcpd.service || die
180 minstallconf udhcpd.confd udhcpd || die
181 minstalltmp udhcpd.tmpfilesd udhcpd.conf || die
182 # tftpd
183 minstallunit tftpd.service-${TFTPD_SVC_REV} tftpd.service || die
184 minstallunit tftpd.socket || die
185 minstallconf tftpd.confd-${TFTPD_CONFD_REV} tftpd || die
186 minstalltmp tftpd.tmpfilesd tftpd.conf || die
187 # httpd
188 minstallunit httpd.service-${HTTPD_SVC_REV} httpd.service || die
189 minstallconf httpd.confd httpd || die
190 minstalltmp httpd.tmpfilesd httpd.conf || die
191
192 # loadkeys emulation script
193 minstallexec -s loadkeys.sh-${LOADKEYS_REV} /usr/bin/loadkeys || die
194
195 # agetty emulation script
196 minstalldir /usr/sbin || die
197 minstallexec -s agetty.sh-${AGETTY_REV} /usr/sbin/agetty || die
198
199 # autologin helper script
200 minstallexec -s autologin.sh /usr/sbin/autologin || die
201
202 # install service configuration files and keep needed directories
203 mkeepdir /var/spool/cron/crontabs || die
204
205 # install a busybox compilant zgrep script, at last needed by plymouth
206 minstallexec -s zgrep.sh /usr/bin/zgrep || die
207
208 # install consolefont and trans from kbd-1.15.5 to fully emulate kbd
209 # for systemd without any configfile changes
210 # busybox cmds requires the base name without any extension, we provide symlinks for systemd
211 minstalldir /usr/share/kbd/consolefonts || die
212 minstallfile lat9w-16.psfu /usr/share/kbd/consolefonts/lat9w-16 || die
213 mlink lat9w-16 /usr/share/kbd/consolefonts/lat9w-16.psfu || die
214 minstallfile LatArCyrHeb-16.psfu /usr/share/kbd/consolefonts/LatArCyrHeb-16 || die
215 mlink LatArCyrHeb-16 /usr/share/kbd/consolefonts/LatArCyrHeb-16.psfu || die
216 minstalldir /usr/share/kbd/consoletrans || die
217 minstallfile -s 8859-1_to_uni.trans /usr/share/kbd/consoletrans/8859-1_to_uni || die
218 mlink 8859-1_to_uni /usr/share/kbd/consoletrans/8859-1_to_uni.trans || die
219
220 # install nologin program
221 minstalldir /usr/sbin || die
222 minstallexec nologin /usr/sbin/nologin || die
223
224 # install unimaps directory and a README to suppress warning messages by dracut
225 minstalldir /usr/share/kbd/unimaps || die
226 MCONFIG=/usr/share/kbd/unimaps/README || die
227 mclearconfig || die
228 maddconfig '# This directory only exist for compatibility reasons' || die
229 }
230
231 postinstall()
232 {
233 if [ -x ${MROOT}/usr/bin/busybox ]
234 then
235 echo "Setting suid bit for ${MROOT}/usr/bin/busybox"
236 chmod +s ${MROOT}/usr/bin/busybox
237 fi
238
239 if [ -f ${MROOT}/usr/share/busybox/busybox.links ]
240 then
241 echo "Setting up busybox links ... "
242 local i
243 for i in $(< ${MROOT}/usr/share/busybox/busybox.links)
244 do
245 ln -snf /usr/bin/busybox ${MROOT}/${i}
246 done
247 fi
248 }