All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH RFC 0/3] support hooks and tables in virtual packages
@ 2019-10-30 13:27 unixmania at gmail.com
  2019-10-30 13:27 ` [Buildroot] [PATCH RFC 1/3] package/pkg-generic.mk: " unixmania at gmail.com
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: unixmania at gmail.com @ 2019-10-30 13:27 UTC (permalink / raw)
  To: buildroot

From: Carlos Santos <unixmania@gmail.com>

Virtual packages are not built but it's useful to allow them to have
permission/device/user tables and target-finalize/rootfs-pre-cmd hooks.

With this change we don't need to replicate date as currently done in
eudev and systemd user tables or test if the package is selected to add
a target-finalize hook as in luainterpreter.

Carlos Santos (3):
  package/pkg-generic.mk: support hooks and tables in virtual packages
  packages/luainterpreter: remove target-finalize hack
  packages/{eudev,systemd}: move commoun users to package/udev

 package/eudev/eudev.mk                   |  7 -------
 package/luainterpreter/luainterpreter.mk |  7 +------
 package/pkg-generic.mk                   | 17 +++++++++++++++++
 package/systemd/systemd.mk               |  3 ---
 package/udev/udev.mk                     |  7 +++++++
 5 files changed, 25 insertions(+), 16 deletions(-)

-- 
2.18.1

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

* [Buildroot] [PATCH RFC 1/3] package/pkg-generic.mk: support hooks and tables in virtual packages
  2019-10-30 13:27 [Buildroot] [PATCH RFC 0/3] support hooks and tables in virtual packages unixmania at gmail.com
@ 2019-10-30 13:27 ` unixmania at gmail.com
  2019-10-31 20:15   ` Yann E. MORIN
  2020-08-30 16:11   ` Arnout Vandecappelle
  2019-10-30 13:27 ` [Buildroot] [PATCH RFC 2/3] packages/luainterpreter: remove target-finalize hack unixmania at gmail.com
  2019-10-30 13:27 ` [Buildroot] [PATCH RFC 3/3] packages/{eudev, systemd}: move commoun users to package/udev unixmania at gmail.com
  2 siblings, 2 replies; 10+ messages in thread
From: unixmania at gmail.com @ 2019-10-30 13:27 UTC (permalink / raw)
  To: buildroot

From: Carlos Santos <unixmania@gmail.com>

Virtual packages are not built but it's useful to allow them to have
permission/device/user tables and target-finalize/rootfs-pre-cmd hooks.

With this change we don't need to replicate date as currently done in
eudev and systemd user tables or test if the package is selected to add
a target-finalize hook as in luainterpreter.

Signed-off-by: Carlos Santos <unixmania@gmail.com>
---
 package/pkg-generic.mk | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 893faba22a..7b3f1646ae 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -930,6 +930,7 @@ $$($(2)_TARGET_DIRCLEAN):		PKG=$(2)
 # Compute the name of the Kconfig option that correspond to the
 # package being enabled. We handle three cases: the special Linux
 # kernel case, the bootloaders case, and the normal packages case.
+# Virtual packages are handled separately (see below).
 ifeq ($(1),linux)
 $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
 else ifneq ($$(filter boot/% $$(foreach dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/boot/%),$(pkgdir)),)
@@ -1118,6 +1119,22 @@ ifneq ($$($(2)_HELP_CMDS),)
 HELP_PACKAGES += $(2)
 endif
 
+# Virtual packages are not built but it's useful to allow them to have
+# permission/device/user tables and target-finalize/rootfs-pre-cmd hooks.
+else ifeq ($$(BR2_PACKAGE_HAS_$(2)),y) # $(2)_KCONFIG_VAR
+
+ifneq ($$($(2)_PERMISSIONS),)
+PACKAGES_PERMISSIONS_TABLE += $$($(2)_PERMISSIONS)$$(sep)
+endif
+ifneq ($$($(2)_DEVICES),)
+PACKAGES_DEVICES_TABLE += $$($(2)_DEVICES)$$(sep)
+endif
+ifneq ($$($(2)_USERS),)
+PACKAGES_USERS += $$($(2)_USERS)$$(sep)
+endif
+TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS)
+ROOTFS_PRE_CMD_HOOKS += $$($(2)_ROOTFS_PRE_CMD_HOOKS)
+
 endif # $(2)_KCONFIG_VAR
 endef # inner-generic-package
 
-- 
2.18.1

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

* [Buildroot] [PATCH RFC 2/3] packages/luainterpreter: remove target-finalize hack
  2019-10-30 13:27 [Buildroot] [PATCH RFC 0/3] support hooks and tables in virtual packages unixmania at gmail.com
  2019-10-30 13:27 ` [Buildroot] [PATCH RFC 1/3] package/pkg-generic.mk: " unixmania at gmail.com
@ 2019-10-30 13:27 ` unixmania at gmail.com
  2020-08-30 16:11   ` Arnout Vandecappelle
  2019-10-30 13:27 ` [Buildroot] [PATCH RFC 3/3] packages/{eudev, systemd}: move commoun users to package/udev unixmania at gmail.com
  2 siblings, 1 reply; 10+ messages in thread
From: unixmania at gmail.com @ 2019-10-30 13:27 UTC (permalink / raw)
  To: buildroot

From: Carlos Santos <unixmania@gmail.com>

Use LUAINTERPRETER_TARGET_FINALIZE_HOOKS, now that it's suported by
virtual packages.

Signed-off-by: Carlos Santos <unixmania@gmail.com>
---
 package/luainterpreter/luainterpreter.mk | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/package/luainterpreter/luainterpreter.mk b/package/luainterpreter/luainterpreter.mk
index 58d421b183..828b71e8d2 100644
--- a/package/luainterpreter/luainterpreter.mk
+++ b/package/luainterpreter/luainterpreter.mk
@@ -6,16 +6,11 @@
 
 LUAINTERPRETER_ABIVER = $(call qstrip,$(BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION))
 
-# Lua packages often install documentation, clean that up globally
-# Since luainterpreter is a virtual package, we can't use
-# LUAINTERPRETER_TARGET_FINALIZE_HOOKS
-ifeq ($(BR2_PACKAGE_HAS_LUAINTERPRETER),y)
 define LUAINTERPRETER_REMOVE_DOC
 	rm -rf $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/doc
 endef
 
-TARGET_FINALIZE_HOOKS += LUAINTERPRETER_REMOVE_DOC
-endif
+LUAINTERPRETER_TARGET_FINALIZE_HOOKS += LUAINTERPRETER_REMOVE_DOC
 
 $(eval $(virtual-package))
 $(eval $(host-virtual-package))
-- 
2.18.1

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

* [Buildroot] [PATCH RFC 3/3] packages/{eudev, systemd}: move commoun users to package/udev
  2019-10-30 13:27 [Buildroot] [PATCH RFC 0/3] support hooks and tables in virtual packages unixmania at gmail.com
  2019-10-30 13:27 ` [Buildroot] [PATCH RFC 1/3] package/pkg-generic.mk: " unixmania at gmail.com
  2019-10-30 13:27 ` [Buildroot] [PATCH RFC 2/3] packages/luainterpreter: remove target-finalize hack unixmania at gmail.com
@ 2019-10-30 13:27 ` unixmania at gmail.com
  2020-08-30 16:12   ` Arnout Vandecappelle
  2 siblings, 1 reply; 10+ messages in thread
From: unixmania at gmail.com @ 2019-10-30 13:27 UTC (permalink / raw)
  To: buildroot

From: Carlos Santos <unixmania@gmail.com>

Use UDEV_USERS, now that it's suported by virtual packages.

Signed-off-by: Carlos Santos <unixmania@gmail.com>
---
 package/eudev/eudev.mk     | 7 -------
 package/systemd/systemd.mk | 3 ---
 package/udev/udev.mk       | 7 +++++++
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/package/eudev/eudev.mk b/package/eudev/eudev.mk
index 2a3adb849c..c7597738b0 100644
--- a/package/eudev/eudev.mk
+++ b/package/eudev/eudev.mk
@@ -48,11 +48,4 @@ define EUDEV_INSTALL_INIT_SYSV
 	$(INSTALL) -D -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
