diff options
author | Andres Beltran <abeltran@linux.microsoft.com> | 2021-10-05 00:34:15 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-14 11:22:18 +0100 |
commit | f3518bcdab10ea3bd193bbb1b8a57ad9f751db63 (patch) | |
tree | 51077bcafc2b84b469a4c8c906883fa4621e2111 /meta | |
parent | 433201369e3d8336335d052eea32fe64e811f6e6 (diff) | |
download | poky-f3518bcdab10ea3bd193bbb1b8a57ad9f751db63.tar.gz |
buildhistory: Fix package output files for SDKs
Currently, installed packages are listed for images in image-info.txt, but
not for SDKs in sdk-info.txt. Add TOOLCHAIN_HOST_TASK and
TOOLCHAIN_TARGET_TASK to the output variables in sdk-info.txt.
Moreover, package output files for the SDK host are empty because
PKGDATA_DIR defaults to the target directory. Fix this bug and create a new
variable called PKGDATA_DIR_SDK which stores the correct path for the SDK
host package data.
(From OE-Core rev: 82e6172c1df378dff4e503aa878501c08937b5bb)
Signed-off-by: Andres Beltran <abeltran@linux.microsoft.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/buildhistory.bbclass | 21 | ||||
-rw-r--r-- | meta/classes/cross-canadian.bbclass | 2 | ||||
-rw-r--r-- | meta/classes/nativesdk.bbclass | 2 | ||||
-rw-r--r-- | meta/conf/bitbake.conf | 1 | ||||
-rw-r--r-- | meta/lib/oe/package_manager/__init__.py | 2 |
5 files changed, 20 insertions, 8 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index a613306270..7c44fec2d1 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
@@ -442,11 +442,16 @@ def buildhistory_list_installed(d, rootfs_type="image"): | |||
442 | else: | 442 | else: |
443 | pkgs = sdk_list_installed_packages(d, rootfs_type == "sdk_target") | 443 | pkgs = sdk_list_installed_packages(d, rootfs_type == "sdk_target") |
444 | 444 | ||
445 | if rootfs_type == "sdk_host": | ||
446 | pkgdata_dir = d.getVar('PKGDATA_DIR_SDK') | ||
447 | else: | ||
448 | pkgdata_dir = d.getVar('PKGDATA_DIR') | ||
449 | |||
445 | for output_type, output_file in process_list: | 450 | for output_type, output_file in process_list: |
446 | output_file_full = os.path.join(d.getVar('WORKDIR'), output_file) | 451 | output_file_full = os.path.join(d.getVar('WORKDIR'), output_file) |
447 | 452 | ||
448 | with open(output_file_full, 'w') as output: | 453 | with open(output_file_full, 'w') as output: |
449 | output.write(format_pkg_list(pkgs, output_type, d.getVar('PKGDATA_DIR'))) | 454 | output.write(format_pkg_list(pkgs, output_type, pkgdata_dir)) |
450 | 455 | ||
451 | python buildhistory_list_installed_image() { | 456 | python buildhistory_list_installed_image() { |
452 | buildhistory_list_installed(d) | 457 | buildhistory_list_installed(d) |
@@ -496,13 +501,19 @@ buildhistory_get_installed() { | |||
496 | echo "}" >> $1/depends.dot | 501 | echo "}" >> $1/depends.dot |
497 | rm $1/depends.tmp | 502 | rm $1/depends.tmp |
498 | 503 | ||
504 | # Set correct pkgdatadir | ||
505 | pkgdatadir=${PKGDATA_DIR} | ||
506 | if [ "$2" == "sdk" ] && [ "$3" == "host" ]; then | ||
507 | pkgdatadir="${PKGDATA_DIR_SDK}" | ||
508 | fi | ||
509 | |||
499 | # Produce installed package sizes list | 510 | # Produce installed package sizes list |
500 | oe-pkgdata-util -p ${PKGDATA_DIR} read-value "PKGSIZE" -n -f $pkgcache > $1/installed-package-sizes.tmp | 511 | oe-pkgdata-util -p $pkgdatadir read-value "PKGSIZE" -n -f $pkgcache > $1/installed-package-sizes.tmp |
501 | cat $1/installed-package-sizes.tmp | awk '{print $2 "\tKiB\t" $1}' | sort -n -r > $1/installed-package-sizes.txt | 512 | cat $1/installed-package-sizes.tmp | awk '{print $2 "\tKiB\t" $1}' | sort -n -r > $1/installed-package-sizes.txt |
502 | rm $1/installed-package-sizes.tmp | 513 | rm $1/installed-package-sizes.tmp |
503 | 514 | ||
504 | # Produce package info: runtime_name, buildtime_name, recipe, version, size | 515 | # Produce package info: runtime_name, buildtime_name, recipe, version, size |
505 | oe-pkgdata-util -p ${PKGDATA_DIR} read-value "PACKAGE,PN,PV,PKGSIZE" -n -f $pkgcache > $1/installed-package-info.tmp | 516 | oe-pkgdata-util -p $pkgdatadir read-value "PACKAGE,PN,PV,PKGSIZE" -n -f $pkgcache > $1/installed-package-info.tmp |
506 | cat $1/installed-package-info.tmp | sort -n -r -k 5 > $1/installed-package-info.txt | 517 | cat $1/installed-package-info.tmp | sort -n -r -k 5 > $1/installed-package-info.txt |
507 | rm $1/installed-package-info.tmp | 518 | rm $1/installed-package-info.tmp |
508 | 519 | ||
@@ -542,7 +553,7 @@ buildhistory_get_sdk_installed() { | |||
542 | return | 553 | return |
543 | fi | 554 | fi |
544 | 555 | ||
545 | buildhistory_get_installed ${BUILDHISTORY_DIR_SDK}/$1 sdk | 556 | buildhistory_get_installed ${BUILDHISTORY_DIR_SDK}/$1 sdk $1 |
546 | } | 557 | } |
547 | 558 | ||
548 | buildhistory_get_sdk_installed_host() { | 559 | buildhistory_get_sdk_installed_host() { |
@@ -773,7 +784,7 @@ def buildhistory_get_imagevars(d): | |||
773 | def buildhistory_get_sdkvars(d): | 784 | def buildhistory_get_sdkvars(d): |
774 | if d.getVar('BB_WORKERCONTEXT') != '1': | 785 | if d.getVar('BB_WORKERCONTEXT') != '1': |
775 | return "" | 786 | return "" |
776 | sdkvars = "DISTRO DISTRO_VERSION SDK_NAME SDK_VERSION SDKMACHINE SDKIMAGE_FEATURES BAD_RECOMMENDATIONS NO_RECOMMENDATIONS PACKAGE_EXCLUDE" | 787 | sdkvars = "DISTRO DISTRO_VERSION SDK_NAME SDK_VERSION SDKMACHINE SDKIMAGE_FEATURES TOOLCHAIN_HOST_TASK TOOLCHAIN_TARGET_TASK BAD_RECOMMENDATIONS NO_RECOMMENDATIONS PACKAGE_EXCLUDE" |
777 | if d.getVar('BB_CURRENTTASK') == 'populate_sdk_ext': | 788 | if d.getVar('BB_CURRENTTASK') == 'populate_sdk_ext': |
778 | # Extensible SDK uses some additional variables | 789 | # Extensible SDK uses some additional variables |
779 | sdkvars += " SDK_LOCAL_CONF_WHITELIST SDK_LOCAL_CONF_BLACKLIST SDK_INHERIT_BLACKLIST SDK_UPDATE_URL SDK_EXT_TYPE SDK_RECRDEP_TASKS SDK_INCLUDE_PKGDATA SDK_INCLUDE_TOOLCHAIN" | 790 | sdkvars += " SDK_LOCAL_CONF_WHITELIST SDK_LOCAL_CONF_BLACKLIST SDK_INHERIT_BLACKLIST SDK_UPDATE_URL SDK_EXT_TYPE SDK_RECRDEP_TASKS SDK_INCLUDE_PKGDATA SDK_INCLUDE_TOOLCHAIN" |
diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass index ffbc2167e3..ac82e86356 100644 --- a/meta/classes/cross-canadian.bbclass +++ b/meta/classes/cross-canadian.bbclass | |||
@@ -169,7 +169,7 @@ USE_NLS = "${SDKUSE_NLS}" | |||
169 | # and not any particular tune that is enabled. | 169 | # and not any particular tune that is enabled. |
170 | TARGET_ARCH[vardepsexclude] = "TUNE_ARCH" | 170 | TARGET_ARCH[vardepsexclude] = "TUNE_ARCH" |
171 | 171 | ||
172 | PKGDATA_DIR = "${TMPDIR}/pkgdata/${SDK_SYS}" | 172 | PKGDATA_DIR = "${PKGDATA_DIR_SDK}" |
173 | # If MLPREFIX is set by multilib code, shlibs | 173 | # If MLPREFIX is set by multilib code, shlibs |
174 | # points to the wrong place so force it | 174 | # points to the wrong place so force it |
175 | SHLIBSDIRS = "${PKGDATA_DIR}/nativesdk-shlibs2" | 175 | SHLIBSDIRS = "${PKGDATA_DIR}/nativesdk-shlibs2" |
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass index c66de8c787..14e210562f 100644 --- a/meta/classes/nativesdk.bbclass +++ b/meta/classes/nativesdk.bbclass | |||
@@ -31,7 +31,7 @@ PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}" | |||
31 | DEPENDS:append = " chrpath-replacement-native" | 31 | DEPENDS:append = " chrpath-replacement-native" |
32 | EXTRANATIVEPATH += "chrpath-native" | 32 | EXTRANATIVEPATH += "chrpath-native" |
33 | 33 | ||
34 | PKGDATA_DIR = "${TMPDIR}/pkgdata/${SDK_SYS}" | 34 | PKGDATA_DIR = "${PKGDATA_DIR_SDK}" |
35 | 35 | ||
36 | HOST_ARCH = "${SDK_ARCH}" | 36 | HOST_ARCH = "${SDK_ARCH}" |
37 | HOST_VENDOR = "${SDK_VENDOR}" | 37 | HOST_VENDOR = "${SDK_VENDOR}" |
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 030d29b097..441cc2b470 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf | |||
@@ -415,6 +415,7 @@ DEPLOY_DIR_IMAGE ?= "${DEPLOY_DIR}/images/${MACHINE}" | |||
415 | DEPLOY_DIR_TOOLS = "${DEPLOY_DIR}/tools" | 415 | DEPLOY_DIR_TOOLS = "${DEPLOY_DIR}/tools" |
416 | 416 | ||
417 | PKGDATA_DIR = "${TMPDIR}/pkgdata/${MACHINE}" | 417 | PKGDATA_DIR = "${TMPDIR}/pkgdata/${MACHINE}" |
418 | PKGDATA_DIR_SDK = "${TMPDIR}/pkgdata/${SDK_SYS}" | ||
418 | 419 | ||
419 | ################################################################## | 420 | ################################################################## |
420 | # SDK variables. | 421 | # SDK variables. |
diff --git a/meta/lib/oe/package_manager/__init__.py b/meta/lib/oe/package_manager/__init__.py index 8f7b60e077..80bc1a6bc6 100644 --- a/meta/lib/oe/package_manager/__init__.py +++ b/meta/lib/oe/package_manager/__init__.py | |||
@@ -321,7 +321,7 @@ class PackageManager(object, metaclass=ABCMeta): | |||
321 | # TODO don't have sdk here but have a property on the superclass | 321 | # TODO don't have sdk here but have a property on the superclass |
322 | # (and respect in install_complementary) | 322 | # (and respect in install_complementary) |
323 | if sdk: | 323 | if sdk: |
324 | pkgdatadir = self.d.expand("${TMPDIR}/pkgdata/${SDK_SYS}") | 324 | pkgdatadir = self.d.getVar("PKGDATA_DIR_SDK") |
325 | else: | 325 | else: |
326 | pkgdatadir = self.d.getVar("PKGDATA_DIR") | 326 | pkgdatadir = self.d.getVar("PKGDATA_DIR") |
327 | 327 | ||