[OE-core] [PATCH 1/1] rootfs-postcommands.bbclass: sort passwd entries

Phil Blundell pb at pbcl.net
Sun Jan 8 09:36:55 UTC 2017


On Sat, 2017-01-07 at 22:52 +0000, Richard Purdie wrote:
> On Sat, 2017-01-07 at 20:00 +0100, Patrick Ohly wrote:
> > 
> > On Sat, 2017-01-07 at 09:59 +0000, Phil Blundell wrote:
> > > 
> > > That sounds like a good idea.  And in that case, maybe it would
> > > be
> > > better to sort on uid rather than username?  That would preserve
> > > the
> > > "traditional" ordering in the file, i.e. root first.
> > I had thought about that, but then did not pursue that further
> > because
> > it would have made sorting quite a bit more complex (needs to know
> > about
> > line content, id not present in each file).
> > 
> > I can give it a try, though, if that's considered worth some
> > additional
> > complexity.
> 
> I think those functions can be python functions and this might not be
> too bad to write in python....

I'm not sure it's that complicated.  Maybe I'm overlooking something
obvious, but something like "sort -t: -k3n" seems like it ought to
suffice for sorting /etc/passwd and /etc/group on numeric id.

I didn't understand Patrick's comment about "id not present in each
file" though, maybe that's the key to the extra complexity.

p.




More information about the Openembedded-core mailing list