如何在 Yocto 中将 /etc/resolv.conf 符号链接到 /var/run/systemd/resolve/stub-resolv.conf

如何在 Yocto 中将 /etc/resolv.conf 符号链接到 /var/run/systemd/resolve/stub-resolv.conf

我正在尝试使用 NetworkManager v1.22.16 和 systemd 244.5 设置 Yocto 版本。systemd-resolved - /etc/resolv.conf 建议我将 /etc/resolv.conf 设置为 /var/run/systemd/resolve/stub-resolv.conf 的符号链接。最初它链接到 /etc/resolv-conf.NetworkManager 但我通过添加一个 networkmanager_%.bbappend 文件修复了这个问题:

ALTERNATIVE_${PN} = ""

但现在我发现 /etc/resolv.conf 是 /etc/resolv-conf.systemd 的符号链接,而 /etc/resolv-conf.systemd 本身就是 /run/systemd/resolve/resolv.conf 的符号链接。我不确定这是从哪里来的,可能是在设备启动之后。一切似乎都正常,这样可以吗?或者我是否仍然需要覆盖构建以使 /etc/resolv.conf 成为 /var/run/systemd/resolve/stub-resolv.conf 的符号链接?

相关内容