package/iwd: add basic configuration file
authorPeter Seiderer <ps.report@gmx.net>
Tue, 16 Jun 2020 06:34:30 +0000 (08:34 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 17 Jun 2020 19:56:41 +0000 (21:56 +0200)
Add basic /etc/iwd/main.conf configuration file to enable
network configuration (use built-in dhcp client).

For the non systemd-resolved case select the openresolv package
to fulfill the iwd resolvconf requirement (and adjust the
configuration file accordingly).

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/iwd/Config.in
package/iwd/iwd.mk
package/iwd/main.conf [new file with mode: 0644]

index ec53d13047330dbe85089007d91baaa43c812b67..4e85fb4fd78f184728895e8a3813d1cad55de2c3 100644 (file)
@@ -8,6 +8,7 @@ config BR2_PACKAGE_IWD
        depends on BR2_USE_WCHAR # ell
        select BR2_PACKAGE_DBUS # runtime
        select BR2_PACKAGE_ELL
+       select BR2_PACKAGE_OPENRESOLV if !BR2_PACKAGE_SYSTEMD_RESOLVED
        help
          iNet Wireless daemon (iwd)
 
index 32ff175933a6f3f900706de092da494d835d5b83..d0749642677f7f90d0fc0fe0f39520526fe8adc0 100644 (file)
@@ -46,4 +46,17 @@ else
 IWD_CONF_OPTS += --disable-systemd-service
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD_RESOLVED),y)
+IWD_RESOLV_SERVICE = systemd
+else
+IWD_RESOLV_SERVICE = resolvconf
+endif
+
+define IWD_INSTALL_CONFIG_FILE
+       $(INSTALL) -D -m 644 package/iwd/main.conf $(TARGET_DIR)/etc/iwd/main.conf
+       $(SED) 's,__RESOLV_SERVICE__,$(IWD_RESOLV_SERVICE),' $(TARGET_DIR)/etc/iwd/main.conf
+endef
+
+IWD_POST_INSTALL_TARGET_HOOKS += IWD_INSTALL_CONFIG_FILE
+
 $(eval $(autotools-package))
diff --git a/package/iwd/main.conf b/package/iwd/main.conf
new file mode 100644 (file)
index 0000000..22c1cd7
--- /dev/null
@@ -0,0 +1,5 @@
+# use built-in dhcp client
+[General]
+EnableNetworkConfiguration=true
+[Network]
+NameResolvingService=__RESOLV_SERVICE__