From: Stefan Herbrechtsmeier Date: Thu, 24 Feb 2022 17:00:10 +0000 (+0100) Subject: classes: rootfs-postcommands: avoid exception in overlayfs_qa_check X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=4396348c24efb1185d68876d3cf6ade90324dee5;p=openembedded-core.git classes: rootfs-postcommands: avoid exception in overlayfs_qa_check The overlayfs_qa_check in the rootfs-postcommands class throws an exception if the overlayfs distro feature is enabled but no global OVERLAYFS_MOUNT_POINT is specifived. File: '/home/stefan/dalos-linutronix/poky/meta/classes/rootfs-postcommands.bbclass', lineno: 389, function: overlayfs_qa_check 0385: searchpaths = [oe.path.join(imagepath, d.getVar("sysconfdir"), "systemd", "system"), 0386: oe.path.join(imagepath, d.getVar("systemd_system_unitdir"))] 0387: 0388: allUnitExist = True; *** 0389: for mountPoint in overlayMountPoints: 0390: path = d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint) 0391: unit = mountUnitName(path) 0392: 0393: if not any(os.path.isfile(oe.path.join(dirpath, unit)) Exception: TypeError: 'NoneType' object is not iterable Signed-off-by: Stefan Herbrechtsmeier Signed-off-by: Richard Purdie --- diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 74035c30b7..cd8986d8a9 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass @@ -380,7 +380,7 @@ python overlayfs_qa_check() { from oe.overlayfs import mountUnitName # this is a dumb check for unit existence, not its validity - overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT") + overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT") or {} imagepath = d.getVar("IMAGE_ROOTFS") searchpaths = [oe.path.join(imagepath, d.getVar("sysconfdir"), "systemd", "system"), oe.path.join(imagepath, d.getVar("systemd_system_unitdir"))]