summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/util-linux
diff options
context:
space:
mode:
authorAndré Draszik <andre.draszik@jci.com>2019-02-05 02:32:33 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-12 14:04:31 +0000
commit0548b8f39373dfe68c3e6aa0a6e52a3c93ad43cb (patch)
tree95a39c713ed7515c40054cde22bb78a3eae1ddc7 /meta/recipes-core/util-linux
parent7676025942b5b4d1a6a059afb314b9863b10784a (diff)
downloadpoky-0548b8f39373dfe68c3e6aa0a6e52a3c93ad43cb.tar.gz
util-linux: one package per binary (pt 1: base_sbindir)
Now that we have required infrastructure in place, we can start creating one package per binary. To make this process easier to follow, this is done in steps, starting with binaries from base_sbindir. Existing packages (and current dependency by main package): * agetty * blkid * cfdisk <- RRECOMMENDS * fdisk <- RRECOMMENDS * fsck * fstrim * losetup <- RDEPENDS * hwclock * sulogin <- RDEPENDS * swaponoff <- RDEPENDS * switch-root <- RRECOMMENDS New packages: * blockdev * ctrlaltdel * mkswap * nologin * pivot-root * swapon * swapoff swaponoff is empty now and simply depends on swapon swapoff To avoid breaking existing users, all the new packages are added to the main package as RRECOMMENDS_${PN}, so they are pulled into existing images etc. The existing RDEPENDS_${PN} will need some further clean-up in the future, as it appears a bit random which packages the main package depends on vs. recommends. Existing packages that aren't in RDEPENDS / RRECOMMENDS haven't been added to RRECOMMENDS for that reason. [YOCTO #13058] (From OE-Core rev: 97554a56f7d9fa82294b1316f143de3f37506fc7) Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/util-linux')
-rw-r--r--meta/recipes-core/util-linux/util-linux.inc65
1 files changed, 33 insertions, 32 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index a35174f009..a81045251b 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -28,19 +28,36 @@ MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
28SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \ 28SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \
29 " 29 "
30 30
31PACKAGES =+ "util-linux-agetty util-linux-blkdiscard util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \ 31PACKAGES =+ "util-linux-blkdiscard util-linux-sfdisk \
32 util-linux-swaponoff util-linux-losetup util-linux-umount \ 32 util-linux-swaponoff util-linux-umount \
33 util-linux-mount util-linux-readprofile util-linux-uuidd \ 33 util-linux-mount util-linux-readprofile util-linux-uuidd \
34 util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs util-linux-fsck \ 34 util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs \
35 util-linux-blkid util-linux-mkfs util-linux-mcookie util-linux-rfkill \ 35 util-linux-mkfs util-linux-mcookie util-linux-rfkill \
36 util-linux-lsblk util-linux-mkfs.cramfs util-linux-fstrim \ 36 util-linux-lsblk util-linux-mkfs.cramfs \
37 util-linux-partx util-linux-hwclock util-linux-mountpoint \ 37 util-linux-partx util-linux-mountpoint \
38 util-linux-findfs util-linux-getopt util-linux-sulogin util-linux-prlimit \ 38 util-linux-findfs util-linux-getopt util-linux-prlimit \
39 util-linux-ionice util-linux-switch-root util-linux-unshare" 39 util-linux-ionice util-linux-unshare"
40PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}" 40PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}"
41PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}" 41PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}"
42 42
43PACKAGES_DYNAMIC = "^util-linux-lib.*" 43python util_linux_binpackages () {
44 def pkg_hook(f, pkg, file_regex, output_pattern, modulename):
45 if d.getVar('ALTERNATIVE_' + pkg):
46 return
47 if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename):
48 d.setVar('ALTERNATIVE_' + pkg, modulename)
49
50 for dir in [ '${base_sbindir}' ]:
51 do_split_packages(d, root=dir,
52 file_regex=r'(.*)', output_pattern='${PN}-%s',
53 description='${PN} %s',
54 hook=pkg_hook, extra_depends='', prepend=True)
55}
56
57# we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
58PACKAGE_PREPROCESS_FUNCS =+ "util_linux_binpackages "
59
60PACKAGES_DYNAMIC = "^util-linux-.*"
44 61
45CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms" 62CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms"
46UTIL_LINUX_LIBDIR = "${libdir}" 63UTIL_LINUX_LIBDIR = "${libdir}"
@@ -81,14 +98,8 @@ FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
81 98
82FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la" 99FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
83 100
84FILES_util-linux-agetty = "${base_sbindir}/agetty"
85FILES_util-linux-blkdiscard = "${sbindir}/blkdiscard" 101FILES_util-linux-blkdiscard = "${sbindir}/blkdiscard"
86FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}"
87FILES_util-linux-fstrim = "${base_sbindir}/fstrim.${BPN}"
88FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk"
89FILES_util-linux-sfdisk = "${sbindir}/sfdisk" 102FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
90FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} ${base_sbindir}/swapoff.${BPN}"
91FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}"
92FILES_util-linux-mount = "${base_bindir}/mount.${BPN}" 103FILES_util-linux-mount = "${base_bindir}/mount.${BPN}"
93FILES_util-linux-mcookie = "${bindir}/mcookie" 104FILES_util-linux-mcookie = "${bindir}/mcookie"
94FILES_util-linux-umount = "${base_bindir}/umount.${BPN}" 105FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
@@ -97,7 +108,6 @@ FILES_util-linux-uuidgen = "${bindir}/uuidgen"
97FILES_util-linux-uuidd = "${sbindir}/uuidd" 108FILES_util-linux-uuidd = "${sbindir}/uuidd"
98FILES_util-linux-rfkill = "${sbindir}/rfkill.${BPN}" 109FILES_util-linux-rfkill = "${sbindir}/rfkill.${BPN}"
99FILES_util-linux-partx = "${sbindir}/partx" 110FILES_util-linux-partx = "${sbindir}/partx"
100FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}"
101FILES_util-linux-findfs = "${sbindir}/findfs" 111FILES_util-linux-findfs = "${sbindir}/findfs"
102FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}" 112FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}"
103FILES_util-linux-runuser = "${sbindir}/runuser" 113FILES_util-linux-runuser = "${sbindir}/runuser"
@@ -113,27 +123,24 @@ FILES_util-linux-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so
113FILES_util-linux-lsblk = "${bindir}/lsblk" 123FILES_util-linux-lsblk = "${bindir}/lsblk"
114FILES_util-linux-lscpu = "${bindir}/lscpu" 124FILES_util-linux-lscpu = "${bindir}/lscpu"
115 125
116FILES_util-linux-fsck = "${base_sbindir}/fsck.${BPN}"
117FILES_util-linux-mkfs = "${sbindir}/mkfs" 126FILES_util-linux-mkfs = "${sbindir}/mkfs"
118 127
119FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs" 128FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
120FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs" 129FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
121 130
122FILES_util-linux-sulogin = "${base_sbindir}/sulogin.${BPN}"
123FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}" 131FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}"
124 132
125FILES_util-linux-switch-root = "${base_sbindir}/switch_root.${BPN}"
126FILES_util-linux-unshare = "${bindir}/unshare.${BPN}" 133FILES_util-linux-unshare = "${bindir}/unshare.${BPN}"
127 134
128# Util-linux' blkid replaces the e2fsprogs one 135# Util-linux' blkid replaces the e2fsprogs one
129FILES_util-linux-blkid = "${base_sbindir}/blkid.${BPN}"
130RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid" 136RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
131RREPLACES_util-linux-blkid = "e2fsprogs-blkid" 137RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
132 138
133RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin util-linux-lsblk" 139RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin util-linux-lsblk"
134RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}" 140RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}"
135 141
136RRECOMMENDS_${PN} = "util-linux-blkdiscard util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs util-linux-mountpoint util-linux-prlimit util-linux-ionice util-linux-switch-root" 142RRECOMMENDS_${PN} = "util-linux-blkdiscard util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs util-linux-mountpoint util-linux-prlimit util-linux-ionice"
143RRECOMMENDS_${PN} += "${PN}-blockdev ${PN}-cfdisk ${PN}-ctrlaltdel ${PN}-fdisk ${PN}-mkswap ${PN}-nologin ${PN}-pivot-root ${PN}-switch-root"
137 144
138RRECOMMENDS_${PN}_class-native = "" 145RRECOMMENDS_${PN}_class-native = ""
139RRECOMMENDS_${PN}_class-nativesdk = "" 146RRECOMMENDS_${PN}_class-nativesdk = ""
@@ -142,6 +149,9 @@ RDEPENDS_${PN}_class-nativesdk = ""
142 149
143RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linux-libuuid-dev" 150RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linux-libuuid-dev"
144 151
152RDEPENDS_${PN}-swaponoff = "${PN}-swapon ${PN}-swapoff"
153ALLOW_EMPTY_${PN}-swaponoff = "1"
154
145#SYSTEMD_PACKAGES = "${PN}-uuidd ${PN}-fstrim" 155#SYSTEMD_PACKAGES = "${PN}-uuidd ${PN}-fstrim"
146SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.socket uuidd.service" 156SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.socket uuidd.service"
147SYSTEMD_AUTO_ENABLE_${PN}-uuidd = "disable" 157SYSTEMD_AUTO_ENABLE_${PN}-uuidd = "disable"
@@ -213,9 +223,9 @@ do_install_append_class-native () {
213ALTERNATIVE_PRIORITY = "80" 223ALTERNATIVE_PRIORITY = "80"
214 224
215ALTERNATIVE_${PN} = " \ 225ALTERNATIVE_${PN} = " \
216 dmesg kill more mkswap blockdev pivot_root \ 226 dmesg kill more \
217 hexdump last lastb logger mesg renice wall \ 227 hexdump last lastb logger mesg renice wall \
218 setsid chrt flock utmpdump eject nologin taskset fallocate \ 228 setsid chrt flock utmpdump eject taskset fallocate \
219 fsfreeze nsenter cal rev \ 229 fsfreeze nsenter cal rev \
220" 230"
221 231
@@ -254,13 +264,10 @@ ALTERNATIVE_LINK_NAME[uuid.3] = "${mandir}/man3/uuid.3"
254ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1" 264ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1"
255ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1" 265ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1"
256 266
257ALTERNATIVE_util-linux-hwclock = "hwclock"
258ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock" 267ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock"
259 268
260ALTERNATIVE_util-linux-fdisk = "fdisk"
261ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk" 269ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk"
262 270
263ALTERNATIVE_util-linux-fstrim = "fstrim"
264ALTERNATIVE_LINK_NAME[fstrim] = "${base_sbindir}/fstrim" 271ALTERNATIVE_LINK_NAME[fstrim] = "${base_sbindir}/fstrim"
265 272
266ALTERNATIVE_util-linux-agetty = "getty" 273ALTERNATIVE_util-linux-agetty = "getty"
@@ -279,17 +286,13 @@ ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount"
279ALTERNATIVE_util-linux-readprofile = "readprofile" 286ALTERNATIVE_util-linux-readprofile = "readprofile"
280ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile" 287ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile"
281 288
282ALTERNATIVE_util-linux-losetup = "losetup"
283ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup" 289ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup"
284 290
285ALTERNATIVE_util-linux-swaponoff = "swapoff swapon"
286ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff" 291ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff"
287ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon" 292ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon"
288 293
289ALTERNATIVE_util-linux-fsck = "fsck"
290ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck" 294ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck"
291 295
292ALTERNATIVE_util-linux-blkid = "blkid"
293ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" 296ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid"
294 297
295ALTERNATIVE_util-linux-rfkill = "rfkill" 298ALTERNATIVE_util-linux-rfkill = "rfkill"
@@ -298,7 +301,6 @@ ALTERNATIVE_LINK_NAME[rfkill] = "${sbindir}/rfkill"
298ALTERNATIVE_util-linux-getopt = "getopt" 301ALTERNATIVE_util-linux-getopt = "getopt"
299ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt" 302ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt"
300 303
301ALTERNATIVE_util-linux-sulogin = "sulogin"
302ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" 304ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin"
303 305
304ALTERNATIVE_util-linux-mountpoint = "mountpoint" 306ALTERNATIVE_util-linux-mountpoint = "mountpoint"
@@ -310,7 +312,6 @@ ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare"
310ALTERNATIVE_util-linux-ionice = "ionice" 312ALTERNATIVE_util-linux-ionice = "ionice"
311ALTERNATIVE_LINK_NAME[ionice] = "${bindir}/ionice" 313ALTERNATIVE_LINK_NAME[ionice] = "${bindir}/ionice"
312 314
313ALTERNATIVE_util-linux-switch-root = "switch_root"
314ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root" 315ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
315 316
316BBCLASSEXTEND = "native nativesdk" 317BBCLASSEXTEND = "native nativesdk"