mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 12:35:33 -04:00
universal7885: debug-tools are moved to ext
This commit is contained in:
parent
289ce8f5f9
commit
4849848417
8 changed files with 1 additions and 138 deletions
|
|
@ -1,23 +0,0 @@
|
||||||
//
|
|
||||||
// Copyright (C) 2021 Soo Hwan Na "Royna"
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
//
|
|
||||||
|
|
||||||
cc_binary {
|
|
||||||
name: "eklogger",
|
|
||||||
srcs: [
|
|
||||||
"Logger.cpp",
|
|
||||||
],
|
|
||||||
init_rc: ["eklogger.rc"],
|
|
||||||
}
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2021 Soo Hwan Na "Royna"
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <thread>
|
|
||||||
|
|
||||||
#define KMSG_PATH "/proc/kmsg"
|
|
||||||
#define WRITE_KMSG "/data/debug/kmsg.txt"
|
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
void copy_kmsg() {
|
|
||||||
std::ifstream readfile(KMSG_PATH);
|
|
||||||
std::ofstream writefile(WRITE_KMSG);
|
|
||||||
while (1) { writefile << readfile.rdbuf(); }
|
|
||||||
}
|
|
||||||
void copy_logcat() {
|
|
||||||
system("/system/bin/logcat -b all -f /data/debug/logcat.txt");
|
|
||||||
}
|
|
||||||
int main() {
|
|
||||||
std::thread kmsg(copy_kmsg);
|
|
||||||
std::thread logcat(copy_logcat);
|
|
||||||
kmsg.join();
|
|
||||||
logcat.join();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
service eureka_debugger /system/bin/eklogger
|
|
||||||
user root
|
|
||||||
group system
|
|
||||||
oneshot
|
|
||||||
disabled
|
|
||||||
|
|
||||||
on post-fs-data
|
|
||||||
mkdir /data/debug 0755 root system encryption=None
|
|
||||||
rm /data/debug/logcat.txt
|
|
||||||
rm /data/debug/kmsg.txt
|
|
||||||
# Turn on logging
|
|
||||||
write /sys/module/printk/parameters/enabled 1
|
|
||||||
start eureka_debugger
|
|
||||||
|
|
||||||
on property:sys.boot_completed=1
|
|
||||||
stop eureka_debugger
|
|
||||||
write /sys/module/printk/parameters/enabled 0
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
cc_binary {
|
|
||||||
name: "dlopener",
|
|
||||||
compile_multilib: "both",
|
|
||||||
multilib: {
|
|
||||||
lib32: {
|
|
||||||
suffix: "32",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
srcs: ["dlopener.c"],
|
|
||||||
vendor_available: true,
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
|
||||||
const char *path;
|
|
||||||
void *handle = NULL;
|
|
||||||
int ret = EXIT_FAILURE;
|
|
||||||
|
|
||||||
if (argc <= 1) {
|
|
||||||
printf("Please specify a module to load!\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
path = argv[1];
|
|
||||||
|
|
||||||
handle = dlopen(path, RTLD_NOW);
|
|
||||||
if (handle == NULL) {
|
|
||||||
const char *err_str = dlerror();
|
|
||||||
printf("load: module=%s\n%s\n", path, err_str ? err_str : "unknown");
|
|
||||||
} else {
|
|
||||||
printf("load: module=%s %s\n", path, "Success!");
|
|
||||||
ret = EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
type eklogger, domain, coredomain;
|
|
||||||
type eklogger_exec, exec_type, file_type, system_file_type;
|
|
||||||
init_daemon_domain(eklogger)
|
|
||||||
type eklogger_data_file, file_type, data_file_type, core_data_file_type;
|
|
||||||
|
|
||||||
allow eklogger eklogger_data_file:dir rw_dir_perms;
|
|
||||||
allow eklogger eklogger_data_file:file rw_file_perms;
|
|
||||||
allow eklogger proc_kmsg:file r_file_perms;
|
|
||||||
allow eklogger logcat_exec:file rx_file_perms;
|
|
||||||
allow eklogger self:capability2 syslog;
|
|
||||||
allow eklogger kernel:system syslog_mod;
|
|
||||||
allow eklogger eklogger_data_file:file create_file_perms;
|
|
||||||
allow eklogger shell_exec:file rx_file_perms;
|
|
||||||
allow eklogger self:capability sys_nice;
|
|
||||||
allow eklogger logdr_socket:sock_file write;
|
|
||||||
allow eklogger logd:unix_stream_socket connectto;
|
|
||||||
|
|
||||||
|
|
@ -3,10 +3,6 @@
|
||||||
### DATA
|
### DATA
|
||||||
/data/zram(/.*)? u:object_r:zram_data_file:s0
|
/data/zram(/.*)? u:object_r:zram_data_file:s0
|
||||||
|
|
||||||
# Eureka Bootlogger
|
|
||||||
/system/bin/eklogger u:object_r:eklogger_exec:s0
|
|
||||||
/data/debug(/.*)? u:object_r:eklogger_data_file:s0
|
|
||||||
|
|
||||||
# FMRadio
|
# FMRadio
|
||||||
/system/bin/vendor\.eureka\.hardware\.fmradio-service u:object_r:hal_fmradio_default_exec:s0
|
/system/bin/vendor\.eureka\.hardware\.fmradio-service u:object_r:hal_fmradio_default_exec:s0
|
||||||
/system/bin/vendor\.eureka\.hardware\.audio_route-service u:object_r:hal_audio_route_default_exec:s0
|
/system/bin/vendor\.eureka\.hardware\.audio_route-service u:object_r:hal_audio_route_default_exec:s0
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ PRODUCT_PACKAGES += \
|
||||||
libsuspend
|
libsuspend
|
||||||
|
|
||||||
# Debug
|
# Debug
|
||||||
PRODUCT_PACKAGES += eklogger dlopener dlopener.vendor
|
$(call inherit-product, hardware/samsung-ext/interfaces/debug-tools/debug.mk)
|
||||||
|
|
||||||
# DRM
|
# DRM
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue