Hob: oe-core related changes
Hi Richard,
This is the second pull request for Hob oe-core related changes.
Please help to review and pull.
Note that this pull request has dependency on branch dxu4/hob-bitbake-changes-v2.
Changes from v1:
1. Change the way to pass package information to GUI.
In v1 we defined a do_packageinfo task to pass the package information of built recipes. Here we use a new approach to pass all the available package information to the client GUI.
2. Change the name for hob.bb and hob-toolchain.bb to dummy-image.bb and dummy-toolchain.bb.
Thanks,
Dongxiao
The following changes since commit 9b944ae2f0e4dbac5a8f1f235f60730e56b26516:
Richard Purdie (1):
Revert "site/common-uclibc: Cache gl_cv_func_wcwidth_works"
are available in the git repository at:
git://git.pokylinux.org/poky-contrib dxu4/hob-oecore-changes-v2
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dxu4/hob-oecore-changes-v2
Dongxiao Xu (4):
packageinfo.bbclass: add a new bbclass to pass package information dummy-image.bb: add an empty image template
dummy-toolchain: add a new recipe dummy-toolchain
layers: add a new folder to put user added layers
Shane Wang (1):
package.bbclass: set package size into pkgdata for hob2's use
layers/README | 1 + meta/classes/package.bbclass | 8 +++++++ meta/classes/packageinfo.bbclass | 30 +++++++++++++++++++++++++++++ meta/recipes-core/images/dummy-image.bb | 1 + meta/recipes-core/meta/dummy-toolchain.bb | 10 +++++++++ 5 files changed, 50 insertions(+), 0 deletions(-) create mode 100644 layers/README create mode 100644 meta/classes/packageinfo.bbclass create mode 100644 meta/recipes-core/images/dummy-image.bb create mode 100644 meta/recipes-core/meta/dummy-toolchain.bb
PATCH 1/5 package.bbclass: set package size into pkgdata for hob2's use
From: Shane Wang <[email protected]>
Write the size of a package into its pkgdata for hob2 to get the size and show on the UI for image making.
--- meta/classes/package.bbclass | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
meta/classes/package.bbclass +8 -0
@@ -1042,6 +1042,13 @@ python emit_pkgdata() { f.write('%s: %s\n' % (var, encode(val))) return + def get_directory_size(dir): + if os.listdir(dir): + size = int(os.popen('du -sk %s' % dir).readlines()[0].split('\t')[0]) + else: + size = 0 + return size + packages = d.getVar('PACKAGES', True) pkgdest = d.getVar('PKGDEST', 1) pkgdatadir = d.getVar('PKGDESTWORK', True)
@@ -1090,6 +1097,7 @@ python emit_pkgdata() { for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg, True) or "").split(): write_if_exists(sf, pkg, 'FILERDEPENDS_' + dfile) + sf.write('%s_%s: %s\n' % ('PKGSIZE', pkg, get_directory_size(pkgdest + "/%s" % pkg))) sf.close()
Signature · 1 line
1.7.0.4
PATCH 2/5 packageinfo.bbclass: add a new bbclass to pass package information
In reply to Dongxiao Xupackageinfo.bbclass is to pass the accurate package information to clients (e.g. Hob), including PN, PV, RDEPENDS, PKGSIZE, etc.
--- meta/classes/packageinfo.bbclass | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) create mode 100644 meta/classes/packageinfo.bbclass
meta/classes/packageinfo.bbclass new file +30 -0
@@ -0,0 +1,30 @@ +python packageinfo_handler () { + if isinstance(e, bb.event.TargetsTreeGenerated) or isinstance(e, bb.event.BuildCompleted): + import oe.packagedata + pkginfolist = [] + tmpdir = e.data.getVar('TMPDIR', True) + target_vendor = e.data.getVar('TARGET_VENDOR', True) + target_os = e.data.getVar('TARGET_OS', True) + package_archs = e.data.getVar('PACKAGE_ARCHS', True) + packaging = e.data.getVar('PACKAGE_CLASSES', True).split()[0].split('_')[1] + deploy_dir = e.data.getVar('DEPLOY_DIR', True) + '/' + packaging + for arch in package_archs.split(): + pkgdata_dir = tmpdir + '/pkgdata/' + arch + target_vendor + '-' + target_os + '/runtime/' + if os.path.exists(pkgdata_dir): + for root, dirs, files in os.walk(pkgdata_dir): + for pkgname in files: + if pkgname.endswith('.packaged'): + continue + sdata = oe.packagedata.read_pkgdatafile(root + pkgname) + sdata['PKG'] = pkgname + pkgrename = sdata['PKG_%s' % pkgname] + pkgv = sdata['PKGV'] + pkgr = sdata['PKGR'] + pkgname_path = deploy_dir + '/' + arch + '/' + pkgname + '-' + pkgv + '-' + pkgr + '.' + arch + '.' + packaging + pkgrename_path = deploy_dir + '/' + arch + '/' + pkgrename + '-' + pkgv + '-' + pkgr + '.' + arch + '.' + packaging + if os.path.exists(pkgname_path) or os.path.exists(pkgrename_path): + pkginfolist.append(sdata) + bb.event.fire(bb.event.PackageInfo(pkginfolist), e.data) +} + +addhandler packageinfo_handler
Signature · 1 line
1.7.0.4
PATCH 3/5 dummy-image.bb: add an empty image template
In reply to Dongxiao XuThis recipe serves as the target when using Hob to generate image.
--- meta/recipes-core/images/dummy-image.bb | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 meta/recipes-core/images/dummy-image.bb
meta/recipes-core/images/dummy-image.bb new file +1 -0
@@ -0,0 +1 @@ +inherit image
Signature · 1 line
1.7.0.4
PATCH 4/5 dummy-toolchain: add a new recipe dummy-toolchain
In reply to Dongxiao XuThis is a dummy recipe to build toolchain in Hob
--- meta/recipes-core/meta/dummy-toolchain.bb | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) create mode 100644 meta/recipes-core/meta/dummy-toolchain.bb
meta/recipes-core/meta/dummy-toolchain.bb new file +10 -0
@@ -0,0 +1,10 @@ +DESCRIPTION = "dummy toolchain" +LICENSE = "MIT" + +PR = "r0" + +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +IMAGETEST ?= "dummy" +inherit populate_sdk imagetest-${IMAGETEST}
Signature · 1 line
1.7.0.4
PATCH 5/5 layers: add a new folder to put user added layers
In reply to Dongxiao XuThis is helpful for remote users to find the available layers in the bitbake server machine.
--- layers/README | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 layers/README
layers/README new file +1 -0
@@ -0,0 +1 @@ +Please put extra layers (besides meta and meta-yocto) in this folder.
Signature · 1 line
1.7.0.4