-	- - render -1 * - - - DRI rendering nodes
-	- - kvm -1 * - - - kvm nodes
-endef
-
 $(eval $(autotools-package))
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index df40961fee..512e124149 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -477,10 +477,7 @@ define SYSTEMD_INSTALL_IMAGES_CMDS
 endef
 
 define SYSTEMD_USERS
-	- - input -1 * - - - Input device group
 	- - systemd-journal -1 * - - - Journal
-	- - render -1 * - - - DRI rendering nodes
-	- - kvm -1 * - - - kvm nodes
 	systemd-bus-proxy -1 systemd-bus-proxy -1 * - - - Proxy D-Bus messages to/from a bus
 	systemd-journal-gateway -1 systemd-journal-gateway -1 * /var/log/journal - - Journal Gateway
 	systemd-journal-remote -1 systemd-journal-remote -1 * /var/log/journal/remote - - Journal Remote
diff --git a/package/udev/udev.mk b/package/udev/udev.mk
index cc4a6e3a26..05b35b21f0 100644
--- a/package/udev/udev.mk
+++ b/package/udev/udev.mk
@@ -4,4 +4,11 @@
 #
 ################################################################################
 
+# Required by default rules for input devices
+define UDEV_USERS
+	- - input -1 * - - - Input device group
+	- - render -1 * - - - DRI rendering nodes
+	- - kvm -1 * - - - kvm nodes
+endef
+
 $(eval $(virtual-package))
-- 
2.18.1

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

* [Buildroot] [PATCH RFC 1/3] package/pkg-generic.mk: support hooks and tables in virtual packages
  2019-10-30 13:27 ` [Buildroot] [PATCH RFC 1/3] package/pkg-generic.mk: " unixmania at gmail.com
@ 2019-10-31 20:15   ` Yann E. MORIN
  2019-10-31 21:47     ` Carlos Santos
  2020-08-30 16:11   ` Arnout Vandecappelle
  1 sibling, 1 reply; 10+ messages in thread
From: Yann E. MORIN @ 2019-10-31 20:15 UTC (permalink / raw)
  To: buildroot

Carlos, All,

On 2019-10-30 10:27 -0300, unixmania at gmail.com spake thusly:
> From: Carlos Santos <unixmania@gmail.com>
> 
> Virtual packages are not built but it's useful to allow them to have
> permission/device/user tables and target-finalize/rootfs-pre-cmd hooks.

Agreed, that would be nice to deduplicate such things.

> With this change we don't need to replicate date as currently done in

What do you mean by "date"?

> eudev and systemd user tables or test if the package is selected to add
> a target-finalize hook as in luainterpreter.
> 
> Signed-off-by: Carlos Santos <unixmania@gmail.com>
> ---
>  package/pkg-generic.mk | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 893faba22a..7b3f1646ae 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -930,6 +930,7 @@ $$($(2)_TARGET_DIRCLEAN):		PKG=$(2)
>  # Compute the name of the Kconfig option that correspond to the
>  # package being enabled. We handle three cases: the special Linux
>  # kernel case, the bootloaders case, and the normal packages case.
> +# Virtual packages are handled separately (see below).
>  ifeq ($(1),linux)
>  $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
>  else ifneq ($$(filter boot/% $$(foreach dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/boot/%),$(pkgdir)),)
> @@ -1118,6 +1119,22 @@ ifneq ($$($(2)_HELP_CMDS),)
>  HELP_PACKAGES += $(2)
>  endif
>  
> +# Virtual packages are not built but it's useful to allow them to have
> +# permission/device/user tables and target-finalize/rootfs-pre-cmd hooks.
> +else ifeq ($$(BR2_PACKAGE_HAS_$(2)),y) # $(2)_KCONFIG_VAR

Actually, I think that virtual packages should instead also be "nornal"
packages, so that they use the standard code path. By "normal" package,
I mean they should also have a BR2_PACKAGE_FOO option in addition to the
BR2_PACKAGE_HAS_FOO option.

For example, we already have one virtual package that is both normal and
virtual: the skeleton package has both BR2_PACKAGE_HAS_SKELETON and
BR2_PACKAGE_SKELETON.

pkg-virtual.mk is probably the place to make that systematic, something
like:

    BR2_PACKAGE_$(2) = $$(BR2_PACKAGE_HAS_$(2))

... so that virtual packages do not have to all repeat the variable...

Unless there is a big road-block that prevents virtual package to be
treated as normal packages...

Regards,
Yann E. MORIN.

> +ifneq ($$($(2)_PERMISSIONS),)
> +PACKAGES_PERMISSIONS_TABLE += $$($(2)_PERMISSIONS)$$(sep)
> +endif
> +ifneq ($$($(2)_DEVICES),)
> +PACKAGES_DEVICES_TABLE += $$($(2)_DEVICES)$$(sep)
> +endif
> +ifneq ($$($(2)_USERS),)
> +PACKAGES_USERS += $$($(2)_USERS)$$(sep)
> +endif
> +TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS)
> +ROOTFS_PRE_CMD_HOOKS += $$($(2)_ROOTFS_PRE_CMD_HOOKS)
> +
>  endif # $(2)_KCONFIG_VAR
>  endef # inner-generic-package
>  
> -- 
> 2.18.1
> 
> _______________________________________________
> 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 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH RFC 1/3] package/pkg-generic.mk: support hooks and tables in virtual packages
  2019-10-31 20:15   ` Yann E. MORIN
@ 2019-10-31 21:47     ` Carlos Santos
  2019-11-02 23:42       ` Carlos Santos
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos Santos @ 2019-10-31 21:47 UTC (permalink / raw)
  To: buildroot

On Thu, Oct 31, 2019 at 5:15 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> Carlos, All,
>
> On 2019-10-30 10:27 -0300, unixmania at gmail.com spake thusly:
> > From: Carlos Santos <unixmania@gmail.com>
> >
> > Virtual packages are not built but it's useful to allow them to have
> > permission/device/user tables and target-finalize/rootfs-pre-cmd hooks.
>
> Agreed, that would be nice to deduplicate such things.
>
> > With this change we don't need to replicate date as currently done in
>
> What do you mean by "date"?

It means "typo", should be "data".

> > eudev and systemd user tables or test if the package is selected to add
> > a target-finalize hook as in luainterpreter.
> >
> > Signed-off-by: Carlos Santos <unixmania@gmail.com>
> > ---
> >  package/pkg-generic.mk | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> >
> > diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> > index 893faba22a..7b3f1646ae 100644
> > --- a/package/pkg-generic.mk
> > +++ b/package/pkg-generic.mk
> > @@ -930,6 +930,7 @@ $$($(2)_TARGET_DIRCLEAN):         PKG=$(2)
> >  # Compute the name of the Kconfig option that correspond to the
> >  # package being enabled. We handle three cases: the special Linux
> >  # kernel case, the bootloaders case, and the normal packages case.
> > +# Virtual packages are handled separately (see below).
> >  ifeq ($(1),linux)
> >  $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
> >  else ifneq ($$(filter boot/% $$(foreach dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/boot/%),$(pkgdir)),)
> > @@ -1118,6 +1119,22 @@ ifneq ($$($(2)_HELP_CMDS),)
> >  HELP_PACKAGES += $(2)
> >  endif
> >
> > +# Virtual packages are not built but it's useful to allow them to have
> > +# permission/device/user tables and target-finalize/rootfs-pre-cmd hooks.
> > +else ifeq ($$(BR2_PACKAGE_HAS_$(2)),y) # $(2)_KCONFIG_VAR
>
> Actually, I think that virtual packages should instead also be "nornal"
> packages, so that they use the standard code path. By "normal" package,
> I mean they should also have a BR2_PACKAGE_FOO option in addition to the
> BR2_PACKAGE_HAS_FOO option.

So we could use this, instead, instead of the else below :

# Compute the name of the Kconfig option that correspond to the
# package being enabled. We handle three cases: the special Linux
# kernel case, the bootloaders case, and the normal packages case.
# Virtual packages are not built but it's useful to allow them to have
# permission/device/user tables and target-finalize/rootfs-pre-cmd
hooks.
ifeq ($(1),linux)
$(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
else ifneq ($$(filter boot/% $$(foreach
dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/boot/%),$(pkgdir)),)
$(2)_KCONFIG_VAR = BR2_TARGET_$(2)
else ifneq ($$(filter toolchain/% $$(foreach
dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/toolchain/%),$(pkgdir)),)
$(2)_KCONFIG_VAR = BR2_$(2)
else ifeq ($(2)_IS_VIRTUAL,YES)
$(2)_KCONFIG_VAR = BR2_PACKAGE_HAS_$(2)
else
$(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
endif

> For example, we already have one virtual package that is both normal and
> virtual: the skeleton package has both BR2_PACKAGE_HAS_SKELETON and
> BR2_PACKAGE_SKELETON.

Right, but BR2_PACKAGE_SKELETON does not seem to be used anywhere.
Perhaps it should can be removed.

> pkg-virtual.mk is probably the place to make that systematic, something
> like:
>
>     BR2_PACKAGE_$(2) = $$(BR2_PACKAGE_HAS_$(2))
>
> ... so that virtual packages do not have to all repeat the variable...
>
> Unless there is a big road-block that prevents virtual package to be
> treated as normal packages...

It creates a conflict with BR2_PACKAGE_UDEV in Config.in.legacy.

> Regards,
> Yann E. MORIN.
>
> > +ifneq ($$($(2)_PERMISSIONS),)
> > +PACKAGES_PERMISSIONS_TABLE += $$($(2)_PERMISSIONS)$$(sep)
> > +endif
> > +ifneq ($$($(2)_DEVICES),)
> > +PACKAGES_DEVICES_TABLE += $$($(2)_DEVICES)$$(sep)
> > +endif
> > +ifneq ($$($(2)_USERS),)
> > +PACKAGES_USERS += $$($(2)_USERS)$$(sep)
> > +endif
> > +TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS)
> > +ROOTFS_PRE_CMD_HOOKS += $$($(2)_ROOTFS_PRE_CMD_HOOKS)
> > +
> >  endif # $(2)_KCONFIG_VAR
> >  endef # inner-generic-package
> >
> > --
> > 2.18.1
> >
> > _______________________________________________
> > 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 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'



-- 
Carlos Santos <unixmania@gmail.com>

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

* [Buildroot] [PATCH RFC 1/3] package/pkg-generic.mk: support hooks and tables in virtual packages
  2019-10-31 21:47     ` Carlos Santos
@ 2019-11-02 23:42       ` Carlos Santos
  0 siblings, 0 replies; 10+ messages in thread
From: Carlos Santos @ 2019-11-02 23:42 UTC (permalink / raw)
  To: buildroot

On Thu, Oct 31, 2019 at 6:47 PM Carlos Santos <unixmania@gmail.com> wrote:
>
> On Thu, Oct 31, 2019 at 5:15 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> >
> > Carlos, All,
> >
> > On 2019-10-30 10:27 -0300, unixmania at gmail.com spake thusly:
> > > From: Carlos Santos <unixmania@gmail.com>
> > >
> > > Virtual packages are not built but it's useful to allow them to have
> > > permission/device/user tables and target-finalize/rootfs-pre-cmd hooks.
> >
> > Agreed, that would be nice to deduplicate such things.
> >
> > > With this change we don't need to replicate date as currently done in
> >
> > What do you mean by "date"?
>
> It means "typo", should be "data".
>
> > > eudev and systemd user tables or test if the package is selected to add
> > > a target-finalize hook as in luainterpreter.
> > >
> > > Signed-off-by: Carlos Santos <unixmania@gmail.com>
> > > ---
> > >  package/pkg-generic.mk | 17 +++++++++++++++++
> > >  1 file changed, 17 insertions(+)
> > >
> > > diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> > > index 893faba22a..7b3f1646ae 100644
> > > --- a/package/pkg-generic.mk
> > > +++ b/package/pkg-generic.mk
> > > @@ -930,6 +930,7 @@ $$($(2)_TARGET_DIRCLEAN):         PKG=$(2)
> > >  # Compute the name of the Kconfig option that correspond to the
> > >  # package being enabled. We handle three cases: the special Linux
> > >  # kernel case, the bootloaders case, and the normal packages case.
> > > +# Virtual packages are handled separately (see below).
> > >  ifeq ($(1),linux)
> > >  $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
> > >  else ifneq ($$(filter boot/% $$(foreach dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/boot/%),$(pkgdir)),)
> > > @@ -1118,6 +1119,22 @@ ifneq ($$($(2)_HELP_CMDS),)
> > >  HELP_PACKAGES += $(2)
> > >  endif
> > >
> > > +# Virtual packages are not built but it's useful to allow them to have
> > > +# permission/device/user tables and target-finalize/rootfs-pre-cmd hooks.
> > > +else ifeq ($$(BR2_PACKAGE_HAS_$(2)),y) # $(2)_KCONFIG_VAR
> >
> > Actually, I think that virtual packages should instead also be "nornal"
> > packages, so that they use the standard code path. By "normal" package,
> > I mean they should also have a BR2_PACKAGE_FOO option in addition to the
> > BR2_PACKAGE_HAS_FOO option.
>
> So we could use this, instead, instead of the else below :
>
> # Compute the name of the Kconfig option that correspond to the
> # package being enabled. We handle three cases: the special Linux
> # kernel case, the bootloaders case, and the normal packages case.
> # Virtual packages are not built but it's useful to allow them to have
> # permission/device/user tables and target-finalize/rootfs-pre-cmd
> hooks.
> ifeq ($(1),linux)
> $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
> else ifneq ($$(filter boot/% $$(foreach
> dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/boot/%),$(pkgdir)),)
> $(2)_KCONFIG_VAR = BR2_TARGET_$(2)
> else ifneq ($$(filter toolchain/% $$(foreach
> dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/toolchain/%),$(pkgdir)),)
> $(2)_KCONFIG_VAR = BR2_$(2)
> else ifeq ($(2)_IS_VIRTUAL,YES)
> $(2)_KCONFIG_VAR = BR2_PACKAGE_HAS_$(2)
> else
> $(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
> endif

I attempted this solution but it adds virtual packages to the global
package list unless I add something like

ifeq ($$($(2)_IS_VIRTUAL),)
PACKAGES += $(1)
endif

Also it does not seem to make sense to check FOO_PROVIDES and process
reverse dependencies.

-- 
Carlos Santos <unixmania@gmail.com>

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

* [Buildroot] [PATCH RFC 1/3] package/pkg-generic.mk: support hooks and tables in virtual packages
  2019-10-30 13:27 ` [Buildroot] [PATCH RFC 1/3] package/pkg-generic.mk: " unixmania at gmail.com
  2019-10-31 20:15   ` Yann E. MORIN
@ 2020-08-30 16:11   ` Arnout Vandecappelle
  1 sibling, 0 replies; 10+ messages in thread
