Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/4] scripts/mkusers: allow the creation of groups alone
@ 2014-10-21 14:26 Gustavo Zacarias
  2014-10-21 14:26 ` [Buildroot] [PATCH 2/4] docs/manual: document makeusers group-only creation Gustavo Zacarias
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Gustavo Zacarias @ 2014-10-21 14:26 UTC (permalink / raw)
  To: buildroot

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: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 support/scripts/mkusers | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/support/scripts/mkusers b/support/scripts/mkusers
index ffd192d..5e5a5d9 100755
--- a/support/scripts/mkusers
+++ b/support/scripts/mkusers
@@ -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}"
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 2/4] docs/manual: document makeusers group-only creation
  2014-10-21 14:26 [Buildroot] [PATCH 1/4] scripts/mkusers: allow the creation of groups alone Gustavo Zacarias
@ 2014-10-21 14:26 ` Gustavo Zacarias
  2014-10-21 16:33   ` Yann E. MORIN
  2014-10-21 14:26 ` [Buildroot] [PATCH 3/4] eudev: add input group Gustavo Zacarias
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Gustavo Zacarias @ 2014-10-21 14:26 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 docs/manual/makeusers-syntax.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/docs/manual/makeusers-syntax.txt b/docs/manual/makeusers-syntax.txt
index 5b3f347..8e64a0e 100644
--- a/docs/manual/makeusers-syntax.txt
+++ b/docs/manual/makeusers-syntax.txt
@@ -51,6 +51,8 @@ There are a few restrictions on the content of each field:
 If +home+ is not +-+, then the home directory, and all files below,
 will belong to the user and its main group.
 
+If +username+ is +-+, then just a group will be created.
+
 Examples:
 
 ----
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 3/4] eudev: add input group
  2014-10-21 14:26 [Buildroot] [PATCH 1/4] scripts/mkusers: allow the creation of groups alone Gustavo Zacarias
  2014-10-21 14:26 ` [Buildroot] [PATCH 2/4] docs/manual: document makeusers group-only creation Gustavo Zacarias
@ 2014-10-21 14:26 ` Gustavo Zacarias
  2014-10-21 16:33   ` Yann E. MORIN
  2014-10-21 14:26 ` [Buildroot] [PATCH 4/4] systemd: " Gustavo Zacarias
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Gustavo Zacarias @ 2014-10-21 14:26 UTC (permalink / raw)
  To: buildroot

It's used by 50-default-udev.rules for input-class devices.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/eudev/eudev.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/eudev/eudev.mk b/package/eudev/eudev.mk
index fd935a7..3cd22be 100644
--- a/package/eudev/eudev.mk
+++ b/package/eudev/eudev.mk
@@ -42,4 +42,9 @@ define EUDEV_INSTALL_INIT_SYSV
 	$(INSTALL) -m 0755 package/eudev/S10udev $(TARGET_DIR)/etc/init.d/S10udev
 endef
 
+# Required by default rules for input devices
+define EUDEV_USERS
+	- - input -1 * - - - Input device group
+endef
+
 $(eval $(autotools-package))
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 4/4] systemd: add input group
  2014-10-21 14:26 [Buildroot] [PATCH 1/4] scripts/mkusers: allow the creation of groups alone Gustavo Zacarias
  2014-10-21 14:26 ` [Buildroot] [PATCH 2/4] docs/manual: document makeusers group-only creation Gustavo Zacarias
  2014-10-21 14:26 ` [Buildroot] [PATCH 3/4] eudev: add input group Gustavo Zacarias
@ 2014-10-21 14:26 ` Gustavo Zacarias
  2014-10-21 16:34   ` Yann E. MORIN
  2014-10-21 16:30 ` [Buildroot] [PATCH 1/4] scripts/mkusers: allow the creation of groups alone Yann E. MORIN
  2014-10-22 20:14 ` Thomas Petazzoni
  4 siblings, 1 reply; 9+ messages in thread
From: Gustavo Zacarias @ 2014-10-21 14:26 UTC (permalink / raw)
  To: buildroot

It's used by 50-default-udev.rules for input-class devices.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/systemd/systemd.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index fd19bff..75a32f4 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -179,6 +179,7 @@ define SYSTEMD_USERS
 	systemd-bus-proxy -1 systemd-bus-proxy -1 * - - - Proxy D-Bus messages to/from a bus
 	systemd-timesync -1 systemd-timesync -1 * - - - Network Time Synchronization
 	systemd-network -1 systemd-network -1 * - - - Network Manager
+	- - input -1 * - - - Input device group
 endef
 
 define SYSTEMD_DISABLE_SERVICE_TTY1
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 1/4] scripts/mkusers: allow the creation of groups alone
  2014-10-21 14:26 [Buildroot] [PATCH 1/4] scripts/mkusers: allow the creation of groups alone Gustavo Zacarias
                   ` (2 preceding siblings ...)
  2014-10-21 14:26 ` [Buildroot] [PATCH 4/4] systemd: " Gustavo Zacarias
@ 2014-10-21 16:30 ` Yann E. MORIN
  2014-10-22 20:14 ` Thomas Petazzoni
  4 siblings, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2014-10-21 16:30 UTC (permalink / raw)
  To: buildroot

Gustavo, All,

On 2014-10-21 11:26 -0300, Gustavo Zacarias spake thusly:
> 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.

Gah, FIFO de-queuing. You beat me to it! :-)

> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  support/scripts/mkusers | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/support/scripts/mkusers b/support/scripts/mkusers
> index ffd192d..5e5a5d9 100755
> --- a/support/scripts/mkusers
> +++ b/support/scripts/mkusers
> @@ -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}"
> -- 
> 2.0.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 2/4] docs/manual: document makeusers group-only creation
  2014-10-21 14:26 ` [Buildroot] [PATCH 2/4] docs/manual: document makeusers group-only creation Gustavo Zacarias
@ 2014-10-21 16:33   ` Yann E. MORIN
  0 siblings, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2014-10-21 16:33 UTC (permalink / raw)
  To: buildroot

Gustavo, All,

On 2014-10-21 11:26 -0300, Gustavo Zacarias spake thusly:
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> ---
>  docs/manual/makeusers-syntax.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/docs/manual/makeusers-syntax.txt b/docs/manual/makeusers-syntax.txt
> index 5b3f347..8e64a0e 100644
> --- a/docs/manual/makeusers-syntax.txt
> +++ b/docs/manual/makeusers-syntax.txt
> @@ -51,6 +51,8 @@ There are a few restrictions on the content of each field:
>  If +home+ is not +-+, then the home directory, and all files below,
>  will belong to the user and its main group.
>  
> +If +username+ is +-+, then just a group will be created.
> +

I would have preferred we add this to the existing explanations about
the user filed, lsomething like:

    - +username+ is the desired user name (aka login name) for the user.
      It can not be +root+, and must be unique. If set to +-+, then just
      a group will be created.

But I won;t be pedantic about this, so if the maintainer wants it as-is,
you get my:

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

>  Examples:
>  
>  ----
> -- 
> 2.0.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 3/4] eudev: add input group
  2014-10-21 14:26 ` [Buildroot] [PATCH 3/4] eudev: add input group Gustavo Zacarias
@ 2014-10-21 16:33   ` Yann E. MORIN
  0 siblings, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2014-10-21 16:33 UTC (permalink / raw)
  To: buildroot

Gustavo, All,

On 2014-10-21 11:26 -0300, Gustavo Zacarias spake thusly:
> It's used by 50-default-udev.rules for input-class devices.
> 
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  package/eudev/eudev.mk | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/package/eudev/eudev.mk b/package/eudev/eudev.mk
> index fd935a7..3cd22be 100644
> --- a/package/eudev/eudev.mk
> +++ b/package/eudev/eudev.mk
> @@ -42,4 +42,9 @@ define EUDEV_INSTALL_INIT_SYSV
>  	$(INSTALL) -m 0755 package/eudev/S10udev $(TARGET_DIR)/etc/init.d/S10udev
>  endef
>  
> +# Required by default rules for input devices
> +define EUDEV_USERS
> +	- - input -1 * - - - Input device group
> +endef
> +
>  $(eval $(autotools-package))
> -- 
> 2.0.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 4/4] systemd: add input group
  2014-10-21 14:26 ` [Buildroot] [PATCH 4/4] systemd: " Gustavo Zacarias
@ 2014-10-21 16:34   ` Yann E. MORIN
  0 siblings, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2014-10-21 16:34 UTC (permalink / raw)
  To: buildroot

Gustavo, All,

On 2014-10-21 11:26 -0300, Gustavo Zacarias spake thusly:
> It's used by 50-default-udev.rules for input-class devices.
> 
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  package/systemd/systemd.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index fd19bff..75a32f4 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -179,6 +179,7 @@ define SYSTEMD_USERS
>  	systemd-bus-proxy -1 systemd-bus-proxy -1 * - - - Proxy D-Bus messages to/from a bus
>  	systemd-timesync -1 systemd-timesync -1 * - - - Network Time Synchronization
>  	systemd-network -1 systemd-network -1 * - - - Network Manager
> +	- - input -1 * - - - Input device group
>  endef
>  
>  define SYSTEMD_DISABLE_SERVICE_TTY1
> -- 
> 2.0.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 1/4] scripts/mkusers: allow the creation of groups alone
  2014-10-21 14:26 [Buildroot] [PATCH 1/4] scripts/mkusers: allow the creation of groups alone Gustavo Zacarias
                   ` (3 preceding siblings ...)
  2014-10-21 16:30 ` [Buildroot] [PATCH 1/4] scripts/mkusers: allow the creation of groups alone Yann E. MORIN
@ 2014-10-22 20:14 ` Thomas Petazzoni
  4 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2014-10-22 20:14 UTC (permalink / raw)
  To: buildroot

Dear Gustavo Zacarias,

On Tue, 21 Oct 2014 11:26:36 -0300, Gustavo Zacarias wrote:
> 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: Gustavo Zacarias <gustavo@zacarias.com.ar>
> ---
>  support/scripts/mkusers | 2 ++
>  1 file changed, 2 insertions(+)

I've applied the four patches. On the documentation patch, I've taken
into account the suggestion of Yann to slightly adjust the commit.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-10-22 20:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-21 14:26 [Buildroot] [PATCH 1/4] scripts/mkusers: allow the creation of groups alone Gustavo Zacarias
2014-10-21 14:26 ` [Buildroot] [PATCH 2/4] docs/manual: document makeusers group-only creation Gustavo Zacarias
2014-10-21 16:33   ` Yann E. MORIN
2014-10-21 14:26 ` [Buildroot] [PATCH 3/4] eudev: add input group Gustavo Zacarias
2014-10-21 16:33   ` Yann E. MORIN
2014-10-21 14:26 ` [Buildroot] [PATCH 4/4] systemd: " Gustavo Zacarias
2014-10-21 16:34   ` Yann E. MORIN
2014-10-21 16:30 ` [Buildroot] [PATCH 1/4] scripts/mkusers: allow the creation of groups alone Yann E. MORIN
2014-10-22 20:14 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox