Misc improvements 1 from Mentor
v2 cover Misc improvements 1 from Mentor
From: Christopher Larson <[email protected]>
This is the second of three pull requests / patch series from Mentor's queue of changes destined for oe-core master (not jethro). This series includes a few recipe improvements and adds the ability to supply and use wks files from a different layer than the image.
v2 changes:
- dropped the nativesdk-perl wrapper patch, I'll prep a separate patch series
- sysprof: fixed typo in its patch
- image_types: restored support for ${IMAGE_BASENAME}.wks to not break tests, correct the search path to include scripts/ for other layers, fixed other issues iwth the search, and fixed the file-checksums usage so changes to the wks contents cause the image to be rebuilt
The following changes since commit e44ed8c18e395b9c055aefee113b90708e8a8a2f:
build-appliance-image: Update to jethro head revision (2015-11-03 14:02:57 +0000)
are available in the git repository at:
git://github.com/kergoth/openembedded-core mentor-misc-improvements-1-after-jethro
https://github.com/kergoth/openembedded-core/tree/mentor-misc-improvements-1-after-jethro
Christopher Larson (6):
image_types: improve wks path specification
sysprof: use packageconfig for the gui
sysprof: add missing gdk-pixbuf/pango deps
systemd: for valgrind, define VALGRIND=1
bluez5: enable sysvinit support
psplash: add systemd support
meta/classes/image_types.bbclass | 36 +++++++++--- meta/recipes-connectivity/bluez5/bluez5.inc | 8 ++- meta/recipes-connectivity/bluez5/bluez5/init | 68 ++++++++++++++++++++++ .../psplash/files/psplash-quit.service | 11 ++++ .../psplash/files/psplash-start.service | 11 ++++ meta/recipes-core/psplash/psplash_git.bb | 20 +++++-- meta/recipes-core/systemd/systemd_225.bb | 3 + .../sysprof/files/gui-argument.patch | 35 +++++++++++ meta/recipes-kernel/sysprof/sysprof_git.bb | 9 ++- 9 files changed, 185 insertions(+), 16 deletions(-) create mode 100644 meta/recipes-connectivity/bluez5/bluez5/init create mode 100755 meta/recipes-core/psplash/files/psplash-quit.service create mode 100755 meta/recipes-core/psplash/files/psplash-start.service create mode 100644 meta/recipes-kernel/sysprof/files/gui-argument.patch
Signature · 1 line
2.2.1
PATCH v2 1/6 image_types: improve wks path specification
From: Christopher Larson <[email protected]>
Hardcoding a full input path with zero flexibility goes against everything the Yocto Project is about. Rework it to let the user specify the wks base filename with WKS_FILE and it'll search the layers for the wks file and use it.
--- meta/classes/image_types.bbclass | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-)
meta/classes/image_types.bbclass +29 -7
@@ -170,15 +170,37 @@ IMAGE_CMD_ubi () { IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs ${MKUBIFS_ARGS}" +WKS_FILE ?= "${IMAGE_BASENAME}.${MACHINE}.wks" +WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks" +WKS_SEARCH_PATH ?= "${THISDIR}:${@':'.join('%s/scripts/lib/wic/canned-wks' % l for l in '${BBPATH}:${COREBASE}'.split(':'))}" +WKS_FULL_PATH = "${@wks_search('${WKS_FILES}'.split(), '${WKS_SEARCH_PATH}') or ''}" + +def wks_search(files, search_path): + for f in files: + if os.path.isabs(f): + if os.path.exists(f): + return f + else: + searched = bb.utils.which(search_path, f) + if searched: + return searched + IMAGE_CMD_wic () { - out=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME} - wks=${FILE_DIRNAME}/${IMAGE_BASENAME}.${MACHINE}.wks - [ -e $wks ] || wks=${FILE_DIRNAME}/${IMAGE_BASENAME}.wks - [ -e $wks ] || bbfatal "Kiskstart file $wks doesn't exist" - BUILDDIR=${TOPDIR} wic create $wks --vars ${STAGING_DIR_TARGET}/imgdata/ -e ${IMAGE_BASENAME} -o $out/ - mv $out/build/${IMAGE_BASENAME}*.direct $out.rootfs.wic - rm -rf $out/ + out="${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}" + wks="${WKS_FULL_PATH}" + if [ -z "$wks" ]; then + bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately." + fi + + BUILDDIR="${TOPDIR}" wic create "$wks" --vars "${STAGING_DIR_TARGET}/imgdata/" -e "${IMAGE_BASENAME}" -o "$out/" + mv "$out/build/$(basename "${wks%.wks}")"*.direct "$out.rootfs.wic" + rm -rf "$out/" } +IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES" + +# Rebuild when the wks file changes +USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${COMPRESSIONTYPES}'.split()), '1', '', d)}" +do_rootfs[file-checksums] += "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}" EXTRA_IMAGECMD = ""
Signature · 1 line
2.2.1
PATCH v2 2/6 sysprof: use packageconfig for the gui
From: Christopher Larson <[email protected]>
This makes the gtk dependencies optional.
--- .../sysprof/files/gui-argument.patch | 35 ++++++++++++++++++++++ meta/recipes-kernel/sysprof/sysprof_git.bb | 9 ++++-- 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 meta/recipes-kernel/sysprof/files/gui-argument.patch
meta/recipes-kernel/sysprof/files/gui-argument.patch new file +35 -0
@@ -0,0 +1,35 @@ +Add the ability to explicitly enable/disable GUI support + +Signed-off-by: Christopher Larson <[email protected]> +Upstream-status: Pending + +--- git.orig/configure.ac ++++ git/configure.ac +@@ -62,12 +62,24 @@ KMICRO=`uname -r | cut -d"." -f 3 | cut + # Pkgconfig dependencies + + core_dep="glib-2.0 >= 2.6.0" +-gui_dep="gtk+-2.0 > 2.6.0 gdk-pixbuf-2.0 pangoft2 libglade-2.0" + + PKG_CHECK_MODULES(CORE_DEP, $core_dep, [], AC_MSG_ERROR([sysprof dependencies not satisfied])) + +-build_gui=yes +-PKG_CHECK_MODULES(GUI_DEP, $gui_dep, [], build_gui=no) ++gui_dep="gtk+-2.0 > 2.6.0 gdk-pixbuf-2.0 pangoft2 libglade-2.0" ++ ++AC_ARG_ENABLE([gui], ++ [AS_HELP_STRING([--disable-gui], ++ [Disable GUI functionality (requires gtk+, gdk-pixbuf, pangoft2, libglade) @<:@default=auto@:>@])], ++ [], ++ [enable_gui=auto]) ++ ++build_gui=no ++AS_IF([test "x$enable_gui" != xno], ++ [PKG_CHECK_MODULES(GUI_DEP, $gui_dep, build_gui=yes, ++ [if test "x$enable_gui" != xauto; then ++ AC_MSG_FAILURE( ++ [--enable-gui was given, but gui dependencies were not satisfied]) ++ fi])]) + + AM_CONDITIONAL([BUILD_GUI], [test "$build_gui" = yes]) +
meta/recipes-kernel/sysprof/sysprof_git.bb +6 -3
@@ -2,13 +2,14 @@ SUMMARY = "System-wide Performance Profiler for Linux" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" -DEPENDS = "gtk+ libglade" +DEPENDS = "glib-2.0" SRCREV = "cd44ee6644c3641507fb53b8a2a69137f2971219" PV = "1.2.0+git${SRCPV}" SRC_URI = "git://git.gnome.org/sysprof \ file://define-NT_GNU_BUILD_ID.patch \ + file://gui-argument.patch \ " SRC_URI_append_arm = " file://rmb-arm.patch"
@@ -19,8 +20,10 @@ SRC_URI_append_mips64n32 = " file://rmb-mips.patch" S = "${WORKDIR}/git" -inherit autotools pkgconfig distro_features_check -ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}" +inherit autotools pkgconfig + +PACKAGECONFIG ?= "${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK2DISTROFEATURES}', 'gui', '', d)}" +PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,gtk+ libglade" # We do not yet work for aarch64. #
Signature · 1 line
2.2.1
PATCH v2 3/6 sysprof: add missing gdk-pixbuf/pango deps
In reply to Christopher LarsonFrom: Christopher Larson <[email protected]>
These are explicitly checked with pkg-config in the configure script.
--- meta/recipes-kernel/sysprof/sysprof_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-kernel/sysprof/sysprof_git.bb +1 -1
@@ -23,7 +23,7 @@ S = "${WORKDIR}/git" inherit autotools pkgconfig PACKAGECONFIG ?= "${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK2DISTROFEATURES}', 'gui', '', d)}" -PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,gtk+ libglade" +PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,gtk+ gdk-pixbuf pango libglade" # We do not yet work for aarch64. #
Signature · 1 line
2.2.1
Re: [PATCHv2 3/6] sysprof: add missing gdk-pixbuf/pango deps
Quoted 4 lines · Christopher Larson
(quoted diff) +1
-1-PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,gtk+ libglade" +PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,gtk+ gdk-pixbuf pangolibglade"
As you're patching something you just introduced, I squashed these.
Ross
Re: [PATCHv2 3/6] sysprof: add missing gdk-pixbuf/pango deps
Quoted 9 lines · Ross
Quoted 4 lines · Christopher Larson
(quoted diff) +1
-1-PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,gtk+ libglade" +PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,gtk+ gdk-pixbuf pangolibglade"
As you're patching something you just introduced, I squashed these.
Conceptually, they're independent, since these additional deps weren't in the original DEPENDS either, so the first makes it conditional, the second alters what the deps of the recipe are, but I don't feel too strongly about it, squashing is okay too.
Signature · 5 lines
Christopher Larson kergoth at gmail dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
PATCH v2 4/6 systemd: for valgrind, define VALGRIND=1
In reply to Christopher LarsonFrom: Christopher Larson <[email protected]>
Per the systemd README, this should be defined to run systemd under valgrind, otherwise false positives will be triggered.
--- meta/recipes-core/systemd/systemd_225.bb | 3 +++ 1 file changed, 3 insertions(+)
meta/recipes-core/systemd/systemd_225.bb +3 -0
@@ -127,6 +127,9 @@ EXTRA_OECONF = " --with-rootprefix=${rootprefix} \ # uclibc does not have NSS EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname " +# per the systemd README, define VALGRIND=1 to run under valgrind +CFLAGS .= "${@bb.utils.contains('PACKAGECONFIG', 'valgrind', ' -DVALGRIND=1', '', d)}" + # disable problematic GCC 5.2 optimizations [YOCTO #8291] FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns -fno-schedule-insns2"
Signature · 1 line
2.2.1
PATCH v2 5/6 bluez5: enable sysvinit support
In reply to Christopher LarsonFrom: Christopher Larson <[email protected]>
This is from Shrikant Bobade <[email protected]>.
--- meta/recipes-connectivity/bluez5/bluez5.inc | 8 +++- meta/recipes-connectivity/bluez5/bluez5/init | 68 ++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-connectivity/bluez5/bluez5/init
meta/recipes-connectivity/bluez5/bluez5.inc +7 -1
@@ -18,10 +18,11 @@ PACKAGECONFIG[experimental] = "--enable-experimental,--disable-experimental," SRC_URI = "\ ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \ + file://init \ " S = "${WORKDIR}/bluez-${PV}" -inherit autotools-brokensep pkgconfig systemd +inherit autotools-brokensep pkgconfig systemd update-rc.d EXTRA_OECONF = "\ --enable-tools \
@@ -42,6 +43,9 @@ NOINST_TOOLS = " \ " do_install_append() { + install -d ${D}${INIT_D_DIR} + install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth + install -d ${D}${sysconfdir}/bluetooth/ if [ -f ${S}/profiles/audio/audio.conf ]; then install -m 0644 ${S}/profiles/audio/audio.conf ${D}/${sysconfdir}/bluetooth/
@@ -100,5 +104,7 @@ FILES_${PN}-dbg += "\ RDEPENDS_${PN}-testtools += "python python-dbus python-pygobject" SYSTEMD_SERVICE_${PN} = "bluetooth.service" +INITSCRIPT_PACKAGES = "${PN}" +INITSCRIPT_NAME_${PN} = "bluetooth" EXCLUDE_FROM_WORLD = "1"
meta/recipes-connectivity/bluez5/bluez5/init new file +68 -0
68 lines not on this page · raw message
Signature · 1 line
2.2.1
PATCH v2 6/6 psplash: add systemd support
In reply to Christopher LarsonFrom: Christopher Larson <[email protected]>
--- meta/recipes-core/psplash/files/psplash-quit.service | 11 +++++++++++ .../recipes-core/psplash/files/psplash-start.service | 11 +++++++++++ meta/recipes-core/psplash/psplash_git.bb | 20 +++++++++++++++----- 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100755 meta/recipes-core/psplash/files/psplash-quit.service create mode 100755 meta/recipes-core/psplash/files/psplash-start.service
meta/recipes-core/psplash/files/psplash-quit.service new file +11 -0
@@ -0,0 +1,11 @@ +[Unit] +Description=Terminate Psplash Boot Screen +After=psplash-start.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/psplash-write QUIT +TimeoutSec=20 + +[Install] +WantedBy=multi-user.target
meta/recipes-core/psplash/files/psplash-start.service new file +11 -0
@@ -0,0 +1,11 @@ +[Unit] +Description=Starts Psplash Boot screen +Wants=systemd-vconsole-setup.service +After=systemd-vconsole-setup.service systemd-udev-trigger.service systemd-udevd.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/bin/psplash + +[Install] +WantedBy=sysinit.target
meta/recipes-core/psplash/psplash_git.bb +15 -5
@@ -12,6 +12,8 @@ PR = "r15" SRC_URI = "git://git.yoctoproject.org/${BPN} \ file://0001-psplash-fb-Convert-psplash_fb_plot_pixel-to-a-static.patch \ file://psplash-init \ + file://psplash-start.service \ + file://psplash-quit.service \ ${SPLASH_IMAGES}" SPLASH_IMAGES = "file://psplash-poky-img.h;outsuffix=default"
@@ -66,11 +68,13 @@ python __anonymous() { S = "${WORKDIR}/git" -inherit autotools pkgconfig update-rc.d update-alternatives +inherit autotools pkgconfig update-rc.d update-alternatives systemd ALTERNATIVE_PRIORITY = "100" ALTERNATIVE_LINK_NAME[psplash] = "${bindir}/psplash" +SYSTEMD_SERVICE_${PN} = "psplash-start.service psplash-quit.service" + python do_compile () { import shutil
@@ -97,8 +101,15 @@ python do_compile () { do_install_append() { install -d ${D}/mnt/.psplash/ - install -d ${D}${sysconfdir}/init.d/ - install -m 0755 ${WORKDIR}/psplash-init ${D}${sysconfdir}/init.d/psplash.sh + if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/init.d/ + install -m 0755 ${WORKDIR}/psplash-init ${D}${sysconfdir}/init.d/psplash.sh + fi + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/psplash-quit.service ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/psplash-start.service ${D}${systemd_unitdir}/system + fi install -d ${D}${bindir} for i in ${SPLASH_INSTALL} ; do install -m 0755 $i ${D}${bindir}/$i
@@ -111,9 +122,8 @@ FILES_${PN} += "/mnt/.psplash" INITSCRIPT_NAME = "psplash.sh" INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ." -DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}" pkg_postinst_${PN} () { - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then if [ -n "$D" ]; then OPTS="--root=$D" fi
Signature · 1 line
2.2.1
Re: [PATCHv2 6/6] psplash: add systemd support
Quoted 5 lines · Christopher Larson
meta/recipes-core/psplash/files/psplash-quit.service | 11 +++++++++++ .../recipes-core/psplash/files/psplash-start.service | 11 +++++++++++ meta/recipes-core/psplash/psplash_git.bb | 20+++++++++++++++-----
This causes the selftest to fail:
| ====================================================================== | FAIL: test_systemd_failed (oeqa.runtime.systemd.SystemdBasicTests) | ---------------------------------------------------------------------- | Traceback (most recent call last): | File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-systemd/build/meta/lib/oeqa/utils/decorators.py", line 106, in wrapped_f
| return func(*args, **kwargs)
| File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-systemd/build/meta/lib/oeqa/utils/decorators.py", line 94, in wrapped_f
| return f(*args, **kwargs)
| File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-systemd/build/meta/lib/oeqa/runtime/systemd.py", line 65, in test_systemd_failed
| self.assertTrue(match, msg="Some systemd units failed:\n%s" % output) | AssertionError: None is not true : Some systemd units failed: | UNIT LOAD ACTIVE SUB DESCRIPTION | ● bluetooth.service loaded failed failed Bluetooth service | ● psplash-quit.service loaded failed failed Terminate Psplash Boot Screen | ● psplash-start.service loaded failed failed Starts Psplash Boot screen
Ross
Re: [PATCHv2 6/6] psplash: add systemd support
Quoted 25 lines · Ross
Quoted 5 lines · Christopher Larson
meta/recipes-core/psplash/files/psplash-quit.service | 11 +++++++++++ .../recipes-core/psplash/files/psplash-start.service | 11 +++++++++++ meta/recipes-core/psplash/psplash_git.bb | 20+++++++++++++++-----
This causes the selftest to fail:
| ====================================================================== | FAIL: test_systemd_failed (oeqa.runtime.systemd.SystemdBasicTests) | ---------------------------------------------------------------------- | Traceback (most recent call last): | File"
/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-systemd/build/meta/lib/oeqa/utils/decorators.py", line 106, inwrapped_f
| returnfunc(*args, **kwargs)
| File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-systemd/build/meta/lib/oeqa/utils/decorators.py", line 94, inwrapped_f
| returnf(*args, **kwargs)
| File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-systemd/build/meta/lib/oeqa/runtime/systemd.py", line 65, intest_systemd_failed
Quoted 7 lines
| self.assertTrue(match, msg="Some systemd units failed:\n%s" % output) | AssertionError: None is not true : Some systemd units failed: | UNIT LOAD ACTIVE SUB DESCRIPTION | ● bluetooth.service loaded failed failed Bluetooth service | ● psplash-quit.service loaded failed failed Terminate Psplash BootScreen
| ● psplash-start.service loaded failed failed Starts Psplash Boot screen
Interesting, is psplash configured in our test environment? Either way, worst case we can drop this commit for now and can revisit it. I'm heading out of town tomorrow until December 1st, so likely will be limited in what I can do to address any issues that crop up during that period. Thanks.
Signature · 5 lines
Christopher Larson kergoth at gmail dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
Re: [PATCHv2 6/6] psplash: add systemd support
Quoted 5 lines · Christopher Larson
Interesting, is psplash configured in our test environment? Either way, worst case we can drop this commit for now and can revisit it. I'm heading out of town tomorrow until December 1st, so likely will be limited in what I can do to address any issues that crop up during that period. Thanks.
It should be working - at least the sysvinit images work absolutely fine and show the splash. I'll add giving this a go locally to my list of things to do.
Ross
Re: [PATCHv2 6/6] psplash: add systemd support
Quoted 9 lines · Ross Burton
Quoted 6 lines · Christopher Larson
Interesting, is psplash configured in our test environment? Either way, worst case we can drop this commit for now and can revisit it. I'm heading out of town tomorrow until December 1st, so likely will be limited in what I can do to address any issues that crop up during that period. Thanks.
Quoted 3 lines
It should be working - at least the sysvinit images work absolutely fine and show the splash. I'll add giving this a go locally to my list of things to do.
I'll dig into this shortly and re-submit if appropriate. Getting caught up on the status of submitted patches now. Thanks.
Signature · 5 lines
Christopher Larson kergoth at gmail dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
Re: [PATCHv2 6/6] psplash: add systemd support
Quoted 12 lines · Christopher Larson
Quoted 10 lines · Ross Burton
Quoted 6 lines · Christopher Larson
Interesting, is psplash configured in our test environment? Either way, worst case we can drop this commit for now and can revisit it. I'm heading out of town tomorrow until December 1st, so likely will be limited in what I can do to address any issues that crop up during that period. Thanks.
Quoted 7 lines
Quoted 3 lines
It should be working - at least the sysvinit images work absolutely fine and show the splash. I'll add giving this a go locally to my list of things to do.
I'll dig into this shortly and re-submit if appropriate. Getting caught up on the status of submitted patches now. Thanks.
We have an internal user-space splash system and we ended using libsystemd to notify when the initialization is complete.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750