mbox series

[0/5] Add support for USERMOD_PARAM in useradd.bbclass

Message ID 20260512190415.948535-1-pkj@axis.com
Headers show
Series Add support for USERMOD_PARAM in useradd.bbclass | expand

Message

Peter Kjellerstedt May 12, 2026, 7:04 p.m. UTC
This is my proposed solution for groupmems' lack of support for the
--prefix option
(https://bugzilla.yoctoproject.org/show_bug.cgi?id=16277), and the fact
that groupmems will be removed in the next version of shadow.

The first three commits make a little bit of clean-up to
useradd.bbclass and then add the support for USERMOD_PARAM. These I
would like to see backported to Wrynose. While technically it is a new
feature, I hope this can be accepted (it should not affect anyone who 
does not actively start using it). It would make it a lot easier for us 
and others who are using GROUPMEMS_PARAM today (we have more than 300 
recipes that will need to be updated) as it would then be possible to 
migrate the recipes over some time rather than having to do a flag day 
rewrite.

The next commit (only intended for master) modifies the
perform_groupmems() function so that it actually uses usermod to do the
work. This allows GROUPMEMS_PARAM to continue to work while we migrate
to USERMOD_PARAM.

The last commit (also only intended for master) adds a warning for all
recipes that use GROUPMEMS_PARAM, to inform that one should switch to
USERMOD_PARAM.

The final piece (which is not included) here, is the actual removal of
support for GROUPMEMS_PARAM. This I intend should be in place in time 
before feature freeze.

The intention of the above plan is to give us and others who rely on
GROUPMEMS_PARAM a way to do the migration without having to resort to a
flag day upgrade of a huge number of recipes, and still have everything
in place and cleaned-up before 6.1 is released.

Peter Kjellerstedt (5):
  useradd.bbclass: Some clean-ups and simplifications
  useradd.bbclass: Add support for USERMOD_PARAM
  package.bbclass: Add USERMOD_PARAM to PACKAGEVARS
  useradd_base.bbclass: Emulate the groupmems command using usermod
  useradd.bbclass: Show a deprecation warning if GROUPMEMS_PARAM is used

 meta/classes-global/package.bbclass |   2 +-
 meta/classes/useradd.bbclass        | 104 ++++++++++++++++++----------
 meta/classes/useradd_base.bbclass   |   7 +-
 meta/conf/documentation.conf        |   1 +
 4 files changed, 72 insertions(+), 42 deletions(-)

Comments

Richard Purdie May 12, 2026, 7:49 p.m. UTC | #1
On Tue, 2026-05-12 at 21:04 +0200, Peter Kjellerstedt via lists.openembedded.org wrote:
> This is my proposed solution for groupmems' lack of support for the
> --prefix option
> (https://bugzilla.yoctoproject.org/show_bug.cgi?id=16277), and the fact
> that groupmems will be removed in the next version of shadow.
> 
> The first three commits make a little bit of clean-up to
> useradd.bbclass and then add the support for USERMOD_PARAM. These I
> would like to see backported to Wrynose. While technically it is a new
> feature, I hope this can be accepted (it should not affect anyone who
> does not actively start using it). It would make it a lot easier for us 
> and others who are using GROUPMEMS_PARAM today (we have more than 300
> recipes that will need to be updated) as it would then be possible to
> migrate the recipes over some time rather than having to do a flag day 
> rewrite.

I appreciate the patch series, thanks for doing that. I'm much less
happy that this is marked as "something we must backport" and then the
series starts with a patch mixing whitespace and "simplifications".

Whilst I appreciate it would make it easier for you, you're breaking
several different elements of the stable backport policies and hence
actually actively make it harder to make case to backport it. It
certainly doesn't make it easier for me, quite the opposite.

Cheers,

Richard
Peter Kjellerstedt May 12, 2026, 9 p.m. UTC | #2
> -----Original Message-----
> From: Richard Purdie <richard.purdie@linuxfoundation.org>
> Sent: den 12 maj 2026 21:49
> To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>; openembedded-
> core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH 0/5] Add support for USERMOD_PARAM in
> useradd.bbclass
> 
> On Tue, 2026-05-12 at 21:04 +0200, Peter Kjellerstedt via lists.openembedded.org wrote:
> > This is my proposed solution for groupmems' lack of support for the
> > --prefix option
> > (https://bugzilla.yoctoproject.org/show_bug.cgi?id=16277), and the fact
> > that groupmems will be removed in the next version of shadow.
> >
> > The first three commits make a little bit of clean-up to
> > useradd.bbclass and then add the support for USERMOD_PARAM. These I
> > would like to see backported to Wrynose. While technically it is a new
> > feature, I hope this can be accepted (it should not affect anyone who
> > does not actively start using it). It would make it a lot easier for us
> > and others who are using GROUPMEMS_PARAM today (we have more than 300
> > recipes that will need to be updated) as it would then be possible to
> > migrate the recipes over some time rather than having to do a flag day
> > rewrite.
> 
> I appreciate the patch series, thanks for doing that. I'm much less
> happy that this is marked as "something we must backport" and then the

I did write "that I would like" and "I hope" so definitely not "must". 

> series starts with a patch mixing whitespace and "simplifications".

I can split this if that is the only blocker for a backport so that 
what is needed for the two following commits remain, and the cleanup 
is left as a separate commit for master. However, ...

> Whilst I appreciate it would make it easier for you, you're breaking
> several different elements of the stable backport policies and hence
> actually actively make it harder to make case to backport it. It
> certainly doesn't make it easier for me, quite the opposite.

I am aware of that this is a new feature, albeit one that should not 
affect anyone who are not actively trying to solve the problem with 
groupmems. It would certainly be easier for me if support for 
USERMOD_PARAM is backported, but we can make do without it as we can 
backport a version of useradd.bbclass into one of our own layers. 
Having it in OE-Core is mainly a way to help others who are in the 
same situation as us. 

What I would really appreciate though is to allow support for 
GROUPMEMS_PARAM (emulated using usermod) to remain on master until 
closer to feature freeze as otherwise we will have to resort to 
a flag day update of all our recipes that use GROUPMEMS_PARAM. 
I promise that I will send a patch that removes support for 
GROUPMEMS_PARAM in good time before the feature freeze.

The sad part (as I realized while making these changes), is that 
groupmems (and therefore GROUPMEMS_PARAM) actually has a better API 
for what OE is doing, and allows for much better validation in 
perform_groupmems() than in perform_usermod(). And no, I am not 
arguing for keeping support for GROUPMEMS_PARAM, as that does not 
make any sense in the long run if upstream is removing the command. 
I just thought I'd mention it.

> 
> Cheers,
> 
> Richard

//Peter