diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2020-04-06 23:33:31 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2020-04-06 23:33:31 +0300 |
commit | ee6f67609223ac24c3e4f55ae7cc78c60a3fdb34 (patch) | |
tree | bd1d54ebe254cd845372cf2dec425f077afb0e13 /meta-phosphor/classes | |
parent | 38e3aafdebeed3bf185faba0e17d8ad0ca04b879 (diff) | |
parent | 81e9ee0bf0a3cf373ed354fb1687b5ddebc6150c (diff) | |
download | openbmc-ee6f67609223ac24c3e4f55ae7cc78c60a3fdb34.tar.xz |
Merge tag 'wht-0.47' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into update
Diffstat (limited to 'meta-phosphor/classes')
5 files changed, 43 insertions, 5 deletions
diff --git a/meta-phosphor/classes/image_types_phosphor.bbclass b/meta-phosphor/classes/image_types_phosphor.bbclass index 10388d257..39534db8d 100644 --- a/meta-phosphor/classes/image_types_phosphor.bbclass +++ b/meta-phosphor/classes/image_types_phosphor.bbclass @@ -324,7 +324,11 @@ python do_generate_static() { def _append_image(imgpath, start_kb, finish_kb): imgsize = os.path.getsize(imgpath) - if imgsize > (finish_kb - start_kb) * 1024: + maxsize = (finish_kb - start_kb) * 1024 + bb.debug(1, 'Considering file size=' + str(imgsize) + ' name=' + imgpath) + bb.debug(1, 'Spanning start=' + str(start_kb) + 'K end=' + str(finish_kb) + 'K') + bb.debug(1, 'Compare needed=' + str(imgsize) + ' available=' + str(maxsize) + ' margin=' + str(maxsize - imgsize)) + if imgsize > maxsize: bb.fatal("Image '%s' is too large!" % imgpath) subprocess.check_call(['dd', 'bs=1k', 'conv=notrunc', diff --git a/meta-phosphor/classes/obmc-phosphor-python-autotools.bbclass b/meta-phosphor/classes/obmc-phosphor-python-autotools.bbclass index d69eb345e..0922a1ab6 100644 --- a/meta-phosphor/classes/obmc-phosphor-python-autotools.bbclass +++ b/meta-phosphor/classes/obmc-phosphor-python-autotools.bbclass @@ -15,3 +15,16 @@ python() { set_append(d, 'FILES_%s' % pkg, d.getVar('PYTHON_SITEPACKAGES_DIR', True)) } + +# In order to facilitate packages that use python3native, but also +# depend on python2 scripts we need to replace the #! to be nativepython +# instead of just python. Without this, `which python` points to the +# host's python, which is not the one where required modules would be +# installed. +do_install_append_class-native() { + for i in ${D}${bindir}/* ${D}${sbindir}/*; do + if [ -f "$i" ]; then + sed -i -e s:env\ python:env\ nativepython:g $i + fi + done +} diff --git a/meta-phosphor/classes/obmc-phosphor-python3-autotools.bbclass b/meta-phosphor/classes/obmc-phosphor-python3-autotools.bbclass index d76598a36..89a884a1b 100644 --- a/meta-phosphor/classes/obmc-phosphor-python3-autotools.bbclass +++ b/meta-phosphor/classes/obmc-phosphor-python3-autotools.bbclass @@ -1,6 +1,9 @@ inherit obmc-phosphor-utils inherit python3native +OBMC_PYTHON_EXE="python3" +OBMC_PYTHON_EXE_class-native="nativepython3" + DEPENDS += "python3" export BUILD_SYS @@ -15,3 +18,21 @@ python() { set_append(d, 'FILES_%s' % pkg, d.getVar('PYTHON_SITEPACKAGES_DIR', True)) } + +# python-setuptools does some mangling of the #! in any scripts it installs, +# which has been reported for years at pypa/setuptools#494. OE has +# workarounds in distutils3.bbclass, but we cannot inherit that here because +# it conflicts with autotools.bbclass. Port the un-mangling code here. +# +# This finds any ${PYTHON} executable path that got put into the scripts +# and reverts it back to "/usr/bin/env python3". It also reverts any full +# ${STAGING_BINDIR_NATIVE} path back to "/usr/bin". +# +do_install_append() { + for i in ${D}${bindir}/* ${D}${sbindir}/*; do + if [ -f "$i" ]; then + sed -i -e s:${PYTHON}:${USRBINPATH}/env\ ${OBMC_PYTHON_EXE}:g $i + sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i + fi + done +} diff --git a/meta-phosphor/classes/obmc-xmlpatch.bbclass b/meta-phosphor/classes/obmc-xmlpatch.bbclass index 9dc37507a..359820622 100644 --- a/meta-phosphor/classes/obmc-xmlpatch.bbclass +++ b/meta-phosphor/classes/obmc-xmlpatch.bbclass @@ -7,15 +7,15 @@ #See patchxml.py for details on the XML patch format. # -inherit pythonnative +inherit python3native inherit obmc-phosphor-utils do_patch[depends] = "mrw-patch-native:do_populate_sysroot" def find_patch_files(d): all_patches = listvar_to_list(d, 'SRC_URI') - xml_patches = filter(lambda x: x.endswith('.patch.xml') and - x.startswith('file://'), all_patches) + xml_patches = [x for x in all_patches if x.endswith('.patch.xml') and + x.startswith('file://')] return [x.lstrip('file://') for x in xml_patches] diff --git a/meta-phosphor/classes/phosphor-networkd-rev.bbclass b/meta-phosphor/classes/phosphor-networkd-rev.bbclass index 378d2020c..aa5dc3136 100644 --- a/meta-phosphor/classes/phosphor-networkd-rev.bbclass +++ b/meta-phosphor/classes/phosphor-networkd-rev.bbclass @@ -1,2 +1,2 @@ SRC_URI += "git://github.com/openbmc/phosphor-networkd" -SRCREV = "dbd328d7e037b1af13fb0f20f3708e2261b9e0b6" +SRCREV = "99801cea8c6dd13b4f4965c362966e5d497ea71e" |