Skip to contentSkip to conversation

cve-update-db: do_populate_cve_db depends on do_fetch

PATCH Superseded Pierre Le Magourou 2 participants 3 messages Jun 27, 2019

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cve-update-db: do_populate_cve_db depends on do_fetch

From: Pierre Le Magourou <[email protected]>

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.

---
 meta/recipes-core/meta/cve-update-db.bb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meta/recipes-core/meta/cve-update-db.bb +5 -2
index 522fd23807..e096db7717 100644
@@ -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"
Signature · 1 line
2.11.0
#1 lore raw
Quoted 7 lines · Pierre Le Magourou

From: Pierre Le Magourou <[email protected]>

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.

Quoted 6 lines

Signed-off-by: Pierre Le Magourou <
[email protected]>

---
 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

#2 lore raw
Quoted 9 lines

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