diff mbox series

systemd: Add 'default-dns-fallback' PACKAGECONFIG option

Message ID 20220907071155.2807336-1-niko.mauno@vaisala.com
State New
Headers show
Series systemd: Add 'default-dns-fallback' PACKAGECONFIG option | expand

Commit Message

Niko Mauno Sept. 7, 2022, 7:11 a.m. UTC
systemd defines a default set of fallback DNS servers in
https://github.com/systemd/systemd/blob/v251/meson_options.txt#L328-L330

By adding a PACKAGECONFIG knob providing a convenient way to opt out,
and then removing that value from systemd's PACKAGECONFIG, the output
from runtime 'resolvectl status' command no longer contains the
following line:

  Fallback DNS Servers: 1.1.1.1#cloudflare-dns.com 8.8.8.8#dns.google 1.0.0.1#cloudflare-dns.com 8.8.4.4#dns.google 2606:4700:4700::1111#cloudflare-dns.com 2001:4860:4860::8888#dns.google 2606:4700:4700::1001#cloudflare-dns.com 2001:4860:4860::8844#dns.google

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
---
 meta/recipes-core/systemd/systemd_251.4.bb | 2 ++
 1 file changed, 2 insertions(+)

Comments

Alexander Kanavin Sept. 7, 2022, 7:26 a.m. UTC | #1
I would rather invert this, and define 'no-dns-fallback', off by default.

Alex

On Wed, 7 Sept 2022 at 09:12, niko.mauno@vaisala.com via
lists.openembedded.org <niko.mauno=vaisala.com@lists.openembedded.org>
wrote:
>
> systemd defines a default set of fallback DNS servers in
> https://github.com/systemd/systemd/blob/v251/meson_options.txt#L328-L330
>
> By adding a PACKAGECONFIG knob providing a convenient way to opt out,
> and then removing that value from systemd's PACKAGECONFIG, the output
> from runtime 'resolvectl status' command no longer contains the
> following line:
>
>   Fallback DNS Servers: 1.1.1.1#cloudflare-dns.com 8.8.8.8#dns.google 1.0.0.1#cloudflare-dns.com 8.8.4.4#dns.google 2606:4700:4700::1111#cloudflare-dns.com 2001:4860:4860::8888#dns.google 2606:4700:4700::1001#cloudflare-dns.com 2001:4860:4860::8844#dns.google
>
> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
> ---
>  meta/recipes-core/systemd/systemd_251.4.bb | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-core/systemd/systemd_251.4.bb b/meta/recipes-core/systemd/systemd_251.4.bb
> index 8497e24af9..0f30b7dbb3 100644
> --- a/meta/recipes-core/systemd/systemd_251.4.bb
> +++ b/meta/recipes-core/systemd/systemd_251.4.bb
> @@ -64,6 +64,7 @@ PACKAGECONFIG ??= " \
>      ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', 'link-udev-shared', d)} \
>      backlight \
>      binfmt \
> +    default-dns-fallback \
>      gshadow \
>      hibernate \
>      hostnamed \
> @@ -129,6 +130,7 @@ PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
>  PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup,,cryptsetup"
>  PACKAGECONFIG[tpm2] = "-Dtpm2=true,-Dtpm2=false,tpm2-tss,tpm2-tss libtss2 libtss2-tcti-device"
>  PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
> +PACKAGECONFIG[default-dns-fallback] = ",-Ddns-servers="
>  PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
>  PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi"
>  PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
> --
> 2.35.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#170370): https://lists.openembedded.org/g/openembedded-core/message/170370
> Mute This Topic: https://lists.openembedded.org/mt/93520181/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Niko Mauno Sept. 7, 2022, 9:28 a.m. UTC | #2
Thanks, felt ambiguous first about using negation.
Fixed in v3: 
https://patchwork.yoctoproject.org/project/oe-core/patch/20220907092333.3248421-1-niko.mauno@vaisala.com/

-Niko

On 7.9.2022 10.26, Alexander Kanavin wrote:
> I would rather invert this, and define 'no-dns-fallback', off by default.
> 
> Alex
> 
> On Wed, 7 Sept 2022 at 09:12, niko.mauno@vaisala.com via
> lists.openembedded.org <niko.mauno=vaisala.com@lists.openembedded.org>
> wrote:
>>
>> systemd defines a default set of fallback DNS servers in
>> https://github.com/systemd/systemd/blob/v251/meson_options.txt#L328-L330
>>
>> By adding a PACKAGECONFIG knob providing a convenient way to opt out,
>> and then removing that value from systemd's PACKAGECONFIG, the output
>> from runtime 'resolvectl status' command no longer contains the
>> following line:
>>
>>    Fallback DNS Servers: 1.1.1.1#cloudflare-dns.com 8.8.8.8#dns.google 1.0.0.1#cloudflare-dns.com 8.8.4.4#dns.google 2606:4700:4700::1111#cloudflare-dns.com 2001:4860:4860::8888#dns.google 2606:4700:4700::1001#cloudflare-dns.com 2001:4860:4860::8844#dns.google
>>
>> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
>> ---
>>   meta/recipes-core/systemd/systemd_251.4.bb | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/meta/recipes-core/systemd/systemd_251.4.bb b/meta/recipes-core/systemd/systemd_251.4.bb
>> index 8497e24af9..0f30b7dbb3 100644
>> --- a/meta/recipes-core/systemd/systemd_251.4.bb
>> +++ b/meta/recipes-core/systemd/systemd_251.4.bb
>> @@ -64,6 +64,7 @@ PACKAGECONFIG ??= " \
>>       ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', 'link-udev-shared', d)} \
>>       backlight \
>>       binfmt \
>> +    default-dns-fallback \
>>       gshadow \
>>       hibernate \
>>       hostnamed \
>> @@ -129,6 +130,7 @@ PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
>>   PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup,,cryptsetup"
>>   PACKAGECONFIG[tpm2] = "-Dtpm2=true,-Dtpm2=false,tpm2-tss,tpm2-tss libtss2 libtss2-tcti-device"
>>   PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
>> +PACKAGECONFIG[default-dns-fallback] = ",-Ddns-servers="
>>   PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
>>   PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi"
>>   PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
>> --
>> 2.35.1
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#170370): https://lists.openembedded.org/g/openembedded-core/message/170370
>> Mute This Topic: https://lists.openembedded.org/mt/93520181/1686489
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
Alexander Kanavin Sept. 7, 2022, 9:34 a.m. UTC | #3
Thanks, I think it's more clear this way. PACKAGECONFIGs that do
nothing when on, and something when off are harder to grasp.

Alex

On Wed, 7 Sept 2022 at 11:28, Niko Mauno <niko.mauno@vaisala.com> wrote:
>
> Thanks, felt ambiguous first about using negation.
> Fixed in v3:
> https://patchwork.yoctoproject.org/project/oe-core/patch/20220907092333.3248421-1-niko.mauno@vaisala.com/
>
> -Niko
>
> On 7.9.2022 10.26, Alexander Kanavin wrote:
> > I would rather invert this, and define 'no-dns-fallback', off by default.
> >
> > Alex
> >
> > On Wed, 7 Sept 2022 at 09:12, niko.mauno@vaisala.com via
> > lists.openembedded.org <niko.mauno=vaisala.com@lists.openembedded.org>
> > wrote:
> >>
> >> systemd defines a default set of fallback DNS servers in
> >> https://github.com/systemd/systemd/blob/v251/meson_options.txt#L328-L330
> >>
> >> By adding a PACKAGECONFIG knob providing a convenient way to opt out,
> >> and then removing that value from systemd's PACKAGECONFIG, the output
> >> from runtime 'resolvectl status' command no longer contains the
> >> following line:
> >>
> >>    Fallback DNS Servers: 1.1.1.1#cloudflare-dns.com 8.8.8.8#dns.google 1.0.0.1#cloudflare-dns.com 8.8.4.4#dns.google 2606:4700:4700::1111#cloudflare-dns.com 2001:4860:4860::8888#dns.google 2606:4700:4700::1001#cloudflare-dns.com 2001:4860:4860::8844#dns.google
> >>
> >> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
> >> ---
> >>   meta/recipes-core/systemd/systemd_251.4.bb | 2 ++
> >>   1 file changed, 2 insertions(+)
> >>
> >> diff --git a/meta/recipes-core/systemd/systemd_251.4.bb b/meta/recipes-core/systemd/systemd_251.4.bb
> >> index 8497e24af9..0f30b7dbb3 100644
> >> --- a/meta/recipes-core/systemd/systemd_251.4.bb
> >> +++ b/meta/recipes-core/systemd/systemd_251.4.bb
> >> @@ -64,6 +64,7 @@ PACKAGECONFIG ??= " \
> >>       ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', 'link-udev-shared', d)} \
> >>       backlight \
> >>       binfmt \
> >> +    default-dns-fallback \
> >>       gshadow \
> >>       hibernate \
> >>       hostnamed \
> >> @@ -129,6 +130,7 @@ PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
> >>   PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup,,cryptsetup"
> >>   PACKAGECONFIG[tpm2] = "-Dtpm2=true,-Dtpm2=false,tpm2-tss,tpm2-tss libtss2 libtss2-tcti-device"
> >>   PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
> >> +PACKAGECONFIG[default-dns-fallback] = ",-Ddns-servers="
> >>   PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
> >>   PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi"
> >>   PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
> >> --
> >> 2.35.1
> >>
> >>
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >> Links: You receive all messages sent to this group.
> >> View/Reply Online (#170370): https://lists.openembedded.org/g/openembedded-core/message/170370
> >> Mute This Topic: https://lists.openembedded.org/mt/93520181/1686489
> >> Group Owner: openembedded-core+owner@lists.openembedded.org
> >> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >>
Richard Purdie Sept. 7, 2022, 9:42 a.m. UTC | #4
On Wed, 2022-09-07 at 11:34 +0200, Alexander Kanavin wrote:
> Thanks, I think it's more clear this way. PACKAGECONFIGs that do
> nothing when on, and something when off are harder to grasp.

Thanks, I agree this looks better FWIW :)

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd_251.4.bb b/meta/recipes-core/systemd/systemd_251.4.bb
index 8497e24af9..0f30b7dbb3 100644
--- a/meta/recipes-core/systemd/systemd_251.4.bb
+++ b/meta/recipes-core/systemd/systemd_251.4.bb
@@ -64,6 +64,7 @@  PACKAGECONFIG ??= " \
     ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', 'link-udev-shared', d)} \
     backlight \
     binfmt \
+    default-dns-fallback \
     gshadow \
     hibernate \
     hostnamed \
@@ -129,6 +130,7 @@  PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
 PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup,,cryptsetup"
 PACKAGECONFIG[tpm2] = "-Dtpm2=true,-Dtpm2=false,tpm2-tss,tpm2-tss libtss2 libtss2-tcti-device"
 PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
+PACKAGECONFIG[default-dns-fallback] = ",-Ddns-servers="
 PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
 PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi"
 PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"