No subject
Tue Aug 16 15:44:19 PDT 2016
>From 85abc5625db46a55e28419c0d8a0bd7ad54f4013 Mon Sep 17 00: 00:00 2001
Message-ID: <94eb2c05d1727746bc053a381537 at google.com>
Subject: [PATCH] Add init fragment for hostapd on Android
From: Christopher Wiley <wiley at google.com>
To: hostap at lists.infradead.org
Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes
This fragment defines how the Android init system should start hostapd
as a standalone service. Previously, hostapd was fork/exec'd from
Android's netd. This left hostapd with some dangling file descriptors
and a process parent minimally interested in acting as init for child
processes.
Signed-off-by: Christopher Wiley <wiley at google.com>
---
hostapd/Android.mk | 1 +
hostapd/hostapd.android.rc | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
create mode 100644 hostapd/hostapd.android.rc
diff --git a/hostapd/Android.mk b/hostapd/Android.mk
index 5dee966..ea3a39a 100644
--- a/hostapd/Android.mk
+++ b/hostapd/Android.mk
@@ -995,6 +995,7 @@ endif
LOCAL_CFLAGS := $(L_CFLAGS)
LOCAL_SRC_FILES := $(OBJS)
LOCAL_C_INCLUDES := $(INCLUDES)
+LOCAL_INIT_RC := hostapd.android.rc
include $(BUILD_EXECUTABLE)
endif # ifeq ($(WPA_BUILD_HOSTAPD),true)
diff --git a/hostapd/hostapd.android.rc b/hostapd/hostapd.android.rc
new file mode 100644
index 0000000..83e8d87
--- /dev/null
+++ b/hostapd/hostapd.android.rc
@@ -0,0 +1,20 @@
+#
+# init.rc fragment for hostapd on Android
+# Copyright (c) 2002-2016, Jouni Malinen <j at w1.fi>
+#
+# This software may be distributed under the terms of the BSD license.
+# See README for more details.
+#
+
+on post-fs-data
+ mkdir /data/misc/wifi/hostapd 0770 wifi wifi
+
+service hostapd /system/bin/hostapd \
+ -e /data/misc/wifi/entropy.bin \
+ /data/misc/wifi/hostapd.conf
+ class main
+ user wifi
+ writepid /data/misc/wifi/hostapd.pid
+ group wifi
+ disabled
+ oneshot
--
2.8.0.rc3.226.g39d4020
More information about the Hostap
mailing list