ca-certificates: run postinst script only for -target package
PATCH 1/1 ca-certificates: run postinst script only for -target package
Nativesdk package has a special arrangement where the same thing is done in do_install(). It was assumed (in the comment) that postinsts don't run when installing nativesdk packages, but this was incorrect: they are run, but any failures were previously silently ignored. Now this missing failure reporting has been fixed, and so we get to see the failures.
--- meta/recipes-support/ca-certificates/ca-certificates_20170717.bb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-support/ca-certificates/ca-certificates_20170717.bb +3 -2
@@ -64,13 +64,14 @@ do_install_append_class-target () { ${D}${mandir}/man8/update-ca-certificates.8 } -pkg_postinst_${PN} () { +pkg_postinst_${PN}_class-target () { SYSROOT="$D" $D${sbindir}/update-ca-certificates } CONFFILES_${PN} += "${sysconfdir}/ca-certificates.conf" -# Postinsts don't seem to be run for nativesdk packages when populating SDKs. +# Rather than make a postinst script that works for both target and nativesdk, +# we just run update-ca-certificate from do_install() for nativesdk. CONFFILES_${PN}_append_class-nativesdk = " ${sysconfdir}/ssl/certs/ca-certificates.crt" do_install_append_class-nativesdk () { SYSROOT="${D}${SDKPATHNATIVE}" ${D}${sbindir}/update-ca-certificates
Signature · 1 line
2.16.1
Do you already have similar patch for nativesdk-shadow somewhere?
One thing I've noticed with new set -e is that you get only one failure per run, which is expected.
Just when I had 8 different update-alternatives call failing in busybox postinst (due to different defconfig we use) I would appreciate to see all errors in one go. But I don't see how to "improve" this easily, running it twice with and without "set -e" would probably cause more confusion than helping with too many errors in one postinst.
It would be great if the output of postinst script could be extracted to separate file or the warning provided some simple way to re-execute just the failing postinst manually (e.g. with devtool). Currently I do it manually, which I cannot recommend to anyone (basically removing rm_work from INHERIT to keep rootfs after do_rootfs, then jumping to rootfs directory, exporting D and running the postinst from OPKGLIBDIR).
Regards,
Quoted 49 lines · Alexander Kanavin
Nativesdk package has a special arrangement where the same thing is done in
do_install(). It was assumed (in the comment) that postinsts don't run when
installing nativesdk packages, but this was incorrect: they are run, but any failures were previously silently ignored. Now this missing failure reporting has
been fixed, and so we get to see the failures.Signed-off-by Alexander Kanavin <[email protected]>--- meta/recipes-support/ca-certificates/ca-certificates_20170717.bb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)(quoted diff) +0
-020170717.bb b/meta/recipes-support/ca-certificates/ca-certificates_ 20170717.bb
index52a1a07f68c..51af72e79a3100644meta/recipes-support/ca-certificates/ca-certificates_20170717.bb +1
-2@@ -64,13 +64,14 @@ do_install_append_class-target () { ${D}${mandir}/man8/update-ca-certificates.8 } -pkg_postinst_${PN} () { +pkg_postinst_${PN}_class-target () { SYSROOT="$D" $D${sbindir}/update-ca-certificates } CONFFILES_${PN} += "${sysconfdir}/ca-certificates.conf" -# Postinsts don't seem to be run for nativesdk packages when populatingSDKs.
+# Rather than make a postinst script that works for both target and nativesdk,
+# we just run update-ca-certificate fromdo_install()for nativesdk.
CONFFILES_${PN}_append_class-nativesdk = " ${sysconfdir}/ssl/certs/ca-
certificates.crt"do_install_append_class-nativesdk () { SYSROOT="${D}${SDKPATHNATIVE}" ${D}${sbindir}/update-ca-certificates--
2.16.1--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Quoted 1 line · Martin Jansa
Do you already have similar patch for nativesdk-shadow somewhere?
Nope. Hopefully the maintainer of the shadow recipe can step in?
Quoted 1 line
It would be great if the output of postinst script could be extracted to separate file or the warning provided some simple way to re-execute just the failing postinst manually (e.g. with devtool). Currently I do it manually, which I cannot recommend to anyone (basically removing
rm_workfrom INHERIT to keep rootfs afterdo_rootfs, then jumping to rootfs directory, exporting D and running the postinst from OPKGLIBDIR).
For rpm, setting ROOTFS_RPM_DEBUG will execute the postinst with -x and log the lines and their output to log.do_rootfs. But you're right - care to file a bug?
Alex
PATCH 1/2 gio-module-cache.bbclass: disable update_gio_module_cache postinst script for nativesdk
* it fails to find postinst_intercept dir:
NOTE: IMAGE/1.0.0-1-r3/sdk/image///usr/lib/opkg/info/nativesdk-libglib-2.0-0.postinst: 4:
IMAGE/1.0.0-1-r3/sdk/image///usr/lib/opkg/info/nativesdk-libglib-2.0-0.postinst:
IMAGE/1.0.0-1-r3/intercept_scripts/postinst_intercept: not found
--- meta/classes/gio-module-cache.bbclass | 1 + 1 file changed, 1 insertion(+)
meta/classes/gio-module-cache.bbclass +1 -0
@@ -2,6 +2,7 @@ PACKAGE_WRITE_DEPS += "qemu-native" inherit qemu GIO_MODULE_PACKAGES ??= "${PN}" +GIO_MODULE_PACKAGES_class-nativesdk = "" gio_module_cache_common() { if [ "x$D" != "x" ]; then
Signature · 1 line
2.15.1
PATCH 2/2 shadow.inc: run postinst only for target
* fails for nativesdk-shadow with:
pwconv: /etc/passwd.29063: No such file or directory
pwconv: cannot lock /etc/passwd; try again later.
--- meta/recipes-extended/shadow/shadow.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-extended/shadow/shadow.inc +1 -1
@@ -190,7 +190,7 @@ ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1" ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8" PACKAGE_WRITE_DEPS += "shadow-native" -pkg_postinst_${PN} () { +pkg_postinst_${PN}_class-target () { if [ "x$D" != "x" ]; then rootarg="--root $D" else
Signature · 1 line
2.15.1
Re: [PATCH 1/2] gio-module-cache.bbclass: disable update_gio_module_cache postinst script for nativesdk
In reply to Martin JansaCan you file a bug for this? Probably best to fix instead of working around, as this leaves gio modules broken.
Ross
Quoted 34 lines · Martin Jansa
* it fails to find
postinst_interceptdir:
NOTE: IMAGE/1.0.0-1-r3/sdk/image///usr/lib/opkg/info/nativesdk-libglib-2.0-0.postinst:
4:IMAGE/1.0.0-1-r3/sdk/image///usr/lib/opkg/info/nativesdk-libglib-2.0-0.postinst:
IMAGE/1.0.0-1-r3/intercept_scripts/postinst_intercept: not foundSigned-off-by Martin Jansa <[email protected]>--- meta/classes/gio-module-cache.bbclass | 1 + 1 file changed, 1 insertion(+)meta/classes/gio-module-cache.bbclass +1
-1@@ -2,6 +2,7 @@ PACKAGE_WRITE_DEPS += "qemu-native" inherit qemu GIO_MODULE_PACKAGES ??= "${PN}" +GIO_MODULE_PACKAGES_class-nativesdk = "" gio_module_cache_common() { if [ "x$D" != "x" ]; then --2.15.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [PATCH 1/2] gio-module-cache.bbclass: disable update_gio_module_cache postinst script for nativesdk
Quoted 1 line · Ross
Can you file a bug for this? Probably best to fix instead of working around, as this leaves gio modules broken.
I also wonder if the shadow recipe's postinst needs to be fixed properly (instead of removing it altogether for nativesdk). On the other hand these two have been broken for a long time, and no one noticed, so maybe they don't need working nativesdk postinst at all.
Alex
Re: [PATCH 1/2] gio-module-cache.bbclass: disable update_gio_module_cache postinst script for nativesdk
I've tried to remove this from my sumo build and noticed that it's still failing, the log shows:
NOTE: Running intercept scripts:
NOTE: > Executing update_gio_module_cache-nativesdk intercept ...
WARNING: The postinstall intercept hook 'update_gio_module_cache-nativesdk'
failed, details in my-sdk/1.0.0-1-r3/temp/log.do_populate_sdk
NOTE: Exit code 255. Output:
my-sdk/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec/nativesdk-gio-querymodules:
Invalid ELF image for this architecture
unfortunately the workdir is again gone already, I'll check if it happens with latest master as well and will try to keep the workdir if rm_work isn't faster than me.
Cheers,
Quoted 11 lines · Alexander Kanavin
Quoted 2 lines · Ross
Can you file a bug for this? Probably best to fix instead of working around, as this leaves gio modules broken.
I also wonder if the shadow recipe's postinst needs to be fixed properly (instead of removing it altogether for nativesdk). On the other hand these two have been broken for a long time, and no one noticed, so maybe they don't need working nativesdk postinst at all.
Alex
PATCH 1/1 gio-module-cache.bbclass: disable update_gio_module_cache postinst script for nativesdk
* it fails to execute native binary inside the qemu usermode for target arch as shown e.g. for qemuarm and raspberrypi3 build on x86_64 builder:
qemuarm-webos-linux-gnueabi/webos-ndk-basic/1.0.0-1-r3/temp/log.do_populate_sdk:
NOTE: > Executing update_gio_module_cache-nativesdk intercept ...
WARNING: The postinstall intercept hook 'update_gio_module_cache-nativesdk' failed, details in log.do_populate_sdk qemuarm-webos-linux-gnueabi/webos-ndk-basic/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec/nativesdk-gio-querymodules: Invalid ELF image for this architecture
qemuarm-webos-linux-gnueabi/my-sdk/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/armv5te-webos-linux-gnueabi/usr/libexec/gio-querymodules:
ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, BuildID[sha1]=5b7f0c77e8ee9587f4e02eaf1d54a1e230e539bd, stripped
qemuarm-webos-linux-gnueabi/my-sdk/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec/nativesdk-gio-querymodules:
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, BuildID[sha1]=eeded124aa53c7ac997dd6326e5d9b75e8d9c43d, stripped qemuarm-webos-linux-gnueabi/webos-ndk-basic/1.0.0-1-r3/intercept_scripts-ac629c4abfb418548877d2a412f7e552bd21e66f0b645b8875dc56ed9f0df40d/update_gio_module_cache-nativesdk
bindir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/bin base_libdir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/lib libexecdir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec libdir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/lib
binprefix=nativesdk-
set -e
PSEUDO_UNLOAD=1 qemuwrapper -L $D -E
LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
$D${libexecdir}/${binprefix}gio-querymodules$D${libdir}/gio/modules/
[ ! -e $D${libdir}/gio/modules/giomodule.cache ] ||
chown root:root $D${libdir}/gio/modules/giomodule.cache raspberrypi3-webos-linux-gnueabi/webos-ndk-basic/1.0.0-1-r3/temp/log.do_populate_sdk:
NOTE: > Executing update_gio_module_cache-nativesdk intercept ...
WARNING: The postinstall intercept hook 'update_gio_module_cache-nativesdk' failed, details in log.do_populate_sdk raspberrypi3-webos-linux-gnueabi/webos-ndk-basic/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec/nativesdk-gio-querymodules: Invalid ELF image for this architecture
raspberrypi3-webos-linux-gnueabi/my-sdk/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/cortexa7t2hf-neon-vfpv4-webos-linux-gnueabi/usr/libexec/gio-querymodules:
ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, BuildID[sha1]=5267f1e542b014522af5ab54443d768ba6b47351, stripped
raspberrypi3-webos-linux-gnueabi/my-sdk/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec/nativesdk-gio-querymodules:
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, BuildID[sha1]=eeded124aa53c7ac997dd6326e5d9b75e8d9c43d, stripped raspberrypi3-webos-linux-gnueabi/webos-ndk-basic/1.0.0-1-r3/intercept_scripts-a4270d1427cca0a9d172dbcd8dc262957c8e081c657e1123cc9ad551d65f22ea/update_gio_module_cache-nativesdk
bindir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/bin base_libdir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/lib libexecdir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec libdir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/lib
binprefix=nativesdk-
set -e
PSEUDO_UNLOAD=1 qemuwrapper -L $D -E
LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
$D${libexecdir}/${binprefix}gio-querymodules$D${libdir}/gio/modules/
[ ! -e $D${libdir}/gio/modules/giomodule.cache ] ||
chown root:root $D${libdir}/gio/modules/giomodule.cache* it isn't needed in master, because nativesdk postinst were fixed by:
commit d10fd6ae3fe46290c6e3a5250878966d9f12ca3f
Author: Alexander Kanavin <[email protected]>
Date: Mon Jun 11 16:38:20 2018 +0300
Subject: qemuwrapper-cross: enable multilib and nativesdk variants of the script
* which depends on:
commit d4f5b8e26acaadffac6df10f9a9d9ebfb3045f5f
Author: Alexander Kanavin <[email protected]>
Date: Mon Jun 11 16:38:17 2018 +0300
Subject: gtk-immodules-cache.bbclass: convert cache creation to postinst_intercept mechanism
* backporting just these 2 isn't enough, we would need to backport
something else as well, otherwise it fails with:
webos-ndk-basic/1.0.0-1-r3/intercept_scripts-a4270d1427cca0a9d172dbcd8dc262957c8e081c657e1123cc9ad551d65f22ea/update_gio_module_cache-nativesdk:
nativesdk-qemuwrapper: not found
and at this point I would rather safely disable it for nativesdk in sumo instead of backporting bunch more commits to stable branch
--- meta/classes/gio-module-cache.bbclass | 1 + 1 file changed, 1 insertion(+)
meta/classes/gio-module-cache.bbclass +1 -0
@@ -2,6 +2,7 @@ PACKAGE_WRITE_DEPS += "qemu-native" inherit qemu GIO_MODULE_PACKAGES ??= "${PN}" +GIO_MODULE_PACKAGES_class-nativesdk = "" gio_module_cache_common() { if [ "x$D" != "x" ]; then
Signature · 1 line
2.17.1
Re: [sumo][PATCH] gio-module-cache.bbclass: disable update_gio_module_cache postinst script for nativesdk
FWIW, I am fine with this.
Alex
2018-07-20 18:03 GMT+02:00 Martin Jansa <[email protected]>:
Quoted 102 lines
* it fails to execute native binary inside the qemu usermode for target arch as shown e.g. for qemuarm and raspberrypi3 build on
x86_64builder:qemuarm-webos-linux-gnueabi/webos-ndk-basic/1.0.0-1-r3/temp/log.do_populate_sdk:
NOTE: > Executing update_gio_module_cache-nativesdk intercept ...
WARNING: The postinstall intercept hook 'update_gio_module_cache-nativesdk' failed, details in log.do_populate_sdk qemuarm-webos-linux-gnueabi/webos-ndk-basic/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec/nativesdk-gio-querymodules: Invalid ELF image for this architectureqemuarm-webos-linux-gnueabi/my-sdk/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/armv5te-webos-linux-gnueabi/usr/libexec/gio-querymodules:
ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, BuildID[sha1]=5b7f0c77e8ee9587f4e02eaf1d54a1e230e539bd, stripped qemuarm-webos-linux-gnueabi/my-sdk/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec/nativesdk-gio-querymodules: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, BuildID[sha1]=eeded124aa53c7ac997dd6326e5d9b75e8d9c43d, strippedqemuarm-webos-linux-gnueabi/webos-ndk-basic/1.0.0-1-r3/intercept_scripts-ac629c4abfb418548877d2a412f7e552bd21e66f0b645b8875dc56ed9f0df40d/update_gio_module_cache-nativesdk
bindir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/bin base_libdir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/lib libexecdir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec libdir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/lib
binprefix=nativesdk-set -e
PSEUDO_UNLOAD=1 qemuwrapper -L $D -E
LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \ $D${libexecdir}/${binprefix}gio-querymodules$D${libdir}/gio/modules/
[ ! -e $D${libdir}/gio/modules/giomodule.cache ] ||
chown root:root $D${libdir}/gio/modules/giomodule.cacheraspberrypi3-webos-linux-gnueabi/webos-ndk-basic/1.0.0-1-r3/temp/log.do_populate_sdk:
NOTE: > Executing update_gio_module_cache-nativesdk intercept ...
WARNING: The postinstall intercept hook 'update_gio_module_cache-nativesdk' failed, details in log.do_populate_sdk raspberrypi3-webos-linux-gnueabi/webos-ndk-basic/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec/nativesdk-gio-querymodules: Invalid ELF image for this architectureraspberrypi3-webos-linux-gnueabi/my-sdk/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/cortexa7t2hf-neon-vfpv4-webos-linux-gnueabi/usr/libexec/gio-querymodules:
ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, BuildID[sha1]=5267f1e542b014522af5ab54443d768ba6b47351, stripped raspberrypi3-webos-linux-gnueabi/my-sdk/1.0.0-1-r3/sdk/image/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec/nativesdk-gio-querymodules: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, BuildID[sha1]=eeded124aa53c7ac997dd6326e5d9b75e8d9c43d, strippedraspberrypi3-webos-linux-gnueabi/webos-ndk-basic/1.0.0-1-r3/intercept_scripts-a4270d1427cca0a9d172dbcd8dc262957c8e081c657e1123cc9ad551d65f22ea/update_gio_module_cache-nativesdk
bindir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/bin base_libdir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/lib libexecdir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/libexec libdir=/opt/webos-sdk-x86_64/7.0~s14/sysroots/x86_64-webossdk-linux/usr/lib
binprefix=nativesdk-set -e
PSEUDO_UNLOAD=1 qemuwrapper -L $D -E
LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \ $D${libexecdir}/${binprefix}gio-querymodules$D${libdir}/gio/modules/
[ ! -e $D${libdir}/gio/modules/giomodule.cache ] ||
chown root:root $D${libdir}/gio/modules/giomodule.cache* it isn't needed in master, because nativesdk postinst were fixed by:
commitd10fd6ae3fe46290c6e3a5250878966d9f12ca3f
Author: Alexander Kanavin <[email protected]>
Date: Mon Jun 11 16:38:20 2018 +0300
Subject: qemuwrapper-cross: enable multilib and nativesdk variants of the script
* which depends on:
commitd4f5b8e26acaadffac6df10f9a9d9ebfb3045f5f
Author: Alexander Kanavin <[email protected]>
Date: Mon Jun 11 16:38:17 2018 +0300
Subject: gtk-immodules-cache.bbclass: convert cache creation topostinst_interceptmechanism* backporting just these 2 isn't enough, we would need to backport
something else as well, otherwise it fails with:
webos-ndk-basic/1.0.0-1-r3/intercept_scripts-a4270d1427cca0a9d172dbcd8dc262957c8e081c657e1123cc9ad551d65f22ea/update_gio_module_cache-nativesdk:
nativesdk-qemuwrapper: not foundand at this point I would rather safely disable it for nativesdk in sumo instead of backporting bunch more commits to stable branch
Signed-off-by Martin Jansa <[email protected]>--- meta/classes/gio-module-cache.bbclass | 1 + 1 file changed, 1 insertion(+)meta/classes/gio-module-cache.bbclass +1
-1@@ -2,6 +2,7 @@ PACKAGE_WRITE_DEPS += "qemu-native" inherit qemu GIO_MODULE_PACKAGES ??= "${PN}" +GIO_MODULE_PACKAGES_class-nativesdk = "" gio_module_cache_common() { if [ "x$D" != "x" ]; then --2.17.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core