Instead of spinning on useradd, checking that it actually did what we asked it to do, we could just flock $syscconfdir before running the commands.
We have a fix in our local branch that doesn't seem to have been sent to the oe-core email list likely since Kai thought it was a work-around. I'm going to assign this to Kai and ask him to send this patch to the list. WR branch: commit dfd6e7a8ec8fe36eb1d96f4127cb5d599ceedacf Author: Kai Kang <kai.kang@windriver.com> Date: Wed Aug 5 10:33:11 2015 +0800 useradd_base.bbclass: fix simultaneous with flock Issue: LIN8-643 When perform useradd during populate sysroot, it locks files passwd.lock and group.lock at same time. And then it meets a dead lock issue. Use flock to reslove it by using an universal lock file for all the user and group related operations. The lock file is put in image dir /tmp. /tmp will be mounted as a tmpfs, so the lock file will not be visible when boot the target. (LOCAL REV: NOT UPSTREAM) -- Workaround Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Oh that's certainly a good start, thanks Randy/Kai.
Fixed in oe-core 2ebf697b46c42cee8bfa6d2e6087397f8cce385c.
Can this be backported to jethro ?