From 0f936c67a42d2d7cdcb5f436e4f30c5a6fa60d55 Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Tue, 19 Mar 2024 10:23:42 +0100 Subject: [PATCH 1/2] vng: override kconfig with '--force' By default, vng --build and --kconfig will not modify existing kconfig, even if new kconfig files are given. The idea is to let people modifying them manually. It is now possible to force the modification of the kconfig by using '--force'. Suggested-by: Andrea Righi Signed-off-by: Matthieu Baerts (NGI0) --- virtme_ng/run.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/virtme_ng/run.py b/virtme_ng/run.py index 0e88db4..b8bad32 100644 --- a/virtme_ng/run.py +++ b/virtme_ng/run.py @@ -408,7 +408,8 @@ def make_parser(): "--force", action="store_true", help="Force reset git repository to target branch or commit " - "(warning: this may drop uncommitted changes)", + "(warning: this may drop uncommitted changes), " + "and force kernel config override", ) parser.add_argument( @@ -565,7 +566,9 @@ def checkout(self, args): def config(self, args): """Perform a make config operation on a kernel source directory.""" arch = args.arch - cmd = "virtme-configkernel --defconfig --no-update" + cmd = "virtme-configkernel --defconfig" + if not args.force: + cmd += " --no-update" if arch is not None: if arch not in ARCH_MAPPING: arg_fail(f"unsupported architecture: {arch}") From 785435457d247e2b1254e73cdfdd775cbab0e75f Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Tue, 19 Mar 2024 17:37:04 +0100 Subject: [PATCH 2/2] vng: --kconfig: override the .config It seems counter-intuitive not to do anything when 'vng --kconfig' is called and a .config file is present. So now, the .config is overridden when the '--kconfig' option is passed. Signed-off-by: Matthieu Baerts (NGI0) --- virtme_ng/run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virtme_ng/run.py b/virtme_ng/run.py index b8bad32..b8b8da3 100644 --- a/virtme_ng/run.py +++ b/virtme_ng/run.py @@ -157,7 +157,7 @@ def make_parser(): "--kconfig", "-k", action="store_true", - help="Only generate the kernel .config without building/running anything", + help="Only override the kernel .config without building/running anything", ) parser.add_argument( @@ -567,7 +567,7 @@ def config(self, args): """Perform a make config operation on a kernel source directory.""" arch = args.arch cmd = "virtme-configkernel --defconfig" - if not args.force: + if not args.force and not args.kconfig: cmd += " --no-update" if arch is not None: if arch not in ARCH_MAPPING: