net: Add networkd/resolved and networkd/resolved-stub subfeatures

Creates systemd-resolved symbolic link to /etc/resolv.conf
This commit is contained in:
Mikhail Gordeev
2021-08-19 01:57:59 +03:00
committed by Anton Midyukov
parent 621afbee75
commit df67477a9a
2 changed files with 19 additions and 0 deletions

View File

@ -43,3 +43,12 @@ use/net/connman: use/net
use/net/networkd: use/net
@$(call set,THE_NET_SUBSYS,systemd-networkd)
@$(call add,DEFAULT_SERVICES_ENABLE,systemd-networkd)
@$(call xport,SYSTEMD_RESOLVED)
use/net/networkd/resolved: use/net/networkd
@$(call add,DEFAULT_SERVICES_ENABLE,systemd-resolved)
@$(call set,SYSTEMD_RESOLVED,yes)
use/net/networkd/resolved-stub: use/net/networkd
@$(call add,DEFAULT_SERVICES_ENABLE,systemd-resolved)
@$(call set,SYSTEMD_RESOLVED,stub)

View File

@ -0,0 +1,10 @@
#!/bin/sh
[ -h /sbin/init ] || exit 0
[ -n "$GLOBAL_SYSTEMD_RESOLVED" ] || exit 0
if [ "$GLOBAL_SYSTEMD_RESOLVED" = stub ]; then
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
else
ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
fi