All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] fs/common: allow custom user table to override package-defined users
@ 2018-10-02 23:02 Matt Weber
  2018-10-20 13:34 ` Arnout Vandecappelle
  2018-10-24 12:22 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Matt Weber @ 2018-10-02 23:02 UTC (permalink / raw)
  To: buildroot

Currently, when a custom user table and a package define the same user,
the settings from the package takes precedence over the ones from the
custom user table.

However, it makes sense to allow the settings from the custom user table
take precedence. For example, it would allow redirecting the user's
home directory to an alternate location (e.g. away from tmp and into a
partition that is persistent).

The support/scripts/mkusers script will only retain settings from the
latest definition it finds.

Thus, by passing the custom user table after the package defined users,
it is possible to override the package provided user definitions.

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
Change v1 -> v2
[Yann
 - Updated commit message
---
 fs/common.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/common.mk b/fs/common.mk
index abf3541..453da60 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -75,10 +75,11 @@ $(ROOTFS_COMMON_TAR): $(ROOTFS_COMMON_DEPENDENCIES) target-finalize
 	echo '#!/bin/sh' > $(FAKEROOT_SCRIPT)
 	echo "set -e" >> $(FAKEROOT_SCRIPT)
 	echo "chown -h -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
+
+	$(call PRINTF,$(PACKAGES_USERS)) >> $(USERS_TABLE)
 ifneq ($(ROOTFS_USERS_TABLES),)
 	cat $(ROOTFS_USERS_TABLES) >> $(USERS_TABLE)
 endif
-	$(call PRINTF,$(PACKAGES_USERS)) >> $(USERS_TABLE)
 	PATH=$(BR_PATH) $(TOPDIR)/support/scripts/mkusers $(USERS_TABLE) $(TARGET_DIR) >> $(FAKEROOT_SCRIPT)
 ifneq ($(ROOTFS_DEVICE_TABLES),)
 	cat $(ROOTFS_DEVICE_TABLES) > $(FULL_DEVICE_TABLE)
-- 
1.9.1

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

* [Buildroot] [PATCH v2] fs/common: allow custom user table to override package-defined users
  2018-10-02 23:02 [Buildroot] [PATCH v2] fs/common: allow custom user table to override package-defined users Matt Weber
@ 2018-10-20 13:34 ` Arnout Vandecappelle
  2018-10-24 12:22 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2018-10-20 13:34 UTC (permalink / raw)
  To: buildroot



On 03/10/2018 00:02, Matt Weber wrote:
> Currently, when a custom user table and a package define the same user,
> the settings from the package takes precedence over the ones from the
> custom user table.
> 
> However, it makes sense to allow the settings from the custom user table
> take precedence. For example, it would allow redirecting the user's
> home directory to an alternate location (e.g. away from tmp and into a
> partition that is persistent).
> 
> The support/scripts/mkusers script will only retain settings from the
> latest definition it finds.
> 
> Thus, by passing the custom user table after the package defined users,
> it is possible to override the package provided user definitions.
> 
> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>

 Applied to master, thanks.

 Regards,
 Arnout

> ---
> Change v1 -> v2
> [Yann
>  - Updated commit message
> ---
>  fs/common.mk | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/common.mk b/fs/common.mk
> index abf3541..453da60 100644
> --- a/fs/common.mk
> +++ b/fs/common.mk
> @@ -75,10 +75,11 @@ $(ROOTFS_COMMON_TAR): $(ROOTFS_COMMON_DEPENDENCIES) target-finalize
>  	echo '#!/bin/sh' > $(FAKEROOT_SCRIPT)
>  	echo "set -e" >> $(FAKEROOT_SCRIPT)
>  	echo "chown -h -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
> +
> +	$(call PRINTF,$(PACKAGES_USERS)) >> $(USERS_TABLE)
>  ifneq ($(ROOTFS_USERS_TABLES),)
>  	cat $(ROOTFS_USERS_TABLES) >> $(USERS_TABLE)
>  endif
> -	$(call PRINTF,$(PACKAGES_USERS)) >> $(USERS_TABLE)
>  	PATH=$(BR_PATH) $(TOPDIR)/support/scripts/mkusers $(USERS_TABLE) $(TARGET_DIR) >> $(FAKEROOT_SCRIPT)
>  ifneq ($(ROOTFS_DEVICE_TABLES),)
>  	cat $(ROOTFS_DEVICE_TABLES) > $(FULL_DEVICE_TABLE)
> 

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

* [Buildroot] [PATCH v2] fs/common: allow custom user table to override package-defined users
  2018-10-02 23:02 [Buildroot] [PATCH v2] fs/common: allow custom user table to override package-defined users Matt Weber
  2018-10-20 13:34 ` Arnout Vandecappelle
@ 2018-10-24 12:22 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-10-24 12:22 UTC (permalink / raw)
  To: buildroot

>>>>> "Matt" == Matt Weber <matthew.weber@rockwellcollins.com> writes:

 > Currently, when a custom user table and a package define the same user,
 > the settings from the package takes precedence over the ones from the
 > custom user table.

 > However, it makes sense to allow the settings from the custom user table
 > take precedence. For example, it would allow redirecting the user's
 > home directory to an alternate location (e.g. away from tmp and into a
 > partition that is persistent).

 > The support/scripts/mkusers script will only retain settings from the
 > latest definition it finds.

 > Thus, by passing the custom user table after the package defined users,
 > it is possible to override the package provided user definitions.

 > Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
 > ---
 > Change v1 -> v2
 > [Yann
 >  - Updated commit message

Committed to 2018.08.x, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2018-10-24 12:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02 23:02 [Buildroot] [PATCH v2] fs/common: allow custom user table to override package-defined users Matt Weber
2018-10-20 13:34 ` Arnout Vandecappelle
2018-10-24 12:22 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.