diff options
| author | Joey Hewitt <joey@joeyhewitt.com> | 2017-08-24 22:45:54 -0700 |
|---|---|---|
| committer | Joey Hewitt <joey@joeyhewitt.com> | 2017-08-30 21:50:56 -0700 |
| commit | 2ebbd3692aa3005a707dbde528f62ad3e8de134f (patch) | |
| tree | a7a6db681611488f7580aa27334032d8470288b6 | |
| parent | 4314e83ce7bf8d2e41bacdff167dc0d81d2c0170 (diff) | |
| download | frameworks_opt_telephony_ril_ofono-2ebbd3692aa3005a707dbde528f62ad3e8de134f.tar.gz frameworks_opt_telephony_ril_ofono-2ebbd3692aa3005a707dbde528f62ad3e8de134f.tar.bz2 frameworks_opt_telephony_ril_ofono-2ebbd3692aa3005a707dbde528f62ad3e8de134f.zip | |
add system patches needed
| -rw-r--r-- | README.md | 12 | ||||
| -rw-r--r-- | patches/external_sepolicy.patch | 56 | ||||
| -rw-r--r-- | patches/frameworks_opt_telephony.patch (renamed from patches) | 1 | ||||
| -rw-r--r-- | patches/system_core.patch | 35 | ||||
| -rw-r--r-- | patches/system_etc_dbus.conf | 28 |
5 files changed, 126 insertions, 6 deletions
@@ -15,11 +15,11 @@ The goal of this project is to write an Android RIL daemon implemented on top of # Usage 1. System patches - * See `patches` file for pseudo-patches to get an idea of what I'm running - * Patch telephony framework to be able to load the RIL class from another package - * system/core/rootdir/init.rc - add dbus and ofono services - * install dbus conf file in /system/etc/dbus.conf - * sepolicy updates for dbus and radio interop + * See `patches` directory. The patches: + * Change the telephony framework to be able to load the RIL class from a system app package, specified by system property (set in `start` script) + * Add dbus and ofono services in the init.rc (ofono is disabled until manually started) + * Add a dbus conf file in /system/etc + * Update selinux policies for dbus and radio interop 1. Build from CM12.1 checkout with [this manifest](https://github.com/scintill/android/commit/424776d7635ddfae3591516e032cc5820f1dfc1a) * `mmm ~/ril_ofono` * (Might depend on the rest of android or at least RIL having been built before.) @@ -62,6 +62,8 @@ that raw PDUs can do. And duplicating the work is ugly anyway, so I think I will * make dbus exceptions be checked exceptions, so the compiler will find them and I have to handle them * dexopt/proguard? - see notes in Android.mk * crashes in airplane mode trying to query properties on probably not-up interfaces +* remove anonymous auth from dbus.conf (currently there to ease debugging; not needed for the RIL code to connect properly) +* `init: Warning! Service ofonod-debug needs a SELinux domain defined; please fix!` # License diff --git a/patches/external_sepolicy.patch b/patches/external_sepolicy.patch new file mode 100644 index 0000000..6663dba --- /dev/null +++ b/patches/external_sepolicy.patch @@ -0,0 +1,56 @@ +diff --git a/dbus.te b/dbus.te +new file mode 100644 +index 0000000..f26105a +--- /dev/null ++++ b/dbus.te +@@ -0,0 +1,4 @@ ++type dbus_daemon, domain; ++type dbus_daemon_exec, exec_type, file_type; ++ ++init_daemon_domain(dbus_daemon) +diff --git a/file.te b/file.te +index 24ca895..7eef0e8 100644 +--- a/file.te ++++ b/file.te +@@ -138,6 +138,7 @@ type bluetooth_efs_file, file_type; + # Socket types + type adbd_socket, file_type; + type bluetooth_socket, file_type; ++type dbus_daemon_socket, file_type; + type dnsproxyd_socket, file_type, mlstrustedobject; + type dumpstate_socket, file_type; + type fwmarkd_socket, file_type, mlstrustedobject; +diff --git a/file_contexts b/file_contexts +index 62802e0..5ab5b41 100644 +--- a/file_contexts ++++ b/file_contexts +@@ -77,6 +77,7 @@ + /dev/snd(/.*)? u:object_r:audio_device:s0 + /dev/socket(/.*)? u:object_r:socket_device:s0 + /dev/socket/adbd u:object_r:adbd_socket:s0 ++/dev/socket/dbus u:object_r:dbus_daemon_socket:s0 + /dev/socket/dnsproxyd u:object_r:dnsproxyd_socket:s0 + /dev/socket/dumpstate u:object_r:dumpstate_socket:s0 + /dev/socket/fwmarkd u:object_r:fwmarkd_socket:s0 +@@ -135,6 +136,7 @@ + /system/bin/vold u:object_r:vold_exec:s0 + /system/bin/netd u:object_r:netd_exec:s0 + /system/bin/rild u:object_r:rild_exec:s0 ++/system/bin/dbus-daemon u:object_r:dbus_daemon_exec:s0 + /system/bin/mediaserver u:object_r:mediaserver_exec:s0 + /system/bin/mdnsd u:object_r:mdnsd_exec:s0 + /system/bin/installd u:object_r:installd_exec:s0 +diff --git a/radio.te b/radio.te +index 7d90706..3f54cc5 100644 +--- a/radio.te ++++ b/radio.te +@@ -11,6 +11,9 @@ unix_socket_connect(radio, property, init) + # Talks to rild via the rild socket. + unix_socket_connect(radio, rild, rild) + ++# Talks to dbus ++unix_socket_connect(radio, dbus_daemon, dbus_daemon) ++ + # Data file accesses. + allow radio radio_data_file:dir create_dir_perms; + allow radio radio_data_file:notdevfile_class_set create_file_perms; diff --git a/patches b/patches/frameworks_opt_telephony.patch index c02f6c7..d4b46bd 100644 --- a/patches +++ b/patches/frameworks_opt_telephony.patch @@ -1,4 +1,3 @@ -# frameworks/opt/telephony diff --git a/src/java/com/android/internal/telephony/PhoneFactory.java b/src/java/com/android/internal/telephony/PhoneFactory.java index 08ea27c..0d5d84c 100644 --- a/src/java/com/android/internal/telephony/PhoneFactory.java diff --git a/patches/system_core.patch b/patches/system_core.patch new file mode 100644 index 0000000..5de2cae --- /dev/null +++ b/patches/system_core.patch @@ -0,0 +1,35 @@ +diff --git a/rootdir/init.rc b/rootdir/init.rc +index 001ab13..6029d3c 100644 +--- a/rootdir/init.rc ++++ b/rootdir/init.rc +@@ -561,6 +561,30 @@ service ril-daemon /system/bin/rild + user root + group radio cache inet misc audio sdcard_rw qcom_diag log + ++service dbus /system/bin/dbus-daemon --system --nofork ++ class main ++ socket dbus stream 0660 root radio ++ user radio ++ group radio ++ ++service ofonod /system/bin/ofonod --nodetach ++ disabled ++ class main ++ user radio ++ group radio ++ setenv OFONO_RIL_DEVICE ril ++ setenv OFONO_RIL_RAT_LTE 1 ++ ++service ofonod-debug /system/bin/ofonod --nodetach --debug ++ disabled ++ class main ++ user radio ++ group radio ++ setenv OFONO_RIL_DEVICE ril ++ setenv OFONO_RIL_RAT_LTE 1 ++ setenv OFONO_RIL_TRACE 1 ++ setenv OFONO_RIL_HEX_TRACE 1 ++ + service surfaceflinger /system/bin/surfaceflinger + class core + user system diff --git a/patches/system_etc_dbus.conf b/patches/system_etc_dbus.conf new file mode 100644 index 0000000..94f8c60 --- /dev/null +++ b/patches/system_etc_dbus.conf @@ -0,0 +1,28 @@ +--- /dev/null ++++ /system/etc/dbus.conf +@@ -0,0 +1,25 @@ ++<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN" ++ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> ++<busconfig> ++ <!-- Our well-known bus type, do not change this --> ++ <type>system</type> ++ <!-- Only allow socket-credentials-based authentication --> ++ <auth>EXTERNAL</auth> ++<auth>ANONYMOUS</auth> ++<allow_anonymous /> ++ <!-- Only listen on a local socket. (abstract=/path/to/socket ++ means use abstract namespace, don't really create filesystem ++ file; only Linux supports this. Use path=/whatever on other ++ systems.) --> ++ <listen>unix:path=/dev/socket/dbus</listen> ++ <!-- Allow everything, D-Bus socket is protected by unix filesystem ++ permissions --> ++ <policy context="default"> ++ <allow send_interface="*"/> ++ <allow receive_interface="*"/> ++ <allow own="*"/> ++ <allow user="*"/> ++ <allow send_requested_reply="true"/> ++ <allow receive_requested_reply="true"/> ++ </policy> ++</busconfig> |