From: Arnout Vandecappelle @ 2020-08-30 16:11 UTC (permalink / raw)
  To: buildroot



On 30/10/2019 14:27, unixmania at gmail.com wrote:
> From: Carlos Santos <unixmania@gmail.com>
> 
> Virtual packages are not built but it's useful to allow them to have
> permission/device/user tables and target-finalize/rootfs-pre-cmd hooks.
> 
> With this change we don't need to replicate date as currently done in
> eudev and systemd user tables or test if the package is selected to add
> a target-finalize hook as in luainterpreter.
> 
> Signed-off-by: Carlos Santos <unixmania@gmail.com>

 Since Yann's suggestion didn't work, I've applied the original (with typo fixes
in commit message) to next, thanks.

 Regards,
 Arnout

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

* [Buildroot] [PATCH RFC 2/3] packages/luainterpreter: remove target-finalize hack
  2019-10-30 13:27 ` [Buildroot] [PATCH RFC 2/3] packages/luainterpreter: remove target-finalize hack unixmania at gmail.com
@ 2020-08-30 16:11   ` Arnout Vandecappelle
  0 siblings, 0 replies; 10+ messages in thread
From: Arnout Vandecappelle @ 2020-08-30 16:11 UTC (permalink / raw)
  To: buildroot



On 30/10/2019 14:27, unixmania at gmail.com wrote:
> From: Carlos Santos <unixmania@gmail.com>
> 
> Use LUAINTERPRETER_TARGET_FINALIZE_HOOKS, now that it's suported by
> virtual packages.
> 
> Signed-off-by: Carlos Santos <unixmania@gmail.com>
> ---
>  package/luainterpreter/luainterpreter.mk | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/package/luainterpreter/luainterpreter.mk b/package/luainterpreter/luainterpreter.mk
> index 58d421b183..828b71e8d2 100644
> --- a/package/luainterpreter/luainterpreter.mk
> +++ b/package/luainterpreter/luainterpreter.mk
> @@ -6,16 +6,11 @@
>  
>  LUAINTERPRETER_ABIVER = $(call qstrip,$(BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION))
>  
> -# Lua packages often install documentation, clean that up globally

 This comment was still relevant, so I kept that and applied to next, thanks.

 Regards,
 Arnout

