[OE-core][PATCH] gtk-icon-cache: Fix GTKIC_CMD if-else condition
GTKIC_CMD variable gets the wrong assignation leading into a post install script error. Fix if-else condition in GTKIC_CMD variable to assign gtk4-update-icon-cache when GTKIC_VERSION is 4 but gtk-update-icon-cache when is 3. Also, rename gtk-update-icon-cache-3.0.0 to gtk-update-icon-cache-3.0 to match the gtk-update-icon-cache binary name deployed in meta/recipes-gnome/gtk+/gtk+3.inc. Signed-off-by: Daniel Gomez --- meta/classes-recipe/gtk-icon-cache.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes-recipe/gtk-icon-cache.bbclass b/meta/classes-recipe/gtk-icon-cache.bbclass index 17c7eb7a33..9ecb49916c 100644 --- a/meta/classes-recipe/gtk-icon-cache.bbclass +++ b/meta/classes-recipe/gtk-icon-cache.bbclass @@ -9,7 +9,7 @@ FILES:${PN} += "${datadir}/icons/hicolor" GTKIC_VERSION ??= '3' GTKPN = "${@ 'gtk4' if d.getVar('GTKIC_VERSION') == '4' else 'gtk+3' }" -GTKIC_CMD = "${@ 'gtk-update-icon-cache-3.0.0' if d.getVar('GTKIC_VERSION') == '4' else 'gtk4-update-icon-cache' }" +GTKIC_CMD = "${@ 'gtk4-update-icon-cache' if d.getVar('GTKIC_VERSION') == '4' else 'gtk-update-icon-cache-3.0' }" #gtk+3/gtk4 require GTK3DISTROFEATURES, DEPENDS on it make all the #recipes inherit this class require GTK3DISTROFEATURES -- 2.35.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#171148): https://lists.openembedded.org/g/openembedded-core/message/171148 Mute This Topic: https://lists.openembedded.org/mt/93970944/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[RFC][OE-core][PATCH] bbfileconfig: Add class support
Add support for the class 'BBFILECONFIG' which allows to select the recipes for a given layer. Example: 'Enable' python3-colorlog recipe from meta-python. INHERIT += "bbfileconfig" BBFILECONFIG_meta-python += "python3-colorlog" Signed-off-by: Daniel Gomez --- Hi, We have developed the 'BBFILECONFIG' class in order to be able to select the recipes we want to parse in an allow list manner. Its meant to control whether a recipe (bb) file from a specic layer is picked to be parsed or not. Similar to the PACKAGECONFIG for packages inside recipes (hence the BBFILECONFIG name). When handling multiple metadata sources it easily becomes huge to build a full distro ('world'). Current methods (AFAIK) only allows to block/disallow recipe files with BBMASK. Note: BBFILES_DYNAMIC does part of the job but different use-case. Could this make sense to upstream? Perhaps there is a better/cleaner way of doing this? We are currently using this with a reduction of 40k -> 20k packages (per machine). Of course, the class only parses the bb files (and therfore the number of packages to be created) for the recipes we don't want them to be part of our custom distro. This helps us to reduce build times while using directly upstream layers without the need of copying/forking the recipes files in internal layers. Few extra notes: 1. The class does not handle depencencies. If a recipe is added to the list, the developer should also add manually its depencencies in their respective BBFILECONFIG_. 2. When multiple recipe files share a common name, some 'unclaimed' recipes will be added too. Example: In meta-openembedded/meta-python we have: python3-pybind11_2.10.0.bb and python3-pybind11-json_0.2.11.bb. If one wants to add only the first one, the recipe name should be suffixed with '_': BBFILECONFIG_meta-python = "python3-pybind11_" Unfortunately, if the recipe does not follow _.bb filename pattern but instead uses .bb there would be no way to filter out a second recipe sharing the same recipe name. However, this is perhaps not the recommended way to name a recipe. Is it correct? 3. This class would require the following bitbake patch. Embedding it here as part of the RFC for reference. diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index 32a529f0..645c59f7 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -1796,6 +1796,15 @@ class CookerExit(bb.event.Event): bb.event.Event.__init__(self) +class CookerStarted(bb.event.Event): +""" +Notify clients of the Cooker started +""" + +def __init__(self): +bb.event.Event.__init__(self) + + class CookerCollectFiles(object): def __init__(self, priorities, mc=''): self.mc = mc @@ -1834,6 +1843,7 @@ class CookerCollectFiles(object): def collect_bbfiles(self, config, eventdata): """Collect all available .bb build files""" +bb.event.fire(CookerStarted(), eventdata) masked = 0 collectlog.debug("collecting .bb files") meta/classes/bbfileconfig.bbclass | 73 +++ 1 file changed, 73 insertions(+) create mode 100644 meta/classes/bbfileconfig.bbclass diff --git a/meta/classes/bbfileconfig.bbclass b/meta/classes/bbfileconfig.bbclass new file mode 100644 index 00..4582fd6eb8 --- /dev/null +++ b/meta/classes/bbfileconfig.bbclass @@ -0,0 +1,73 @@ +# +# SPDX-License-Identifier: GPL-2.0-only +# +# Author: Daniel Gomez +# +# This class allows to select recipe files on a per-layer basis for global +# parsing and world target. +# +# It adds the ability to parse individual recipes from a specific layer from the +# a configuration file. +# +# Usage: add INHERIT += "bbfileconfig" to the local.conf configuration file +# and add BBFILECONFIG variable to a configuration file (e.g. conf/layer.conf) +# to be able to perform individual recipe file selection. Must be suffixed with +# the name of the layer (e.g. BBFILECONFIG_core). +# +# Example: Assuming meta-skeleton is part of the BBLAYERS, enable the bbfileconfig +# to parse only the libxpm recipe +# (meta-skeleton/recipes-skeleton/libxpm/libxpm_3.5.6.bb). +# +# INHERIT += "bbfileconfig" +# BBFILECONFIG_skeleton = "libxpm" + +# Default space-separated list of recipe files to be removed from BBFILES +BBFILECONFIG_REMOVE_DIRS ?= "\ +recipes*/*/*.bb \ +recipes*/*/*.bbappend \ +recipes-*/*/*.bb \ +recipes-*/*/*.bbappend \ +" + +# Default space-separated list of recipe files dirnames prefixes to be appended +# to the selected layer +BBFILECONFIG_BBFILES_DIRS ?= "recipes-*/*" + +# BBFILE selector handler executed at CookerStarted event: +# 1. Get layer collections from BBFILE_COLLECTIONS. +# 2. For each active collection (BBFILECONFIG_ is initialized), removed +#dirs listed in BBFILECONFIG_REMOVE_DIRS from the BBFILES variable. +# 3. For each coll
[OE-core][PATCH v3] dropbear: Add enable-x11-forwarding PACKAGECONFIG option
Add the option to enable X11 forwarding in dropbear with a new PACKAGECONFIG option ('enable-x11-forwarding'). Method uses localoption.h file for dropbear feature selection. Add backport patch to fix X11 forwarding in the current 2022.82 version. Signed-off-by: Daniel Gomez --- v3 - Add S-o-b in the backport patch. - Replace CFLAGS with localoptions.h as method to configure and enable dropbear features. v2: - Drop patch default_options patch and use CFLAGS to enable dropbear features. Previous versions: v2: https://lore.kernel.org/all/20220927102904.722281-1-dan...@qtec.com/ v1: https://lore.kernel.org/all/20220720194416.89631-1-dan...@qtec.com/ ...d-failure-use-DROPBEAR_PRIO_LOWDELAY.patch | 28 +++ .../recipes-core/dropbear/dropbear_2022.82.bb | 11 +++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch diff --git a/meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch b/meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch new file mode 100644 index 00..a26c1a851a --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch @@ -0,0 +1,28 @@ +From 64292091fe3e8ea7c9bfe74af730b2ff5428bf10 Mon Sep 17 00:00:00 2001 +From: Matt Johnston +Date: Sat, 23 Apr 2022 22:33:31 +0800 +Subject: [PATCH] Fix X11 build failure, use DROPBEAR_PRIO_LOWDELAY + +Upstream-Status: Backport + +Signed-off-by: Daniel Gomez +--- + svr-x11fwd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/svr-x11fwd.c b/svr-x11fwd.c +index 353cb12..5d9e6a9 100644 +--- a/svr-x11fwd.c b/svr-x11fwd.c +@@ -206,7 +206,7 @@ void x11cleanup(struct ChanSess *chansess) { + } + + static int x11_inithandler(struct Channel *channel) { +- channel->prio = DROPBEAR_CHANNEL_PRIO_INTERACTIVE; ++ channel->prio = DROPBEAR_PRIO_LOWDELAY; + return 0; + } + +-- +2.35.1 + diff --git a/meta/recipes-core/dropbear/dropbear_2022.82.bb b/meta/recipes-core/dropbear/dropbear_2022.82.bb index 2de243b889..41c14ff2f1 100644 --- a/meta/recipes-core/dropbear/dropbear_2022.82.bb +++ b/meta/recipes-core/dropbear/dropbear_2022.82.bb @@ -22,7 +22,8 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \ file://dropbear.socket \ file://dropbear.default \ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} " + ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} \ + file://0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch" SRC_URI[sha256sum] = "3a038d2bbc02bf28bbdd20c012091f741a3ec5cbe460691811d714876aad75d1" @@ -53,6 +54,7 @@ EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"' PACKAGECONFIG ?= "disable-weak-ciphers" PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt" PACKAGECONFIG[disable-weak-ciphers] = "" +PACKAGECONFIG[enable-x11-forwarding] = "" EXTRA_OECONF += "\ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}" @@ -64,6 +66,13 @@ EXTRA_OECONF += "--disable-harden" # musl does not implement wtmp/logwtmp APIs EXTRA_OECONF:append:libc-musl = " --disable-wtmp --disable-lastlog" +do_configure:append() { + echo "/* Dropbear features */" > ${B}/localoptions.h + if ${@bb.utils.contains('PACKAGECONFIG', 'enable-x11-forwarding', 'true', 'false', d)}; then + echo "#define DROPBEAR_X11FWD 1" >> ${B}/localoptions.h + fi +} + do_install() { install -d ${D}${sysconfdir} \ ${D}${sysconfdir}/init.d \ -- 2.35.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#171115): https://lists.openembedded.org/g/openembedded-core/message/171115 Mute This Topic: https://lists.openembedded.org/mt/93955383/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][PATCH] dropbear: Enable x11 forwarding
On Mon, 25 Jul 2022 at 10:49, Ross Burton wrote: > > On 25 Jul 2022, at 04:11, Matt Johnston wrote: > > The upstream method for Dropbear configuration is #define entries in a > > localoptions.h file. default_options.h should be left untouched. Adding it > > to CFLAGS for configure would also work, as > > > > ./configure CFLAGS="-Os -Wall -DDROPBEAR_X11FWD=1” > > Perfect, thanks Matt! I've just sent a new version [1] using CFLAGS but I think I should have used localoptions.h instead as that will match the upstream configuration method. What do you think? Shall I change to localoptions.h instead? I think that should be a more elegant solution. [1] https://lore.kernel.org/all/20220927102904.722281-1-dan...@qtec.com/ > > Ross > -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#171095): https://lists.openembedded.org/g/openembedded-core/message/171095 Mute This Topic: https://lists.openembedded.org/mt/92512561/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][PATCH] dropbear: Add enable-x11-forwarding PACKAGECONFIG option
On Tue, 27 Sept 2022 at 12:32, Ross Burton wrote: > > On 27 Sep 2022, at 11:29, Daniel Gomez via lists.openembedded.org > wrote: > > diff --git > > a/meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch > > > > b/meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch > > new file mode 100644 > > index 00..994bbdd42a > > --- /dev/null > > +++ > > b/meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch > > @@ -0,0 +1,27 @@ > > +From 0292aacdf0aa57d03f2a3ab7e53cf650e6f29389 Mon Sep 17 00:00:00 2001 > > +From: Matt Johnston > > +Date: Sat, 23 Apr 2022 22:33:31 +0800 > > +Subject: [PATCH] Fix X11 build failure, use DROPBEAR_PRIO_LOWDELAY > > + > > +Upstream-Status: Backport > > This patch also needs your S-o-b. Okay, thanks. I will then send a v2 with that. Although this should have been the v2 already. Sorry for that. Here the previous patch thread: https://lore.kernel.org/all/20220720194416.89631-1-dan...@qtec.com/ > > Thanks, > Ross > -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#171094): https://lists.openembedded.org/g/openembedded-core/message/171094 Mute This Topic: https://lists.openembedded.org/mt/93946749/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH] rootfs-postcommands: Remove dropbear inconsistent comment
When allow-root-login, remove default dropbear comment 'Disallow root'. Signed-off-by: Daniel Gomez --- meta/classes-recipe/rootfs-postcommands.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass b/meta/classes-recipe/rootfs-postcommands.bbclass index 74601f0829..690fa976aa 100644 --- a/meta/classes-recipe/rootfs-postcommands.bbclass +++ b/meta/classes-recipe/rootfs-postcommands.bbclass @@ -204,6 +204,7 @@ ssh_allow_root_login () { if [ -e ${IMAGE_ROOTFS}${sbindir}/dropbear ] ; then if grep -q DROPBEAR_EXTRA_ARGS ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear 2>/dev/null ; then sed -i '/^DROPBEAR_EXTRA_ARGS=/ s/-w//' ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear + sed -i '/^# Disallow root/d' ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear fi fi } -- 2.35.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#171091): https://lists.openembedded.org/g/openembedded-core/message/171091 Mute This Topic: https://lists.openembedded.org/mt/93946761/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH] dropbear: Add enable-x11-forwarding PACKAGECONFIG option
Add the option to enable X11 forwarding in dropbear with a new PACKAGECONFIG option ('enable-x11-forwarding'). Method uses CFLAGS to configure it. Add backport patch to fix X11 forwarding in the current 2022.82 version. Signed-off-by: Daniel Gomez --- ...d-failure-use-DROPBEAR_PRIO_LOWDELAY.patch | 27 +++ .../recipes-core/dropbear/dropbear_2022.82.bb | 7 - 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch diff --git a/meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch b/meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch new file mode 100644 index 00..994bbdd42a --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch @@ -0,0 +1,27 @@ +From 0292aacdf0aa57d03f2a3ab7e53cf650e6f29389 Mon Sep 17 00:00:00 2001 +From: Matt Johnston +Date: Sat, 23 Apr 2022 22:33:31 +0800 +Subject: [PATCH] Fix X11 build failure, use DROPBEAR_PRIO_LOWDELAY + +Upstream-Status: Backport + +--- + svr-x11fwd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/svr-x11fwd.c b/svr-x11fwd.c +index 353cb12..5d9e6a9 100644 +--- a/svr-x11fwd.c b/svr-x11fwd.c +@@ -206,7 +206,7 @@ void x11cleanup(struct ChanSess *chansess) { + } + + static int x11_inithandler(struct Channel *channel) { +- channel->prio = DROPBEAR_CHANNEL_PRIO_INTERACTIVE; ++ channel->prio = DROPBEAR_PRIO_LOWDELAY; + return 0; + } + +-- +2.35.1 + diff --git a/meta/recipes-core/dropbear/dropbear_2022.82.bb b/meta/recipes-core/dropbear/dropbear_2022.82.bb index 2de243b889..dfb4e21a2c 100644 --- a/meta/recipes-core/dropbear/dropbear_2022.82.bb +++ b/meta/recipes-core/dropbear/dropbear_2022.82.bb @@ -22,7 +22,8 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \ file://dropbear.socket \ file://dropbear.default \ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} " + ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} \ + file://0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch" SRC_URI[sha256sum] = "3a038d2bbc02bf28bbdd20c012091f741a3ec5cbe460691811d714876aad75d1" @@ -53,10 +54,14 @@ EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"' PACKAGECONFIG ?= "disable-weak-ciphers" PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt" PACKAGECONFIG[disable-weak-ciphers] = "" +PACKAGECONFIG[enable-x11-forwarding] = "" EXTRA_OECONF += "\ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}" +CFLAGS += "\ + ${@bb.utils.contains('PACKAGECONFIG', 'enable-x11-forwarding', '-DDROPBEAR_X11FWD=1', '', d)}" + # This option appends to CFLAGS and LDFLAGS from OE # This is causing [textrel] QA warning EXTRA_OECONF += "--disable-harden" -- 2.35.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#171089): https://lists.openembedded.org/g/openembedded-core/message/171089 Mute This Topic: https://lists.openembedded.org/mt/93946749/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][PATCH] dropbear: Enable x11 forwarding
On Thu, 21 Jul 2022 at 11:13, Ross Burton wrote: > > > > On 20 Jul 2022, at 20:44, Daniel Gomez via lists.openembedded.org > > wrote: > > + ${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' \ > > + > > file://0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch \ > > This patch should be always applied, as it doesn’t cause any breakage when > applied if not used. Patches which are conditional tend to cause breakage > when they’re not always applied. > > > +file://0008-default_options-Enable-x11-forwarding.patch', > > '', d)}” > > This should be a PACKAGECONFIG instead of a forced on/off based on > DISTRO_FEATURES. > > Upstreaming a configure option to expose this as —enable-x-forwarding would > be great, but for now you can easily sed this file as needed based on the > value of PACKAGECONFIG. Thanks Ross for the review. I'll send a v2 with the changes and look into the upstream option. > > Ross -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#168383): https://lists.openembedded.org/g/openembedded-core/message/168383 Mute This Topic: https://lists.openembedded.org/mt/92512561/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH] dropbear: Enable x11 forwarding
Enable X11 forwarding whenever X11 is part of the DISTRO_FEATURES. Add backport patch to fix X11 forwarding in the current 2022.82 version. Signed-off-by: Daniel Gomez --- meta/recipes-core/dropbear/dropbear.inc | 5 ++- ...d-failure-use-DROPBEAR_PRIO_LOWDELAY.patch | 27 ...efault_options-Enable-x11-forwarding.patch | 32 +++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch create mode 100644 meta/recipes-core/dropbear/dropbear/0008-default_options-Enable-x11-forwarding.patch diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc index e170587d08..7ee808db61 100644 --- a/meta/recipes-core/dropbear/dropbear.inc +++ b/meta/recipes-core/dropbear/dropbear.inc @@ -22,7 +22,10 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \ file://dropbear.socket \ file://dropbear.default \ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} " + ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' \ + file://0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch \ +file://0008-default_options-Enable-x11-forwarding.patch', '', d)}" PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ file://0006-dropbear-configuration-file.patch \ diff --git a/meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch b/meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch new file mode 100644 index 00..994bbdd42a --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/0007-Fix-X11-build-failure-use-DROPBEAR_PRIO_LOWDELAY.patch @@ -0,0 +1,27 @@ +From 0292aacdf0aa57d03f2a3ab7e53cf650e6f29389 Mon Sep 17 00:00:00 2001 +From: Matt Johnston +Date: Sat, 23 Apr 2022 22:33:31 +0800 +Subject: [PATCH] Fix X11 build failure, use DROPBEAR_PRIO_LOWDELAY + +Upstream-Status: Backport + +--- + svr-x11fwd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/svr-x11fwd.c b/svr-x11fwd.c +index 353cb12..5d9e6a9 100644 +--- a/svr-x11fwd.c b/svr-x11fwd.c +@@ -206,7 +206,7 @@ void x11cleanup(struct ChanSess *chansess) { + } + + static int x11_inithandler(struct Channel *channel) { +- channel->prio = DROPBEAR_CHANNEL_PRIO_INTERACTIVE; ++ channel->prio = DROPBEAR_PRIO_LOWDELAY; + return 0; + } + +-- +2.35.1 + diff --git a/meta/recipes-core/dropbear/dropbear/0008-default_options-Enable-x11-forwarding.patch b/meta/recipes-core/dropbear/dropbear/0008-default_options-Enable-x11-forwarding.patch new file mode 100644 index 00..b604c0e850 --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/0008-default_options-Enable-x11-forwarding.patch @@ -0,0 +1,32 @@ +From bbdd4e27431df123e9f39c5fea6d1a90e90a4385 Mon Sep 17 00:00:00 2001 +From: Daniel Gomez +Date: Wed, 20 Jul 2022 18:07:51 +0200 +Subject: [PATCH] default_options: Enable x11 forwarding + +Activate dropbear X11 forwarding feature. + +Disabled by default at rev: a27e8b053e520117b20993b8e51103c5bd22da8c + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Daniel Gomez +--- + default_options.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/default_options.h b/default_options.h +index 1a6a911..cd637a1 100644 +--- a/default_options.h b/default_options.h +@@ -60,7 +60,7 @@ IMPORTANT: Some options will require "make clean" after changes */ + #define DROPBEAR_SMALL_CODE 1 + + /* Enable X11 Forwarding - server only */ +-#define DROPBEAR_X11FWD 0 ++#define DROPBEAR_X11FWD 1 + + /* Enable TCP Fowarding */ + /* 'Local' is "-L" style (client listening port forwarded via server) +-- +2.35.1 + -- 2.35.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#168374): https://lists.openembedded.org/g/openembedded-core/message/168374 Mute This Topic: https://lists.openembedded.org/mt/92512561/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH] dropbear: Add configuration file to CONFFILES
Avoid overwriting the dropbear configuration when the package gets updated by adding it to the CONFFILES list. Before: root@qt5222:~# dpkg -i dropbear_2022.82-r0.26_amd64.deb (Reading database ... 32509 files and directories currently installed.) Preparing to unpack dropbear_2022.82-r0.26_amd64.deb ... Unpacking dropbear (2022.82-r0.26) over (2022.82-r0.25) ... Setting up dropbear (2022.82-r0.26) ... update-alternatives: Linking /usr/bin/scp to /usr/sbin/dropbearmulti update-alternatives: Linking /usr/bin/ssh to /usr/sbin/dropbearmulti After: root@qt5222:~# dpkg -i dropbear_2022.82-r0.27_amd64.deb (Reading database ... 32509 files and directories currently installed.) Preparing to unpack dropbear_2022.82-r0.27_amd64.deb ... Unpacking dropbear (2022.82-r0.27) over (2022.82-r0.26) ... Setting up dropbear (2022.82-r0.27) ... Configuration file '/etc/default/dropbear' ==> File on system created by you or by a script. ==> File also in package provided by package maintainer. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** dropbear (Y/I/N/O/D/Z) [default=N] ? Signed-off-by: Daniel Gomez --- meta/recipes-core/dropbear/dropbear.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc index 78f9f9adbd..e170587d08 100644 --- a/meta/recipes-core/dropbear/dropbear.inc +++ b/meta/recipes-core/dropbear/dropbear.inc @@ -123,4 +123,6 @@ pkg_postrm:${PN} () { fi } +CONFFILES:${PN} = "${sysconfdir}/default/dropbear" + FILES:${PN} += "${bindir}" -- 2.35.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#168273): https://lists.openembedded.org/g/openembedded-core/message/168273 Mute This Topic: https://lists.openembedded.org/mt/92477842/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH] os-release: Add DISTRO_CODENAME as vardeps for do_compile
DISTRO_CODENAME is part of VERSION variable but not used as dependency for do_compile task. Append it to the vardeps list to rebuild in case it changes. Signed-off-by: Daniel Gomez --- meta/recipes-core/os-release/os-release.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb index 8847fe30c3..637d059e8b 100644 --- a/meta/recipes-core/os-release/os-release.bb +++ b/meta/recipes-core/os-release/os-release.bb @@ -12,7 +12,9 @@ do_configure[noexec] = "1" # Other valid fields: BUILD_ID ID_LIKE ANSI_COLOR CPE_NAME # HOME_URL SUPPORT_URL BUG_REPORT_URL -OS_RELEASE_FIELDS = "ID ID_LIKE NAME VERSION VERSION_ID PRETTY_NAME" +OS_RELEASE_FIELDS = "\ +ID ID_LIKE NAME VERSION VERSION_ID PRETTY_NAME DISTRO_CODENAME \ +" OS_RELEASE_UNQUOTED_FIELDS = "ID VERSION_ID VARIANT_ID" ID = "${DISTRO}" -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#158482): https://lists.openembedded.org/g/openembedded-core/message/158482 Mute This Topic: https://lists.openembedded.org/mt/87154817/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [oe] [meta-oe] android-tools: Add flag to enable adbd service (#147)
On Tue, 16 Nov 2021 at 19:17, Devendra Tewari wrote: > > Hi Daniel, > > Em 16 de nov. de 2021, à(s) 11:49, Daniel Gomez escreveu: > > Hi Devendra and Khem, > > I'd like to ask about the 'recent' commit you integrated in the > android-tools recipe a few months ago: > http://git.openembedded.org/meta-openembedded/commit/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb?id=4271cc28279b79140fc6bbde32c9110aec8d1d86 > > Basically, you are adding a postprocess rootfs command to the $PN-adbd > package to include the '/var/usb-debugging-enabled' file in your > rootfs image or not using the 'ROOTFS_POSTPROCESS_COMMAND_${PN}-adbd > +=' line. > I wonder if this is a new feature or perhaps an error, as I'm trying > to implement it in dunfell and it does not work as expected. Should > this work also in dunfell? Are the rootfs postprocess commands > > executed inside the recipe? > > > I verified it at the time (on master pre hardknott) with rpi-sdimg image type > (from meta-raspberrypi) set in IMAGE_FSTYPES. Later, I tried to get it to > work with wic / bmap image fs type but haven’t been able to. Thanks for the confirmation. I'm using wic+dunfell and it didn't work. I'll try to replicate it with the honister release to see if it works there. > > Well, what I'm trying to do is to include a configuration file for the > dropbear recipe based on the IMAGE_BASENAME so I can include different > files depending on the image at recipe level. It works fine if I move > everything to the image recipe: > > meta-qtec-distro/recipes-core/dropbear $ cat dropbear_%.bbappend > dropbear () { >touch ${IMAGE_ROOTFS}${sysconfdir}/file1 > } > > dropbear2 () { >touch ${IMAGE_ROOTFS}${sysconfdir}/file2 > } > > PACKAGES =+ "${PN}-conf" > > ROOTFS_POSTPROCESS_COMMAND_${PN}-conf += > "${@bb.utils.contains("IMAGE_BASENAME", "poky-qtec-image-netboot", > "dropbear;", "dropbear2;", d)}" > > Any ideas? > > > Official documentation is not clear where all ROOTFS_POSTPROCESS_COMMAND can > be used, but using it in image recipes works reliably for me. Thanks again. I'll do some more testing then. > > Thanks in advance! > > Daniel > > > Regards, > Devendra -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#158371): https://lists.openembedded.org/g/openembedded-core/message/158371 Mute This Topic: https://lists.openembedded.org/mt/87096196/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] [oe] [meta-oe] android-tools: Add flag to enable adbd service (#147)
Hi Devendra and Khem, I'd like to ask about the 'recent' commit you integrated in the android-tools recipe a few months ago: http://git.openembedded.org/meta-openembedded/commit/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb?id=4271cc28279b79140fc6bbde32c9110aec8d1d86 Basically, you are adding a postprocess rootfs command to the $PN-adbd package to include the '/var/usb-debugging-enabled' file in your rootfs image or not using the 'ROOTFS_POSTPROCESS_COMMAND_${PN}-adbd +=' line. I wonder if this is a new feature or perhaps an error, as I'm trying to implement it in dunfell and it does not work as expected. Should this work also in dunfell? Are the rootfs postprocess commands executed inside the recipe? Well, what I'm trying to do is to include a configuration file for the dropbear recipe based on the IMAGE_BASENAME so I can include different files depending on the image at recipe level. It works fine if I move everything to the image recipe: meta-qtec-distro/recipes-core/dropbear $ cat dropbear_%.bbappend dropbear () { touch ${IMAGE_ROOTFS}${sysconfdir}/file1 } dropbear2 () { touch ${IMAGE_ROOTFS}${sysconfdir}/file2 } PACKAGES =+ "${PN}-conf" ROOTFS_POSTPROCESS_COMMAND_${PN}-conf += "${@bb.utils.contains("IMAGE_BASENAME", "poky-qtec-image-netboot", "dropbear;", "dropbear2;", d)}" Any ideas? Thanks in advance! Daniel -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#158344): https://lists.openembedded.org/g/openembedded-core/message/158344 Mute This Topic: https://lists.openembedded.org/mt/87096196/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][PATCH v2 2/2] oeqa: wic: Add tests for --no-fstab-update
Hi, On Tue, 17 Aug 2021 at 15:34, Alexandre Belloni wrote: > > Hi, > > On 16/08/2021 10:05:08+0200, Daniel Gomez wrote: > > Hi Alexandre, > > > > > > On Fri, 13 Aug 2021 at 07:41, Daniel Gomez via lists.openembedded.org > > wrote: > > > > > > Hi Alexandre, > > > > > > On Thu, 12 Aug 2021 at 18:34, Alexandre Belloni > > > wrote: > > > > > > > > Hello, > > > > > > > > On 10/08/2021 22:11:01+0200, Daniel Gomez wrote: > > > > > Add tests for the --no-fstab-update wic part command. > > > > > > > > > > Signed-off-by: Daniel Gomez > > > > > --- > > > > > meta/lib/oeqa/selftest/cases/wic.py | 56 > > > > > + > > > > > 1 file changed, 56 insertions(+) > > > > > > > > > > diff --git a/meta/lib/oeqa/selftest/cases/wic.py > > > > > b/meta/lib/oeqa/selftest/cases/wic.py > > > > > index 2efbe514c1..a58360851a 100644 > > > > > --- a/meta/lib/oeqa/selftest/cases/wic.py > > > > > +++ b/meta/lib/oeqa/selftest/cases/wic.py > > > > > @@ -11,6 +11,7 @@ > > > > > import os > > > > > import sys > > > > > import unittest > > > > > +import hashlib > > > > > > > > > > from glob import glob > > > > > from shutil import rmtree, copy > > > > > @@ -686,6 +687,61 @@ part /etc --source rootfs --fstype=ext4 > > > > > --change-directory=etc > > > > >% (wks_file, self.resultdir), > > > > > ignore_status=True).status) > > > > > os.remove(wks_file) > > > > > > > > > > +def test_no_fstab_update(self): > > > > > +"""Test --no-fstab-update wks option.""" > > > > > + > > > > > +oldpath = os.environ['PATH'] > > > > > +os.environ['PATH'] = get_bb_var("PATH", "wic-tools") > > > > > + > > > > > +# Get stock fstab from base-files recipe > > > > > +bitbake('base-files') > > > > > +bf_fstab = os.path.join(get_bb_var('WORKDIR', > > > > > 'base-files'),'image/etc/fstab') > > > > > +bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % > > > > > bf_fstab).output.split(" ")[0] > > > > > + > > > > > > > > This failed on the autobuilders: > > > > > > > > File > > > > "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/selftest/cases/wic.py", > > > > line 699, in test_no_fstab_update > > > > bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % > > > > bf_fstab).output.split(" ")[0] > > > > File > > > > "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/utils/commands.py", > > > > line 207, in runCmd > > > > raise AssertionError("Command '%s' returned non-zero exit status > > > > %d:\n%s" % (command, result.status, exc_output)) > > > > AssertionError: Command 'md5sum > > > > /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-15202/tmp/work/qemux86_64-poky-linux/base-files/3.0.14-r89/image/etc/fstab > > > > 2>/dev/null' returned non-zero exit status 1: > > > > > > > > Full log here: > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/2374/steps/14/logs/stdio > > > > > > Thanks for letting me know. I'll take a look. > > > > I can't replicate the problem in my setup ('master' branch for bitbake > > and openembedded core; 'qemux86-64' machine) . Could it be possible to > > get the environment variables for the build? > > > > The problem comes when executing the first md5sum command: > > > > 1. bitbake 'base-files' recipe. > > 2. Get the 'WORKDIR' for 'base-files' recipe. > > 3. Do 'md5sum' for the 'WORKDIR' + 'image/etc/fstab' file. > > > > md5sum > > /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-15202/tmp/work/qemux86_64-poky-linux/base-files/3.0.14-r89/image/etc/fstab > > > > If the file does not exist, md5sum will return the same '1' status > > (assuming that's the error). Could this be bause the '${WORKDIR} + > > image' for the 'base-files'
[OE-core][PATCH v3 1/2] wic: Add --no-fstab-update part option
When embedding a rootfs image (e.g. 'rootfs-dir') as a partition we might want to keep the stock fstab for that image. In such a case, use this option to not update the fstab and use the stock one instead. This option allows you to specify which partitions get the fstab updated and which get the stock fstab. The option matches the argument you can pass to wic itself where the same action is performed but for all the partitions. Example: part /export --source rootfs --rootfs-dir=hockeycam-image --fstype=ext4 --label export --align 1024 --no-fstab-update part / --source rootfs --fstype=ext4 --label rootfs --align 1024 Signed-off-by: Daniel Gomez --- scripts/lib/wic/help.py | 3 +++ scripts/lib/wic/ksparser.py | 1 + scripts/lib/wic/partition.py | 5 +++-- scripts/lib/wic/plugins/source/rootfs.py | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py index 41451d1cb0..991907d3f5 100644 --- a/scripts/lib/wic/help.py +++ b/scripts/lib/wic/help.py @@ -991,6 +991,9 @@ DESCRIPTION multiple partitions and we want to keep the right permissions and usernames in all the partitions. + --no-fstab-update: This option is specific to wic. It does not update the +'/etc/fstab' stock file for the given partition. + --extra-space: This option is specific to wic. It adds extra space after the space filled by the content of the partition. The final size can go diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py index 7a4cc83af5..0df9eb0d05 100644 --- a/scripts/lib/wic/ksparser.py +++ b/scripts/lib/wic/ksparser.py @@ -185,6 +185,7 @@ class KickStart(): part.add_argument('--use-uuid', action='store_true') part.add_argument('--uuid') part.add_argument('--fsuuid') +part.add_argument('--no-fstab-update', action='store_true') bootloader = subparsers.add_parser('bootloader') bootloader.add_argument('--append') diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index e0b2c5bdf2..ab304f1b2a 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py @@ -54,6 +54,7 @@ class Partition(): self.uuid = args.uuid self.fsuuid = args.fsuuid self.type = args.type +self.no_fstab_update = args.no_fstab_update self.updated_fstab_path = None self.has_fstab = False self.update_fstab_in_rootfs = False @@ -286,7 +287,7 @@ class Partition(): (self.fstype, extraopts, rootfs, label_str, self.fsuuid, rootfs_dir) exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo) -if self.updated_fstab_path and self.has_fstab: +if self.updated_fstab_path and self.has_fstab and not self.no_fstab_update: debugfs_script_path = os.path.join(cr_workdir, "debugfs_script") with open(debugfs_script_path, "w") as f: f.write("cd etc\n") @@ -350,7 +351,7 @@ class Partition(): mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, rootfs_dir) exec_native_cmd(mcopy_cmd, native_sysroot) -if self.updated_fstab_path and self.has_fstab: +if self.updated_fstab_path and self.has_fstab and not self.no_fstab_update: mcopy_cmd = "mcopy -i %s %s ::/etc/fstab" % (rootfs, self.updated_fstab_path) exec_native_cmd(mcopy_cmd, native_sysroot) diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py index 96d940a91d..2e34e715ca 100644 --- a/scripts/lib/wic/plugins/source/rootfs.py +++ b/scripts/lib/wic/plugins/source/rootfs.py @@ -218,7 +218,7 @@ class RootfsPlugin(SourcePlugin): # Update part.has_fstab here as fstab may have been added or # removed by the above modifications. part.has_fstab = os.path.exists(os.path.join(new_rootfs, "etc/fstab")) -if part.update_fstab_in_rootfs and part.has_fstab: +if part.update_fstab_in_rootfs and part.has_fstab and not part.no_fstab_update: fstab_path = os.path.join(new_rootfs, "etc/fstab") # Assume that fstab should always be owned by root with fixed permissions install_cmd = "install -m 0644 %s %s" % (part.updated_fstab_path, fstab_path) -- 2.30.2 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#154894): https://lists.openembedded.org/g/openembedded-core/message/154894 Mute This Topic: https://lists.openembedded.org/mt/84957310/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH v3 2/2] oeqa: wic: Add tests for --no-fstab-update
Add tests for the --no-fstab-update wic part command. Signed-off-by: Daniel Gomez --- meta/lib/oeqa/selftest/cases/wic.py | 58 + 1 file changed, 58 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 2efbe514c1..3b4143414f 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -11,6 +11,7 @@ import os import sys import unittest +import hashlib from glob import glob from shutil import rmtree, copy @@ -686,6 +687,63 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc % (wks_file, self.resultdir), ignore_status=True).status) os.remove(wks_file) +def test_no_fstab_update(self): +"""Test --no-fstab-update wks option.""" + +oldpath = os.environ['PATH'] +os.environ['PATH'] = get_bb_var("PATH", "wic-tools") + +# Get stock fstab from base-files recipe +self.assertEqual(0, bitbake('base-files -c do_install').status) +bf_fstab = os.path.join(get_bb_var('D', 'base-files'), 'etc/fstab') +self.assertEqual(True, os.path.exists(bf_fstab)) +bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % bf_fstab).output.split(" ")[0] + +try: +no_fstab_update_path = os.path.join(self.resultdir, 'test-no-fstab-update') +os.makedirs(no_fstab_update_path) +wks_file = os.path.join(no_fstab_update_path, 'temp.wks') +with open(wks_file, 'w') as wks: +wks.writelines(['part / --source rootfs --fstype=ext4 --label rootfs\n', +'part /mnt/p2 --source rootfs --rootfs-dir=core-image-minimal ', +'--fstype=ext4 --label p2 --no-fstab-update\n']) +runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir)) + +part_fstab_md5sum = [] +for i in range(1, 3): +part = glob(os.path.join(self.resultdir, 'temp-*.direct.p') + str(i))[0] +part_fstab = runCmd("debugfs -R 'cat etc/fstab' %s 2>/dev/null" % (part)) +part_fstab_md5sum.append(hashlib.md5((part_fstab.output + "\n\n").encode('utf-8')).hexdigest()) + +# '/etc/fstab' in partition 2 should contain the same stock fstab file +# as the one installed by the base-file recipe. +self.assertEqual(bf_fstab_md5sum, part_fstab_md5sum[1]) + +# '/etc/fstab' in partition 1 should contain an updated fstab file. +self.assertNotEqual(bf_fstab_md5sum, part_fstab_md5sum[0]) + +finally: +os.environ['PATH'] = oldpath + +def test_no_fstab_update_errors(self): +"""Test --no-fstab-update wks option error handling.""" +wks_file = 'temp.wks' + +# Absolute argument. +with open(wks_file, 'w') as wks: +wks.write("part / --source rootfs --fstype=ext4 --no-fstab-update /etc") +self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir), ignore_status=True).status) +os.remove(wks_file) + +# Argument pointing to parent directory. +with open(wks_file, 'w') as wks: +wks.write("part / --source rootfs --fstype=ext4 --no-fstab-update ././..") +self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir), ignore_status=True).status) +os.remove(wks_file) + class Wic2(WicTestCase): def test_bmap_short(self): -- 2.30.2 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#154895): https://lists.openembedded.org/g/openembedded-core/message/154895 Mute This Topic: https://lists.openembedded.org/mt/84957311/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][PATCH v2 2/2] oeqa: wic: Add tests for --no-fstab-update
Hi Alexandre, On Fri, 13 Aug 2021 at 07:41, Daniel Gomez via lists.openembedded.org wrote: > > Hi Alexandre, > > On Thu, 12 Aug 2021 at 18:34, Alexandre Belloni > wrote: > > > > Hello, > > > > On 10/08/2021 22:11:01+0200, Daniel Gomez wrote: > > > Add tests for the --no-fstab-update wic part command. > > > > > > Signed-off-by: Daniel Gomez > > > --- > > > meta/lib/oeqa/selftest/cases/wic.py | 56 + > > > 1 file changed, 56 insertions(+) > > > > > > diff --git a/meta/lib/oeqa/selftest/cases/wic.py > > > b/meta/lib/oeqa/selftest/cases/wic.py > > > index 2efbe514c1..a58360851a 100644 > > > --- a/meta/lib/oeqa/selftest/cases/wic.py > > > +++ b/meta/lib/oeqa/selftest/cases/wic.py > > > @@ -11,6 +11,7 @@ > > > import os > > > import sys > > > import unittest > > > +import hashlib > > > > > > from glob import glob > > > from shutil import rmtree, copy > > > @@ -686,6 +687,61 @@ part /etc --source rootfs --fstype=ext4 > > > --change-directory=etc > > >% (wks_file, self.resultdir), > > > ignore_status=True).status) > > > os.remove(wks_file) > > > > > > +def test_no_fstab_update(self): > > > +"""Test --no-fstab-update wks option.""" > > > + > > > +oldpath = os.environ['PATH'] > > > +os.environ['PATH'] = get_bb_var("PATH", "wic-tools") > > > + > > > +# Get stock fstab from base-files recipe > > > +bitbake('base-files') > > > +bf_fstab = os.path.join(get_bb_var('WORKDIR', > > > 'base-files'),'image/etc/fstab') > > > +bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % > > > bf_fstab).output.split(" ")[0] > > > + > > > > This failed on the autobuilders: > > > > File > > "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/selftest/cases/wic.py", > > line 699, in test_no_fstab_update > > bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % > > bf_fstab).output.split(" ")[0] > > File > > "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/utils/commands.py", > > line 207, in runCmd > > raise AssertionError("Command '%s' returned non-zero exit status > > %d:\n%s" % (command, result.status, exc_output)) > > AssertionError: Command 'md5sum > > /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-15202/tmp/work/qemux86_64-poky-linux/base-files/3.0.14-r89/image/etc/fstab > > 2>/dev/null' returned non-zero exit status 1: > > > > Full log here: > > https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/2374/steps/14/logs/stdio > > Thanks for letting me know. I'll take a look. I can't replicate the problem in my setup ('master' branch for bitbake and openembedded core; 'qemux86-64' machine) . Could it be possible to get the environment variables for the build? The problem comes when executing the first md5sum command: 1. bitbake 'base-files' recipe. 2. Get the 'WORKDIR' for 'base-files' recipe. 3. Do 'md5sum' for the 'WORKDIR' + 'image/etc/fstab' file. md5sum /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-15202/tmp/work/qemux86_64-poky-linux/base-files/3.0.14-r89/image/etc/fstab If the file does not exist, md5sum will return the same '1' status (assuming that's the error). Could this be bause the '${WORKDIR} + image' for the 'base-files' recipe is located under another directory? Could we get access to that directory to know if the file was present there? If that's the case, I could replace the command to be executed with one of the following environment variables: D="/workdir/openembedded-core/build/tmp-glibc/work/qemux86_64-oe-linux/base-files/3.0.14-r89/image" PKGD="/workdir/openembedded-core/build/tmp-glibc/work/qemux86_64-oe-linux/base-files/3.0.14-r89/package" PKGDEST="/workdir/openembedded-core/build/tmp-glibc/work/qemux86_64-oe-linux/base-files/3.0.14-r89/packages-split" Otherwise, any ideas or suggestions? Thanks > > > > > > +try: > > > +no_fstab_update_path = os.path.join(self.resultdir, > > > 'test-no-fstab-update') > > > +os.makedirs(no_fstab_update_path) > > > +wks_file = os.path.join(no_fstab_update_path, 'temp.wks') > > > +with open(wks_file, 'w') as wks: > > > +wks.writ
Re: [OE-core][PATCH v2 2/2] oeqa: wic: Add tests for --no-fstab-update
Hi Alexandre, On Thu, 12 Aug 2021 at 18:34, Alexandre Belloni wrote: > > Hello, > > On 10/08/2021 22:11:01+0200, Daniel Gomez wrote: > > Add tests for the --no-fstab-update wic part command. > > > > Signed-off-by: Daniel Gomez > > --- > > meta/lib/oeqa/selftest/cases/wic.py | 56 + > > 1 file changed, 56 insertions(+) > > > > diff --git a/meta/lib/oeqa/selftest/cases/wic.py > > b/meta/lib/oeqa/selftest/cases/wic.py > > index 2efbe514c1..a58360851a 100644 > > --- a/meta/lib/oeqa/selftest/cases/wic.py > > +++ b/meta/lib/oeqa/selftest/cases/wic.py > > @@ -11,6 +11,7 @@ > > import os > > import sys > > import unittest > > +import hashlib > > > > from glob import glob > > from shutil import rmtree, copy > > @@ -686,6 +687,61 @@ part /etc --source rootfs --fstype=ext4 > > --change-directory=etc > >% (wks_file, self.resultdir), > > ignore_status=True).status) > > os.remove(wks_file) > > > > +def test_no_fstab_update(self): > > +"""Test --no-fstab-update wks option.""" > > + > > +oldpath = os.environ['PATH'] > > +os.environ['PATH'] = get_bb_var("PATH", "wic-tools") > > + > > +# Get stock fstab from base-files recipe > > +bitbake('base-files') > > +bf_fstab = os.path.join(get_bb_var('WORKDIR', > > 'base-files'),'image/etc/fstab') > > +bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % > > bf_fstab).output.split(" ")[0] > > + > > This failed on the autobuilders: > > File > "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/selftest/cases/wic.py", > line 699, in test_no_fstab_update > bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % > bf_fstab).output.split(" ")[0] > File > "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/utils/commands.py", > line 207, in runCmd > raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" > % (command, result.status, exc_output)) > AssertionError: Command 'md5sum > /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-15202/tmp/work/qemux86_64-poky-linux/base-files/3.0.14-r89/image/etc/fstab > 2>/dev/null' returned non-zero exit status 1: > > Full log here: > https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/2374/steps/14/logs/stdio Thanks for letting me know. I'll take a look. > > > +try: > > +no_fstab_update_path = os.path.join(self.resultdir, > > 'test-no-fstab-update') > > +os.makedirs(no_fstab_update_path) > > +wks_file = os.path.join(no_fstab_update_path, 'temp.wks') > > +with open(wks_file, 'w') as wks: > > +wks.writelines(['part / --source rootfs --fstype=ext4 > > --label rootfs\n', > > +'part /mnt/p2 --source rootfs > > --rootfs-dir=core-image-minimal ', > > +'--fstype=ext4 --label p2 > > --no-fstab-update\n']) > > +runCmd("wic create %s -e core-image-minimal -o %s" \ > > + % (wks_file, self.resultdir)) > > + > > +part_fstab_md5sum = [] > > +for i in range(1, 3): > > +part = glob(os.path.join(self.resultdir, > > 'temp-*.direct.p') + str(i))[0] > > +part_fstab = runCmd("debugfs -R 'cat etc/fstab' %s > > 2>/dev/null" % (part)) > > +part_fstab_md5sum.append(hashlib.md5((part_fstab.output + > > "\n\n").encode('utf-8')).hexdigest()) > > + > > +# '/etc/fstab' in partition 2 should contain the same stock > > fstab file at base-file recipe. > > +self.assertEqual(bf_fstab_md5sum, part_fstab_md5sum[1]) > > + > > +# '/etc/fstab' in partition 1 should contain an updated fstab > > file. > > +self.assertNotEqual(bf_fstab_md5sum, part_fstab_md5sum[0]) > > + > > +finally: > > +os.environ['PATH'] = oldpath > > + > > +def test_no_fstab_update_errors(self): > > +"""Test --no-fstab-update wks option error handling.""" > > +wks_file = 'temp.wks' > > + > > +# Absolute argument. > > +with open(wks_file, 'w') as wks: > > +wks.write("part / --source r
[OE-core][PATCH v2 2/2] oeqa: wic: Add tests for --no-fstab-update
Add tests for the --no-fstab-update wic part command. Signed-off-by: Daniel Gomez --- meta/lib/oeqa/selftest/cases/wic.py | 56 + 1 file changed, 56 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 2efbe514c1..a58360851a 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -11,6 +11,7 @@ import os import sys import unittest +import hashlib from glob import glob from shutil import rmtree, copy @@ -686,6 +687,61 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc % (wks_file, self.resultdir), ignore_status=True).status) os.remove(wks_file) +def test_no_fstab_update(self): +"""Test --no-fstab-update wks option.""" + +oldpath = os.environ['PATH'] +os.environ['PATH'] = get_bb_var("PATH", "wic-tools") + +# Get stock fstab from base-files recipe +bitbake('base-files') +bf_fstab = os.path.join(get_bb_var('WORKDIR', 'base-files'),'image/etc/fstab') +bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % bf_fstab).output.split(" ")[0] + +try: +no_fstab_update_path = os.path.join(self.resultdir, 'test-no-fstab-update') +os.makedirs(no_fstab_update_path) +wks_file = os.path.join(no_fstab_update_path, 'temp.wks') +with open(wks_file, 'w') as wks: +wks.writelines(['part / --source rootfs --fstype=ext4 --label rootfs\n', +'part /mnt/p2 --source rootfs --rootfs-dir=core-image-minimal ', +'--fstype=ext4 --label p2 --no-fstab-update\n']) +runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir)) + +part_fstab_md5sum = [] +for i in range(1, 3): +part = glob(os.path.join(self.resultdir, 'temp-*.direct.p') + str(i))[0] +part_fstab = runCmd("debugfs -R 'cat etc/fstab' %s 2>/dev/null" % (part)) +part_fstab_md5sum.append(hashlib.md5((part_fstab.output + "\n\n").encode('utf-8')).hexdigest()) + +# '/etc/fstab' in partition 2 should contain the same stock fstab file at base-file recipe. +self.assertEqual(bf_fstab_md5sum, part_fstab_md5sum[1]) + +# '/etc/fstab' in partition 1 should contain an updated fstab file. +self.assertNotEqual(bf_fstab_md5sum, part_fstab_md5sum[0]) + +finally: +os.environ['PATH'] = oldpath + +def test_no_fstab_update_errors(self): +"""Test --no-fstab-update wks option error handling.""" +wks_file = 'temp.wks' + +# Absolute argument. +with open(wks_file, 'w') as wks: +wks.write("part / --source rootfs --fstype=ext4 --no-fstab-update /etc") +self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir), ignore_status=True).status) +os.remove(wks_file) + +# Argument pointing to parent directory. +with open(wks_file, 'w') as wks: +wks.write("part / --source rootfs --fstype=ext4 --no-fstab-update ././..") +self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir), ignore_status=True).status) +os.remove(wks_file) + class Wic2(WicTestCase): def test_bmap_short(self): -- 2.30.2 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#154697): https://lists.openembedded.org/g/openembedded-core/message/154697 Mute This Topic: https://lists.openembedded.org/mt/84801997/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH v2 1/2] wic: Add --no-fstab-update part option
When embedding a rootfs image (e.g. 'rootfs-dir') as a partition we might want to keep the stock fstab for that image. In such a case, use this option to not update the fstab and use the stock one instead. This option allows you to specify which partitions get the fstab updated and which get the stock fstab. The option matches the argument you can pass to wic itself where the same action is performed but for all the partitions. Example: part /export --source rootfs --rootfs-dir=hockeycam-image --fstype=ext4 --label export --align 1024 --no-fstab-update part / --source rootfs --fstype=ext4 --label rootfs --align 1024 Signed-off-by: Daniel Gomez --- scripts/lib/wic/help.py | 3 +++ scripts/lib/wic/ksparser.py | 1 + scripts/lib/wic/partition.py | 5 +++-- scripts/lib/wic/plugins/source/rootfs.py | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py index 991e5094bb..5c3d278d4e 100644 --- a/scripts/lib/wic/help.py +++ b/scripts/lib/wic/help.py @@ -991,6 +991,9 @@ DESCRIPTION multiple partitions and we want to keep the right permissions and usernames in all the partitions. + --no-fstab-update: This option is specific to wic. It does not update the +'/etc/fstab' stock file for the given partition. + --extra-space: This option is specific to wic. It adds extra space after the space filled by the content of the partition. The final size can go diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py index 7a4cc83af5..0df9eb0d05 100644 --- a/scripts/lib/wic/ksparser.py +++ b/scripts/lib/wic/ksparser.py @@ -185,6 +185,7 @@ class KickStart(): part.add_argument('--use-uuid', action='store_true') part.add_argument('--uuid') part.add_argument('--fsuuid') +part.add_argument('--no-fstab-update', action='store_true') bootloader = subparsers.add_parser('bootloader') bootloader.add_argument('--append') diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index e0b2c5bdf2..ab304f1b2a 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py @@ -54,6 +54,7 @@ class Partition(): self.uuid = args.uuid self.fsuuid = args.fsuuid self.type = args.type +self.no_fstab_update = args.no_fstab_update self.updated_fstab_path = None self.has_fstab = False self.update_fstab_in_rootfs = False @@ -286,7 +287,7 @@ class Partition(): (self.fstype, extraopts, rootfs, label_str, self.fsuuid, rootfs_dir) exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo) -if self.updated_fstab_path and self.has_fstab: +if self.updated_fstab_path and self.has_fstab and not self.no_fstab_update: debugfs_script_path = os.path.join(cr_workdir, "debugfs_script") with open(debugfs_script_path, "w") as f: f.write("cd etc\n") @@ -350,7 +351,7 @@ class Partition(): mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, rootfs_dir) exec_native_cmd(mcopy_cmd, native_sysroot) -if self.updated_fstab_path and self.has_fstab: +if self.updated_fstab_path and self.has_fstab and not self.no_fstab_update: mcopy_cmd = "mcopy -i %s %s ::/etc/fstab" % (rootfs, self.updated_fstab_path) exec_native_cmd(mcopy_cmd, native_sysroot) diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py index 96d940a91d..2e34e715ca 100644 --- a/scripts/lib/wic/plugins/source/rootfs.py +++ b/scripts/lib/wic/plugins/source/rootfs.py @@ -218,7 +218,7 @@ class RootfsPlugin(SourcePlugin): # Update part.has_fstab here as fstab may have been added or # removed by the above modifications. part.has_fstab = os.path.exists(os.path.join(new_rootfs, "etc/fstab")) -if part.update_fstab_in_rootfs and part.has_fstab: +if part.update_fstab_in_rootfs and part.has_fstab and not part.no_fstab_update: fstab_path = os.path.join(new_rootfs, "etc/fstab") # Assume that fstab should always be owned by root with fixed permissions install_cmd = "install -m 0644 %s %s" % (part.updated_fstab_path, fstab_path) -- 2.30.2 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#154696): https://lists.openembedded.org/g/openembedded-core/message/154696 Mute This Topic: https://lists.openembedded.org/mt/84801996/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][PATCH] 1/2] wic: Add --no-fstab-update part option
Hi Paul, On Tue, 10 Aug 2021 at 15:25, Paul Barker wrote: > > On Tue, 10 Aug 2021 15:06:02 +0200 > Daniel Gomez wrote: > > > When embedding a rootfs image (e.g. 'rootfs-dir') as a partition we might > > want to keep the stock fstab for that image. In such case, use > > this option to not update the fstab and use the stock one instead. > > > > This option allows to specify which partitions get the fstab updated > > and which get the stock fstab. > > > > The option matches the argument you can pass to wic itself where the > > same action is performed but for all the partitions. > > > > Example: > > part /export --source rootfs --rootfs-dir=hockeycam-image --fstype=ext4 > > --label export --align 1024 --no-fstab-update > > > > part / --source rootfs --fstype=ext4 --label rootfs --align 1024 > > > > Signed-off-by: Daniel Gomez > > --- > > scripts/lib/wic/help.py | 3 +++ > > scripts/lib/wic/ksparser.py | 1 + > > scripts/lib/wic/partition.py | 5 +++-- > > 3 files changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py > > index 991e5094bb..5c3d278d4e 100644 > > --- a/scripts/lib/wic/help.py > > +++ b/scripts/lib/wic/help.py > > @@ -991,6 +991,9 @@ DESCRIPTION > > multiple partitions and we want to keep the > > right > > permissions and usernames in all the > > partitions. > > > > + --no-fstab-update: This option is specific to wic. It does not > > update the > > +'/etc/fstab' stock file for the given > > partition. > > + > > --extra-space: This option is specific to wic. It adds extra > > space after the space filled by the content > > of the partition. The final size can go > > diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py > > index 7a4cc83af5..0df9eb0d05 100644 > > --- a/scripts/lib/wic/ksparser.py > > +++ b/scripts/lib/wic/ksparser.py > > @@ -185,6 +185,7 @@ class KickStart(): > > part.add_argument('--use-uuid', action='store_true') > > part.add_argument('--uuid') > > part.add_argument('--fsuuid') > > +part.add_argument('--no-fstab-update', action='store_true') > > > > bootloader = subparsers.add_parser('bootloader') > > bootloader.add_argument('--append') > > diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py > > index e0b2c5bdf2..ab304f1b2a 100644 > > --- a/scripts/lib/wic/partition.py > > +++ b/scripts/lib/wic/partition.py > > @@ -54,6 +54,7 @@ class Partition(): > > self.uuid = args.uuid > > self.fsuuid = args.fsuuid > > self.type = args.type > > +self.no_fstab_update = args.no_fstab_update > > self.updated_fstab_path = None > > self.has_fstab = False > > self.update_fstab_in_rootfs = False > > @@ -286,7 +287,7 @@ class Partition(): > > (self.fstype, extraopts, rootfs, label_str, self.fsuuid, > > rootfs_dir) > > exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo) > > > > -if self.updated_fstab_path and self.has_fstab: > > +if self.updated_fstab_path and self.has_fstab and not > > self.no_fstab_update: > > debugfs_script_path = os.path.join(cr_workdir, > > "debugfs_script") > > with open(debugfs_script_path, "w") as f: > > f.write("cd etc\n") > > @@ -350,7 +351,7 @@ class Partition(): > > mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, rootfs_dir) > > exec_native_cmd(mcopy_cmd, native_sysroot) > > > > -if self.updated_fstab_path and self.has_fstab: > > +if self.updated_fstab_path and self.has_fstab and not > > self.no_fstab_update: > > mcopy_cmd = "mcopy -i %s %s ::/etc/fstab" % (rootfs, > > self.updated_fstab_path) > > exec_native_cmd(mcopy_cmd, native_sysroot) > > > > This looks like the right approach. However, you're still missing the > handling for filesystems other than ext2/3/4 & msdos. See > http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/scripts/lib/wic/plugins/source/rootfs.py#n218 > and grep to see if there are any other uses of updated_fstab_path. Thanks for your quick reply. Sorry, I wasn't sure about that part of the code so thanks for mentioning
[OE-core][PATCH] 1/2] wic: Add --no-fstab-update part option
When embedding a rootfs image (e.g. 'rootfs-dir') as a partition we might want to keep the stock fstab for that image. In such case, use this option to not update the fstab and use the stock one instead. This option allows to specify which partitions get the fstab updated and which get the stock fstab. The option matches the argument you can pass to wic itself where the same action is performed but for all the partitions. Example: part /export --source rootfs --rootfs-dir=hockeycam-image --fstype=ext4 --label export --align 1024 --no-fstab-update part / --source rootfs --fstype=ext4 --label rootfs --align 1024 Signed-off-by: Daniel Gomez --- scripts/lib/wic/help.py | 3 +++ scripts/lib/wic/ksparser.py | 1 + scripts/lib/wic/partition.py | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py index 991e5094bb..5c3d278d4e 100644 --- a/scripts/lib/wic/help.py +++ b/scripts/lib/wic/help.py @@ -991,6 +991,9 @@ DESCRIPTION multiple partitions and we want to keep the right permissions and usernames in all the partitions. + --no-fstab-update: This option is specific to wic. It does not update the +'/etc/fstab' stock file for the given partition. + --extra-space: This option is specific to wic. It adds extra space after the space filled by the content of the partition. The final size can go diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py index 7a4cc83af5..0df9eb0d05 100644 --- a/scripts/lib/wic/ksparser.py +++ b/scripts/lib/wic/ksparser.py @@ -185,6 +185,7 @@ class KickStart(): part.add_argument('--use-uuid', action='store_true') part.add_argument('--uuid') part.add_argument('--fsuuid') +part.add_argument('--no-fstab-update', action='store_true') bootloader = subparsers.add_parser('bootloader') bootloader.add_argument('--append') diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index e0b2c5bdf2..ab304f1b2a 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py @@ -54,6 +54,7 @@ class Partition(): self.uuid = args.uuid self.fsuuid = args.fsuuid self.type = args.type +self.no_fstab_update = args.no_fstab_update self.updated_fstab_path = None self.has_fstab = False self.update_fstab_in_rootfs = False @@ -286,7 +287,7 @@ class Partition(): (self.fstype, extraopts, rootfs, label_str, self.fsuuid, rootfs_dir) exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo) -if self.updated_fstab_path and self.has_fstab: +if self.updated_fstab_path and self.has_fstab and not self.no_fstab_update: debugfs_script_path = os.path.join(cr_workdir, "debugfs_script") with open(debugfs_script_path, "w") as f: f.write("cd etc\n") @@ -350,7 +351,7 @@ class Partition(): mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, rootfs_dir) exec_native_cmd(mcopy_cmd, native_sysroot) -if self.updated_fstab_path and self.has_fstab: +if self.updated_fstab_path and self.has_fstab and not self.no_fstab_update: mcopy_cmd = "mcopy -i %s %s ::/etc/fstab" % (rootfs, self.updated_fstab_path) exec_native_cmd(mcopy_cmd, native_sysroot) -- 2.30.2 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#154682): https://lists.openembedded.org/g/openembedded-core/message/154682 Mute This Topic: https://lists.openembedded.org/mt/84792172/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH] 2/2] oeqa: wic: Add tests for --no-fstab-update
Add tests for the --no-fstab-update wic part command. Signed-off-by: Daniel Gomez --- meta/lib/oeqa/selftest/cases/wic.py | 56 + 1 file changed, 56 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 2efbe514c1..a58360851a 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -11,6 +11,7 @@ import os import sys import unittest +import hashlib from glob import glob from shutil import rmtree, copy @@ -686,6 +687,61 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc % (wks_file, self.resultdir), ignore_status=True).status) os.remove(wks_file) +def test_no_fstab_update(self): +"""Test --no-fstab-update wks option.""" + +oldpath = os.environ['PATH'] +os.environ['PATH'] = get_bb_var("PATH", "wic-tools") + +# Get stock fstab from base-files recipe +bitbake('base-files') +bf_fstab = os.path.join(get_bb_var('WORKDIR', 'base-files'),'image/etc/fstab') +bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % bf_fstab).output.split(" ")[0] + +try: +no_fstab_update_path = os.path.join(self.resultdir, 'test-no-fstab-update') +os.makedirs(no_fstab_update_path) +wks_file = os.path.join(no_fstab_update_path, 'temp.wks') +with open(wks_file, 'w') as wks: +wks.writelines(['part / --source rootfs --fstype=ext4 --label rootfs\n', +'part /mnt/p2 --source rootfs --rootfs-dir=core-image-minimal ', +'--fstype=ext4 --label p2 --no-fstab-update\n']) +runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir)) + +part_fstab_md5sum = [] +for i in range(1, 3): +part = glob(os.path.join(self.resultdir, 'temp-*.direct.p') + str(i))[0] +part_fstab = runCmd("debugfs -R 'cat etc/fstab' %s 2>/dev/null" % (part)) +part_fstab_md5sum.append(hashlib.md5((part_fstab.output + "\n\n").encode('utf-8')).hexdigest()) + +# '/etc/fstab' in partition 2 should contain the same stock fstab file at base-file recipe. +self.assertEqual(bf_fstab_md5sum, part_fstab_md5sum[1]) + +# '/etc/fstab' in partition 1 should contain an updated fstab file. +self.assertNotEqual(bf_fstab_md5sum, part_fstab_md5sum[0]) + +finally: +os.environ['PATH'] = oldpath + +def test_no_fstab_update_errors(self): +"""Test --no-fstab-update wks option error handling.""" +wks_file = 'temp.wks' + +# Absolute argument. +with open(wks_file, 'w') as wks: +wks.write("part / --source rootfs --fstype=ext4 --no-fstab-update /etc") +self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir), ignore_status=True).status) +os.remove(wks_file) + +# Argument pointing to parent directory. +with open(wks_file, 'w') as wks: +wks.write("part / --source rootfs --fstype=ext4 --no-fstab-update ././..") +self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir), ignore_status=True).status) +os.remove(wks_file) + class Wic2(WicTestCase): def test_bmap_short(self): -- 2.30.2 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#154683): https://lists.openembedded.org/g/openembedded-core/message/154683 Mute This Topic: https://lists.openembedded.org/mt/84792173/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][RFC][PATCH][dunfell] wic: Add --use-stock-fstab option
On Fri, 6 Aug 2021 at 12:29, Paul Barker wrote: > > On Fri, 6 Aug 2021 11:23:37 +0200 > Daniel Gomez wrote: > > > When embeddding rootfs image (e.g. 'rootfs-dir') as a partition we > > might want to keep the stock fstab for that image. In such case, use > > this option to not update the fstab and use the stock one instead. > > > > This option allows to specify which partitions get the updated fstab > > and which get the stock fstab. > > > > Example: > > part /export --source rootfs --rootfs-dir=hockeycam-image > > --fstype=ext4 --label export --align 1024 --use-stock-fstab > > > > part / --source rootfs --fstype=ext4 --label rootfs --align 1024 > > > > Signed-off-by: Daniel Gomez > > --- > > > > The commit-id ce682a73b7447652f898ce1d1d0416a456df5416 reverted the > > functionality to restore the stock/original fstab file in a rootfs > > partition image (wic plugin). > > > > Add back such functionality with an option to the user to select which > > fstab will be used for each partition by adding the --use-stock-fstab. > > In this case, the user will select whether or not the stock fstab will > > be updated or kept. > > > > If you agree with the patch I'll adapt it to the master branch. > > > > Daniel > > > > scripts/lib/wic/ksparser.py | 1 + > > scripts/lib/wic/partition.py | 3 ++- > > 2 files changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py > > index 452a160232..64933e0a5b 100644 > > --- a/scripts/lib/wic/ksparser.py > > +++ b/scripts/lib/wic/ksparser.py > > @@ -184,6 +184,7 @@ class KickStart(): > > part.add_argument('--use-uuid', action='store_true') > > part.add_argument('--uuid') > > part.add_argument('--fsuuid') > > +part.add_argument('--use-stock-fstab', action='store_true') > > > > bootloader = subparsers.add_parser('bootloader') > > bootloader.add_argument('--append') > > diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py > > index 85f9847047..c9e45773de 100644 > > --- a/scripts/lib/wic/partition.py > > +++ b/scripts/lib/wic/partition.py > > @@ -54,6 +54,7 @@ class Partition(): > > self.uuid = args.uuid > > self.fsuuid = args.fsuuid > > self.type = args.type > > +self.use_stock_fstab = args.use_stock_fstab > > self.updated_fstab_path = None > > self.has_fstab = False > > self.update_fstab_in_rootfs = False > > @@ -286,7 +287,7 @@ class Partition(): > > (self.fstype, extraopts, rootfs, label_str, self.fsuuid, > > rootfs_dir) > > exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo) > > > > -if self.updated_fstab_path and self.has_fstab: > > +if self.updated_fstab_path and self.has_fstab and not > > self.use_stock_fstab: > > debugfs_script_path = os.path.join(cr_workdir, > > "debugfs_script") > > with open(debugfs_script_path, "w") as f: > > f.write("cd etc\n") > > -- > > 2.30.2 > > > > You're only addressing ext2/3/4 partitions here. The patch needs to be > extended to cover the msdos partition case and the > update_fstab_in_rootfs case in the rootfs source plugin. > > I also recommend changing the option in ksparser to '--no-fstab-update' > to match the argument you can pass to wic itself. That way you can pass > '--no-fstab-update' to wic to set the option for all partitions, or > include it in the wks file to set the option per-partition. Thanks Richard and Paul for the suggestions and the missing tasks. I'll send a patch as soon as I have all prepared. Daniel > > Thanks, > > -- > Paul Barker > https://pbarker.dev/ -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#154562): https://lists.openembedded.org/g/openembedded-core/message/154562 Mute This Topic: https://lists.openembedded.org/mt/84704596/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][RFC][PATCH][dunfell] wic: direct: Use stock fstab in partitions
Hi Richard, On Thu, 5 Aug 2021 at 17:31, Richard Purdie wrote: > > On Thu, 2021-08-05 at 17:03 +0200, Daniel Gomez wrote: > > Be able to get the stock fstab in partitions. > > > > Functionality reverted at commit id: > > ce682a73b7447652f898ce1d1d0416a456df5416 > > > > Signed-off-by: Daniel Gomez > > --- > > > > Hi, > > > > I'm trying to get back the stock fstab file in a rootfs partition > > image (wic plugin) and I'd like to know what you think about it. > > > > Functionality was included before commit-id > > ce682a73b7447652f898ce1d1d0416a456df5416 and removed afterwards. Would > > it be possible to add it again? What would be needed to re-add it? > > > > The commit you mention above shouldn't have changed the output, it just used a > different method to replace the fstab file. The question becomes why isn't the > modified file being used in the way you're generating an image. I don't know > wic well enough to know the answer to that though. Thanks for your comments. I did some debugging and the fstab in use for each partition will always be updated/replaced in the 'prepare_rootfs_ext' function (when 'update_fstab' in direct.py updates it): http://git.openembedded.org/openembedded-core/tree/scripts/lib/wic/partition.py?h=dunfell#n289 To fix it, I made this patch for dunfell so it gets updated if the user wants. https://lists.openembedded.org/g/openembedded-core/message/154537 The user now decides with --use-stock-fstab if the stock fstab is kept or replaced/updated. As said in the other patch/message, I'll update it to master if you agree. Thanks, Daniel > > Cheers, > > Richard > > > > Thanks in advance, > > Daniel > > > > Here the relevant information: > > > > wks definition: > > part /boot/bootloader --source qbootimg-pcbios --active --align 1024 > > --use-uuid --fsoptions defaults,ro > > part /export --source rootfs --rootfs-dir=hockeycam-image --fstype=ext4 > > --label export --align 1024 --use-uuid --fsoptions defaults,ro > > --extra-space 400M > > part /media/rw --fstype=ext4 --label rwfs --align 1024 --use-uuid --size 200 > > part / --source rootfs --fstype=ext4 --label rootfs --align 1024 --use-uuid > > --fsoptions defaults,ro --extra-space 400M > > > > bootloader --timeout=1 --append="ro rootfstype=ext4 qtec_mem.size=64" > > --source qbootimg-pcbios > > > > /export/etc/fstab before: > > # stock fstab - you probably want to override this with a machine specific > > one > > > > /dev/root/auto ro 1 0 > > proc /procproc defaults > > 0 0 > > devpts /dev/pts devpts > > mode=0620,ptmxmode=0666,gid=5 0 0 > > tmpfs/run tmpfs > > mode=0755,nodev,nosuid,strictatime 0 0 > > tmpfs/var/volatiletmpfs defaults > > 0 0 > > > > # uncomment this if your device has a SD/MMC/Transflash slot > > #/dev/mmcblk0p1 /media/card auto defaults,sync,noauto > > 0 0 > > > > /dev/sdb /mnt auto defaults 0 0 > > UUID=D339-7B77 /boot/bootloadervfatdefaults,ro 0 0 > > UUID=31f46be1-d9fb-4081-bd53-2c2727e7854b /export ext4defaults,ro > > 0 0 > > UUID=d8e8f5d4-897e-48cd-9188-33598363f706 /media/rw ext4 > > defaults0 0 > > > > /export/etc/fstab after: > > # stock fstab - you probably want to override this with a machine specific > > one > > > > /dev/root/auto ro 1 0 > > proc /procproc defaults > > 0 0 > > devpts /dev/pts devpts > > mode=0620,ptmxmode=0666,gid=5 0 0 > > tmpfs/run tmpfs > > mode=0755,nodev,nosuid,strictatime 0 0 > > tmpfs/var/volatiletmpfs defaults > > 0 0 > > > > # uncomment this if your device has a SD/MMC/Transflash slot > > #/dev/mmcblk0p1 /media/card auto defaults,sync,noauto > > 0 0 > > > > 10.100.10.100:/mnt/rw /media/rw nfsdefaults 0 0 > > > > > > scripts/lib/wic/plugins/imager/direct.py | 20 > > 1 file changed, 16 insertions(+), 4 deletions(-) > > > > diff --git a/scripts/lib/wic/plugins/imager/direct.py > > b/scripts/lib/wic/plug
[OE-core][RFC][PATCH][dunfell] wic: Add --use-stock-fstab option
When embeddding rootfs image (e.g. 'rootfs-dir') as a partition we might want to keep the stock fstab for that image. In such case, use this option to not update the fstab and use the stock one instead. This option allows to specify which partitions get the updated fstab and which get the stock fstab. Example: part /export --source rootfs --rootfs-dir=hockeycam-image --fstype=ext4 --label export --align 1024 --use-stock-fstab part / --source rootfs --fstype=ext4 --label rootfs --align 1024 Signed-off-by: Daniel Gomez --- The commit-id ce682a73b7447652f898ce1d1d0416a456df5416 reverted the functionality to restore the stock/original fstab file in a rootfs partition image (wic plugin). Add back such functionality with an option to the user to select which fstab will be used for each partition by adding the --use-stock-fstab. In this case, the user will select whether or not the stock fstab will be updated or kept. If you agree with the patch I'll adapt it to the master branch. Daniel scripts/lib/wic/ksparser.py | 1 + scripts/lib/wic/partition.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py index 452a160232..64933e0a5b 100644 --- a/scripts/lib/wic/ksparser.py +++ b/scripts/lib/wic/ksparser.py @@ -184,6 +184,7 @@ class KickStart(): part.add_argument('--use-uuid', action='store_true') part.add_argument('--uuid') part.add_argument('--fsuuid') +part.add_argument('--use-stock-fstab', action='store_true') bootloader = subparsers.add_parser('bootloader') bootloader.add_argument('--append') diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index 85f9847047..c9e45773de 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py @@ -54,6 +54,7 @@ class Partition(): self.uuid = args.uuid self.fsuuid = args.fsuuid self.type = args.type +self.use_stock_fstab = args.use_stock_fstab self.updated_fstab_path = None self.has_fstab = False self.update_fstab_in_rootfs = False @@ -286,7 +287,7 @@ class Partition(): (self.fstype, extraopts, rootfs, label_str, self.fsuuid, rootfs_dir) exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo) -if self.updated_fstab_path and self.has_fstab: +if self.updated_fstab_path and self.has_fstab and not self.use_stock_fstab: debugfs_script_path = os.path.join(cr_workdir, "debugfs_script") with open(debugfs_script_path, "w") as f: f.write("cd etc\n") -- 2.30.2 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#154537): https://lists.openembedded.org/g/openembedded-core/message/154537 Mute This Topic: https://lists.openembedded.org/mt/84704596/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][RFC][PATCH][dunfell] wic: direct: Use stock fstab in partitions
Be able to get the stock fstab in partitions. Functionality reverted at commit id: ce682a73b7447652f898ce1d1d0416a456df5416 Signed-off-by: Daniel Gomez --- Hi, I'm trying to get back the stock fstab file in a rootfs partition image (wic plugin) and I'd like to know what you think about it. Functionality was included before commit-id ce682a73b7447652f898ce1d1d0416a456df5416 and removed afterwards. Would it be possible to add it again? What would be needed to re-add it? Thanks in advance, Daniel Here the relevant information: wks definition: part /boot/bootloader --source qbootimg-pcbios --active --align 1024 --use-uuid --fsoptions defaults,ro part /export --source rootfs --rootfs-dir=hockeycam-image --fstype=ext4 --label export --align 1024 --use-uuid --fsoptions defaults,ro --extra-space 400M part /media/rw --fstype=ext4 --label rwfs --align 1024 --use-uuid --size 200 part / --source rootfs --fstype=ext4 --label rootfs --align 1024 --use-uuid --fsoptions defaults,ro --extra-space 400M bootloader --timeout=1 --append="ro rootfstype=ext4 qtec_mem.size=64" --source qbootimg-pcbios /export/etc/fstab before: # stock fstab - you probably want to override this with a machine specific one /dev/root/auto ro 1 0 proc /procproc defaults 0 0 devpts /dev/pts devpts mode=0620,ptmxmode=0666,gid=5 0 0 tmpfs/run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 tmpfs/var/volatiletmpfs defaults 0 0 # uncomment this if your device has a SD/MMC/Transflash slot #/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0 /dev/sdb /mnt auto defaults 0 0 UUID=D339-7B77 /boot/bootloadervfatdefaults,ro 0 0 UUID=31f46be1-d9fb-4081-bd53-2c2727e7854b /export ext4defaults,ro 0 0 UUID=d8e8f5d4-897e-48cd-9188-33598363f706 /media/rw ext4 defaults0 0 /export/etc/fstab after: # stock fstab - you probably want to override this with a machine specific one /dev/root/auto ro 1 0 proc /procproc defaults 0 0 devpts /dev/pts devpts mode=0620,ptmxmode=0666,gid=5 0 0 tmpfs/run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 tmpfs/var/volatiletmpfs defaults 0 0 # uncomment this if your device has a SD/MMC/Transflash slot #/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0 10.100.10.100:/mnt/rw /media/rw nfsdefaults 0 0 scripts/lib/wic/plugins/imager/direct.py | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py index 7e1c1c03ab..1bb9d38524 100644 --- a/scripts/lib/wic/plugins/imager/direct.py +++ b/scripts/lib/wic/plugins/imager/direct.py @@ -111,7 +111,15 @@ class DirectPlugin(ImagerPlugin): with open(fstab_path) as fstab: fstab_lines = fstab.readlines() +self.original_fstab = fstab_lines.copy() +if self._update_fstab(fstab_lines, self.parts): +with open(fstab_path, "w") as fstab: +fstab.writelines(fstab_lines) +else: +self.original_fstab = None + +def _update_fstab(self, fstab_lines, parts): updated = False for part in self.parts: if not part.realnum or not part.mountpoint \ @@ -142,10 +150,7 @@ class DirectPlugin(ImagerPlugin): fstab_lines.append(line) updated = True -if updated: -self.updated_fstab_path = os.path.join(self.workdir, "fstab") -with open(self.updated_fstab_path, "w") as f: -f.writelines(fstab_lines) +return updated def _full_path(self, path, name, extention): """ Construct full file path to a file we generate. """ @@ -274,6 +279,13 @@ class DirectPlugin(ImagerPlugin): if os.path.isfile(path): shutil.move(path, os.path.join(self.outdir, fname)) + +# Restore original fstab +if self.original_fstab: +fstab_path = self.rootfs_dir.get("ROOTFS_DIR") + "/etc/fstab" +with open(fstab_path, "w") as fstab: +fstab.writelines(self.original_fstab) + # remove work directory shutil.rmtree(self.workdir, ignore_errors=True) -- 2.30.2 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#154479): https://lists.openembedded.org/g/openembedded-core/message/154479
Re: [OE-core] sstate not used due to runtaskdeps
On Fri, 2 Jul 2021 at 13:10, Daniel Gomez wrote: > > Hi all, > > I'm having a problem with perf recipe sstate not being reused in one > of my 'sstate clients' due to the following difference/change: > > pokyuser@da642d39231a:/workdir/build$ bitbake-diffsigs -t perf do_configure > runtaskdeps changed: > perf/perf.bb:do_deploy_source_date_epoch with hash > 5bb942d026e5da1235e70eec6e1568262f9d3efc5f73e73500192308d8ee09a6 > changed to > perf/perf.bb:do_deploy_source_date_epoch with hash > 366a660a6f7db7d516e8100b50ce8baccc22b0ab8df940a5b721e666994c > Hash for dependent task perf/perf.bb:do_deploy_source_date_epoch > changed from 5bb942d026e5da1235e70eec6e1568262f9d3efc5f73e73500192308d8ee09a6 > to 366a660a6f7db7d516e8100b50ce8baccc22b0ab8df940a5b721e666994c I've continued with this issue looking at the task dependencies for the perf which are the following: bitbake -g perf cat task-depends.dot | grep "perf.do_configure\|perf.do_deploy_source" "perf.do_compile" -> "perf.do_configure" "perf.do_configure" [label="perf do_configure\n:1.0-r9\n/workdir/repo/poky/meta/recipes-kernel/perf/perf.bb"] "perf.do_configure" -> "linux-qtec.do_shared_workdir" "perf.do_configure" -> "perf.do_deploy_source_date_epoch" "perf.do_configure" -> "perf.do_patch" "perf.do_configure" -> "perf.do_prepare_recipe_sysroot" "perf.do_deploy_source_date_epoch" [label="perf do_deploy_source_date_epoch\n:1.0-r9\n/workdir/repo/poky/meta/recipes-kernel/perf/perf.bb"] "perf.do_deploy_source_date_epoch" -> "perf.do_patch" In my case, both recipes linux-qtec (custom kernel) and perf are not using the sstate. I have also compared the sigdata for the linux-qtec.do_shared_workdir task between BUILDA and BUILDB and both have the same hash: qt5222-poky-linux/linux-qtec/5.13+gitAUTOINC+e6f9eb0341-r0.do_shared_workdir.1c27b593... and still they don't reuse the sstate. The rest of the tasks locally generated in the client have the same hash as the server. Any idea what can I do/debug next? > > Basically, my BUILDA (yocto server) has generated the perf sstate and > for debugging this error, the sigdata which I have compared with my > BUILDB (yocto sstate client) figuring out that do_configure task was > the first one to differ in between builds. According to [1] I should > see the changes in between builds so I assume in my case it is the > runtaskdeps but not sure how to proceed now. Comparing the 2 sigdata > for the do_deploy_source_date_epoch task using bitbake-diffsigs makes > no output. So, I tried to use bitbake-dumpsig in between them and > compare the output with diff: > > bitbake-dumpsig > 1.0-r9.do_deploy_source_date_epoch.sigdata.366a660a6f7db7d516e8100b50ce8baccc22b0ab8df940a5b721e666994c > | less > 366.log > bitbake-dumpsig > 1.0-r9.do_deploy_source_date_epoch.sigdata.5bb942d026e5da1235e70eec6e1568262f9d3efc5f73e73500192308d8ee09a6 > | less > 5bb.log > diff -u 366.log 5bb.log > > Where you see things like this: > -List of dependencies for variable libdir is {'baselib', 'exec_prefix'} > +List of dependencies for variable libdir is {'exec_prefix', 'baselib'} > > Or lines being added/removed. > > For reference, here the links I've followed: > [1] > https://wiki.yoctoproject.org/wiki/TipsAndTricks/Understanding_what_changed_(diffsigs_etc) > [2] > https://www.openembedded.org/pipermail/openembedded-core/2014-June/211563.html > > Any suggestions on what I should do next to find out what is causing > the sstate not being reused on the client/consumer of the sstate side? > > Thanks in advance, > > Daniel -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#153467): https://lists.openembedded.org/g/openembedded-core/message/153467 Mute This Topic: https://lists.openembedded.org/mt/83937746/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] sstate not used due to runtaskdeps
Hi all, I'm having a problem with perf recipe sstate not being reused in one of my 'sstate clients' due to the following difference/change: pokyuser@da642d39231a:/workdir/build$ bitbake-diffsigs -t perf do_configure runtaskdeps changed: perf/perf.bb:do_deploy_source_date_epoch with hash 5bb942d026e5da1235e70eec6e1568262f9d3efc5f73e73500192308d8ee09a6 changed to perf/perf.bb:do_deploy_source_date_epoch with hash 366a660a6f7db7d516e8100b50ce8baccc22b0ab8df940a5b721e666994c Hash for dependent task perf/perf.bb:do_deploy_source_date_epoch changed from 5bb942d026e5da1235e70eec6e1568262f9d3efc5f73e73500192308d8ee09a6 to 366a660a6f7db7d516e8100b50ce8baccc22b0ab8df940a5b721e666994c Basically, my BUILDA (yocto server) has generated the perf sstate and for debugging this error, the sigdata which I have compared with my BUILDB (yocto sstate client) figuring out that do_configure task was the first one to differ in between builds. According to [1] I should see the changes in between builds so I assume in my case it is the runtaskdeps but not sure how to proceed now. Comparing the 2 sigdata for the do_deploy_source_date_epoch task using bitbake-diffsigs makes no output. So, I tried to use bitbake-dumpsig in between them and compare the output with diff: bitbake-dumpsig 1.0-r9.do_deploy_source_date_epoch.sigdata.366a660a6f7db7d516e8100b50ce8baccc22b0ab8df940a5b721e666994c | less > 366.log bitbake-dumpsig 1.0-r9.do_deploy_source_date_epoch.sigdata.5bb942d026e5da1235e70eec6e1568262f9d3efc5f73e73500192308d8ee09a6 | less > 5bb.log diff -u 366.log 5bb.log Where you see things like this: -List of dependencies for variable libdir is {'baselib', 'exec_prefix'} +List of dependencies for variable libdir is {'exec_prefix', 'baselib'} Or lines being added/removed. For reference, here the links I've followed: [1] https://wiki.yoctoproject.org/wiki/TipsAndTricks/Understanding_what_changed_(diffsigs_etc) [2] https://www.openembedded.org/pipermail/openembedded-core/2014-June/211563.html Any suggestions on what I should do next to find out what is causing the sstate not being reused on the client/consumer of the sstate side? Thanks in advance, Daniel -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#153461): https://lists.openembedded.org/g/openembedded-core/message/153461 Mute This Topic: https://lists.openembedded.org/mt/83937746/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] alsa-state: pkg_postinst fails
Hi, When upgrading our system, alsa-state package fails (exit code 99) due to the following: root@qt5222:~# /usr/sbin/alsactl -g -f /var/lib/alsa/asound.state restore No state is present for card Generic Found hardware: "HDA-Intel" "ATI R6xx HDMI" "HDA:1002aa01,00aa0100,00100700" "0x1002" "0x15de" Hardware is initialized using a generic method No state is present for card Generic root@qt5222:~# echo $? 99 Adding -I (don't initialize even if restore fails) to the script solves/workarounds the problem: /usr/sbin/alsactl -g -I -f /var/lib/alsa/asound.state restore I was wondering if that's the proper solution or I'm actually missing some configuration to make alsactl restore command to work properly. System logs, when booting also shows the same issue: May 07 10:07:47 qt5222 systemd-udevd[202]: controlC0: Process '/usr/sbin/alsactl restore 0' failed with exit code 99. Hardware info: root@qt5222:~# journalctl -b | grep alsa May 07 10:07:47 qt5222 systemd-udevd[202]: controlC0: Process '/usr/sbin/alsactl restore 0' failed with exit code 99. root@qt5222:~# lspci -knn | grep -iA2 audio 05:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller [1002:15de] Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller [1002:15de] Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel -- 05:00.5 Multimedia controller [0480]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor [1022:15e2] Subsystem: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor [1022:15e2] 06:00.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 61) Subsystem: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] root@qt5222:~# cat /proc/asound/cards 0 [Generic]: HDA-Intel - HD-Audio Generic HD-Audio Generic at 0xd04c irq 69 Any hint? Or should I just add -I option? Thanks in advance! Daniel -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#151479): https://lists.openembedded.org/g/openembedded-core/message/151479 Mute This Topic: https://lists.openembedded.org/mt/82677286/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH] allarch: Add missing allarch ttf-bitstream-vera
allarch is missing in ttf-bitstream-vera recipe. Add it and include the recipe in the SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS list. Signed-off-by: Daniel Gomez --- meta/conf/layer.conf | 1 + meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf index c115c87043..1a01d02fef 100644 --- a/meta/conf/layer.conf +++ b/meta/conf/layer.conf @@ -71,6 +71,7 @@ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \ grub-efi->grub-bootconf \ liberation-fonts->fontconfig \ cantarell-fonts->fontconfig \ + ttf-bitstream-vera->fontconfig \ gnome-icon-theme->librsvg \ font-alias->font-util \ systemd-boot->systemd-bootconf \ diff --git a/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb b/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb index 70b32cf8f1..3e1ba196b5 100644 --- a/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb +++ b/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb @@ -9,7 +9,7 @@ LICENSE = "BitstreamVera" LIC_FILES_CHKSUM = "file://COPYRIGHT.TXT;md5=27d7484b1e18d0ee4ce538644a3f04be" PR = "r7" -inherit fontcache +inherit allarch fontcache FONT_PACKAGES = "${PN}" -- 2.27.0 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#141215): https://lists.openembedded.org/g/openembedded-core/message/141215 Mute This Topic: https://lists.openembedded.org/mt/76008040/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][PATCH] allarch: Fix wrong dependencies
Hi Richard, On Wed, 5 Aug 2020 at 15:31, Richard Purdie wrote: > > On Wed, 2020-08-05 at 15:22 +0200, Daniel Gomez wrote: > > In all these cases, allarch is used but the package dependencies are not > > allarch. It generates a conflict when the same package is built for > > different > > MACHINES at the same time. > > > > Here a build error for the ttf-ubuntu-font-family in a multiconfig > > enviroment: > > This is on the wrong mailing list. I also thought there was code > somewhere to remove font dependencies from changing the task > signatures? Sorry! I mixed the lists. > > http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/conf/layer.conf > > see the lines like: > > liberation-fonts->fontconfig \ > cantarell-fonts->fontconfig \ > > Perhaps meta-oe has some of those missing? I didn't notice about that SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS list and looks like meta-oe already implements it so, what we actually need is to include that recipe in our layer conf. On the other hand, I think the following recipes are missing the inherit allarch: meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb meta/recipes-graphics/ttf-fonts/liberation-fonts_2.00.1.bb And then, add the ttf-bitstream-vera recipe as part of the SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS. Will send a patch to fix it. Thanks! > > Cheers, > > Richard > -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#141213): https://lists.openembedded.org/g/openembedded-core/message/141213 Mute This Topic: https://lists.openembedded.org/mt/76007129/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH] allarch: Fix wrong dependencies
In all these cases, allarch is used but the package dependencies are not allarch. It generates a conflict when the same package is built for different MACHINES at the same time. Here a build error for the ttf-ubuntu-font-family in a multiconfig enviroment: ERROR: mc:qt5507:ttf-ubuntu-font-family-0.83-r1 do_package_write_deb: Fatal errors occurred in subprocesses: Command 'PATH="/workdir/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/workdir/repo/poky/scripts:/workdir/build/tmp/work/all-poky-linux/ttf-ubuntu-font-family/0.83-r1/recipe-sysroot-native/usr/bin/allarch-poky-linux:/workdir/build/tmp/work/all-poky-linux/ttf-ubuntu-font-family/0.83-r1/recipe-sysroot/usr/bin/crossscripts:/workdir/build/tmp/work/all-poky-linux/ttf-ubuntu-font-family/0.83-r1/recipe-sysroot-native/usr/sbin:/workdir/build/tmp/work/all-poky-linux/ttf-ubuntu-font-family/0.83-r1/recipe-sysroot-native/usr/bin:/workdir/build/tmp/work/all-poky-linux/ttf-ubuntu-font-family/0.83-r1/recipe-sysroot-native/sbin:/workdir/build/tmp/work/all-poky-linux/ttf-ubuntu-font-family/0.83-r1/recipe-sysroot-native/bin:/workdir/repo/poky/bitbake/bin:/workdir/build/tmp/hosttools" dpkg-deb -b /workdir/build/tmp/work/all-poky-linux/ttf-ubuntu-font-family/0.83-r1/packages-split/ttf-ubuntu-sans /workdir/build/tmp/work/all-poky-linux/ttf-ubuntu-font-family/0.83-r1/deploy-debs/all' returned non-zero exit status 2 Subprocess output:dpkg-deb: building package 'ttf-ubuntu-sans' in '/workdir/build/tmp/work/all-poky-linux/ttf-ubuntu-font-family/0.83-r1/deploy-debs/all'. dpkg-deb: error: unable to create '/workdir/build/tmp/work/all-poky-linux/ttf-ubuntu-font-family/0.83-r1/deploy-debs/all': No such file or directory ERROR: mc:qt5507:ttf-ubuntu-font-family-0.83-r1 do_package_write_deb: ERROR: mc:qt5507:ttf-ubuntu-font-family-0.83-r1 do_package_write_deb: Function failed: do_package_deb ERROR: Logfile of failure stored in: /workdir/build/tmp/work/all-poky-linux/ttf-ubuntu-font-family/0.83-r1/temp/log.do_package_write_deb.11826 NOTE: recipe ttf-ubuntu-font-family-0.83-r1: task do_package_write_deb: Failed ERROR: Task (multiconfig:qt5507:/workdir/repo/poky/../meta-qtec-hockey/recipes-graphics/ttf-fonts/ttf-ubuntu-font-family_0.83.bb:do_package_write_deb) failed with exit code '1' Similar patch: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/recipes-graphics/ttf-fonts?id=0d9f7900dec4ec68d8ad6c8a455e5b4f068e3715 Signed-off-by: Daniel Gomez --- meta-oe/recipes-graphics/terminus-font/terminus-font_4.38.bb| 2 +- .../ttf-fonts/source-han-sans-cn-fonts_1.004.bb | 2 +- .../ttf-fonts/source-han-sans-jp-fonts_1.004.bb | 2 +- .../ttf-fonts/source-han-sans-kr-fonts_1.004.bb | 2 +- .../ttf-fonts/source-han-sans-tw-fonts_1.004.bb | 2 +- meta-oe/recipes-graphics/ttf-fonts/ttf-pt-sans_1.1.bb | 2 +- meta-oe/recipes-graphics/ttf-fonts/ttf.inc | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/meta-oe/recipes-graphics/terminus-font/terminus-font_4.38.bb b/meta-oe/recipes-graphics/terminus-font/terminus-font_4.38.bb index c460fc35c..23a73b37b 100644 --- a/meta-oe/recipes-graphics/terminus-font/terminus-font_4.38.bb +++ b/meta-oe/recipes-graphics/terminus-font/terminus-font_4.38.bb @@ -14,7 +14,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz" SRC_URI[md5sum] = "a8e792fe6e84c86ed2b6ed3e2a12ba66" SRC_URI[sha256sum] = "f6f4876a4dabe6a37c270c20bb9e141e38fb50e0bba200e1b9d0470e5eed97b7" -inherit allarch fontcache +inherit fontcache PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" PACKAGECONFIG[x11] = "" diff --git a/meta-oe/recipes-graphics/ttf-fonts/source-han-sans-cn-fonts_1.004.bb b/meta-oe/recipes-graphics/ttf-fonts/source-han-sans-cn-fonts_1.004.bb index 9fbfc8b49..04ab188e6 100644 --- a/meta-oe/recipes-graphics/ttf-fonts/source-han-sans-cn-fonts_1.004.bb +++ b/meta-oe/recipes-graphics/ttf-fonts/source-han-sans-cn-fonts_1.004.bb @@ -5,7 +5,7 @@ HOMEPAGE = "https://github.com/adobe-fonts/source-han-sans; LICENSE = "OFL-1.1" LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=55719faa0112708e946b820b24b14097" -inherit allarch fontcache +inherit fontcache # Download tends to break - so - or not? #EXCLUDE_FROM_WORLD = "1" diff --git a/meta-oe/recipes-graphics/ttf-fonts/source-han-sans-jp-fonts_1.004.bb b/meta-oe/recipes-graphics/ttf-fonts/source-han-sans-jp-fonts_1.004.bb index 4a26a2f57..bb54e8aa5 100644 --- a/meta-oe/recipes-graphics/ttf-fonts/source-han-sans-jp-fonts_1.004.bb +++ b/meta-oe/recipes-graphics/ttf-fonts/source-han-sans-jp-fonts_1.004.bb @@ -5,7 +5,7 @@ HOMEPAGE = "https://github.com/adobe-fonts/source-han-sans; LICENSE = "OFL-1.1" LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=55719faa0112708e946b820b24b14097" -inherit allarch fontcache +inherit fontcache # Download tend
[OE-core][PATCH] ttf-fonts: Update ttf-ubuntu-font-family recipe
Current version 0.80 is no longer available with the link in the recipe. Update it to use 0.83 version. Signed-off-by: Daniel Gomez --- ...ont-family_0.80.bb => ttf-ubuntu-font-family_0.83.bb} | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) rename meta-oe/recipes-graphics/ttf-fonts/{ttf-ubuntu-font-family_0.80.bb => ttf-ubuntu-font-family_0.83.bb} (65%) diff --git a/meta-oe/recipes-graphics/ttf-fonts/ttf-ubuntu-font-family_0.80.bb b/meta-oe/recipes-graphics/ttf-fonts/ttf-ubuntu-font-family_0.83.bb similarity index 65% rename from meta-oe/recipes-graphics/ttf-fonts/ttf-ubuntu-font-family_0.80.bb rename to meta-oe/recipes-graphics/ttf-fonts/ttf-ubuntu-font-family_0.83.bb index d5d1b9a17..b8aa4c01c 100644 --- a/meta-oe/recipes-graphics/ttf-fonts/ttf-ubuntu-font-family_0.80.bb +++ b/meta-oe/recipes-graphics/ttf-fonts/ttf-ubuntu-font-family_0.83.bb @@ -6,10 +6,13 @@ LICENSE = "UFL" LIC_FILES_CHKSUM = "file://LICENCE.txt;md5=325a1a9029112a2405e743c7f816427b" PR = "r1" -SRC_URI = "http://font.ubuntu.com/download/ubuntu-font-family-${PV}.zip; +SHA1SUM = "0cef8205" -SRC_URI[md5sum] = "a1fc70f5a5b1d096ab8310886cddaa1c" -SRC_URI[sha256sum] = "107170099bbc3beae8602b97a5c423525d363106c3c24f787d43e09811298e4c" +SRC_URI = "https://assets.ubuntu.com/v1/${SHA1SUM}-ubuntu-font-family-${PV}.zip; + + +SRC_URI[md5sum] = "c5a5059d6856b4ddf79d824dcaf5ad32" +SRC_URI[sha256sum] = "61a2b342526fd552f19fef438bb9211a8212de19ad96e32a1209c039f1d68ecf" S = "${WORKDIR}/ubuntu-font-family-${PV}" -- 2.27.0 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#139950): https://lists.openembedded.org/g/openembedded-core/message/139950 Mute This Topic: https://lists.openembedded.org/mt/75101560/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH] glib-2.0: Backport GMainContext fixes
Backport fixes introduced in 2.63.6 for memory leaks and memory corruption in GMainContext Upstream merge: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1353 Fixes SIGSEGV in GStreamer: Thread 2 "multihandlesink" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x76bb9700 (LWP 18045)] 0x77d65992 in g_source_unref_internal (source=0x700047d0, context=0x5561c800, have_lock=1) at ../../../../../../../repo/workspace/sources/glib-2.0/glib/gmain.c:2146 2146../../../../../../../repo/workspace/sources/glib-2.0/glib/gmain.c: No such file or directory. (gdb) bt #0 0x77d65992 in g_source_unref_internal (source=0x700047d0, context=0x5561c800, have_lock=1) at ../../../../../../../repo/workspace/sources/glib-2.0/glib/gmain.c:2146 #1 0x77d65bb6 in g_source_iter_next (iter=iter@entry=0x76bb8db0, source=source@entry=0x76bb8da8) at ../../../../../../../repo/workspace/sources/glib-2.0/glib/gmain.c:980 #2 0x77d67ef3 in g_main_context_prepare (context=context@entry=0x5561c800, priority=priority@entry=0x76bb8e30) at ../../../../../../../repo/workspace/sources/glib-2.0/glib/gmain.c:944 #3 0x77d6896b in g_main_context_iterate (context=context@entry=0x5561c800, block=block@entry=1, dispatch=dispatch@entry=1, self=) at ../../../../../../../repo/workspace/sources/glib-2.0/glib/gmain.c:3900 #4 0x77d68b4c in g_main_context_iteration (context=0x5561c800, may_block=may_block@entry=1) at ../../../../../../../repo/workspace/sources/glib-2.0/glib/gmain.c:3981 #5 0x76be4482 in gst_multi_socket_sink_thread (mhsink=0x55679ab0 [GstMultiSocketSink]) at ../../../gst-plugins-base-1.14.4/gst/tcp/gstmultisocketsink.c:1164 #6 0x77d8fb35 in g_thread_proxy (data=0x5565c770) at ../../../../../../../repo/workspace/sources/glib-2.0/glib/gthread.c:784 #7 0x77841ebd in start_thread (arg=) at pthread_create.c:486 #8 0x77aa12bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 #8 0x77aa12bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Signed-off-by: Daniel Gomez --- ...-GSource-iterator-if-iteration-can-m.patch | 43 +++ ...-memory-leaks-and-memory-corruption-.patch | 109 ++ ...e-mutex-unlocking-in-destructor-righ.patch | 36 ++ meta/recipes-core/glib-2.0/glib-2.0_2.62.4.bb | 3 + 4 files changed, 191 insertions(+) create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/0011-GMainContext-Fix-GSource-iterator-if-iteration-can-m.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/0012-GMainContext-Fix-memory-leaks-and-memory-corruption-.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/0013-GMainContext-Move-mutex-unlocking-in-destructor-righ.patch diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0011-GMainContext-Fix-GSource-iterator-if-iteration-can-m.patch b/meta/recipes-core/glib-2.0/glib-2.0/0011-GMainContext-Fix-GSource-iterator-if-iteration-can-m.patch new file mode 100644 index 00..3aae6f0c8c --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/0011-GMainContext-Fix-GSource-iterator-if-iteration-can-m.patch @@ -0,0 +1,43 @@ +From ef2be42998e3fc10299055a5a01f7c791538174c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= +Date: Mon, 3 Feb 2020 15:38:28 +0200 +Subject: [PATCH] GMainContext - Fix GSource iterator if iteration can modify + the list + +We first have to ref the next source and then unref the previous one. +This might be the last reference to the previous source, and freeing the +previous source might unref and free the next one which would then leave +use with a dangling pointer here. + +Fixes https://gitlab.gnome.org/GNOME/glib/issues/2031 + +Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/b06c48de7554607ff3fb58d6c0510cfa5088e909] + +--- + glib/gmain.c | 8 ++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/glib/gmain.c b/glib/gmain.c +index af979c8..a9a287d 100644 +--- a/glib/gmain.c b/glib/gmain.c +@@ -969,13 +969,17 @@ g_source_iter_next (GSourceIter *iter, GSource **source) +* GSourceList to be removed from source_lists (if iter->source is +* the only source in its list, and it is destroyed), so we have to +* keep it reffed until after we advance iter->current_list, above. ++ * ++ * Also we first have to ref the next source before unreffing the ++ * previous one as unreffing the previous source can potentially ++ * free the next one. +*/ ++ if (next_source && iter->may_modify) ++g_source_ref (next_source); + + if (iter->source && iter->may_modify) + g_source_unref_internal (iter->source, iter->context, TRUE); + iter->source = next_source; +- if (iter->source && iter->may_modify) +-g_source_ref (iter->sour
[OE-core] [PATCH] lttng-modules: Add missing SRCREV_FORMAT
When using devupstream class the SRCREV_FORMAT variable must be set. Signed-off-by: Daniel Gomez --- When using class-devupstream, multiple SCMs are used. Therefore, it is needed to select the variant of the recipe via PREFERRED_VERSION. In addition, SRCREV_FORMAT variable must be set. An example of devupstream class + SRCREV_FORMAT: meta/recipes-kernel/linux/linux-yocto.inc Error log: ERROR: ExpansionError during parsing /workdir/repo/poky/meta/recipes-kernel/lttng/lttng-modules_2.10.10.bb Traceback (most recent call last): File "Var ", line 1, in File "/workdir/repo/poky/bitbake/lib/bb/fetch2/__init__.py", line 768, in get_srcrev(d=, method_name='sortable_revision'): raise FetchError("The SRCREV_FORMAT variable must be set when multiple SCMs are used.\n"\ > "The SCMs are:\n%s" % '\n'.join(scms)) bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: The SRCREV_FORMAT variable must be set when multiple SCMs are used. The SCMs are: git://git.lttng.org/lttng-modules;branch=stable-2.10 git://git.lttng.org/lttng-modules.git;branch=stable-2.10 meta/recipes-kernel/lttng/lttng-modules_2.10.10.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.10.10.bb b/meta/recipes-kernel/lttng/lttng-modules_2.10.10.bb index 6e2d655495..dccc4b9842 100644 --- a/meta/recipes-kernel/lttng/lttng-modules_2.10.10.bb +++ b/meta/recipes-kernel/lttng/lttng-modules_2.10.10.bb @@ -43,3 +43,4 @@ SRC_URI_class-devupstream = "git://git.lttng.org/lttng-modules;branch=stable-2.1 SRCREV_class-devupstream = "624aca5d7507fbd11ea4a1a474c3aa1031bd9a31" PV_class-devupstream = "2.10.10+git${SRCPV}" S_class-devupstream = "${WORKDIR}/git" +SRCREV_FORMAT ?= "lttng_git" -- 2.20.1 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [morty][PATCH] Check libcc1 directory before disabling hardcoding of RPATHs
On vie, 2018-07-27 at 12:59 -0700, Andre McCurdy wrote: > On Fri, Jul 27, 2018 at 6:07 AM, Daniel Gomez > wrote: > > > > Check if libcc1 directory exits before disabling hardcode_into_libs > > configuration because of broken libtool in gcc recipes. > A patch for morty should either be a backport which has already been > merged into all applicable later branches (ie if the same fix is > needed in sumo, rocko or pyro it needs to be merged to those branches > first) or it should explain clearly why it's only applicable to morty. Well, I have realized about the real problem and it is only affecting to the gcc_4.9.bb recipe in the meta-linaro repo and not in the poky one. Basically, libcc1 support is included in gcc versions >= 5.x but not in older versions like 4.9.x and poky does not check the 'hardcode_into_libs' flags in versions where libcc1 is not included. > > > > > Signed-off-by: Daniel Gomez > > --- > > meta/recipes-devtools/gcc/gcc_5.4.bb | 3 ++- > > meta/recipes-devtools/gcc/gcc_6.4.bb | 3 ++- > > 2 files changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/meta/recipes-devtools/gcc/gcc_5.4.bb > > b/meta/recipes-devtools/gcc/gcc_5.4.bb > > index b0a523c..9da8ece 100644 > > --- a/meta/recipes-devtools/gcc/gcc_5.4.bb > > +++ b/meta/recipes-devtools/gcc/gcc_5.4.bb > > @@ -9,7 +9,8 @@ ARM_INSTRUCTION_SET_armv4 = "arm" > > do_configure_prepend() { > > # Easiest way to stop bad RPATHs getting into the library since we > > have a > > # broken libtool here > > - sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' > > ${S}/libcc1/configure > > + if [ -d "${S}/libcc1" ]; then > > + sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' > > ${S}/libcc1/configure > Missing fi ? Yes! I forgot to copy it from the original patch: https://lists.linaro.org/pipermail/openembedded/2018-March/000137.html > > > > } > > > > BBCLASSEXTEND = "nativesdk" > > diff --git a/meta/recipes-devtools/gcc/gcc_6.4.bb > > b/meta/recipes-devtools/gcc/gcc_6.4.bb > > index b0a523c..9da8ece 100644 > > --- a/meta/recipes-devtools/gcc/gcc_6.4.bb > > +++ b/meta/recipes-devtools/gcc/gcc_6.4.bb > > @@ -9,7 +9,8 @@ ARM_INSTRUCTION_SET_armv4 = "arm" > > do_configure_prepend() { > > # Easiest way to stop bad RPATHs getting into the library since we > > have a > > # broken libtool here > > - sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' > > ${S}/libcc1/configure > > + if [ -d "${S}/libcc1" ]; then > > + sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' > > ${S}/libcc1/configure > > } > > > > BBCLASSEXTEND = "nativesdk" > > -- > > 2.7.4 > > > > -- > > ___ > > Openembedded-core mailing list > > Openembedded-core@lists.openembedded.org > > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [morty][PATCH] Check libcc1 directory before disabling hardcoding of RPATHs
Check if libcc1 directory exits before disabling hardcode_into_libs configuration because of broken libtool in gcc recipes. Signed-off-by: Daniel Gomez --- meta/recipes-devtools/gcc/gcc_5.4.bb | 3 ++- meta/recipes-devtools/gcc/gcc_6.4.bb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/recipes-devtools/gcc/gcc_5.4.bb b/meta/recipes-devtools/gcc/gcc_5.4.bb index b0a523c..9da8ece 100644 --- a/meta/recipes-devtools/gcc/gcc_5.4.bb +++ b/meta/recipes-devtools/gcc/gcc_5.4.bb @@ -9,7 +9,8 @@ ARM_INSTRUCTION_SET_armv4 = "arm" do_configure_prepend() { # Easiest way to stop bad RPATHs getting into the library since we have a # broken libtool here - sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure + if [ -d "${S}/libcc1" ]; then + sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure } BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-devtools/gcc/gcc_6.4.bb b/meta/recipes-devtools/gcc/gcc_6.4.bb index b0a523c..9da8ece 100644 --- a/meta/recipes-devtools/gcc/gcc_6.4.bb +++ b/meta/recipes-devtools/gcc/gcc_6.4.bb @@ -9,7 +9,8 @@ ARM_INSTRUCTION_SET_armv4 = "arm" do_configure_prepend() { # Easiest way to stop bad RPATHs getting into the library since we have a # broken libtool here - sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure + if [ -d "${S}/libcc1" ]; then + sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure } BBCLASSEXTEND = "nativesdk" -- 2.7.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core