When a recipe inherits useradd and only sets USERADD_DEPENDS (to depend
on users/groups created by another recipe), without creating any
users/groups itself, the parse-time sanity check incorrectly throws a
fatal error about missing USERADD_PACKAGES.
Skip the USERADD_PACKAGES/USERADD_PARAM validation when USERADD_DEPENDS
is set but USERADD_PACKAGES is not, since the recipe only needs build
dependency tracking, not user/group creation.
Fixes [YOCTO #15863]
Signed-off-by: Zk47T <zizuzacker@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
useradd_packages = d.getVar('USERADD_PACKAGES')
if not useradd_packages:
+ # It's valid to inherit useradd and only set USERADD_DEPENDS to
+ # depend on users/groups created by another recipe, without
+ # creating any users/groups in this recipe.
+ if d.getVar('USERADD_DEPENDS'):
+ return
bb.fatal("%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE', False))
for pkg in useradd_packages.split():