* [Buildroot] [PATCH] fs/rootfs-common: depend on host-mkpasswd if enabled
@ 2025-11-28 12:07 yann.morin
2025-11-28 12:28 ` yann.morin
0 siblings, 1 reply; 2+ messages in thread
From: yann.morin @ 2025-11-28 12:07 UTC (permalink / raw)
To: buildroot; +Cc: yann.morin
From: "Yann E. MORIN" <yann.morin@orange.com>
CUrrently, we opportunistically depend on host-mkpasswd from the common
fs parts, based on whether we have package-defined users, or user-tables
(files with user definitions). This allows to transparently depend on it
without requiring packages to select BR2_PACKAGE_HOST_MKPASSWD.
Dependencies of rootfs-common are acted upon right when fs/common.mk us
parsed. Adding dependencies to the list afterwards does not actualyy add
them to the make rule.
However, by the time we parse the fs/common.mk file, not all packages
have been parsed yet: packages from br2-external trees are only parsed
later.
This means that users defined by packages in br2-external trees do not
have the opportunity to actually contribute to the list of users before
the rootfs-common dependencies are created.
So, the obvious solution would be to move parsing the fs/common.mk after
br2-externall trees are parsed. However, this may open another can of
worms: br2-external trees may define filesystems of their own, and they
need to be able to evaluate the rootfs macros, with : $(eval $(rootfs))
which is provided in... fs/common.mk itself!
So, rather than trying to be too smart, just add the dependency also
when the host package is enabled. That way, people using br2-external
trees can either select host-mkpasswd from packages therein, or they can
add it to their defconfig files.
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
---
fs/common.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/common.mk b/fs/common.mk
index 2f3f8bcc7e..3787658f90 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -41,7 +41,7 @@ ROOTFS_COMMON_TYPE = rootfs
ROOTFS_COMMON_DEPENDENCIES = \
host-fakeroot host-makedevs \
$(BR2_TAR_HOST_DEPENDENCY) \
- $(if $(PACKAGES_USERS)$(ROOTFS_USERS_TABLES),host-mkpasswd)
+ $(if $(BR2_PACKAGE_HOST_MKPASSWD)$(PACKAGES_USERS)$(ROOTFS_USERS_TABLES),host-mkpasswd)
ifeq ($(BR2_REPRODUCIBLE),y)
define ROOTFS_REPRODUCIBLE
--
2.34.1
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH] fs/rootfs-common: depend on host-mkpasswd if enabled
2025-11-28 12:07 [Buildroot] [PATCH] fs/rootfs-common: depend on host-mkpasswd if enabled yann.morin
@ 2025-11-28 12:28 ` yann.morin
0 siblings, 0 replies; 2+ messages in thread
From: yann.morin @ 2025-11-28 12:28 UTC (permalink / raw)
To: buildroot
All,
On 2025-11-28 13:07 +0100, yann.morin@orange.com spake thusly:
> From: "Yann E. MORIN" <yann.morin@orange.com>
[--SNIP--]
> So, rather than trying to be too smart, just add the dependency also
> when the host package is enabled. That way, people using br2-external
> trees can either select host-mkpasswd from packages therein, or they can
> add it to their defconfig files.
[--SNIP--]
> - $(if $(PACKAGES_USERS)$(ROOTFS_USERS_TABLES),host-mkpasswd)
> + $(if $(BR2_PACKAGE_HOST_MKPASSWD)$(PACKAGES_USERS)$(ROOTFS_USERS_TABLES),host-mkpasswd)
Not sure what hapenned during my testing, but this is in fact not needed
at all: host packages that do have a Kconfig symbol, do get built before
the rootfs, when that symbol is enabled, even without an explicit
dependency...
I'm withdrawing this patch. sorry for the noise...
Regards,
Yann E. MORIN.
--
____________
.-----------------.--------------------: _ :------------------.
| Yann E. MORIN | Real-Time Embedded | __/ ) | /"\ ASCII RIBBON |
| | Software Designer | _/ - /' | \ / CAMPAIGN |
| +33 638.411.245 '--------------------: (_ `--, | X AGAINST |
| yann.morin (at) orange.com |_=" ,--' | / \ HTML MAIL |
'--------------------------------------:______/_____:------------------'
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-28 12:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-28 12:07 [Buildroot] [PATCH] fs/rootfs-common: depend on host-mkpasswd if enabled yann.morin
2025-11-28 12:28 ` yann.morin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox