[Buildroot] [PATCH 2/2] mkusers: change default from normal to system user

Arnout Vandecappelle arnout at mind.be
Sun Jan 16 12:27:15 UTC 2022



On 14/01/2022 11:12, Norbert Lange wrote:
> for all packages, this is the fitting default,

  Ah, this is where I saw the remark! :-) I should have read the entire series 
before commenting.

  This patch should be squashed with the preceding one.


  Since my only remarks are nitpicks, I'm going to merge it as is (after 
squashing) - but later. So I'll already give it my

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be>

> but the fallout will be user provided tables.
> 
> Also update the docs with the chagned behaviour.
> 
> Signed-off-by: Norbert Lange <nolange79 at gmail.com>
> ---
>   docs/manual/makeusers-syntax.txt | 11 +++++++----
>   support/scripts/mkusers          |  6 +++---
>   2 files changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/docs/manual/makeusers-syntax.txt b/docs/manual/makeusers-syntax.txt
> index 467e596230..3d1013f447 100644
> --- a/docs/manual/makeusers-syntax.txt
> +++ b/docs/manual/makeusers-syntax.txt
> @@ -20,13 +20,16 @@ Where:
>     It can not be +root+, and must be unique. If set to +-+, then just a
>     group will be created.
>   - +uid+ is the desired UID for the user. It must be unique, and not
> -  +0+. If set to +-1+, then a unique UID will be computed by Buildroot
> -  in the range [1000...1999]
> +  +0+. If set to +-1+ or +-2+, then a unique UID will be computed by
> +  Buildroot, with +-1+ denoting a system UID from [100...999] and +-2+
> +  denoting a user UID from [1000...1999].
>   - +group+ is the desired name for the user's main group. It can not
>     be +root+. If the group does not exist, it will be created.
>   - +gid+ is the desired GID for the user's main group. It must be unique,
> -  and not +0+. If set to +-1+, and the group does not already exist, then
> -  a unique GID will be computed by Buildroot in the range [1000..1999]
> +  and not +0+. If set to +-1+ or +-2+, and the group does not already
> +  exist, then a unique GID will be computed by Buildroot, with +-1+
> +  denoting a system GID from [100...999] and +-2+ denoting a user GID
> +  from [1000...1999].
>   - +password+ is the crypt(3)-encoded password. If prefixed with +!+,
>     then login is disabled. If prefixed with +=+, then it is interpreted
>     as clear-text, and will be crypt-encoded (using MD5). If prefixed with
> diff --git a/support/scripts/mkusers b/support/scripts/mkusers
> index 9d8295e8a3..f7a3180e30 100755
> --- a/support/scripts/mkusers
> +++ b/support/scripts/mkusers
> @@ -14,8 +14,8 @@ LAST_SYSTEM_UID=999
>   FIRST_SYSTEM_GID=100
>   LAST_SYSTEM_GID=999
>   # argument to automatically crease system/user id
> -AUTO_SYSTEM_ID=-2
> -AUTO_USER_ID=-1
> +AUTO_SYSTEM_ID=-1
> +AUTO_USER_ID=-2
>   
>   # No more is configurable below this point
>   #----------------------------------------------------------------------------
> @@ -433,7 +433,7 @@ main() {
>           read username uid group gid passwd home shell groups comment <<<"${line}"
>           if [ "${groups}" != "-" ]; then
>               for g in ${groups//,/ }; do
> -                add_one_group "${g}" ${AUTO_USER_ID}
> +                add_one_group "${g}" ${AUTO_SYSTEM_ID}
>               done
>           fi
>       done
> 



More information about the buildroot mailing list