package/systemd: Allow extra config options
PATCH 1/1 package/systemd: Allow extra config options
Systemd has very many options, adding a way for the user to set custom options can help customizations without changing buildroot files.
--- package/systemd/Config.in | 8 ++++++++ package/systemd/systemd.mk | 2 ++ 2 files changed, 10 insertions(+)
package/systemd/Config.in +8 -0
@@ -89,6 +89,14 @@ if BR2_PACKAGE_SYSTEMD config BR2_PACKAGE_PROVIDES_UDEV default "systemd" +config BR2_PACKAGE_SYSTEMD_EXTRA_CONFIG + string "Additional target systemd options" + default "" + help + Any additional systemd configure options you may want to + include. The options are appended to Buildroot generated + options and can override these. + config BR2_PACKAGE_SYSTEMD_BOOT bool "systemd-boot" depends on BR2_i386 || BR2_x86_64
package/systemd/systemd.mk +2 -0
@@ -500,6 +500,8 @@ ifneq ($(SYSTEMD_FALLBACK_HOSTNAME),) SYSTEMD_CONF_OPTS += -Dfallback-hostname=$(SYSTEMD_FALLBACK_HOSTNAME) endif +SYSTEMD_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_SYSTEMD_EXTRA_CONFIG)) + define SYSTEMD_INSTALL_INIT_HOOK ln -fs multi-user.target \ $(TARGET_DIR)/usr/lib/systemd/system/default.target
Signature · 1 line
2.29.2
Hello Norbert,
Le 26/11/2020 à 16:28, Norbert Lange a écrit :
Quoted 3 lines
Systemd has very many options, adding a way for the user to set custom options can help customizations without changing buildroot files.
This is also true of any package in Buildroot. Users may want to provide a custom option that is not handled yet by Buildroot.
What if the option provided in BR2_PACKAGE_SYSTEMD_EXTRA_CONFIG requires a build dependency ?
Best regards,
Romain
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 7 lines · Romain Naour
Hello Norbert,
Le 26/11/2020 à 16:28, Norbert Lange a écrit :
Quoted 3 lines
Systemd has very many options, adding a way for the user to set custom options can help customizations without changing buildroot files.
Quoted 5 lines
This is also true of any package in Buildroot. Users may want to provide a custom option that is not handled yet by Buildroot.
What if the option provided in
BR2_PACKAGE_SYSTEMD_EXTRA_CONFIGrequires a build dependency ?
Also, I think it's possible to do this in a br2-external. Something like:
systemd-overrides.mk:
ifeq ($(BR2_PACKAGE_SYSTEMD_OVERRIDES),y)SYSTEMD_CONF_OPTS += -Dfoo -DbarSYSTEMD_DEPENDENCIES = foobar
endif
Regards,
Arnout
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Am Sa., 8. Jan. 2022 um 12:04 Uhr schrieb Romain Naour <[email protected]>:
Quoted 8 lines
Hello Norbert,
Quoted 3 lines · Norbert Lange
Systemd has very many options, adding a way for the user to set custom options can help customizations without changing buildroot files.
Quoted 5 lines
This is also true of any package in Buildroot. Users may want to provide a custom option that is not handled yet by Buildroot.
What if the option provided in
BR2_PACKAGE_SYSTEMD_EXTRA_CONFIGrequires a build dependency ?
Responsibility for the guy using those extra options. You have those extra options for a few packages
like QT5.
systemd has a remarkable bunch of options, and upstreaming changes takes years (I dont have any blackmail on the maintainers, your experience may differ ;) )
Quoted 3 lines
Best regards,
Romain
Norbert
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 4 lines · Norbert Lange
Systemd has very many options, adding a way for the user to set custom options can help customizations without changing buildroot files.
I'm not sure this is a good idea, if a configuration option needs customizability it
probably needs a specific kconfig option. Systemd config options tend to require dependency selection and special handling so this seems likely to cause spurious errors due to improper usage. Seems to be a pretty big footgun IMO.
What systemd configure option would you want to be using that isn't currently able to be enabled?
Quoted 42 lines
Signed-off-by Norbert Lange <[email protected]>--- package/systemd/Config.in | 8 ++++++++ package/systemd/systemd.mk | 2 ++ 2 files changed, 10 insertions(+)package/systemd/Config.in +8
-0@@ -89,6 +89,14 @@ if BR2_PACKAGE_SYSTEMD config BR2_PACKAGE_PROVIDES_UDEV default "systemd" +config BR2_PACKAGE_SYSTEMD_EXTRA_CONFIG + string "Additional target systemd options" + default "" + help + Any additional systemd configure options you may want to + include. The options are appended to Buildroot generated + options and can override these. + config BR2_PACKAGE_SYSTEMD_BOOT bool "systemd-boot" depends on BR2_i386 || BR2_x86_64package/systemd/systemd.mk +2
-1@@ -500,6 +500,8 @@ ifneq ($(SYSTEMD_FALLBACK_HOSTNAME),) SYSTEMD_CONF_OPTS += -Dfallback-hostname=$(SYSTEMD_FALLBACK_HOSTNAME) endif +SYSTEMD_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_SYSTEMD_EXTRA_CONFIG)) + define SYSTEMD_INSTALL_INIT_HOOK ln -fs multi-user.target \ $(TARGET_DIR)/usr/lib/systemd/system/default.target --2.29.2
Quoted 4 lines
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Am Sa., 8. Jan. 2022 um 20:04 Uhr schrieb James Hilliard <[email protected]>:
Quoted 7 lines · Norbert Lange
Quoted 4 lines
Systemd has very many options, adding a way for the user to set custom options can help customizations without changing buildroot files.
Quoted 5 lines
I'm not sure this is a good idea, if a configuration option needs customizability it
probably needs a specific kconfig option. Systemd config options tend to require dependency selection and special handling so this seems likely to cause spurious errors due to improper usage. Seems to be a pretty big footgun IMO.
Sure, you are aware that many of my buildroot patches are stuck in limbo since early 2020?
Just doesnt seem feasible to timely fix everything and version bumps often leave more untapped options. Some part of the necessity would be just being pragmatic.
One example would be using the unified cgroups hierarchy (-Ddefault-hierarchy=unified), hybrid is pretty much deprecated, and some systemd features that buildroot allows to enable (OOMD for example) wont work without it.
Quoted 3 lines
What systemd configure option would you want to be using that isn't currently able to be enabled?
FYI those are the ones I currently use:
-Ddefault-hierarchy=unified \
-Dutmp=false \
-Ddefault-dnssec=no \
-Didn=false \
-Denvironment-d=false \
-Dxdg-autostart=false \
-Ddns-over-tls=false \
-Ddefault-llmnr=no \
-Ddns-over-tls=false \
-Ddefault-mdns=no \
-Dlz4=false
Norbert
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 9 lines · Norbert Lange
Am Sa., 8. Jan. 2022 um 20:04 Uhr schrieb James Hilliard <[email protected]>:
Quoted 7 lines · Norbert Lange
Quoted 4 lines
Systemd has very many options, adding a way for the user to set custom options can help customizations without changing buildroot files.
Quoted 8 lines
Quoted 5 lines
I'm not sure this is a good idea, if a configuration option needs customizability it
probably needs a specific kconfig option. Systemd config options tend to require dependency selection and special handling so this seems likely to cause spurious errors due to improper usage. Seems to be a pretty big footgun IMO.Sure, you are aware that many of my buildroot patches are stuck in limbo since early 2020?
Yes, due to various circumstances, maintainer time between Feb 2020 and May
2021 has been very limited, and nobody in the community stepped up to review patches. We finally have a hackaton again where we're processing the backlog and we're making good progress. But we're not going to be able to fully catch up, so unless someone reviews and acks your patches, or unless they're trivial, they're likely to still face long delays in the coming months.
It doesn't help to get your patches in faster, but it does help the community
in general if you do reviews.
Another thing that may help you get patches merged is if you collect them in a
series and repost the entire series when something changes. Ideally you also carry patches from other people in that series. This makes life easier for the maintainers because it shows that it the series makes the whole more cohesive.
Quoted 7 lines
Just doesnt seem feasible to timely fix everything and version bumps often leave more untapped options. Some part of the necessity would be just being pragmatic.
One example would be using the unified cgroups hierarchy (-Ddefault-hierarchy=unified), hybrid is pretty much deprecated, and some systemd features that buildroot allows to enable (OOMD for example) wont work without it.
That's still a fairly recent series :-)
Quoted 6 lines
Quoted 2 lines
What systemd configure option would you want to be using that isn't currently able to be enabled?
FYI those are the ones I currently use:
(quoted diff) +0
-1-Ddefault-hierarchy=unified \
Review
Quoted 10 lines
(quoted diff) +0
-10-Dutmp=false \ -Ddefault-dnssec=no \ -Didn=false \ -Denvironment-d=false \ -Dxdg-autostart=false \ -Ddns-over-tls=false \ -Ddefault-llmnr=no \ -Ddns-over-tls=false \ -Ddefault-mdns=no \ -Dlz4=false
Except for the unified hierarchy, all of these look like they should have been
added when systemd was bumped and the option was created...
Regards,
Arnout
Quoted 7 lines
Norbert
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 10 lines · Norbert Lange
Am Sa., 8. Jan. 2022 um 20:04 Uhr schrieb James Hilliard <[email protected]>:
Quoted 7 lines · Norbert Lange
Quoted 4 lines
Systemd has very many options, adding a way for the user to set custom options can help customizations without changing buildroot files.
Quoted 8 lines
Quoted 5 lines
I'm not sure this is a good idea, if a configuration option needs customizability it
probably needs a specific kconfig option. Systemd config options tend to require dependency selection and special handling so this seems likely to cause spurious errors due to improper usage. Seems to be a pretty big footgun IMO.Sure, you are aware that many of my buildroot patches are stuck in limbo since early 2020?
Different issue IMO.
Quoted 2 lines
Just doesnt seem feasible to timely fix everything and version bumps often leave more untapped options. Some part of the necessity would be just being pragmatic.
I generally try to add any new options when bumping but I sometimes miss some.
Quoted 5 lines
One example would be using the unified cgroups hierarchy (-Ddefault-hierarchy=unified), hybrid is pretty much deprecated, and some systemd features that buildroot allows to enable (OOMD for example) wont work without it.
I mean, this sounds like something that needs to be fixed in upstream buildroot.
Quoted 8 lines
Quoted 4 lines
What systemd configure option would you want to be using that isn't currently able to be enabled?
FYI those are the ones I currently use:
(quoted diff) +0
-1-Ddefault-hierarchy=unified \
Review
Quoted 10 lines
(quoted diff) +0
-10-Dutmp=false \ -Ddefault-dnssec=no \ -Didn=false \ -Denvironment-d=false \ -Dxdg-autostart=false \ -Ddns-over-tls=false \ -Ddefault-llmnr=no \ -Ddns-over-tls=false \ -Ddefault-mdns=no \ -Dlz4=false
I'm seeing a lot of these added though(I remember adding some of them myself), are you
trying to use a newer systemd than the version supported by the buildroot version you are
building from?
Note that systemd defaults can generally be overridden via configs in the overlay as well.
Quoted 2 lines
Norbert
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
James Hilliard <[email protected]> schrieb am So., 9. Jan. 2022, 23:41:
Quoted 16 lines · Norbert Lange
Quoted 5 lines
Am Sa., 8. Jan. 2022 um 20:04 Uhr schrieb James Hilliard <[email protected]>:
Quoted 2 lines
On Thu, Nov 26, 2020 at 8:28 AM Norbert Lange <[email protected]>
Quoted 8 lines · wrote:
Quoted 8 lines
Quoted 4 lines
Systemd has very many options, adding a way for the user to set custom options can help customizations without changing buildroot files.
I'm not sure this is a good idea, if a configuration option needs customizability it
probably needs a specific kconfig option. Systemd config options tendto require
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
dependency selection and special handling so this seems likely to cause spurious errors due to improper usage. Seems to be a pretty big
footgun IMO.
Quoted 3 lines
Sure, you are aware that many of my buildroot patches are stuck in limbo since early 2020?
Different issue IMO.
Yep, but seemed reasonable way out to me.
Quoted 9 lines
Quoted 1 line
Just doesnt seem feasible to timely fix everything and version bumps
often leave
Quoted 1 line
more untapped options. Some part of the necessity would be just being
pragmatic.
I generally try to add any new options when bumping but I sometimes miss some.
Quoted 1 line
Quoted 9 lines
Quoted 3 lines
One example would be using the unified cgroups hierarchy (-Ddefault-hierarchy=unified), hybrid is pretty much deprecated, and some systemd features that buildroot allows to enable (OOMD for
example)
Quoted 1 line
wont work without it.
I mean, this sounds like something that needs to be fixed in upstream buildroot.
And it did finally.
Quoted 16 lines
Quoted 16 lines
Quoted 4 lines
What systemd configure option would you want to be using that isn't currently able to be enabled?
FYI those are the ones I currently use:
(quoted diff) +0
-9-Ddefault-hierarchy=unified \ -Dutmp=false \ -Ddefault-dnssec=no \ -Didn=false \ -Denvironment-d=false \ -Dxdg-autostart=false \ -Ddns-over-tls=false \ -Ddefault-llmnr=no \ -Ddns-over-tls=false \
Quoted 9 lines
Review
Quoted 2 lines
(quoted diff) +0
-2-Ddefault-mdns=no \ -Dlz4=falseI'm seeing a lot of these added though(I remember adding some of them myself), are you
trying to use a newer systemd than the version supported by the buildroot version you are
building from?
Not only missing, but I sometimes need a *different* config. For example i don't want to link against lz4, since I use zstd instead.
Quoted 3 lines
Note that systemd defaults can generally be overridden via configs in the overlay as well.
Yeah, gonna have to look that up. News to me.
I will shelve that one in patchwork then
Norbert.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 1 line · Norbert Lange
Not only missing, but I sometimes need a *different* config. For example i don't want to link against lz4, since I use zstd instead.
Which is a great example of why the option doesn't work: it would affect
dependencies as well.
However, specifically for this one, we have in the .mk file:
ifeq ($(BR2_PACKAGE_ZSTD),y)SYSTEMD_DEPENDENCIES += zstdSYSTEMD_CONF_OPTS += -Dzstd=true
elseSYSTEMD_CONF_OPTS += -Dzstd=false
endif
ifeq ($(BR2_PACKAGE_LZ4),y)SYSTEMD_DEPENDENCIES += lz4SYSTEMD_CONF_OPTS += -Dlz4=true
elseSYSTEMD_CONF_OPTS += -Dlz4=false
endif
So it should already do what you need, no?
Regards,
Arnout
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Arnout Vandecappelle <[email protected]> schrieb am Mo., 10. Jan. 2022, 08:26:
Quoted 19 lines · Norbert Lange
Quoted 1 line
Not only missing, but I sometimes need a *different* config. For example
i don't
Quoted 1 line
want to link against lz4, since I use zstd instead.
Which is a great example of why the option doesn't work: it would affect
dependencies as well.However, specifically for this one, we have in the .mk file:
ifeq ($(BR2_PACKAGE_ZSTD),y)
SYSTEMD_DEPENDENCIES+= zstdSYSTEMD_CONF_OPTS+= -Dzstd=true
elseSYSTEMD_CONF_OPTS+= -Dzstd=false
endif
Quoted 9 lines
ifeq ($(BR2_PACKAGE_LZ4),y)
SYSTEMD_DEPENDENCIES+= lz4SYSTEMD_CONF_OPTS+= -Dlz4=true
elseSYSTEMD_CONF_OPTS+= -Dlz4=false
endifSo it should already do what you need, no?
I want lz4 in the rootfs, i don't want systemd to be linked against it (doesn't add anything for me, if zstd is available too)
Norbert
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot