Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save luk1337/99c586032eacf0d2e21a to your computer and use it in GitHub Desktop.
Save luk1337/99c586032eacf0d2e21a to your computer and use it in GitHub Desktop.
From aec82a2af4abef36f4667ac56de58e70f9915c8b Mon Sep 17 00:00:00 2001
From: LuK1337 <priv.luk@gmail.com>
Date: Thu, 5 Nov 2015 19:29:30 +0100
Subject: [PATCH] msm8226-common: Replace LD_PRELOAD with LD_SHIM_LIBS
Change-Id: Ica1714b41d1ec9f819778e937b03b721f4f3639d
---
libmoto/Android.mk | 21 +++++++++++++++++----
msm8226.mk | 3 ++-
rootdir/etc/init.qcom.rc | 3 ++-
sepolicy/init.te | 2 +-
4 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/libmoto/Android.mk b/libmoto/Android.mk
index 3a82c8c..f943d7f 100644
--- a/libmoto/Android.mk
+++ b/libmoto/Android.mk
@@ -13,14 +13,27 @@
# limitations under the License.
LOCAL_PATH := $(call my-dir)
+
+# Log
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := moto_log.c
+
+LOCAL_SHARED_LIBRARIES := liblog
+LOCAL_MODULE := libmoto_log
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
+
+# Camera
+
include $(CLEAR_VARS)
-LOCAL_SRC_FILES := \
- moto_log.c \
- moto_camera.c
+LOCAL_SRC_FILES := moto_camera.c
LOCAL_SHARED_LIBRARIES := libutils libgui liblog
-LOCAL_MODULE := libmoto
+LOCAL_MODULE := libmoto_camera
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
diff --git a/msm8226.mk b/msm8226.mk
index 3d4a0e8..00ff252 100644
--- a/msm8226.mk
+++ b/msm8226.mk
@@ -130,7 +130,8 @@ PRODUCT_COPY_FILES += \
# Motorola
PRODUCT_PACKAGES += \
- libmoto
+ libmoto_log \
+ libmoto_camera
# OMX
PRODUCT_PACKAGES += \
diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc
index dc8c8bb..95c0724 100644
--- a/rootdir/etc/init.qcom.rc
+++ b/rootdir/etc/init.qcom.rc
@@ -60,7 +60,8 @@ on init
chown root qcom_diag /sys/kernel/dropbox/data
# Symbols required for motorola blobs
- export LD_PRELOAD "/system/lib/libmoto.so /system/lib/libboringssl-compat.so /system/vendor/lib/libsysutils_local.so"
+ export LD_PRELOAD /system/lib/libboringssl-compat.so
+ export LD_SHIM_LIBS /system/lib/liblog.so|libmoto_log.so:/system/vendor/lib/libqmi_client_qmux.so|libmoto_log.so:/system/lib/libmot_sensorlistener.so|libmoto_camera.so:/system/lib/libmdmcutback.so|libsysutils_local.so
on fs
mount_all fstab.qcom
diff --git a/sepolicy/init.te b/sepolicy/init.te
index d466c0d..5558eb9 100644
--- a/sepolicy/init.te
+++ b/sepolicy/init.te
@@ -13,4 +13,4 @@ allow init socket_device:sock_file { create setattr };
allow init sysfs_battery_supply:lnk_file read;
# Allow LD_PRELOAD-ing
-allow init { mm-qcamerad rild rmt_storage }:process noatsecure;
+allow init { mm-qcamerad }:process noatsecure;
--
2.6.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment