diff options
author | André Draszik <andre.draszik@jci.com> | 2019-02-05 02:32:33 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-12 14:04:31 +0000 |
commit | 0548b8f39373dfe68c3e6aa0a6e52a3c93ad43cb (patch) | |
tree | 95a39c713ed7515c40054cde22bb78a3eae1ddc7 /meta/recipes-core/util-linux | |
parent | 7676025942b5b4d1a6a059afb314b9863b10784a (diff) | |
download | poky-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.inc | 65 |
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])}" | |||
28 | SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \ | 28 | SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \ |
29 | " | 29 | " |
30 | 30 | ||
31 | PACKAGES =+ "util-linux-agetty util-linux-blkdiscard util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \ | 31 | PACKAGES =+ "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" |
40 | PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}" | 40 | PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}" |
41 | PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}" | 41 | PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}" |
42 | 42 | ||
43 | PACKAGES_DYNAMIC = "^util-linux-lib.*" | 43 | python 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 | ||
58 | PACKAGE_PREPROCESS_FUNCS =+ "util_linux_binpackages " | ||
59 | |||
60 | PACKAGES_DYNAMIC = "^util-linux-.*" | ||
44 | 61 | ||
45 | CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms" | 62 | CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms" |
46 | UTIL_LINUX_LIBDIR = "${libdir}" | 63 | UTIL_LINUX_LIBDIR = "${libdir}" |
@@ -81,14 +98,8 @@ FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*" | |||
81 | 98 | ||
82 | FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la" | 99 | FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la" |
83 | 100 | ||
84 | FILES_util-linux-agetty = "${base_sbindir}/agetty" | ||
85 | FILES_util-linux-blkdiscard = "${sbindir}/blkdiscard" | 101 | FILES_util-linux-blkdiscard = "${sbindir}/blkdiscard" |
86 | FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}" | ||
87 | FILES_util-linux-fstrim = "${base_sbindir}/fstrim.${BPN}" | ||
88 | FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk" | ||
89 | FILES_util-linux-sfdisk = "${sbindir}/sfdisk" | 102 | FILES_util-linux-sfdisk = "${sbindir}/sfdisk" |
90 | FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} ${base_sbindir}/swapoff.${BPN}" | ||
91 | FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}" | ||
92 | FILES_util-linux-mount = "${base_bindir}/mount.${BPN}" | 103 | FILES_util-linux-mount = "${base_bindir}/mount.${BPN}" |
93 | FILES_util-linux-mcookie = "${bindir}/mcookie" | 104 | FILES_util-linux-mcookie = "${bindir}/mcookie" |
94 | FILES_util-linux-umount = "${base_bindir}/umount.${BPN}" | 105 | FILES_util-linux-umount = "${base_bindir}/umount.${BPN}" |
@@ -97,7 +108,6 @@ FILES_util-linux-uuidgen = "${bindir}/uuidgen" | |||
97 | FILES_util-linux-uuidd = "${sbindir}/uuidd" | 108 | FILES_util-linux-uuidd = "${sbindir}/uuidd" |
98 | FILES_util-linux-rfkill = "${sbindir}/rfkill.${BPN}" | 109 | FILES_util-linux-rfkill = "${sbindir}/rfkill.${BPN}" |
99 | FILES_util-linux-partx = "${sbindir}/partx" | 110 | FILES_util-linux-partx = "${sbindir}/partx" |
100 | FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}" | ||
101 | FILES_util-linux-findfs = "${sbindir}/findfs" | 111 | FILES_util-linux-findfs = "${sbindir}/findfs" |
102 | FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}" | 112 | FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}" |
103 | FILES_util-linux-runuser = "${sbindir}/runuser" | 113 | FILES_util-linux-runuser = "${sbindir}/runuser" |
@@ -113,27 +123,24 @@ FILES_util-linux-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so | |||
113 | FILES_util-linux-lsblk = "${bindir}/lsblk" | 123 | FILES_util-linux-lsblk = "${bindir}/lsblk" |
114 | FILES_util-linux-lscpu = "${bindir}/lscpu" | 124 | FILES_util-linux-lscpu = "${bindir}/lscpu" |
115 | 125 | ||
116 | FILES_util-linux-fsck = "${base_sbindir}/fsck.${BPN}" | ||
117 | FILES_util-linux-mkfs = "${sbindir}/mkfs" | 126 | FILES_util-linux-mkfs = "${sbindir}/mkfs" |
118 | 127 | ||
119 | FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs" | 128 | FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs" |
120 | FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs" | 129 | FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs" |
121 | 130 | ||
122 | FILES_util-linux-sulogin = "${base_sbindir}/sulogin.${BPN}" | ||
123 | FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}" | 131 | FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}" |
124 | 132 | ||
125 | FILES_util-linux-switch-root = "${base_sbindir}/switch_root.${BPN}" | ||
126 | FILES_util-linux-unshare = "${bindir}/unshare.${BPN}" | 133 | FILES_util-linux-unshare = "${bindir}/unshare.${BPN}" |
127 | 134 | ||
128 | # Util-linux' blkid replaces the e2fsprogs one | 135 | # Util-linux' blkid replaces the e2fsprogs one |
129 | FILES_util-linux-blkid = "${base_sbindir}/blkid.${BPN}" | ||
130 | RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid" | 136 | RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid" |
131 | RREPLACES_util-linux-blkid = "e2fsprogs-blkid" | 137 | RREPLACES_util-linux-blkid = "e2fsprogs-blkid" |
132 | 138 | ||
133 | RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin util-linux-lsblk" | 139 | RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin util-linux-lsblk" |
134 | RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}" | 140 | RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}" |
135 | 141 | ||
136 | RRECOMMENDS_${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" | 142 | RRECOMMENDS_${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" |
143 | RRECOMMENDS_${PN} += "${PN}-blockdev ${PN}-cfdisk ${PN}-ctrlaltdel ${PN}-fdisk ${PN}-mkswap ${PN}-nologin ${PN}-pivot-root ${PN}-switch-root" | ||
137 | 144 | ||
138 | RRECOMMENDS_${PN}_class-native = "" | 145 | RRECOMMENDS_${PN}_class-native = "" |
139 | RRECOMMENDS_${PN}_class-nativesdk = "" | 146 | RRECOMMENDS_${PN}_class-nativesdk = "" |
@@ -142,6 +149,9 @@ RDEPENDS_${PN}_class-nativesdk = "" | |||
142 | 149 | ||
143 | RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linux-libuuid-dev" | 150 | RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linux-libuuid-dev" |
144 | 151 | ||
152 | RDEPENDS_${PN}-swaponoff = "${PN}-swapon ${PN}-swapoff" | ||
153 | ALLOW_EMPTY_${PN}-swaponoff = "1" | ||
154 | |||
145 | #SYSTEMD_PACKAGES = "${PN}-uuidd ${PN}-fstrim" | 155 | #SYSTEMD_PACKAGES = "${PN}-uuidd ${PN}-fstrim" |
146 | SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.socket uuidd.service" | 156 | SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.socket uuidd.service" |
147 | SYSTEMD_AUTO_ENABLE_${PN}-uuidd = "disable" | 157 | SYSTEMD_AUTO_ENABLE_${PN}-uuidd = "disable" |
@@ -213,9 +223,9 @@ do_install_append_class-native () { | |||
213 | ALTERNATIVE_PRIORITY = "80" | 223 | ALTERNATIVE_PRIORITY = "80" |
214 | 224 | ||
215 | ALTERNATIVE_${PN} = " \ | 225 | ALTERNATIVE_${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" | |||
254 | ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1" | 264 | ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1" |
255 | ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1" | 265 | ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1" |
256 | 266 | ||
257 | ALTERNATIVE_util-linux-hwclock = "hwclock" | ||
258 | ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock" | 267 | ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock" |
259 | 268 | ||
260 | ALTERNATIVE_util-linux-fdisk = "fdisk" | ||
261 | ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk" | 269 | ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk" |
262 | 270 | ||
263 | ALTERNATIVE_util-linux-fstrim = "fstrim" | ||
264 | ALTERNATIVE_LINK_NAME[fstrim] = "${base_sbindir}/fstrim" | 271 | ALTERNATIVE_LINK_NAME[fstrim] = "${base_sbindir}/fstrim" |
265 | 272 | ||
266 | ALTERNATIVE_util-linux-agetty = "getty" | 273 | ALTERNATIVE_util-linux-agetty = "getty" |
@@ -279,17 +286,13 @@ ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount" | |||
279 | ALTERNATIVE_util-linux-readprofile = "readprofile" | 286 | ALTERNATIVE_util-linux-readprofile = "readprofile" |
280 | ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile" | 287 | ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile" |
281 | 288 | ||
282 | ALTERNATIVE_util-linux-losetup = "losetup" | ||
283 | ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup" | 289 | ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup" |
284 | 290 | ||
285 | ALTERNATIVE_util-linux-swaponoff = "swapoff swapon" | ||
286 | ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff" | 291 | ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff" |
287 | ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon" | 292 | ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon" |
288 | 293 | ||
289 | ALTERNATIVE_util-linux-fsck = "fsck" | ||
290 | ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck" | 294 | ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck" |
291 | 295 | ||
292 | ALTERNATIVE_util-linux-blkid = "blkid" | ||
293 | ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" | 296 | ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" |
294 | 297 | ||
295 | ALTERNATIVE_util-linux-rfkill = "rfkill" | 298 | ALTERNATIVE_util-linux-rfkill = "rfkill" |
@@ -298,7 +301,6 @@ ALTERNATIVE_LINK_NAME[rfkill] = "${sbindir}/rfkill" | |||
298 | ALTERNATIVE_util-linux-getopt = "getopt" | 301 | ALTERNATIVE_util-linux-getopt = "getopt" |
299 | ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt" | 302 | ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt" |
300 | 303 | ||
301 | ALTERNATIVE_util-linux-sulogin = "sulogin" | ||
302 | ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" | 304 | ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" |
303 | 305 | ||
304 | ALTERNATIVE_util-linux-mountpoint = "mountpoint" | 306 | ALTERNATIVE_util-linux-mountpoint = "mountpoint" |
@@ -310,7 +312,6 @@ ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare" | |||
310 | ALTERNATIVE_util-linux-ionice = "ionice" | 312 | ALTERNATIVE_util-linux-ionice = "ionice" |
311 | ALTERNATIVE_LINK_NAME[ionice] = "${bindir}/ionice" | 313 | ALTERNATIVE_LINK_NAME[ionice] = "${bindir}/ionice" |
312 | 314 | ||
313 | ALTERNATIVE_util-linux-switch-root = "switch_root" | ||
314 | ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root" | 315 | ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root" |
315 | 316 | ||
316 | BBCLASSEXTEND = "native nativesdk" | 317 | BBCLASSEXTEND = "native nativesdk" |