Re: dunfell: pkgconfig-native build fails in existing Yocto BSP
Richard Purdie
On Mon, 2021-10-25 at 06:50 +0000, Matthias Klein wrote:
Hello,I just backported a uninative upgrade to dunfell which should address this issue. Cheers, Richard
|
|
Re: dunfell: pkgconfig-native build fails in existing Yocto BSP
Ahmed Hossam
Hello,
We also have the same issue with similar in-docker builds, a workaround for the issue is mentioned here: https://bugzilla.yoctoproject.org/show_bug.cgi?id=14519 until the fix is backported to dunfell. Best Regards, Ahmed Hossam
|
|
Konrad Weihmann <kweihmann@...>
No there isn't - with the yocto project you can build your own distribution not mimic other already available distributions.
toggle quoted messageShow quoted text
If you want to build Ubuntu you have to ask canonical.
On 25.10.21 09:41, keyurthumar0402@... wrote:
I want to build ubuntu distro using yocto.
|
|
keyurthumar0402@...
I want to build ubuntu distro using yocto. Is there a way for that ?
|
|
Re: How to enable graphics acceleration on qemux86-64?
Alexander Kanavin
On Sun, 24 Oct 2021 at 23:29, Manuel Wagesreither <ManWag@...> wrote:
Cheers :) you should also try this on bleeding edge master, it should work the same as hardknott, but if there are issues, you can make and send patches to fix them. Alex
|
|
dunfell: pkgconfig-native build fails in existing Yocto BSP
Matthias Klein
Hello,
our dunfell based yocto no longer builds in the pkgconfig-native section. I tried it in an Ubuntu 18.04 and Debian 10 Docker container. The build always aborts as follows: checking thread related cflags... -D_REENTRANT | checking for pthread_create/pthread_join... no | checking for pthread_create/pthread_join in -lpthread... no | checking for pthread_create/pthread_join in -lpthread32... no | checking for pthread_create/pthread_join in -lpthreads... no | checking for pthread_create/pthread_join in -lthread... no | configure: error: I can't find the libraries for the thread implementation | posix. Please choose another thread implementation or | provide information on your thread implementation. | configure: error: ../../git/glib/configure failed for glib | NOTE: The following config.log files may provide further information. | NOTE: /work/yocto-optimeas/build/tmp/work/x86_64-linux/pkgconfig-native/0.29.2+gitAUTOINC+edf8e6f0ea-r0/build/glib/config.log /work/yocto-optimeas/build/tmp/work/x86_64-linux/pkgconfig-native/0.29.2+gitAUTOINC+edf8e6f0ea-r0/build/config.log | ERROR: configure failed | WARNING: /work/yocto-optimeas/build/tmp/work/x86_64-linux/pkgconfig-native/0.29.2+gitAUTOINC+edf8e6f0ea-r0/temp/run.do_configure.243679:1 exit 1 from 'exit 1' | ERROR: Execution of '/work/yocto-optimeas/build/tmp/work/x86_64-linux/pkgconfig-native/0.29.2+gitAUTOINC+edf8e6f0ea-r0/temp/run.do_configure.243679' failed with exit code 1 ERROR: Task (virtual:native:/work/yocto-optimeas/yocto/poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_configure) failed with exit code '1' ERROR: ninja-native-1.10.0-r0 do_compile: Execution of '/work/yocto-optimeas/build/tmp/work/x86_64-linux/ninja-native/1.10.0-r0/temp/run.do_compile.319277' failed with exit code 1 ERROR: Logfile of failure stored in: /work/yocto-optimeas/build/tmp/work/x86_64-linux/ninja-native/1.10.0-r0/temp/log.do_compile.319277 Log data follows: | DEBUG: Executing shell function do_compile | ninja: fatal: posix_spawn: Operation not permitted | bootstrapping ninja... | wrote build.ninja. | bootstrap complete. rebuilding... | Traceback (most recent call last): | File "./configure.py", line 709, in <module> | subprocess.check_call(rebuild_args) | File "/usr/lib/python3.7/subprocess.py", line 347, in check_call | raise CalledProcessError(retcode, cmd) | subprocess.CalledProcessError: Command '['./ninja']' returned non-zero exit status 1. | WARNING: /work/yocto-optimeas/build/tmp/work/x86_64-linux/ninja-native/1.10.0-r0/temp/run.do_compile.319277:1 exit 1 from 'python3 ./configure.py --bootstrap' | ERROR: Execution of '/work/yocto-optimeas/build/tmp/work/x86_64-linux/ninja-native/1.10.0-r0/temp/run.do_compile.319277' failed with exit code 1 ERROR: Task (virtual:native:/work/yocto-optimeas/yocto/poky/meta/recipes-devtools/ninja/ninja_1.10.0.bb:do_compile) failed with exit code '1' I also tried using the commits from dunfell-next in the poky repo as a test. But then the build doesn't even start and I get the following error: ERROR: ParseError at /work/yocto-optimeas/yocto/meta-openembedded/meta-oe/recipes-extended/libimobiledevice/libplist_2.1.0.bb:9: Could not inherit file classes/python3targetconfig.bbclass | ETA: --:--:-- Does anyone have any idea what is causing this? does anyone have the same behavior? Many greetings, Matthias
|
|
Re: How to enable graphics acceleration on qemux86-64?
Manuel Wagesreither
Hi all, hi Alexander, I solved my problems. Things work fine now. Below I'm summing things up as documentation for myself and also others in case this pops up in someones search query. Am So, 17. Okt 2021, um 13:32, schrieb Alexander Kanavin:
You were are right. In hindsight, your initial post contained everything necessary. The 'PACKAGECONFIG_append_pn-<package-name>' variables tell everything necessary. I couldn't make sense of what I was reading at the beginning. DUNFELL: ========= Summing things up, here's what I need on Dunfell for `runqemu kvm slirp sdl gl`. * DISTRO_FEATURES opengl * 'weston-xwayland' in IMAGE_INSTALL. * 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl gtk+ virglrenderer glx"'. (Having opengl in DISTRO_FEATURES puts opengl in libsdl2-native PACKAGECONFIG automatically.) It's interesting the gtk+ part was necessary even for `runqemu kvm slirp sdl gl`. Thought gtk+ and sdl are different solutions for the same problem. Without gtk+, it would fail with ``` qemu-system-x86_64: ../libepoxy-1.5.4/src/dispatch_common.c:863: epoxy_get_proc_address: Assertion `0 && "Couldn't find current GLX or EGL context.\n"' ``` Can't make sense of that and won't investigate any further. HARDKNOTT: ============ Here's what I need on Hardknott: As Alexander wrote, with Hardknott explicit configuration is no longer necessary if DISTRO_FEATURES has opengl. Think it's due to following patch: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=7561eb32a01f7990ad4a4606ac97ebe2a659e029 Hence I need: * DISTRO_FEATURES opengl * 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl". * 'weston-xwayland' in IMAGE_INSTALL. * /etc/systemd/system/default.target is a symlink to multi-user.target and shadows /lib/systemd/system/default.target which is a symlink to graphical.target. Hence, one must start graphical.target manually. * Need to adapt weston.service to start weston with --modules=xwayland.so. Perhaps this helps anyone. Thanks again for your help, Alexander. Manuel
|
|
Re: [meta-qt4]
On Sat, 23 Oct 2021, at 00:30, Khem Raj wrote:
Hi JaredCc'd Paul Eggleton's current email. Perhaps the readme file in meta-qt4 needs updating. Thanks, -- Paul Barker https://pbarker.dev/
|
|
Re: rebuilding perf fails after cleanall
chuck kamas
Bruce,
I am running a 8 month old version of poky Dunfell, commit
e32d854e. I can see the code in perf.bb where it copies over the
kernel code to its directory, so I think that I have the patch you
mentioned. I have been trying for the past few hours to reproduce
the issue in the x86 poky build, and have not come up with the
magic method. I'll keep on trying to simplify the issue to be
replaceable in the version I am using and the latest dunfell.
Chuck
On 10/22/21 10:57 AM, Bruce Ashfield
wrote:
On Fri, Oct 22, 2021 at 1:23 PM chuck kamas via lists.yoctoproject.org <chuckkamas=yahoo.com@...> wrote:Hi all, I am trying to model a new recipe off of perf.bb to compile the usbip helper kernel code. I have been having issues with the work-shared/../kernel-source directory being empty, so I went back to the perf recipie and tried: bitbake perf -c cleanall bitbake perfWhat release are you using ? We did have some issues with this in the past, but they should all be accounted for now. I can bitbake perf, bitbake -c cleanall perf; bitbake perf perf makes a copy of the kernel-sharel tools directory (it didn't in the past), so it should be safe for any combinations like that. BruceI get the same error about path does not exist and the work-shared kernel-source directory being empty. Is perf.bb only executable in the context of a global rebuild? Chuck-- - Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
|
|
Re: [meta-qt4]
Hi Jared
On 10/22/21 2:40 PM, jared_terry@... wrote: How do I get meta-qt4 patches applied? I tried to contact the maintainer listed and the email comes back undeliverable. I have the needed patch but now way to deliver it. Please see [1] usually sending to the right mailing list and CCing the maintainers is the usual way to send patches [1] https://git.yoctoproject.org/cgit/cgit.cgi/meta-qt4/tree/README
|
|
Re: [meta-qt4]
jared_terry@...
Here is the patch if anybody is interested, should have attached that the first time.
|
|
[meta-qt4]
jared_terry@...
How do I get meta-qt4 patches applied? I tried to contact the maintainer listed and the email comes back undeliverable. I have the needed patch but now way to deliver it.
|
|
Re: rebuilding perf fails after cleanall
Bruce Ashfield
On Fri, Oct 22, 2021 at 1:23 PM chuck kamas via lists.yoctoproject.org
<chuckkamas=yahoo.com@...> wrote: What release are you using ? We did have some issues with this in the past, but they should all be accounted for now. I can bitbake perf, bitbake -c cleanall perf; bitbake perf perf makes a copy of the kernel-sharel tools directory (it didn't in the past), so it should be safe for any combinations like that. Bruce
-- - Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
|
|
rebuilding perf fails after cleanall
chuck kamas
Hi all,
I am trying to model a new recipe off of perf.bb to compile the usbip helper kernel code. I have been having issues with the work-shared/../kernel-source directory being empty, so I went back to the perf recipie and tried: bitbake perf -c cleanall bitbake perf I get the same error about path does not exist and the work-shared kernel-source directory being empty. Is perf.bb only executable in the context of a global rebuild? Chuck
|
|
[meta-security][PATCH] Parsec service. Update PACKAGECONFIG definitions and README.md
Anton Antonov
Signed-off-by: Anton Antonov <Anton.Antonov@...>
--- meta-parsec/README.md | 23 +++++++++++++++---- .../parsec-service/parsec-service_0.8.1.bb | 10 ++++---- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/meta-parsec/README.md b/meta-parsec/README.md index aeb48a6..c5635d3 100644 --- a/meta-parsec/README.md +++ b/meta-parsec/README.md @@ -1,8 +1,7 @@ meta-parsec layer ============== -This layer contains recipes for the Parsec service with Mbed-Crypto, -Pkcs11 and TPM providers and parsec tools. +This layer contains recipes for the Parsec service and parsec tools. Dependencies ============ @@ -43,9 +42,16 @@ local.conf: IMAGE_INSTALL:append = " parsec-service" - The Parsec service will be deployed into the image built with all the supported -providers and with the default config file from the Parsec repository: + By default the Parsec service will be deployed into the image with +TPM, PKCS11, MBED-CRYPTO and CRYPTOAUTHLIB providers build in +and with the default config file from the Parsec repository: https://github.com/parallaxsecond/parsec/blob/main/config.toml + + You can use PACKAGECONFIG for Parsec servic recipe to define +what providers should be built in. For example, + + PACKAGECONFIG:pn-parsec-service = "TPM" + The default Parsec service config file contains the MbedCrypto provider enabled. The config file needs to be updated to use the Parsec service with other providers like TPM or PKCS11. The required procedures are @@ -80,12 +86,19 @@ manual testing of the Parsec service: to test the Parsec service base functionality: https://www.youtube.com/watch?v=ido0CyUdMHM&list=PLKjl7IFAwc4S7WQqqphCsyy6DPDxJ2Skg&index=4 + The parsec-tool recipe also includes `parsec-cli-tests.sh` script +which runs e2e tests against all providers enabled and configured +in Parsec service. + You can use runqemu to start a VM with a built image file and run manual tests with parsec-tool. +Enabling Parsec providers for manual testing +============================================ + 1. MbedCrypto provider The default Parsec service config file contains the MbedCrypto provider -enabled. No changes required for manual testing. +enabled. No changes required. 2. PKCS11 provider The Software HSM can be used for manual testing of the provider by diff --git a/meta-parsec/recipes-parsec/parsec-service/parsec-service_0.8.1.bb b/meta-parsec/recipes-parsec/parsec-service/parsec-service_0.8.1.bb index b8bfa98..9161872 100644 --- a/meta-parsec/recipes-parsec/parsec-service/parsec-service_0.8.1.bb +++ b/meta-parsec/recipes-parsec/parsec-service/parsec-service_0.8.1.bb @@ -13,15 +13,15 @@ SRC_URI += "crate://crates.io/parsec-service/${PV} \ DEPENDS = "clang-native" PACKAGECONFIG ??= "TPM PKCS11 MBED-CRYPTO CRYPTOAUTHLIB" -PACKAGECONFIG[ALL] = "all-providers,,tpm2-tss libts,libts" -PACKAGECONFIG[TPM] = "tpm-provider,,tpm2-tss" -PACKAGECONFIG[PKCS11] = "pkcs11-provider," +PACKAGECONFIG[ALL] = "all-providers cryptoki/generate-bindings tss-esapi/generate-bindings,,tpm2-tss libts,libts" +PACKAGECONFIG[TPM] = "tpm-provider tss-esapi/generate-bindings,,tpm2-tss" +PACKAGECONFIG[PKCS11] = "pkcs11-provider cryptoki/generate-bindings," PACKAGECONFIG[MBED-CRYPTO] = "mbed-crypto-provider," PACKAGECONFIG[CRYPTOAUTHLIB] = "cryptoauthlib-provider," PACKAGECONFIG[TS] = "trusted-service-provider,,libts,libts" -PARSEC_PROVIDERS = "${@d.getVar('PACKAGECONFIG_CONFARGS',True).replace(' ', ',')}" -CARGO_BUILD_FLAGS += " --features ${PARSEC_PROVIDERS},cryptoki/generate-bindings,tss-esapi/generate-bindings" +PARSEC_FEATURES = "${@d.getVar('PACKAGECONFIG_CONFARGS',True).strip().replace(' ', ',')}" +CARGO_BUILD_FLAGS += " --features ${PARSEC_FEATURES}" inherit systemd SYSTEMD_SERVICE:${PN} = "parsec.service" -- 2.25.1
|
|
[psplash][PATCH] README: Update mailing list address
Pavel Zhukov
From: Pavel Zhukov <pavel.zhukov@...>
Signed-off-by: Pavel Zhukov <pavel.zhukov@...> --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 8779a38..ff36509 100644 --- a/README +++ b/README @@ -25,4 +25,4 @@ When creating patches, please use something like: git format-patch -M -s --subject-prefix=3D'psplash][PATCH' origin =20 When sending patches, please use something like: - git send-email --to yocto@... <generated patch> + git send-email --to yocto@... <generated patch> --=20 2.31.1
|
|
[psplash][PATCH] Add configure options to disable progress bar
Pavel Zhukov
From: Pavel Zhukov <pavel.zhukov@...>
Progress bar can overlap with products logos, added --disable-progress-bar configure option to disable progress bar completely without patching the code. Default behaviour is to show progress bar Signed-off-by: Pavel Zhukov <pavel.zhukov@...> --- configure.ac | 8 ++++++++ psplash-config.h | 5 +++++ psplash.c | 14 ++++++++++---- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 2d836a1..2a7da91 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,14 @@ AS_IF([test x$disable_startup_msg =3D xtrue], [ EXTRA_GCC_FLAGS=3D"$EXTRA_GCC_FLAGS -DPSPLASH_DISABLE_STARTUP_MSG" ]) =20 +AC_ARG_ENABLE([progress-bar], + AS_HELP_STRING([--disable-progress-bar], [Disable progress bar]), + [disable_progress_bar=3Dtrue], + [disable_progress_bar=3Dfalse]) +AS_IF([test x$disable_progress_bar =3D xtrue], [ + EXTRA_GCC_FLAGS=3D"$EXTRA_GCC_FLAGS -DPSPLASH_DISABLE_PROGRESS_BAR" +]) + AC_ARG_ENABLE([img-fullscreen], AS_HELP_STRING([--enable-img-fullscreen], [Enable the logo image in = fullscreen mode)]), [img_fullscreen=3Dtrue], diff --git a/psplash-config.h b/psplash-config.h index 0ba8440..eb90ef3 100644 --- a/psplash-config.h +++ b/psplash-config.h @@ -21,6 +21,11 @@ #define PSPLASH_IMG_FULLSCREEN 0 #endif =20 +/* Bool indicated if the progress bar should be disabled */ +#ifndef PSPLASH_DISABLE_PROGRESS_BAR +#define PSPLASH_SHOW_PROGRESS_BAR 1 +#endif + /* Position of the image split from top edge, numerator of fraction */ #define PSPLASH_IMG_SPLIT_NUMERATOR 5 =20 diff --git a/psplash.c b/psplash.c index 1a56629..ee1af6b 100644 --- a/psplash.c +++ b/psplash.c @@ -61,6 +61,7 @@ psplash_draw_msg (PSplashFB *fb, const char *msg) msg); } =20 +#ifdef PSPLASH_SHOW_PROGRESS_BAR void psplash_draw_progress (PSplashFB *fb, int value) { @@ -95,6 +96,7 @@ psplash_draw_progress (PSplashFB *fb, int value) DBG("value: %i, width: %i, barwidth :%i\n", value,=20 width, barwidth); } +#endif /* PSPLASH_SHOW_PROGRESS_BAR */ =20 static int=20 parse_command (PSplashFB *fb, char *string) @@ -108,20 +110,22 @@ parse_command (PSplashFB *fb, char *string) =20 command =3D strtok(string," "); =20 - if (!strcmp(command,"PROGRESS"))=20 + if (!strcmp(command,"MSG")) { char *arg =3D strtok(NULL, "\0"); =20 if (arg) - psplash_draw_progress (fb, atoi(arg)); + psplash_draw_msg (fb, arg); }=20 - else if (!strcmp(command,"MSG"))=20 + #ifdef PSPLASH_SHOW_PROGRESS_BAR + else if (!strcmp(command,"PROGRESS")) { char *arg =3D strtok(NULL, "\0"); =20 if (arg) - psplash_draw_msg (fb, arg); + psplash_draw_progress (fb, atoi(arg)); }=20 +#endif else if (!strcmp(command,"QUIT"))=20 { return 1; @@ -311,6 +315,7 @@ main (int argc, char** argv) POKY_IMG_ROWSTRIDE, POKY_IMG_RLE_PIXEL_DATA); =20 +#ifdef PSPLASH_SHOW_PROGRESS_BAR /* Draw progress bar border */ psplash_fb_draw_image (fb,=20 (fb->width - BAR_IMG_WIDTH)/2,=20 @@ -322,6 +327,7 @@ main (int argc, char** argv) BAR_IMG_RLE_PIXEL_DATA); =20 psplash_draw_progress (fb, 0); +#endif =20 #ifdef PSPLASH_STARTUP_MSG psplash_draw_msg (fb, PSPLASH_STARTUP_MSG); --=20 2.31.1
|
|
[layerindex-web][PATCH 0/7] Fix layer index parsing issues (cover letter only)
Paul Eggleton <paul.eggleton@...>
Fix layer index parsing issues with master & honister, and complete
the move to Django 2.2 LTS. The following changes since commit 2314fb2811bc3753d9dd4459747d8d30369321ad: Add SPDX license headers to layerindex-web source files (2021-04-21 08:22:51 +1200) are available in the git repository at: git://git.yoctoproject.org/layerindex-web paule/newfixes1 http://git.yoctoproject.org/cgit.cgi/layerindex-web/log/?h=paule/newfixes1 Paul Eggleton (7): requirements.txt: set proper version restriction for Django README.devel: update versions update: fix setup of BBLAYERS utils: ensure we show error messages on server startup rrs: make changes to support Django 2.2 about: add Amber & Tim to contributors list Report charset for text & CSV views README.devel | 9 +++--- layerindex/recipeparse.py | 1 + layerindex/update_layer.py | 6 +++- layerindex/urls.py | 4 +-- layerindex/utils.py | 15 +++++++++- layerindex/views.py | 2 +- requirements.txt | 2 +- rrs/migrations/0001_initial.py | 20 ++++++------- rrs/migrations/0002_maintenanceplan.py | 4 +-- rrs/migrations/0003_release_plan.py | 2 +- rrs/migrations/0005_release_plan_nonnull.py | 2 +- rrs/migrations/0006_maintplan_email.py | 2 +- rrs/migrations/0007_python23.py | 4 +-- rrs/migrations/0009_rmh_layerbranch.py | 2 +- rrs/migrations/0012_reup_layerbranch_field.py | 2 +- rrs/migrations/0014_reup_layerbranch_nonnull.py | 2 +- rrs/migrations/0016_rmh_layerbranch_nonnull.py | 2 +- rrs/models.py | 40 ++++++++++++------------- rrs/tools/rrs_upstream_email.py | 2 +- rrs/views.py | 4 +-- templates/layerindex/about.html | 2 ++ 21 files changed, 74 insertions(+), 55 deletions(-) -- 1.8.3.1
|
|
[layerindex-web][PATCH] import_layer.py: support import layer to non-master branch
Changqing Li
From: Changqing Li <changqing.li@...>
Before this commit, it only support create layer on master branch, support import layer to other branch to fix following issue: For layer A, it only works on NON-MASTER branch. If we import it use this tool, it will by default import it to master branch. In master branch, bitbake is newer, and use new overrides style, but layer A use old style overrides style, which make update.py -b master report error: INFO: Collecting data for layer A on branch master (NON-MASTER) NOTE: Starting bitbake server... ERROR: Variable PREMIRRORS_append contains an operation using the old override syntax. Please convert this layer/metadata before attempting to use with a newer bitbake. ERROR: Traceback (most recent call last): File "update_layer.py", line 486, in main layer_config_data = layerconfparser.parse_layer(layerdir) File "/path/to/layerindex-web/layerindex/layerconfparse.py", line 47, in parse_layer utils.parse_layer_conf(layerdir, self.config_data_copy, logger=self.logger) File "/path/to/layerindex-web/layerindex/utils.py", line 288, in parse_layer_conf data = parse_conf(conf_file, data) File "/path/to/layerindex-web/layerindex/utils.py", line 273, in parse_conf data = bb.parse.handle(conf_file, d, include=True) File "/path/to/layerindex/git___lxgit_wrs_com_bitbake/lib/bb/parse/__init__.py", line 107, in handle return h['handle'](fn, data, include) File "/path/to/layerindex/git___lxgit_wrs_com_bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 149, in handle statements.eval(data) File "/path/to/layerindex/git___lxgit_wrs_com_bitbake/lib/bb/parse/ast.py", line 19, in eval statement.eval(data) File "/path/to/layerindex/git___lxgit_wrs_com_bitbake/lib/bb/parse/ast.py", line 145, in eval data.setVar(key, val, parsing=True, **loginfo) File "/path/to/layerindex/git___lxgit_wrs_com_bitbake/lib/bb/tinfoil.py", line 97, in remoteCommand ret = self.tinfoil.run_command('dataStoreConnectorCmd', self.dsindex, cmd, args, kwargs) File "/path/to/layerindex/git___lxgit_wrs_com_bitbake/lib/bb/tinfoil.py", line 469, in run_command result = self.server_connection.connection.runCommand(commandline) File "/path/to/layerindex/git___lxgit_wrs_com_bitbake/lib/bb/server/process.py", line 410, in runCommand raise bb.BBHandledException() Signed-off-by: Changqing Li <changqing.li@...> --- layerindex/tools/import_layer.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/layerindex/tools/import_layer.py b/layerindex/tools/import_layer.py index dfe887c..0c4881f 100755 --- a/layerindex/tools/import_layer.py +++ b/layerindex/tools/import_layer.py @@ -236,6 +236,9 @@ def main(): parser.add_option("-a", "--actual-branch", help = "Set actual branch", action="store", dest="actual_branch") + parser.add_option("-b", "--branch", + help = "Set branch to import", + action="store", dest="branch", default="master") options, args = parser.parse_args(sys.argv) @@ -284,7 +287,7 @@ def main(): if not os.path.exists(fetchdir): os.makedirs(fetchdir) - master_branch = utils.get_branch('master') + master_branch = utils.get_branch(options.branch) core_layer = None try: with transaction.atomic(): @@ -311,7 +314,7 @@ def main(): logger.error("Fetch failed: %s" % str(e)) sys.exit(1) - actual_branch = 'master' + actual_branch = options.branch if (options.actual_branch): actual_branch = options.actual_branch try: @@ -324,7 +327,7 @@ def main(): actual_branch = line.split('-> origin/')[-1] break if not actual_branch: - logger.error("Repository has no master branch nor origin/HEAD") + logger.error("Repository has no %s branch nor origin/HEAD" % options.branch) sys.exit(1) out = utils.runcmd(['git', 'checkout', 'origin/%s' % actual_branch], repodir, logger=logger) @@ -332,7 +335,7 @@ def main(): if options.subdir: layerdir = os.path.join(repodir, options.subdir) if not os.path.exists(layerdir): - logger.error("Subdirectory %s does not exist in repository for master branch" % options.subdir) + logger.error("Subdirectory %s does not exist in repository for %s branch" % (options.subdir, options.branch)) sys.exit(1) if not os.path.exists(os.path.join(layerdir, 'conf/layer.conf')): logger.error("conf/layer.conf not found in subdirectory %s" % options.subdir) -- 2.17.1
|
|
[layerindex-web][PATCH] update.py: add option -s for send mail
Changqing Li
From: Changqing Li <changqing.li@...>
Add option -s to support send mail to admin when update_layer.py return non-zero value. So that admin can find issues ASAP. Signed-off-by: Changqing Li <changqing.li@...> --- layerindex/update.py | 27 ++++++++++++++++++++++++++ templates/layerindex/updatefailure.txt | 11 +++++++++++ 2 files changed, 38 insertions(+) create mode 100644 templates/layerindex/updatefailure.txt diff --git a/layerindex/update.py b/layerindex/update.py index 5a2642b..f66a747 100755 --- a/layerindex/update.py +++ b/layerindex/update.py @@ -35,6 +35,28 @@ except ImportError: logger.error("Please install PythonGit 0.3.1 or later in order to use this script") sys.exit(1) +def send_email(cmd, log): + from django.core.mail import EmailMessage + from django.template.loader import get_template + import settings + + subject = 'Notification: Layer Index Update ERRORS/WARNINGS' + from_email = settings.DEFAULT_FROM_EMAIL + + to_email_list = [] + for a in settings.ADMINS: + to_email_list.append(a[1]) + + d = { + 'cmd': cmd, + 'log': log, + } + + plaintext = get_template('layerindex/updatefailure.txt') + text_content = plaintext.render(d) + + msg = EmailMessage(subject, text_content, from_email, to_email_list) + msg.send() def prepare_update_layer_command(options, branch, layer, initial=False): """Prepare the update_layer.py command line""" @@ -178,6 +200,9 @@ def main(): parser.add_option("", "--keep-temp", help = "Preserve temporary directory at the end instead of deleting it", action="store_true") + parser.add_option("-s", "--send-mail", + help = "Send mail to admin when update layer have errors", + action="store_true", dest="sendmail", default=False) options, args = parser.parse_args(sys.argv) if len(args) > 1: @@ -443,6 +468,8 @@ def main(): layerupdate.retcode = ret if not options.dryrun: layerupdate.save() + if options.sendmail: + send_email(cmd, output) continue col = extract_value('BBFILE_COLLECTIONS', output) diff --git a/templates/layerindex/updatefailure.txt b/templates/layerindex/updatefailure.txt new file mode 100644 index 0000000..ddcb6b9 --- /dev/null +++ b/templates/layerindex/updatefailure.txt @@ -0,0 +1,11 @@ +Hi, Admins + +There are ERRORS/WARNINGS during layer index update, please check it. + +Layer update command: +{{cmd}} + +Details: +{{log | safe}} + +Have a nice day! -- 2.17.1
|
|