Openembedded Core Discussions
 help / color / mirror / Atom feed
* [meta-oe][PATCH v2] cve-update-db: do_populate_cve_db depends on do_fetch
@ 2019-06-27  9:11 Pierre Le Magourou
  2019-06-27 12:30 ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Le Magourou @ 2019-06-27  9:11 UTC (permalink / raw)
  To: openembedded-core

From: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>

To be able to populate NVD database on a fetchall
(bitbake <image> --run-all=fetch), set the do_populate_cve_db task to be
executed before do_fetch.

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
---
 meta/recipes-core/meta/cve-update-db.bb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/meta/cve-update-db.bb b/meta/recipes-core/meta/cve-update-db.bb
index 522fd23807..e096db7717 100644
--- a/meta/recipes-core/meta/cve-update-db.bb
+++ b/meta/recipes-core/meta/cve-update-db.bb
@@ -4,9 +4,12 @@ LICENSE = "MIT"
 INHIBIT_DEFAULT_DEPS = "1"
 PACKAGES = ""
 
+CVE_CHECK_DB_DIR ?= "${DL_DIR}/CVE_CHECK"
+CVE_CHECK_DB_FILE ?= "${CVE_CHECK_DB_DIR}/nvd-json.db"
+CVE_CHECK_TMP_FILE ?= "${TMPDIR}/cve_check"
+
 inherit nopackages
 
-deltask do_fetch
 deltask do_unpack
 deltask do_patch
 deltask do_configure
@@ -115,7 +118,7 @@ def update_db(c, json_filename):
 
 
 
-addtask do_populate_cve_db before do_cve_check
+addtask do_populate_cve_db before do_fetch
 do_populate_cve_db[nostamp] = "1"
 
 EXCLUDE_FROM_WORLD = "1"
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [meta-oe][PATCH v2] cve-update-db: do_populate_cve_db depends on do_fetch
  2019-06-27  9:11 [meta-oe][PATCH v2] cve-update-db: do_populate_cve_db depends on do_fetch Pierre Le Magourou
@ 2019-06-27 12:30 ` Richard Purdie
  2019-06-27 13:42   ` Pierre Le Magourou
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2019-06-27 12:30 UTC (permalink / raw)
  To: Pierre Le Magourou, openembedded-core

On Thu, 2019-06-27 at 11:11 +0200, Pierre Le Magourou wrote:
> From: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
> 
> To be able to populate NVD database on a fetchall
> (bitbake <image> --run-all=fetch), set the do_populate_cve_db task to
> be
> executed before do_fetch.
> 
> Signed-off-by: Pierre Le Magourou <
> pierre.lemagourou@softbankrobotics.com>
> ---
>  meta/recipes-core/meta/cve-update-db.bb | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
Thanks for the fast turnaround on the patch. This seems to move the
problem to:

https://autobuilder.yoctoproject.org/typhoon/#/builders/23/builds/990/steps/7/logs/step1b

:(

Perhaps we need to skip the recipe if the class isn't enabled? Is that
the reason its failing like this?

Cheers,

Richard



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [meta-oe][PATCH v2] cve-update-db: do_populate_cve_db depends on do_fetch
  2019-06-27 12:30 ` Richard Purdie
@ 2019-06-27 13:42   ` Pierre Le Magourou
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Le Magourou @ 2019-06-27 13:42 UTC (permalink / raw)
  To: Richard Purdie; +Cc: OE-core

> Thanks for the fast turnaround on the patch. This seems to move the
> problem to:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/23/builds/990/steps/7/logs/step1b
>
> :(
>
> Perhaps we need to skip the recipe if the class isn't enabled? Is that
> the reason its failing like this?

It is failing with 'sqlite3.OperationalError' exception when opening
the sqlite3 db file.
I reproduced the bug by removing the ${DL_DIR}/CVE_CHECK directory

I forgot to check that the ${DL_DIR}/CVE_CHECK directory exists before
creating sqlite db file in it.
I'll send a v3 patch to fix this.

Pierre


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-27 13:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-27  9:11 [meta-oe][PATCH v2] cve-update-db: do_populate_cve_db depends on do_fetch Pierre Le Magourou
2019-06-27 12:30 ` Richard Purdie
2019-06-27 13:42   ` Pierre Le Magourou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox