* [PATCH 1/4] lib/oe/package_manager: turn postinst failure warnings into bitbake failures
@ 2018-05-01 18:06 Alexander Kanavin
2018-05-01 18:06 ` [PATCH 2/4] gtk+: do not look into $HOME when looking for modules Alexander Kanavin
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Alexander Kanavin @ 2018-05-01 18:06 UTC (permalink / raw)
To: openembedded-core
Sumo release provides a transition period so that deferrals to first boot
via 'exit 1' can be converted to pkg_postinst_ontarget(). For the next release
however, postinst script failures should be treated as such.
[YOCTO #12607]
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
---
meta/lib/oe/package_manager.py | 22 +++++++---------------
meta/lib/oeqa/selftest/cases/runtime_test.py | 4 ++--
2 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 2d8aeba037c..b5fe20bade4 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -84,10 +84,10 @@ def opkg_query(cmd_output):
return output
-# Note: this should be bb.fatal in the future.
-def failed_postinsts_warn(pkgs, log_path):
- bb.warn("""Intentionally failing postinstall scriptlets of %s to defer them to first boot is deprecated. Please place them into pkg_postinst_ontarget_${PN} ().
-If deferring to first boot wasn't the intent, then scriptlet failure may mean an issue in the recipe, or a regression elsewhere.
+def failed_postinsts_abort(pkgs, log_path):
+ bb.fatal("""Postinstall scriptlets of %s have failed. If the intention is to defer them to first boot,
+then please place them into pkg_postinst_ontarget_${PN} ().
+Deferring to first boot via 'exit 1' is no longer supported.
Details of the failure are in %s.""" %(pkgs, log_path))
class Indexer(object, metaclass=ABCMeta):
@@ -789,9 +789,7 @@ class RpmPM(PackageManager):
failed_scriptlets_pkgnames[line.split()[-1]] = True
if len(failed_scriptlets_pkgnames) > 0:
- failed_postinsts_warn(list(failed_scriptlets_pkgnames.keys()), self.d.expand("${T}/log.do_${BB_CURRENTTASK}"))
- for pkg in failed_scriptlets_pkgnames.keys():
- self.save_rpmpostinst(pkg)
+ failed_postinsts_abort(list(failed_scriptlets_pkgnames.keys()), self.d.expand("${T}/log.do_${BB_CURRENTTASK}"))
def remove(self, pkgs, with_dependencies = True):
if len(pkgs) == 0:
@@ -1265,7 +1263,7 @@ class OpkgPM(OpkgDpkgPM):
bb.warn(line)
failed_pkgs.append(line.split(".")[0])
if failed_pkgs:
- failed_postinsts_warn(failed_pkgs, self.d.expand("${T}/log.do_${BB_CURRENTTASK}"))
+ failed_postinsts_abort(failed_pkgs, self.d.expand("${T}/log.do_${BB_CURRENTTASK}"))
except subprocess.CalledProcessError as e:
(bb.fatal, bb.warn)[attempt_only]("Unable to install packages. "
"Command '%s' returned %d:\n%s" %
@@ -1515,7 +1513,6 @@ class DpkgPM(OpkgDpkgPM):
os.environ['INTERCEPT_DIR'] = self.intercepts_dir
os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE')
- failed_pkgs = []
for pkg_name in installed_pkgs:
for control_script in control_scripts:
p_full = os.path.join(info_dir, pkg_name + control_script.suffix)
@@ -1530,12 +1527,7 @@ class DpkgPM(OpkgDpkgPM):
bb.warn("%s for package %s failed with %d:\n%s" %
(control_script.name, pkg_name, e.returncode,
e.output.decode("utf-8")))
- failed_postinsts_warn([pkg_name], self.d.expand("${T}/log.do_${BB_CURRENTTASK}"))
- failed_pkgs.append(pkg_name)
- break
-
- if len(failed_pkgs):
- self.mark_packages("unpacked", failed_pkgs)
+ failed_postinsts_abort([pkg_name], self.d.expand("${T}/log.do_${BB_CURRENTTASK}"))
def update(self):
os.environ['APT_CONFIG'] = self.apt_conf_file
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 9c9b4b34111..21e2c405df1 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -249,8 +249,8 @@ class Postinst(OESelftestTestCase):
features = 'CORE_IMAGE_EXTRA_INSTALL = "postinst-rootfs-failing"\n'
features += 'PACKAGE_CLASSES = "%s"\n' % classes
self.write_config(features)
- bb_result = bitbake('core-image-minimal')
- self.assertGreaterEqual(bb_result.output.find("Intentionally failing postinstall scriptlets of ['postinst-rootfs-failing'] to defer them to first boot is deprecated."), 0,
+ bb_result = bitbake('core-image-minimal', ignore_status=True)
+ self.assertGreaterEqual(bb_result.output.find("Postinstall scriptlets of ['postinst-rootfs-failing'] have failed."), 0,
"Warning about a failed scriptlet not found in bitbake output: %s" %(bb_result.output))
self.assertTrue(os.path.isfile(os.path.join(hosttestdir, "rootfs-before-failure")),
--
2.16.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/4] gtk+: do not look into $HOME when looking for modules
2018-05-01 18:06 [PATCH 1/4] lib/oe/package_manager: turn postinst failure warnings into bitbake failures Alexander Kanavin
@ 2018-05-01 18:06 ` Alexander Kanavin
2018-05-01 18:06 ` [PATCH 3/4] gtk-immodules-cache.bbclass: convert cache creation to postinst_intercept mechanism Alexander Kanavin
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Kanavin @ 2018-05-01 18:06 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
---
...ok-into-HOME-when-looking-for-gtk-modules.patch | 29 ++++++++++++++++++++++
meta/recipes-gnome/gtk+/gtk+_2.24.32.bb | 3 ++-
2 files changed, 31 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-gnome/gtk+/gtk+/0001-Do-not-look-into-HOME-when-looking-for-gtk-modules.patch
diff --git a/meta/recipes-gnome/gtk+/gtk+/0001-Do-not-look-into-HOME-when-looking-for-gtk-modules.patch b/meta/recipes-gnome/gtk+/gtk+/0001-Do-not-look-into-HOME-when-looking-for-gtk-modules.patch
new file mode 100644
index 00000000000..9201e45c39e
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+/0001-Do-not-look-into-HOME-when-looking-for-gtk-modules.patch
@@ -0,0 +1,29 @@
+From 34ce93e1c50bfb88f92a687d4f82de55584f3f6a Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 11 Apr 2018 14:20:39 +0300
+Subject: [PATCH] Do not look into $HOME when looking for gtk modules
+
+On the host it causes host contamination, on the target it's a
+potential security issue. Gtk+3 has already removed this.
+
+Upstream-Status: Inapproriate [gtk2 is in maintenance mode]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ gtk/gtkmodules.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c
+index 50729b6..e09b583 100644
+--- a/gtk/gtkmodules.c
++++ b/gtk/gtkmodules.c
+@@ -65,10 +65,6 @@ get_module_path (void)
+ if (result)
+ return result;
+
+- home_dir = g_get_home_dir();
+- if (home_dir)
+- home_gtk_dir = g_build_filename (home_dir, ".gtk-2.0", NULL);
+-
+ module_path_env = g_getenv ("GTK_PATH");
+ exe_prefix = g_getenv ("GTK_EXE_PREFIX");
+
diff --git a/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb b/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb
index 20703588c39..89fca736b25 100644
--- a/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb
+++ b/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb
@@ -10,7 +10,8 @@ SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-${PV}.tar.xz \
file://toggle-font.diff;striplevel=0 \
file://doc-fixes.patch \
file://strict-prototypes.patch \
- "
+ file://0001-Do-not-look-into-HOME-when-looking-for-gtk-modules.patch \
+ "
SRC_URI[md5sum] = "d5742aa42275203a499b59b4c382a784"
SRC_URI[sha256sum] = "b6c8a93ddda5eabe3bfee1eb39636c9a03d2a56c7b62828b359bf197943c582e"
--
2.16.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/4] gtk-immodules-cache.bbclass: convert cache creation to postinst_intercept mechanism
2018-05-01 18:06 [PATCH 1/4] lib/oe/package_manager: turn postinst failure warnings into bitbake failures Alexander Kanavin
2018-05-01 18:06 ` [PATCH 2/4] gtk+: do not look into $HOME when looking for modules Alexander Kanavin
@ 2018-05-01 18:06 ` Alexander Kanavin
2018-05-01 18:06 ` [PATCH 4/4] sysvinit-inittab: do not use 'exit 1' to postpone to first boot Alexander Kanavin
2018-05-01 18:32 ` ✗ patchtest: failure for "lib/oe/package_manager: turn p..." and 3 more Patchwork
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Kanavin @ 2018-05-01 18:06 UTC (permalink / raw)
To: openembedded-core
This has the following benefits:
- consistent with how the other caches are created into target rootfs
- only runs once per package manager transaction, instead of once per every immodule package
- correctly postpones to first boot if qemu is not working; from postinst itself
this would've required special arrangements to avoid what is now a do_rootfs failure.
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
---
meta/classes/gtk-immodules-cache.bbclass | 70 +++++++++-------------
.../postinst-intercepts/update_gtk_immodules_cache | 18 ++++++
2 files changed, 46 insertions(+), 42 deletions(-)
create mode 100644 scripts/postinst-intercepts/update_gtk_immodules_cache
diff --git a/meta/classes/gtk-immodules-cache.bbclass b/meta/classes/gtk-immodules-cache.bbclass
index 3d82dbe9e34..9bb0af8b26a 100644
--- a/meta/classes/gtk-immodules-cache.bbclass
+++ b/meta/classes/gtk-immodules-cache.bbclass
@@ -10,53 +10,39 @@ GTKIMMODULES_PACKAGES ?= "${PN}"
gtk_immodule_cache_postinst() {
if [ "x$D" != "x" ]; then
- if [ -x $D${bindir}/gtk-query-immodules-2.0 ]; then
- IMFILES=$(ls $D${libdir}/gtk-2.0/*/immodules/*.so)
- ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-2.0')} \
- $IMFILES > $D${libdir}/gtk-2.0/2.10.0/immodules.cache 2>/dev/null &&
- sed -i -e "s:$D::" $D${libdir}/gtk-2.0/2.10.0/immodules.cache
- fi
- if [ -x $D${bindir}/gtk-query-immodules-3.0 ]; then
- IMFILES=$(ls $D${libdir}/gtk-3.0/*/immodules/*.so)
- ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-3.0')} \
- $IMFILES > $D${libdir}/gtk-3.0/3.0.0/immodules.cache 2>/dev/null &&
- sed -i -e "s:$D::" $D${libdir}/gtk-3.0/3.0.0/immodules.cache
- fi
-
- [ $? -ne 0 ] && exit 1
- exit 0
-fi
-if [ ! -z `which gtk-query-immodules-2.0` ]; then
- gtk-query-immodules-2.0 > ${libdir}/gtk-2.0/2.10.0/immodules.cache
-fi
-if [ ! -z `which gtk-query-immodules-3.0` ]; then
- gtk-query-immodules-3.0 > ${libdir}/gtk-3.0/3.0.0/immodules.cache
+ $INTERCEPT_DIR/postinst_intercept update_gtk_immodules_cache ${PKG} \
+ mlprefix=${MLPREFIX} \
+ binprefix=${MLPREFIX} \
+ libdir=${libdir} \
+ libexecdir=${libexecdir} \
+ base_libdir=${base_libdir} \
+ bindir=${bindir}
+else
+ if [ ! -z `which gtk-query-immodules-2.0` ]; then
+ gtk-query-immodules-2.0 > ${libdir}/gtk-2.0/2.10.0/immodules.cache
+ fi
+ if [ ! -z `which gtk-query-immodules-3.0` ]; then
+ gtk-query-immodules-3.0 > ${libdir}/gtk-3.0/3.0.0/immodules.cache
+ fi
fi
}
gtk_immodule_cache_postrm() {
if [ "x$D" != "x" ]; then
- if [ -x $D${bindir}/gtk-query-immodules-2.0 ]; then
- IMFILES=$(ls $D${libdir}/gtk-2.0/*/immodules/*.so)
- ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-2.0')} \
- $IMFILES > $D${libdir}/gtk-2.0/2.10.0/immodules.cache 2>/dev/null &&
- sed -i -e "s:$D::" $D${libdir}/gtk-2.0/2.10.0/immodules.cache
- fi
- if [ -x $D${bindir}/gtk-query-immodules-3.0 ]; then
- IMFILES=$(ls $D${libdir}/gtk-3.0/*/immodules/*.so)
- ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-3.0')} \
- $IMFILES > $D${libdir}/gtk-3.0/3.0.0/immodules.cache 2>/dev/null &&
- sed -i -e "s:$D::" $D${libdir}/gtk-3.0/3.0.0/immodules.cache
- fi
-
- [ $? -ne 0 ] && exit 1
- exit 0
-fi
-if [ ! -z `which gtk-query-immodules-2.0` ]; then
- gtk-query-immodules-2.0 > ${libdir}/gtk-2.0/2.10.0/immodules.cache
-fi
-if [ ! -z `which gtk-query-immodules-3.0` ]; then
- gtk-query-immodules-3.0 > ${libdir}/gtk-3.0/3.0.0/immodules.cache
+ $INTERCEPT_DIR/postinst_intercept update_gtk_immodules_cache ${PKG} \
+ mlprefix=${MLPREFIX} \
+ binprefix=${MLPREFIX} \
+ libdir=${libdir} \
+ libexecdir=${libexecdir} \
+ base_libdir=${base_libdir} \
+ bindir=${bindir}
+else
+ if [ ! -z `which gtk-query-immodules-2.0` ]; then
+ gtk-query-immodules-2.0 > ${libdir}/gtk-2.0/2.10.0/immodules.cache
+ fi
+ if [ ! -z `which gtk-query-immodules-3.0` ]; then
+ gtk-query-immodules-3.0 > ${libdir}/gtk-3.0/3.0.0/immodules.cache
+ fi
fi
}
diff --git a/scripts/postinst-intercepts/update_gtk_immodules_cache b/scripts/postinst-intercepts/update_gtk_immodules_cache
new file mode 100644
index 00000000000..e2b9ff74382
--- /dev/null
+++ b/scripts/postinst-intercepts/update_gtk_immodules_cache
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+if [ -x $D${bindir}/gtk-query-immodules-2.0 ]; then
+ PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
+ $D/${bindir}/gtk-query-immodules-2.0 \
+ > $D${libdir}/gtk-2.0/2.10.0/immodules.cache &&
+ sed -i -e "s:$D::" $D${libdir}/gtk-2.0/2.10.0/immodules.cache
+ chown root:root $D${libdir}/gtk-2.0/2.10.0/immodules.cache
+fi
+if [ -x $D${bindir}/gtk-query-immodules-3.0 ]; then
+ PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
+ $D/${bindir}/gtk-query-immodules-3.0 \
+ > $D${libdir}/gtk-3.0/3.0.0/immodules.cache &&
+ sed -i -e "s:$D::" $D${libdir}/gtk-3.0/3.0.0/immodules.cache
+ chown root:root $D${libdir}/gtk-3.0/3.0.0/immodules.cache
+fi
--
2.16.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 4/4] sysvinit-inittab: do not use 'exit 1' to postpone to first boot
2018-05-01 18:06 [PATCH 1/4] lib/oe/package_manager: turn postinst failure warnings into bitbake failures Alexander Kanavin
2018-05-01 18:06 ` [PATCH 2/4] gtk+: do not look into $HOME when looking for modules Alexander Kanavin
2018-05-01 18:06 ` [PATCH 3/4] gtk-immodules-cache.bbclass: convert cache creation to postinst_intercept mechanism Alexander Kanavin
@ 2018-05-01 18:06 ` Alexander Kanavin
2018-05-01 18:32 ` ✗ patchtest: failure for "lib/oe/package_manager: turn p..." and 3 more Patchwork
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Kanavin @ 2018-05-01 18:06 UTC (permalink / raw)
To: openembedded-core
Instead, first check if we need to do anything at all during first boot,
and if so, either postpone to first boot via pkg_postinst_ontarget()
when running on host, or run the necessary setup code when running on target.
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
---
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
index 5b9c422cafa..8585a418ab8 100644
--- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -53,8 +53,15 @@ EOF
}
pkg_postinst_${PN} () {
+# run this on host and on target
+if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
+ exit 0
+fi
+}
+
+pkg_postinst_ontarget_${PN} () {
# run this on the target
-if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
+if [ -e /proc/consoles ]; then
tmp="${SERIAL_CONSOLES_CHECK}"
for i in $tmp
do
@@ -68,11 +75,7 @@ if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
done
kill -HUP 1
else
- if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
- exit 0
- else
- exit 1
- fi
+ exit 1
fi
}
--
2.16.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* ✗ patchtest: failure for "lib/oe/package_manager: turn p..." and 3 more
2018-05-01 18:06 [PATCH 1/4] lib/oe/package_manager: turn postinst failure warnings into bitbake failures Alexander Kanavin
` (2 preceding siblings ...)
2018-05-01 18:06 ` [PATCH 4/4] sysvinit-inittab: do not use 'exit 1' to postpone to first boot Alexander Kanavin
@ 2018-05-01 18:32 ` Patchwork
3 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-05-01 18:32 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: openembedded-core
== Series Details ==
Series: "lib/oe/package_manager: turn p..." and 3 more
Revision: 1
URL : https://patchwork.openembedded.org/series/11957/
State : failure
== Summary ==
Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:
* Issue Upstream-Status is in incorrect format [test_upstream_status_presence_format]
Suggested fix Fix Upstream-Status format in 0001-Do-not-look-into-HOME-when-looking-for-gtk-modules.patch
Current Upstream-Status: Inapproriate [gtk2 is in maintenance mode]
Standard format Upstream-Status: <Valid status>
Valid status Pending, Accepted, Backport, Denied, Inappropriate [reason], Submitted [where]
If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).
---
Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-01 18:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-01 18:06 [PATCH 1/4] lib/oe/package_manager: turn postinst failure warnings into bitbake failures Alexander Kanavin
2018-05-01 18:06 ` [PATCH 2/4] gtk+: do not look into $HOME when looking for modules Alexander Kanavin
2018-05-01 18:06 ` [PATCH 3/4] gtk-immodules-cache.bbclass: convert cache creation to postinst_intercept mechanism Alexander Kanavin
2018-05-01 18:06 ` [PATCH 4/4] sysvinit-inittab: do not use 'exit 1' to postpone to first boot Alexander Kanavin
2018-05-01 18:32 ` ✗ patchtest: failure for "lib/oe/package_manager: turn p..." and 3 more Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox