diff options
Diffstat (limited to 'meta/recipes-core/util-linux/util-linux.inc')
-rw-r--r-- | meta/recipes-core/util-linux/util-linux.inc | 276 |
1 files changed, 276 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc new file mode 100644 index 0000000000..dbc6a2856f --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux.inc | |||
@@ -0,0 +1,276 @@ | |||
1 | SUMMARY = "A suite of basic system administration utilities" | ||
2 | DESCRIPTION = "Util-linux includes a suite of basic system administration utilities \ | ||
3 | commonly found on most Linux systems. Some of the more important utilities include \ | ||
4 | disk partitioning, kernel message management, filesystem creation, and system login." | ||
5 | |||
6 | SECTION = "base" | ||
7 | |||
8 | LICENSE = "GPLv2+ & LGPLv2.1+ & BSD" | ||
9 | |||
10 | LIC_FILES_CHKSUM = "file://README.licensing;md5=1715f5ee3e01203ca1e1e0b9ee65918c \ | ||
11 | file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | ||
12 | file://Documentation/licenses/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | ||
13 | file://Documentation/licenses/COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \ | ||
14 | file://Documentation/licenses/COPYING.BSD-3;md5=58dcd8452651fc8b07d1f65ce07ca8af \ | ||
15 | file://Documentation/licenses/COPYING.UCB;md5=263860f8968d8bafa5392cab74285262 \ | ||
16 | file://libuuid/COPYING;md5=b442ffb762cf8d3e9df1b99e0bb4af70 \ | ||
17 | file://libmount/COPYING;md5=fb93f01d4361069c5616327705373b16 \ | ||
18 | file://libblkid/COPYING;md5=fb93f01d4361069c5616327705373b16" | ||
19 | |||
20 | inherit autotools gettext pkgconfig systemd ptest | ||
21 | DEPENDS = "zlib ncurses" | ||
22 | DEPENDS_append_class-native = " lzo-native" | ||
23 | DEPENDS_append_class-nativesdk = " lzo-native" | ||
24 | |||
25 | SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-linux-${PV}.tar.xz \ | ||
26 | file://MCONFIG \ | ||
27 | file://defines.h \ | ||
28 | file://make_include \ | ||
29 | file://swapargs.h \ | ||
30 | file://ptest.patch \ | ||
31 | file://run-ptest \ | ||
32 | file://avoid_unsupported_find_opts.patch \ | ||
33 | file://avoid_unsupported_grep_opts.patch \ | ||
34 | file://avoid_unsupported_sleep_param.patch \ | ||
35 | file://display_testname_for_subtest.patch \ | ||
36 | " | ||
37 | |||
38 | PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \ | ||
39 | util-linux-swaponoff util-linux-losetup util-linux-umount \ | ||
40 | util-linux-mount util-linux-readprofile util-linux-libblkid \ | ||
41 | util-linux-libmount util-linux-libuuid util-linux-uuidd \ | ||
42 | util-linux-uuidgen util-linux-lscpu util-linux-fsck util-linux-blkid \ | ||
43 | util-linux-mkfs util-linux-mcookie util-linux-reset \ | ||
44 | util-linux-mkfs.cramfs util-linux-fsck.cramfs util-linux-fstrim \ | ||
45 | util-linux-partx ${PN}-bash-completion util-linux-hwclock \ | ||
46 | util-linux-findfs" | ||
47 | |||
48 | SHARED_EXTRA_OECONF = "--disable-use-tty-group \ | ||
49 | --disable-makeinstall-chown \ | ||
50 | --enable-kill --enable-last --enable-mesg --enable-partx \ | ||
51 | --enable-raw --enable-reset --disable-login \ | ||
52 | --disable-vipw --disable-newgrp --disable-chfn-chsh \ | ||
53 | --enable-write --enable-mount \ | ||
54 | --enable-libuuid --enable-libblkid --enable-fsck --without-udev \ | ||
55 | usrsbin_execdir='${sbindir}' \ | ||
56 | " | ||
57 | |||
58 | EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}" | ||
59 | |||
60 | PACKAGECONFIG_class-target ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ | ||
61 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} " | ||
62 | PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam," | ||
63 | |||
64 | # Respect the systemd feature for uuidd | ||
65 | PACKAGECONFIG[systemd] = "--enable-socket-activation --with-systemdsystemunitdir=${systemd_unitdir}/system/, --disable-socket-activation --without-systemdsystemunitdir" | ||
66 | |||
67 | # Build setpriv requires libcap-ng | ||
68 | PACKAGECONFIG[libcap-ng] = "--enable-setpriv,--disable-setpriv,libcap-ng," | ||
69 | |||
70 | FILES_${PN}-bash-completion += "${datadir}/bash-completion" | ||
71 | FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*" | ||
72 | |||
73 | FILES_util-linux-agetty = "${base_sbindir}/agetty" | ||
74 | FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}" | ||
75 | FILES_util-linux-fstrim = "${base_sbindir}/fstrim" | ||
76 | FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk" | ||
77 | FILES_util-linux-sfdisk = "${sbindir}/sfdisk" | ||
78 | FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} ${base_sbindir}/swapoff.${BPN}" | ||
79 | FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}" | ||
80 | FILES_util-linux-mount = "${base_bindir}/mount.${BPN}" | ||
81 | FILES_util-linux-mcookie = "${bindir}/mcookie" | ||
82 | FILES_util-linux-umount = "${base_bindir}/umount.${BPN}" | ||
83 | FILES_util-linux-readprofile = "${base_sbindir}/readprofile.${BPN}" | ||
84 | FILES_util-linux-uuidgen = "${bindir}/uuidgen" | ||
85 | FILES_util-linux-uuidd = "${sbindir}/uuidd" | ||
86 | FILES_util-linux-reset = "${base_bindir}/reset" | ||
87 | FILES_util-linux-partx = "${sbindir}/partx" | ||
88 | FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}" | ||
89 | FILES_util-linux-findfs = "${sbindir}/findfs" | ||
90 | |||
91 | FILES_util-linux-libblkid = "${base_libdir}/libblkid.so.*" | ||
92 | FILES_util-linux-libmount = "${base_libdir}/libmount.so.*" | ||
93 | FILES_util-linux-libuuid = "${base_libdir}/libuuid.so.*" | ||
94 | FILES_util-linux-lscpu = "${bindir}/lscpu" | ||
95 | |||
96 | FILES_util-linux-fsck = "${base_sbindir}/fsck*" | ||
97 | FILES_util-linux-mkfs = "${sbindir}/mkfs" | ||
98 | |||
99 | FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs" | ||
100 | FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs" | ||
101 | |||
102 | |||
103 | # Util-linux' blkid replaces the e2fsprogs one | ||
104 | FILES_util-linux-blkid = "${base_sbindir}/blkid*" | ||
105 | RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid" | ||
106 | RREPLACES_util-linux-blkid = "e2fsprogs-blkid" | ||
107 | |||
108 | # reset calls 'tput' | ||
109 | RDEPENDS_util-linux-reset += "ncurses" | ||
110 | |||
111 | RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup" | ||
112 | RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs " | ||
113 | |||
114 | RRECOMMENDS_${PN}_class-native = "" | ||
115 | RRECOMMENDS_${PN}_class-nativesdk = "" | ||
116 | RDEPENDS_${PN}_class-native = "" | ||
117 | RDEPENDS_${PN}_class-nativesdk = "" | ||
118 | |||
119 | RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linux-libuuid-dev" | ||
120 | |||
121 | SYSTEMD_PACKAGES = "${PN}-uuidd" | ||
122 | SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.service" | ||
123 | |||
124 | do_compile () { | ||
125 | set -e | ||
126 | install ${WORKDIR}/MCONFIG ${S}/MCONFIG | ||
127 | install ${WORKDIR}/make_include ${S}/make_include | ||
128 | install ${WORKDIR}/swapargs.h ${S}/mount-deprecated/swapargs.h | ||
129 | install ${WORKDIR}/defines.h ${S}/defines.h | ||
130 | oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}' | ||
131 | } | ||
132 | |||
133 | do_install () { | ||
134 | # with ccache the timestamps on compiled files may | ||
135 | # end up earlier than on their inputs, this allows | ||
136 | # for the resultant compilation in the install step. | ||
137 | oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \ | ||
138 | 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \ | ||
139 | 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install | ||
140 | |||
141 | mkdir -p ${D}${base_bindir} | ||
142 | |||
143 | sbinprogs="agetty ctrlaltdel cfdisk vipw vigr" | ||
144 | sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk readprofile fsck blkid blockdev fstrim sulogin switch_root" | ||
145 | usrbinprogs_a="chfn chsh hexdump last logger mesg newgrp renice utmpdump wall setsid chrt flock getopt" | ||
146 | binprogs_a="dmesg kill more umount mount login reset su" | ||
147 | |||
148 | if [ "${base_sbindir}" != "${sbindir}" ]; then | ||
149 | mkdir -p ${D}${base_sbindir} | ||
150 | for p in $sbinprogs $sbinprogs_a; do | ||
151 | if [ -f "${D}${sbindir}/$p" ]; then | ||
152 | mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p" | ||
153 | fi | ||
154 | done | ||
155 | fi | ||
156 | |||
157 | if [ "${base_bindir}" != "${bindir}" ]; then | ||
158 | mkdir -p ${D}${base_bindir} | ||
159 | for p in $binprogs_a; do | ||
160 | if [ -f "${D}${bindir}/$p" ]; then | ||
161 | mv "${D}${bindir}/$p" "${D}${base_bindir}/$p" | ||
162 | fi | ||
163 | done | ||
164 | fi | ||
165 | |||
166 | install -d ${D}${sysconfdir}/default/ | ||
167 | echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall | ||
168 | |||
169 | rm -f ${D}${bindir}/chkdupexe | ||
170 | } | ||
171 | |||
172 | inherit update-alternatives | ||
173 | |||
174 | ALTERNATIVE_PRIORITY = "100" | ||
175 | |||
176 | ALTERNATIVE_${PN} = "dmesg kill more mkswap blockdev pivot_root switch_root" | ||
177 | ALTERNATIVE_${PN} += "mkfs.minix hexdump last logger mesg renice wall" | ||
178 | ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject getopt sulogin" | ||
179 | |||
180 | ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg" | ||
181 | ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill" | ||
182 | ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more" | ||
183 | ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap" | ||
184 | ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev" | ||
185 | ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root" | ||
186 | ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root" | ||
187 | ALTERNATIVE_LINK_NAME[mkfs.minix] = "${base_sbindir}/mkfs.minix" | ||
188 | ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject" | ||
189 | ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt" | ||
190 | ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" | ||
191 | ALTERNATIVE_TARGET[getopt] = "${bindir}/getopt" | ||
192 | |||
193 | ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 mesg.1 wall.1 sulogin.8 utmpdump.1 reset.1" | ||
194 | |||
195 | ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1" | ||
196 | ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1" | ||
197 | ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1" | ||
198 | ALTERNATIVE_LINK_NAME[reset.1] = "${mandir}/man1/reset.1" | ||
199 | ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8" | ||
200 | ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1" | ||
201 | ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1" | ||
202 | |||
203 | ALTERNATIVE_util-linux-hwclock = "hwclock" | ||
204 | # There seems to be problem, atleast on nslu2, with these, untill they are | ||
205 | # fixed the busybox ones have higher priority | ||
206 | ALTERNATIVE_PRIORITY[hwclock] = "10" | ||
207 | ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock" | ||
208 | |||
209 | ALTERNATIVE_util-linux-fdisk = "fdisk" | ||
210 | ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk" | ||
211 | |||
212 | ALTERNATIVE_util-linux-agetty = "getty" | ||
213 | ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty" | ||
214 | ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty" | ||
215 | |||
216 | ALTERNATIVE_util-linux-mount = "mount" | ||
217 | ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount" | ||
218 | |||
219 | ALTERNATIVE_util-linux-umount = "umount" | ||
220 | ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount" | ||
221 | |||
222 | ALTERNATIVE_util-linux-readprofile = "readprofile" | ||
223 | ALTERNATIVE_LINK_NAME[readprofile] = "${base_sbindir}/readprofile" | ||
224 | |||
225 | ALTERNATIVE_util-linux-losetup = "losetup" | ||
226 | ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup" | ||
227 | |||
228 | ALTERNATIVE_util-linux-swaponoff = "swapoff swapon" | ||
229 | ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff" | ||
230 | ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon" | ||
231 | |||
232 | ALTERNATIVE_util-linux-fsck = "fsck.minix fsck" | ||
233 | ALTERNATIVE_LINK_NAME[fsck.minix] = "${base_sbindir}/fsck.minix" | ||
234 | ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck" | ||
235 | |||
236 | ALTERNATIVE_util-linux-blkid = "blkid" | ||
237 | ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" | ||
238 | |||
239 | ALTERNATIVE_util-linux-reset = "reset" | ||
240 | ALTERNATIVE_LINK_NAME[reset] = "${bindir}/reset" | ||
241 | ALTERNATIVE_TARGET[reset] = "${base_bindir}/reset" | ||
242 | |||
243 | BBCLASSEXTEND = "native nativesdk" | ||
244 | |||
245 | python do_package_prepend () { | ||
246 | if '--enable-su' in d.getVar('EXTRA_OECONF', True).split(): | ||
247 | alt_name = "su" | ||
248 | d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, '%s/%s' % (d.getVar('base_bindir', True), alt_name)) | ||
249 | d.appendVar('ALTERNATIVE_%s' % (d.getVar('PN', True)), ' ' + alt_name) | ||
250 | } | ||
251 | |||
252 | do_compile_ptest() { | ||
253 | oe_runmake buildtest-TESTS | ||
254 | } | ||
255 | |||
256 | do_install_ptest() { | ||
257 | mkdir -p ${D}${PTEST_PATH}/tests/ts | ||
258 | find . -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; | ||
259 | cp ${S}/tests/functions.sh ${D}${PTEST_PATH}/tests/ | ||
260 | cp ${S}/tests/commands.sh ${D}${PTEST_PATH}/tests/ | ||
261 | cp ${S}/tests/run.sh ${D}${PTEST_PATH}/tests/ | ||
262 | cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected | ||
263 | |||
264 | list="bitops build-sys cal col colrm column dmesg fsck hexdump hwclock ipcs isosize login look lscpu md5 misc more namei paths schedutils script swapon tailf utmpdump" | ||
265 | # The following tests are not installed yet: | ||
266 | # blkid scsi_debug module dependent | ||
267 | # cramfs gcc dependent | ||
268 | # eject gcc dependent | ||
269 | # fdisk scsi_debug module and gcc dependent | ||
270 | # libmount uuidgen dependent | ||
271 | # mount gcc dependant | ||
272 | # partx blkid dependant | ||
273 | for d in $list; do | ||
274 | cp -pR ${S}/tests/ts/$d ${D}${PTEST_PATH}/tests/ts/ | ||
275 | done | ||
276 | } | ||