All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] systemd: Allow building with no init system
@ 2018-09-17 18:29 Trent Piepho
  2018-10-21 17:28 ` Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: Trent Piepho @ 2018-09-17 18:29 UTC (permalink / raw)
  To: buildroot

It's possible to build systemd, and use the systemd libraries, on a
target with no init system.

While installing systemd when trying to use SysV init will result in
systemd clobbering the SysV system and vice versa, it may well work when
no init system has been selected.  For instance, when building an SDK
the sytemd headers and libraries might be necessary but there is no
reason to have an init system selected.  Someone creating a custom init
system might also want some of the systemd libraries.

Signed-off-by: Trent Piepho <tpiepho@impinj.com>
---
 package/systemd/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/systemd/Config.in b/package/systemd/Config.in
index c858d89c05..71d37f6a5a 100644
--- a/package/systemd/Config.in
+++ b/package/systemd/Config.in
@@ -9,7 +9,7 @@ config BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS
 
 menuconfig BR2_PACKAGE_SYSTEMD
 	bool "systemd"
-	depends on BR2_INIT_SYSTEMD
+	depends on BR2_INIT_SYSTEMD || BR2_INIT_NONE
 	depends on !BR2_STATIC_LIBS # kmod
 	depends on BR2_TOOLCHAIN_HAS_THREADS # dbus
 	depends on BR2_USE_MMU # dbus
-- 
2.14.4

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

* [Buildroot] [PATCH] systemd: Allow building with no init system
  2018-09-17 18:29 [Buildroot] [PATCH] systemd: Allow building with no init system Trent Piepho
@ 2018-10-21 17:28 ` Arnout Vandecappelle
  2018-10-22 18:31   ` Trent Piepho
  0 siblings, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2018-10-21 17:28 UTC (permalink / raw)
  To: buildroot

 Hi Trent,

On 17/09/2018 19:29, Trent Piepho wrote:
> It's possible to build systemd, and use the systemd libraries, on a
> target with no init system.
> 
> While installing systemd when trying to use SysV init will result in
> systemd clobbering the SysV system and vice versa, it may well work when
> no init system has been selected.  For instance, when building an SDK
> the sytemd headers and libraries might be necessary but there is no
> reason to have an init system selected.  Someone creating a custom init
> system might also want some of the systemd libraries.

 I understand your reasoning and I tend to agree to some extent.

 However, for the use cases you mention, you can actually just enable
BR2_INIT_SYSTEMD. If you really don't want /sbin/init in your target, just
remove it post-build.

 To *properly* support a libsystemd-only configuration, a lot more should
change. Basically, nothing should be installed in target except for
libsystemd.so (and the header files which will be removed in finalize). Also,
there is a possible conflict with eudev that needs to be resolved. Possibly
other things would need to be cleaned up as well.

 But basically, we don't really see a use case that warrants all this additional
complexity. Just enable BR2_INIT_SYSTEMD and clean up post-build.

 Regards,
 Arnout

> 
> Signed-off-by: Trent Piepho <tpiepho@impinj.com>
> ---
>  package/systemd/Config.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/systemd/Config.in b/package/systemd/Config.in
> index c858d89c05..71d37f6a5a 100644
> --- a/package/systemd/Config.in
> +++ b/package/systemd/Config.in
> @@ -9,7 +9,7 @@ config BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS
>  
>  menuconfig BR2_PACKAGE_SYSTEMD
>  	bool "systemd"
> -	depends on BR2_INIT_SYSTEMD
> +	depends on BR2_INIT_SYSTEMD || BR2_INIT_NONE
>  	depends on !BR2_STATIC_LIBS # kmod
>  	depends on BR2_TOOLCHAIN_HAS_THREADS # dbus
>  	depends on BR2_USE_MMU # dbus
> 

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

* [Buildroot] [PATCH] systemd: Allow building with no init system
  2018-10-21 17:28 ` Arnout Vandecappelle
@ 2018-10-22 18:31   ` Trent Piepho
  2018-10-22 22:49     ` Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: Trent Piepho @ 2018-10-22 18:31 UTC (permalink / raw)
  To: buildroot

On Sun, 2018-10-21 at 18:28 +0100, Arnout Vandecappelle wrote:
> On 17/09/2018 19:29, Trent Piepho wrote:
> > It's possible to build systemd, and use the systemd libraries, on a
> > target with no init system.
> > 
> > While installing systemd when trying to use SysV init will result in
> > systemd clobbering the SysV system and vice versa, it may well work when
> > no init system has been selected.  For instance, when building an SDK
> > the sytemd headers and libraries might be necessary but there is no
> > reason to have an init system selected.  Someone creating a custom init
> > system might also want some of the systemd libraries.
> 
>  I understand your reasoning and I tend to agree to some extent.
> 
>  However, for the use cases you mention, you can actually just enable
> BR2_INIT_SYSTEMD. If you really don't want /sbin/init in your target, just
> remove it post-build.