> -# Since luainterpreter is a virtual package, we can't use
> -# LUAINTERPRETER_TARGET_FINALIZE_HOOKS
> -ifeq ($(BR2_PACKAGE_HAS_LUAINTERPRETER),y)
>  define LUAINTERPRETER_REMOVE_DOC
>  	rm -rf $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/doc
>  endef
>  
> -TARGET_FINALIZE_HOOKS += LUAINTERPRETER_REMOVE_DOC
> -endif
> +LUAINTERPRETER_TARGET_FINALIZE_HOOKS += LUAINTERPRETER_REMOVE_DOC
>  
>  $(eval $(virtual-package))
>  $(eval $(host-virtual-package))
> 

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

* [Buildroot] [PATCH RFC 3/3] packages/{eudev, systemd}: move commoun users to package/udev
  2019-10-30 13:27 ` [Buildroot] [PATCH RFC 3/3] packages/{eudev, systemd}: move commoun users to package/udev unixmania at gmail.com
@ 2020-08-30 16:12   ` Arnout Vandecappelle
  0 siblings, 0 replies; 10+ messages in thread
From: Arnout Vandecappelle @ 2020-08-30 16:12 UTC (permalink / raw)
  To: buildroot



On 30/10/2019 14:27, unixmania at gmail.com wrote:
> From: Carlos Santos <unixmania@gmail.com>
> 
> Use UDEV_USERS, now that it's suported by virtual packages.
> 
> Signed-off-by: Carlos Santos <unixmania@gmail.com>


 Applied to next, thanks.

 Regards,
 Arnout

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

end of thread, other threads:[~2020-08-30 16:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-30 13:27 [Buildroot] [PATCH RFC 0/3] support hooks and tables in virtual packages unixmania at gmail.com
2019-10-30 13:27 ` [Buildroot] [PATCH RFC 1/3] package/pkg-generic.mk: " unixmania at gmail.com
2019-10-31 20:15   ` Yann E. MORIN
2019-10-31 21:47     ` Carlos Santos
2019-11-02 23:42       ` Carlos Santos
2020-08-30 16:11   ` Arnout Vandecappelle
2019-10-30 13:27 ` [Buildroot] [PATCH RFC 2/3] packages/luainterpreter: remove target-finalize hack unixmania at gmail.com
2020-08-30 16:11   ` Arnout Vandecappelle
2019-10-30 13:27 ` [Buildroot] [PATCH RFC 3/3] packages/{eudev, systemd}: move commoun users to package/udev unixmania at gmail.com
2020-08-30 16:12   ` Arnout Vandecappelle

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.