From patchwork Wed Feb 9 09:53:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QsO2c3rDtnJtw6lueWkgWm9sdMOhbg==?= X-Patchwork-Id: 14153 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org From: "Zoltan Boszormenyi" Subject: [PATCH] qemuboot: Fix NoneType error in do_write_qemuboot_conf Date: Wed, 9 Feb 2022 10:53:07 +0100 Message-Id: <20220209095307.4080727-1-zboszor@pr.hu> MIME-Version: 1.0 List-id: To: openembedded-core@lists.openembedded.org Cc: =?utf-8?b?Wm9sdMOhbiBCw7ZzesO2cm3DqW55aQ==?= From: Zoltán Böszörményi I got this error on current master: File: 'exec_func_python() autogenerated', lineno: 2, function: 0001: *** 0002:do_write_qemuboot_conf(d) 0003: File: '.../layers/openembedded-core/meta/classes/qemuboot.bbclass', lineno: 141, function: do_write_qemuboot_conf 0137: else: 0138: val = d.getVar(k) 0139: # we only want to write out relative paths so that we can relocate images 0140: # and still run them *** 0141: if val.startswith(topdir): 0142: val = os.path.relpath(val, finalpath) 0143: cf.set('config_bsp', k, '%s' % val) 0144: 0145: # QB_DEFAULT_KERNEL's value of KERNEL_IMAGETYPE is the name of a symlink Exception: AttributeError: 'NoneType' object has no attribute 'startswith' Do nothing if "val" is None. Signed-off-by: Zoltán Böszörményi --- meta/classes/qemuboot.bbclass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass index 229bd88527..755d49acd6 100644 --- a/meta/classes/qemuboot.bbclass +++ b/meta/classes/qemuboot.bbclass @@ -136,6 +136,8 @@ python do_write_qemuboot_conf() { 'qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/') else: val = d.getVar(k) + if val is None: + continue # we only want to write out relative paths so that we can relocate images # and still run them if val.startswith(topdir):