Since support for GROUPMEMS_PARAM is implemented using the usermod
command, look for it rather than groupmems when verifying that the
command exists.

Signed-off-by: Peter Kjellerstedt <[email protected]>
---
 meta/classes/useradd.bbclass | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index c9f24bf7f3..4a07394a56 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -155,22 +155,28 @@ common_useradd_sysroot() {
                exit 0
        fi
 
-       # It is also possible we may be in a recipe which doesn't have useradd 
dependencies and hence the
-       # useradd/groupadd tools are unavailable. If there is no dependency, we 
assume we don't want to
-       # create users in the sysroot
-       if ! command -v "$1"; then
-               bbwarn "The $1 command could not be found!"
-               exit 0
-       fi
+       cmd=$1
 
        # Add groups and users defined for all recipe packages
        case "$1" in
                groupadd) GROUPADD_PARAM="${@get_all_cmd_params(d, 
'groupadd')}";;
                useradd) USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}";;
                usermod) USERMOD_PARAM="${@get_all_cmd_params(d, 'usermod')}";;
-               groupmems) GROUPMEMS_PARAM="${@get_all_cmd_params(d, 
'groupmems')}";;
+               groupmems)
+                       GROUPMEMS_PARAM="${@get_all_cmd_params(d, 'groupmems')}"
+                       # groupmems is emulated using usermod
+                       cmd=usermod
+                       ;;
        esac
 
+       # It is also possible we may be in a recipe which doesn't have useradd 
dependencies and hence the
+       # useradd/groupadd tools are unavailable. If there is no dependency, we 
assume we don't want to
+       # create users in the sysroot
+       if ! command -v "$cmd"; then
+               bbwarn "The $cmd command could not be found!"
+               exit 0
+       fi
+
        # Tell the system to use the environment vars
        UA_SYSROOT=1
 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#243778): 
https://lists.openembedded.org/g/openembedded-core/message/243778
Mute This Topic: https://lists.openembedded.org/mt/120833303/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to