You get /usr/sbin/init either way.  What I was trying to do was to stop
building target dbus plus dependencies for an SDK.  But this doesn't
really do that so it doesn't accomplish all that much on it's own.

>  To *properly* support a libsystemd-only configuration, a lot more should
> change. Basically, nothing should be installed in target except for
> libsystemd.so (and the header files which will be removed in finalize). Also,
> there is a possible conflict with eudev that needs to be resolved. Possibly
> other things would need to be cleaned up as well.

I figured that either one is creating an SDK, in which case it doesn't
matter what is in target as long as the stage has the libraries, or one
is creating a custom hybrid init, in which case they'll have to figure
out the above and lot of other things too.

You've got a point about nothing installed on target, that happens to
apply very much to an SDK.  Why even run the target_install steps when
building an SDK? Why not skip the build of any target package without a
INSTALL_STAGING component?

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

* [Buildroot] [PATCH] systemd: Allow building with no init system
  2018-10-22 18:31   ` Trent Piepho
@ 2018-10-22 22:49     ` Arnout Vandecappelle
  0 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2018-10-22 22:49 UTC (permalink / raw)
  To: buildroot

 Hi Trent,

On 10/22/18 7:31 PM, Trent Piepho wrote:
> On Sun, 2018-10-21 at 18:28 +0100, Arnout Vandecappelle wrote:
>> On 17/09/2018 19:29, Trent Piepho wrote:
>>> It's possible to build systemd, and use the systemd libraries, on a
>>> target with no init system.
>>>
>>> While installing systemd when trying to use SysV init will result in
>>> systemd clobbering the SysV system and vice versa, it may well work when
>>> no init system has been selected.  For instance, when building an SDK
>>> the sytemd headers and libraries might be necessary but there is no
>>> reason to have an init system selected.  Someone creating a custom init
>>> system might also want some of the systemd libraries.
>>
>>  I understand your reasoning and I tend to agree to some extent.
>>
>>  However, for the use cases you mention, you can actually just enable
>> BR2_INIT_SYSTEMD. If you really don't want /sbin/init in your target, just
>> remove it post-build.
> 
> You get /usr/sbin/init either way.  What I was trying to do was to stop
> building target dbus plus dependencies for an SDK.  But this doesn't
> really do that so it doesn't accomplish all that much on it's own.

 Indeed, also the dependencies that are not really needed should be removed to
be completely correct.

> 
>>  To *properly* support a libsystemd-only configuration, a lot more should
>> change. Basically, nothing should be installed in target except for
>> libsystemd.so (and the header files which will be removed in finalize). Also,
>> there is a possible conflict with eudev that needs to be resolved. Possibly
>> other things would need to be cleaned up as well.
> 
> I figured that either one is creating an SDK, in which case it doesn't
> matter what is in target as long as the stage has the libraries, or one
> is creating a custom hybrid init, in which case they'll have to figure
> out the above and lot of other things too.
> 
> You've got a point about nothing installed on target, that happens to
> apply very much to an SDK.  Why even run the target_install steps when
> building an SDK? Why not skip the build of any target package without a
> INSTALL_STAGING component?

 Well, for starters, the SDK usecase is a fairly recent addition to Buildroot.
It's not our core business to generate an SDK. There is no way for Buildroot to
"know" that you're building an SDK: you just select a bunch of packages and then
run 'make sdk' but that is just doing a 'make all' plus some postprocessing.

 So you could add a Kconfig symbols that says that you're building just an SDK,
and use that to avoid creating a target directory. But that seems like a lot of
effort and complexity for pretty little gain: how much does it hurt you to have
that target directory lying around?

 If we were to go that way, we would really want to rework the way we do staging
and target install. Instead of doing both in parallel, it would be better to
always install to staging, and then copy from staging to target. But that is a
major rework which requires modifying a lot of packages. So it will not happen
any time soon :-)

 Regards,
 Arnout

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-17 18:29 [Buildroot] [PATCH] systemd: Allow building with no init system Trent Piepho
2018-10-21 17:28 ` Arnout Vandecappelle
2018-10-22 18:31   ` Trent Piepho
2018-10-22 22:49     ` 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.