Commit 2ff8f54e authored by Gustavo Zacarias's avatar Gustavo Zacarias Committed by Thomas Petazzoni
Browse files

scripts/mkusers: allow the creation of groups alone



Let mkusers create groups alone, useful for supplementary permissions in
udev/systemd for example where users can be added to later at runtime.
Use a magic string "-" to signal that user creation should be skipped.

Signed-off-by: default avatarGustavo Zacarias <gustavo@zacarias.com.ar>
Acked-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent 9f13ddf3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -397,6 +397,7 @@ main() {
    # Now, add users whose uid is *not* automatic
    while read username uid group gid passwd home shell groups comment; do
        [ -n "${username}" ] || continue    # Package with no user
        [ "${username}" != "-" ] || continue # Magic string to skip user creation
        [ ${uid} -ge 0     ] || continue    # Automatic uid
        add_one_user "${username}" "${uid}" "${group}" "${gid}" "${passwd}" \
                     "${home}" "${shell}" "${groups}" "${comment}"
@@ -405,6 +406,7 @@ main() {
    # Finally, add users whose uid *is* automatic
    while read username uid group gid passwd home shell groups comment; do
        [ -n "${username}" ] || continue    # Package with no user
        [ "${username}" != "-" ] || continue # Magic string to skip user creation
        [ ${uid} -eq -1    ] || continue    # Non-automatic uid
        add_one_user "${username}" "${uid}" "${group}" "${gid}" "${passwd}" \
                     "${home}" "${shell}" "${groups}" "${comment}"