[OE-core] [PATCH 0/2] enhance useradd-staticids

Patrick Ohly patrick.ohly at intel.com
Thu Oct 19 07:13:24 UTC 2017


I recently tried to enable useradd-staticids.bbclass in a distro which
includes a large portion of meta-oe. This was a rather arduous task
because plenty of IDs need to be defined for recipes which are part of
the world build but not actually used in the distro.

The error or warning messages also aren't particularly helpful.

These two patches address both problems.

However, long term I think it would be worthwhile to rethink the
entire current approach. At the moment, useradd-staticids.bbclass
rewrites the USER/GROUPADD parameters at parse time for all future
usages of the parameters, including setting up local sysroots. This
has the downside that changing IDs later on leads to warnings or
errors about sysroots containing the old IDs.

I think static IDs are only needed for the preinst scripts in packages
for rootfs and target installation, and nowhere else. Therefore IMHO
it would be better to inject the static IDs only into those
scripts. Warnings and errors then can be triggered as part of
installing the package, if desired. Then it becomes possible to build
recipes where some packages create users or groups without actually
defining static IDs, as long as those packages then don't get used.

Triggering a stricter error already during parsing or build time would
still be possible. I'm just not sure how useful that is - perhaps to
catch potential problems without actually having to install the packages.

Patrick Ohly (2):
  useradd-staticids: skip recipes without static IDs
  useradd-staticids: explain how to fix the the problem

 meta/classes/useradd-staticids.bbclass | 74 +++++++++++++--------------
 1 file changed, 37 insertions(+), 37 deletions(-)

base-commit: 39ffa0f3779305c5e8ef86fe4572e961c5912021
-- 
git-series 0.9.1



More information about the Openembedded-core mailing list