summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Draszik <andre.draszik@jci.com>2019-02-05 02:32:36 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-12 14:04:31 +0000
commit9ecdf9067503aa7576665fd83c9d132328af70dd (patch)
tree8f0657365c18747dadd78fd07037bc1375cfbc28
parent6b82821f8ad4bdac2523a382a33559804531f36c (diff)
downloadpoky-9ecdf9067503aa7576665fd83c9d132328af70dd.tar.gz
util-linux: one package per binary (pt 3: sbindir)
Similar to the previous patch. Existing packages (and current dependency by main package): * blkdiscard <- RRECOMMENDS * findfs * fsck.cramfs * mkfs <- RRECOMMENDS * mkfs.cramfs * partx * readprofile <- RRECOMMENDS * rfkill * runuser <- RDEPENDS * sfdisk <- RRECOMMENDS * uuidd New packages: * too many to list 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. Nevertheless, all existing packages have been added to RRECOMMENDS this time, even if they weren't in RDEPENDS / RRECOMMENDS before. [YOCTO #13058] (From OE-Core rev: 19f63aa911ff9d8bea62102c3f3f54cf6dccd6d8) Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/util-linux/util-linux.inc46
1 files changed, 19 insertions, 27 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 4359a1c3fb..3b0598b708 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -28,17 +28,13 @@ 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-blkdiscard util-linux-sfdisk \ 31PACKAGES =+ "util-linux-swaponoff \
32 util-linux-swaponoff \ 32 util-linux-uuidgen util-linux-lscpu \
33 util-linux-readprofile util-linux-uuidd \ 33 util-linux-mcookie \
34 util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs \ 34 util-linux-lsblk \
35 util-linux-mkfs util-linux-mcookie util-linux-rfkill \ 35 util-linux-prlimit \
36 util-linux-lsblk util-linux-mkfs.cramfs \
37 util-linux-partx \
38 util-linux-findfs util-linux-prlimit \
39 util-linux-ionice util-linux-unshare" 36 util-linux-ionice util-linux-unshare"
40PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}" 37PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}"
41PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser', '', d)}"
42 38
43python util_linux_binpackages () { 39python util_linux_binpackages () {
44 def pkg_hook(f, pkg, file_regex, output_pattern, modulename): 40 def pkg_hook(f, pkg, file_regex, output_pattern, modulename):
@@ -47,18 +43,29 @@ python util_linux_binpackages () {
47 if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename): 43 if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename):
48 d.setVar('ALTERNATIVE_' + pkg, modulename) 44 d.setVar('ALTERNATIVE_' + pkg, modulename)
49 45
46 def pkg_hook_with_recommends(f, pkg, file_regex, output_pattern, modulename):
47 pn = d.getVar('PN')
48 d.appendVar('RRECOMMENDS_%s' % pn, ' %s' % pkg)
49 pkg_hook(f, pkg, file_regex, output_pattern, modulename)
50
50 for dir in [ '${base_sbindir}', '${base_bindir}' ]: 51 for dir in [ '${base_sbindir}', '${base_bindir}' ]:
51 do_split_packages(d, root=dir, 52 do_split_packages(d, root=dir,
52 file_regex=r'(.*)', output_pattern='${PN}-%s', 53 file_regex=r'(.*)', output_pattern='${PN}-%s',
53 description='${PN} %s', 54 description='${PN} %s',
54 hook=pkg_hook, extra_depends='', prepend=True) 55 hook=pkg_hook, extra_depends='', prepend=True)
55 56
57 for dir in [ '${sbindir}' ]:
58 do_split_packages(d, root=dir,
59 file_regex=r'(.*)', output_pattern='${PN}-%s',
60 description='${PN} %s',
61 hook=pkg_hook_with_recommends, extra_depends='', prepend=True)
62
56 # There are some symlinks for some binaries which we have ignored 63 # There are some symlinks for some binaries which we have ignored
57 # above. Add them to the package owning the binary they are 64 # above. Add them to the package owning the binary they are
58 # pointing to 65 # pointing to
59 extras = {} 66 extras = {}
60 dvar = d.getVar('PKGD') 67 dvar = d.getVar('PKGD')
61 for root in [ '${base_sbindir}', '${base_bindir}' ]: 68 for root in [ '${base_sbindir}', '${base_bindir}', '${sbindir}' ]:
62 root = d.expand(root) 69 root = d.expand(root)
63 for walkroot, dirs, files in os.walk(dvar + root): 70 for walkroot, dirs, files in os.walk(dvar + root):
64 for f in files: 71 for f in files:
@@ -120,16 +127,8 @@ FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
120 127
121FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la" 128FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
122 129
123FILES_util-linux-blkdiscard = "${sbindir}/blkdiscard"
124FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
125FILES_util-linux-mcookie = "${bindir}/mcookie" 130FILES_util-linux-mcookie = "${bindir}/mcookie"
126FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
127FILES_util-linux-uuidgen = "${bindir}/uuidgen" 131FILES_util-linux-uuidgen = "${bindir}/uuidgen"
128FILES_util-linux-uuidd = "${sbindir}/uuidd"
129FILES_util-linux-rfkill = "${sbindir}/rfkill.${BPN}"
130FILES_util-linux-partx = "${sbindir}/partx"
131FILES_util-linux-findfs = "${sbindir}/findfs"
132FILES_util-linux-runuser = "${sbindir}/runuser"
133FILES_util-linux-prlimit = "${bindir}/prlimit" 132FILES_util-linux-prlimit = "${bindir}/prlimit"
134FILES_util-linux-ionice = "${bindir}/ionice.${BPN}" 133FILES_util-linux-ionice = "${bindir}/ionice.${BPN}"
135FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*" 134FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
@@ -142,11 +141,6 @@ FILES_util-linux-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so
142FILES_util-linux-lsblk = "${bindir}/lsblk" 141FILES_util-linux-lsblk = "${bindir}/lsblk"
143FILES_util-linux-lscpu = "${bindir}/lscpu" 142FILES_util-linux-lscpu = "${bindir}/lscpu"
144 143
145FILES_util-linux-mkfs = "${sbindir}/mkfs"
146
147FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
148FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
149
150FILES_util-linux-unshare = "${bindir}/unshare.${BPN}" 144FILES_util-linux-unshare = "${bindir}/unshare.${BPN}"
151 145
152# Util-linux' blkid replaces the e2fsprogs one 146# Util-linux' blkid replaces the e2fsprogs one
@@ -156,7 +150,7 @@ RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
156RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin util-linux-lsblk" 150RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin util-linux-lsblk"
157RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}" 151RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}"
158 152
159RRECOMMENDS_${PN} = "util-linux-blkdiscard util-linux-sfdisk util-linux-readprofile util-linux-mkfs util-linux-prlimit util-linux-ionice" 153RRECOMMENDS_${PN} = "util-linux-prlimit util-linux-ionice"
160RRECOMMENDS_${PN} += "${PN}-blockdev ${PN}-cfdisk ${PN}-ctrlaltdel ${PN}-fdisk ${PN}-mkswap ${PN}-nologin ${PN}-pivot-root ${PN}-switch-root" 154RRECOMMENDS_${PN} += "${PN}-blockdev ${PN}-cfdisk ${PN}-ctrlaltdel ${PN}-fdisk ${PN}-mkswap ${PN}-nologin ${PN}-pivot-root ${PN}-switch-root"
161RRECOMMENDS_${PN} += "${PN}-dmesg ${PN}-kill ${PN}-more ${PN}-mount ${PN}-mountpoint" 155RRECOMMENDS_${PN} += "${PN}-dmesg ${PN}-kill ${PN}-more ${PN}-mount ${PN}-mountpoint"
162 156
@@ -243,7 +237,7 @@ ALTERNATIVE_PRIORITY = "80"
243ALTERNATIVE_${PN} = " \ 237ALTERNATIVE_${PN} = " \
244 hexdump last lastb logger mesg renice wall \ 238 hexdump last lastb logger mesg renice wall \
245 setsid chrt flock utmpdump eject taskset fallocate \ 239 setsid chrt flock utmpdump eject taskset fallocate \
246 fsfreeze nsenter cal rev \ 240 nsenter cal rev \
247" 241"
248 242
249ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg" 243ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
@@ -295,7 +289,6 @@ ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount"
295ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su" 289ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
296ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount" 290ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount"
297 291
298ALTERNATIVE_util-linux-readprofile = "readprofile"
299ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile" 292ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile"
300 293
301ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup" 294ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup"
@@ -307,7 +300,6 @@ ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck"
307 300
308ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" 301ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid"
309 302
310ALTERNATIVE_util-linux-rfkill = "rfkill"
311ALTERNATIVE_LINK_NAME[rfkill] = "${sbindir}/rfkill" 303ALTERNATIVE_LINK_NAME[rfkill] = "${sbindir}/rfkill"
312 304
313ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt" 305ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt"