mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
useradd_base.bbclass: replace retry logic with flock
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 randomly. Use flock to reslove it by using an universal lock directory for all the user and group related operations. [YOCTO #9022] (From OE-Core rev: 2ebf697b46c42cee8bfa6d2e6087397f8cce385c) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -57,7 +57,7 @@ if test "x`echo $GROUPADD_PARAM | tr -d '[:space:]'`" != "x"; then
|
||||
opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1`
|
||||
remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2-`
|
||||
while test "x$opts" != "x"; do
|
||||
perform_groupadd "$SYSROOT" "$OPT $opts" 10
|
||||
perform_groupadd "$SYSROOT" "$OPT $opts"
|
||||
if test "x$opts" = "x$remaining"; then
|
||||
break
|
||||
fi
|
||||
@@ -73,7 +73,7 @@ if test "x`echo $USERADD_PARAM | tr -d '[:space:]'`" != "x"; then
|
||||
opts=`echo "$USERADD_PARAM" | cut -d ';' -f 1`
|
||||
remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2-`
|
||||
while test "x$opts" != "x"; do
|
||||
perform_useradd "$SYSROOT" "$OPT $opts" 10
|
||||
perform_useradd "$SYSROOT" "$OPT $opts"
|
||||
if test "x$opts" = "x$remaining"; then
|
||||
break
|
||||
fi
|
||||
@@ -89,7 +89,7 @@ if test "x`echo $GROUPMEMS_PARAM | tr -d '[:space:]'`" != "x"; then
|
||||
opts=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 1`
|
||||
remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2-`
|
||||
while test "x$opts" != "x"; do
|
||||
perform_groupmems "$SYSROOT" "$OPT $opts" 10
|
||||
perform_groupmems "$SYSROOT" "$OPT $opts"
|
||||
if test "x$opts" = "x$remaining"; then
|
||||
break
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user