* [Buildroot] [PATCH v2 1/2] package/iwd: add basic configuration file
@ 2020-06-14 20:25 Peter Seiderer
2020-06-14 20:25 ` [Buildroot] [PATCH v2 2/2] package/iwd: add sysv init script Peter Seiderer
2020-06-14 21:28 ` [Buildroot] [PATCH v2 1/2] package/iwd: add basic configuration file Yann E. MORIN
0 siblings, 2 replies; 3+ messages in thread
From: Peter Seiderer @ 2020-06-14 20:25 UTC (permalink / raw)
To: buildroot
Add basic /etc/iwd/main.conf configuration file to enable
network configuration (use built-in dhcp client).
For the non systemd case select the openresolv package to
fulfill the iwd resolvconf requirement.
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v1 -> v2:
- use printf insteadof echo (Yann E. MORIN)
---
package/iwd/Config.in | 1 +
package/iwd/iwd.mk | 21 +++++++++++++++++++++
package/iwd/main.conf | 3 +++
3 files changed, 25 insertions(+)
create mode 100644 package/iwd/main.conf
diff --git a/package/iwd/Config.in b/package/iwd/Config.in
index ec53d13047..e02d946e79 100644
--- a/package/iwd/Config.in
+++ b/package/iwd/Config.in
@@ -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_INIT_SYSTEMD
help
iNet Wireless daemon (iwd)
diff --git a/package/iwd/iwd.mk b/package/iwd/iwd.mk
index 32ff175933..d57b858ea1 100644
--- a/package/iwd/iwd.mk
+++ b/package/iwd/iwd.mk
@@ -46,4 +46,25 @@ else
IWD_CONF_OPTS += --disable-systemd-service
endif
+define IWD_INSTALL_CONFIG_FILE
+ mkdir -p $(TARGET_DIR)/etc/iwd
+ $(INSTALL) -m 644 package/iwd/main.conf $(TARGET_DIR)/etc/iwd/main.conf
+endef
+
+ifeq ($(BR2_INIT_SYSTEMD),y)
+define IWD_CONFIG_FILE_NAME_RESOLV_SERVICE
+ print "[Network]\nNameResolvingService=systemd\n" \
+ >> $(TARGET_DIR)/etc/iwd/main.conf
+endef
+else
+define IWD_CONFIG_FILE_NAME_RESOLV_SERVICE
+ echo -e "[Network]\nNameResolvingService=resolvconf\n" \
+ >> $(TARGET_DIR)/etc/iwd/main.conf
+endef
+endif
+
+IWD_POST_INSTALL_TARGET_HOOKS += \
+ IWD_INSTALL_CONFIG_FILE \
+ IWD_CONFIG_FILE_NAME_RESOLV_SERVICE
+
$(eval $(autotools-package))
diff --git a/package/iwd/main.conf b/package/iwd/main.conf
new file mode 100644
index 0000000000..c26a50d302
--- /dev/null
+++ b/package/iwd/main.conf
@@ -0,0 +1,3 @@
+# use built-in dhcp client
+[General]
+EnableNetworkConfiguration=true
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH v2 2/2] package/iwd: add sysv init script
2020-06-14 20:25 [Buildroot] [PATCH v2 1/2] package/iwd: add basic configuration file Peter Seiderer
@ 2020-06-14 20:25 ` Peter Seiderer
2020-06-14 21:28 ` [Buildroot] [PATCH v2 1/2] package/iwd: add basic configuration file Yann E. MORIN
1 sibling, 0 replies; 3+ messages in thread
From: Peter Seiderer @ 2020-06-14 20:25 UTC (permalink / raw)
To: buildroot
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v1 -> v2:
- use start-stop-daemon (Yann E. MORIN)
---
package/iwd/S40iwd | 42 ++++++++++++++++++++++++++++++++++++++++++
package/iwd/iwd.mk | 7 +++++++
2 files changed, 49 insertions(+)
create mode 100644 package/iwd/S40iwd
diff --git a/package/iwd/S40iwd b/package/iwd/S40iwd
new file mode 100644
index 0000000000..6714ca9956
--- /dev/null
+++ b/package/iwd/S40iwd
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+DAEMON="/usr/libexec/iwd"
+PIDFILE="/var/run/iwd.pid"
+
+IWD_ARGS=""
+
+[ -r "/etc/default/iwd" ] && . "/etc/default/iwd"
+
+start() {
+ printf "Starting iwd:"
+ mkdir -p /tmp/iwd/hotspot
+ start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "$DAEMON" \
+ -- $IWD_ARGS
+ status=$?
+ if [ "$status" -eq 0 ]; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ return "$status"
+}
+
+stop() {
+ printf "Stopping iwd:"
+ start-stop-daemon -K -q -p "$PIDFILE"
+ status=$?
+ if [ "$status" -eq 0 ]; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ return "$status"
+}
+
+case "$1" in
+ start|stop)
+ "$1";;
+ *)
+ echo "Usage: $0 {start|stop}"
+ exit 1
+esac
diff --git a/package/iwd/iwd.mk b/package/iwd/iwd.mk
index d57b858ea1..1114e9683b 100644
--- a/package/iwd/iwd.mk
+++ b/package/iwd/iwd.mk
@@ -67,4 +67,11 @@ IWD_POST_INSTALL_TARGET_HOOKS += \
IWD_INSTALL_CONFIG_FILE \
IWD_CONFIG_FILE_NAME_RESOLV_SERVICE
+define IWD_INSTALL_INIT_SYSV
+ $(INSTALL) -m 0755 -D package/iwd/S40iwd \
+ $(TARGET_DIR)/etc/init.d/S40iwd
+ mkdir -p $(TARGET_DIR)/var/lib/iwd
+ ln -sf /tmp/iwd/hotspot $(TARGET_DIR)/var/lib/iwd/hotspot
+endef
+
$(eval $(autotools-package))
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH v2 1/2] package/iwd: add basic configuration file
2020-06-14 20:25 [Buildroot] [PATCH v2 1/2] package/iwd: add basic configuration file Peter Seiderer
2020-06-14 20:25 ` [Buildroot] [PATCH v2 2/2] package/iwd: add sysv init script Peter Seiderer
@ 2020-06-14 21:28 ` Yann E. MORIN
1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2020-06-14 21:28 UTC (permalink / raw)
To: buildroot
Peter, All,
On 2020-06-14 22:25 +0200, Peter Seiderer spake thusly:
> Add basic /etc/iwd/main.conf configuration file to enable
> network configuration (use built-in dhcp client).
>
> For the non systemd case select the openresolv package to
> fulfill the iwd resolvconf requirement.
>
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Changes v1 -> v2:
> - use printf insteadof echo (Yann E. MORIN)
For the records, I'm still not happy with that patch, which did not
really change since the vporevious iteration, and I have still some
pending questions there, see thread starting at:
http://lists.busybox.net/pipermail/buildroot/2020-June/284664.html
Regards,
Yann E. MORIN.
> ---
> package/iwd/Config.in | 1 +
> package/iwd/iwd.mk | 21 +++++++++++++++++++++
> package/iwd/main.conf | 3 +++
> 3 files changed, 25 insertions(+)
> create mode 100644 package/iwd/main.conf
>
> diff --git a/package/iwd/Config.in b/package/iwd/Config.in
> index ec53d13047..e02d946e79 100644
> --- a/package/iwd/Config.in
> +++ b/package/iwd/Config.in
> @@ -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_INIT_SYSTEMD
> help
> iNet Wireless daemon (iwd)
>
> diff --git a/package/iwd/iwd.mk b/package/iwd/iwd.mk
> index 32ff175933..d57b858ea1 100644
> --- a/package/iwd/iwd.mk
> +++ b/package/iwd/iwd.mk
> @@ -46,4 +46,25 @@ else
> IWD_CONF_OPTS += --disable-systemd-service
> endif
>
> +define IWD_INSTALL_CONFIG_FILE
> + mkdir -p $(TARGET_DIR)/etc/iwd
> + $(INSTALL) -m 644 package/iwd/main.conf $(TARGET_DIR)/etc/iwd/main.conf
> +endef
> +
> +ifeq ($(BR2_INIT_SYSTEMD),y)
> +define IWD_CONFIG_FILE_NAME_RESOLV_SERVICE
> + print "[Network]\nNameResolvingService=systemd\n" \
> + >> $(TARGET_DIR)/etc/iwd/main.conf
> +endef
> +else
> +define IWD_CONFIG_FILE_NAME_RESOLV_SERVICE
> + echo -e "[Network]\nNameResolvingService=resolvconf\n" \
> + >> $(TARGET_DIR)/etc/iwd/main.conf
> +endef
> +endif
> +
> +IWD_POST_INSTALL_TARGET_HOOKS += \
> + IWD_INSTALL_CONFIG_FILE \
> + IWD_CONFIG_FILE_NAME_RESOLV_SERVICE
> +
> $(eval $(autotools-package))
> diff --git a/package/iwd/main.conf b/package/iwd/main.conf
> new file mode 100644
> index 0000000000..c26a50d302
> --- /dev/null
> +++ b/package/iwd/main.conf
> @@ -0,0 +1,3 @@
> +# use built-in dhcp client
> +[General]
> +EnableNetworkConfiguration=true
> --
> 2.27.0
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-14 21:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-14 20:25 [Buildroot] [PATCH v2 1/2] package/iwd: add basic configuration file Peter Seiderer
2020-06-14 20:25 ` [Buildroot] [PATCH v2 2/2] package/iwd: add sysv init script Peter Seiderer
2020-06-14 21:28 ` [Buildroot] [PATCH v2 1/2] package/iwd: add basic configuration file Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox