From 3ddebb375705cc0bb6adb1076fb1dec8a96ad084 Mon Sep 17 00:00:00 2001
From: Chase Qi <chase.qi@linaro.org>
Date: Thu, 30 Jun 2022 09:14:22 +0800
Subject: [PATCH] .oniro-ci: enable wic image debug mode for LAVA testing

LAVA needs a writable directory to deploy test cases, and many test
cases only work with root user.

The debug mode can be disabled by overwriting the
CI_ONIRO_BB_LOCAL_CONF_plus_equals_INHERIT variable at build job level.

Signed-off-by: Chase Qi <chase.qi@linaro.org>
---
 .oniro-ci/build-generic.yaml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/.oniro-ci/build-generic.yaml b/.oniro-ci/build-generic.yaml
index 67abc4ad..c7c91689 100644
--- a/.oniro-ci/build-generic.yaml
+++ b/.oniro-ci/build-generic.yaml
@@ -162,6 +162,8 @@
           | sed -e 's/^CI_ONIRO_BB_LOCAL_CONF_plus_equals_//g' -e 's/"/\\"/g' -e 's/=/ += "/g' -e 's/$/"/g' \
           | sort \
           | tee -a conf/local.conf )
+    # Print local conf for debugging.
+    - grep -E '^[^#]' conf/local.conf
 
     # Sanity check: disallow using public build cache with a specific setting
     # in local.conf. The list of settings may grow over time.
@@ -299,6 +301,11 @@
 .build-wic-image:
   extends: .build-image
   variables:
+    # cve-check is enabled in the .bitbake-workspace job. Append
+    # oniro-debug-linux for all wic image build jobs to enable root login which
+    # is required in LAVA test jobs. The variable can be overwritten in build
+    # job level for builds that require non-root user.
+    CI_ONIRO_BB_LOCAL_CONF_plus_equals_INHERIT: "cve-check oniro-debug-linux"
     CI_ONIRO_JOB_ARTIFACTS: "*.wic.* *.bmap"
   script:
     - !reference [.build-image, script]
-- 
GitLab