From b8acbfc72c8b45619155e9a75253092d5d2739a9 Mon Sep 17 00:00:00 2001 From: viktorxda <35473052+viktorxda@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:50:21 +0200 Subject: [PATCH] [no ci] Package: remove log reader (#1565) --- .../configs/t10_lite_defconfig | 1 - .../configs/t20_lite_defconfig | 1 - .../configs/t20_ultimate_defconfig | 1 - .../configs/t21_lite_defconfig | 1 - .../configs/t21_ultimate_defconfig | 1 - .../configs/t30_lite_defconfig | 1 - br-ext-chip-ingenic/configs/t31_fpv_defconfig | 1 - .../configs/t31_lite_defconfig | 1 - .../configs/t31_ultimate_defconfig | 1 - .../configs/t31glibc_lite_defconfig | 1 - .../configs/t40_lite_defconfig | 1 - .../configs/t40_ultimate_defconfig | 1 - general/package/Config.in | 1 - general/package/logcat/Config.in | 4 - general/package/logcat/logcat.mk | 21 --- general/package/logcat/src/logcat.c | 125 ------------------ 16 files changed, 163 deletions(-) delete mode 100644 general/package/logcat/Config.in delete mode 100644 general/package/logcat/logcat.mk delete mode 100644 general/package/logcat/src/logcat.c diff --git a/br-ext-chip-ingenic/configs/t10_lite_defconfig b/br-ext-chip-ingenic/configs/t10_lite_defconfig index 469fbe8b..26c9a49c 100644 --- a/br-ext-chip-ingenic/configs/t10_lite_defconfig +++ b/br-ext-chip-ingenic/configs/t10_lite_defconfig @@ -108,7 +108,6 @@ BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y BR2_PACKAGE_WIREGUARD_TOOLS=y # DEBUG -BR2_PACKAGE_LOGCAT=y # BR2_PACKAGE_HOST_GDB is not set # BR2_PACKAGE_GDB is not set diff --git a/br-ext-chip-ingenic/configs/t20_lite_defconfig b/br-ext-chip-ingenic/configs/t20_lite_defconfig index 4a401e3d..b7bfd105 100644 --- a/br-ext-chip-ingenic/configs/t20_lite_defconfig +++ b/br-ext-chip-ingenic/configs/t20_lite_defconfig @@ -108,7 +108,6 @@ BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y BR2_PACKAGE_WIREGUARD_TOOLS=y # DEBUG -BR2_PACKAGE_LOGCAT=y # BR2_PACKAGE_HOST_GDB is not set # BR2_PACKAGE_GDB is not set diff --git a/br-ext-chip-ingenic/configs/t20_ultimate_defconfig b/br-ext-chip-ingenic/configs/t20_ultimate_defconfig index 6c1c71dd..dd410942 100644 --- a/br-ext-chip-ingenic/configs/t20_ultimate_defconfig +++ b/br-ext-chip-ingenic/configs/t20_ultimate_defconfig @@ -122,7 +122,6 @@ BR2_PACKAGE_ZEROTIER_ONE=y # BR2_PACKAGE_NABTO is not set # DEBUG -BR2_PACKAGE_LOGCAT=y # BR2_PACKAGE_HOST_GDB is not set # BR2_PACKAGE_GDB is not set diff --git a/br-ext-chip-ingenic/configs/t21_lite_defconfig b/br-ext-chip-ingenic/configs/t21_lite_defconfig index c9e3f00d..05c4c6db 100644 --- a/br-ext-chip-ingenic/configs/t21_lite_defconfig +++ b/br-ext-chip-ingenic/configs/t21_lite_defconfig @@ -108,7 +108,6 @@ BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y BR2_PACKAGE_WIREGUARD_TOOLS=y # DEBUG -BR2_PACKAGE_LOGCAT=y # BR2_PACKAGE_HOST_GDB is not set # BR2_PACKAGE_GDB is not set diff --git a/br-ext-chip-ingenic/configs/t21_ultimate_defconfig b/br-ext-chip-ingenic/configs/t21_ultimate_defconfig index ee4ba915..d6a0a223 100644 --- a/br-ext-chip-ingenic/configs/t21_ultimate_defconfig +++ b/br-ext-chip-ingenic/configs/t21_ultimate_defconfig @@ -110,7 +110,6 @@ BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y BR2_PACKAGE_WIREGUARD_TOOLS=y # DEBUG -BR2_PACKAGE_LOGCAT=y # BR2_PACKAGE_HOST_GDB is not set # BR2_PACKAGE_GDB is not set diff --git a/br-ext-chip-ingenic/configs/t30_lite_defconfig b/br-ext-chip-ingenic/configs/t30_lite_defconfig index 2bb9ebd3..3ec14f43 100644 --- a/br-ext-chip-ingenic/configs/t30_lite_defconfig +++ b/br-ext-chip-ingenic/configs/t30_lite_defconfig @@ -108,7 +108,6 @@ BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y BR2_PACKAGE_WIREGUARD_TOOLS=y # DEBUG -BR2_PACKAGE_LOGCAT=y # BR2_PACKAGE_HOST_GDB is not set # BR2_PACKAGE_GDB is not set diff --git a/br-ext-chip-ingenic/configs/t31_fpv_defconfig b/br-ext-chip-ingenic/configs/t31_fpv_defconfig index bdd661c7..b772d6ea 100644 --- a/br-ext-chip-ingenic/configs/t31_fpv_defconfig +++ b/br-ext-chip-ingenic/configs/t31_fpv_defconfig @@ -114,7 +114,6 @@ BR2_PACKAGE_WIFIBROADCAST=y BR2_PACKAGE_MAVFWD=y # DEBUG -BR2_PACKAGE_LOGCAT=y # BR2_PACKAGE_HOST_GDB is not set # BR2_PACKAGE_GDB is not set diff --git a/br-ext-chip-ingenic/configs/t31_lite_defconfig b/br-ext-chip-ingenic/configs/t31_lite_defconfig index fa1028c3..734ba756 100644 --- a/br-ext-chip-ingenic/configs/t31_lite_defconfig +++ b/br-ext-chip-ingenic/configs/t31_lite_defconfig @@ -111,7 +111,6 @@ BR2_PACKAGE_WIREGUARD_TOOLS=y # BR2_PACKAGE_ONVIF_SIMPLE_SERVER is not set # DEBUG -BR2_PACKAGE_LOGCAT=y # BR2_PACKAGE_HOST_GDB is not set # BR2_PACKAGE_GDB is not set diff --git a/br-ext-chip-ingenic/configs/t31_ultimate_defconfig b/br-ext-chip-ingenic/configs/t31_ultimate_defconfig index f4fea8d4..59172755 100644 --- a/br-ext-chip-ingenic/configs/t31_ultimate_defconfig +++ b/br-ext-chip-ingenic/configs/t31_ultimate_defconfig @@ -128,7 +128,6 @@ BR2_PACKAGE_ZEROTIER_ONE=y # BR2_PACKAGE_NABTO is not set # DEBUG -BR2_PACKAGE_LOGCAT=y # BR2_PACKAGE_HOST_GDB is not set # BR2_PACKAGE_GDB is not set diff --git a/br-ext-chip-ingenic/configs/t31glibc_lite_defconfig b/br-ext-chip-ingenic/configs/t31glibc_lite_defconfig index 36d75c10..8bf771cb 100644 --- a/br-ext-chip-ingenic/configs/t31glibc_lite_defconfig +++ b/br-ext-chip-ingenic/configs/t31glibc_lite_defconfig @@ -109,7 +109,6 @@ BR2_PACKAGE_WIREGUARD_TOOLS=y # BR2_PACKAGE_ONVIF_SIMPLE_SERVER is not set # DEBUG -BR2_PACKAGE_LOGCAT=y # BR2_PACKAGE_HOST_GDB is not set # BR2_PACKAGE_GDB is not set diff --git a/br-ext-chip-ingenic/configs/t40_lite_defconfig b/br-ext-chip-ingenic/configs/t40_lite_defconfig index ed33983a..c81992d2 100644 --- a/br-ext-chip-ingenic/configs/t40_lite_defconfig +++ b/br-ext-chip-ingenic/configs/t40_lite_defconfig @@ -108,7 +108,6 @@ BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y BR2_PACKAGE_WIREGUARD_TOOLS=y # DEBUG -BR2_PACKAGE_LOGCAT=y # BR2_PACKAGE_HOST_GDB is not set # BR2_PACKAGE_GDB is not set diff --git a/br-ext-chip-ingenic/configs/t40_ultimate_defconfig b/br-ext-chip-ingenic/configs/t40_ultimate_defconfig index c206d6c7..e39269ac 100644 --- a/br-ext-chip-ingenic/configs/t40_ultimate_defconfig +++ b/br-ext-chip-ingenic/configs/t40_ultimate_defconfig @@ -119,7 +119,6 @@ BR2_PACKAGE_ZEROTIER_ONE=y # BR2_PACKAGE_NABTO is not set # DEBUG -BR2_PACKAGE_LOGCAT=y # BR2_PACKAGE_HOST_GDB is not set # BR2_PACKAGE_GDB is not set diff --git a/general/package/Config.in b/general/package/Config.in index 829d45b3..b491f48e 100644 --- a/general/package/Config.in +++ b/general/package/Config.in @@ -57,7 +57,6 @@ source "$BR2_EXTERNAL_GENERAL_PATH/package/libsrtp-openipc/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/libwebsockets-openipc/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/linux-firmware-openipc/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/linux-patcher/Config.in" -source "$BR2_EXTERNAL_GENERAL_PATH/package/logcat/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/lshell/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/majestic-fonts/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/majestic-plugins/Config.in" diff --git a/general/package/logcat/Config.in b/general/package/logcat/Config.in deleted file mode 100644 index 01fd9f76..00000000 --- a/general/package/logcat/Config.in +++ /dev/null @@ -1,4 +0,0 @@ -config BR2_PACKAGE_LOGCAT - bool "logcat" - help - Logcat tool for Ingenic diff --git a/general/package/logcat/logcat.mk b/general/package/logcat/logcat.mk deleted file mode 100644 index 26703b13..00000000 --- a/general/package/logcat/logcat.mk +++ /dev/null @@ -1,21 +0,0 @@ -################################################################################ -# -# logcat -# https://github.com/wltechblog/logcat-mini -# -################################################################################ - -LOGCAT_SITE_METHOD = local -LOGCAT_SITE = $(LOGCAT_PKGDIR)/src -LOGCAT_LICENSE = MIT -LOGCAT_LICENSE_FILES = LICENSE - -define LOGCAT_BUILD_CMDS - $(TARGET_CC) $(@D)/logcat.c -o $(@D)/logcat -s -endef - -define LOGCAT_INSTALL_TARGET_CMDS - $(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(@D)/logcat -endef - -$(eval $(generic-package)) diff --git a/general/package/logcat/src/logcat.c b/general/package/logcat/src/logcat.c deleted file mode 100644 index d1003093..00000000 --- a/general/package/logcat/src/logcat.c +++ /dev/null @@ -1,125 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#define LOGGER_ENTRY_MAX_LEN (4 * 1024) -#define LOGGER_FLUSH_LOG _IO(__LOGGERIO, 4) -#define __LOGGERIO 0xAE - -struct logger_entry { - uint16_t len; - uint16_t __pad; - int32_t pid; - int32_t tid; - int32_t sec; - int32_t nsec; - char msg[4096]; -} entry; - -enum android_LogPriority { - ANDROID_LOG_UNKNOWN = 0, - ANDROID_LOG_DEFAULT, - ANDROID_LOG_VERBOSE, - ANDROID_LOG_DEBUG, - ANDROID_LOG_INFO, - ANDROID_LOG_WARN, - ANDROID_LOG_ERROR, - ANDROID_LOG_FATAL, - ANDROID_LOG_SILENT, -}; - -int main(int argc, char *argv[]) { - int fd; - int msize; - int readsize; - int numread; - - if (argc > 1) { - if (strcmp(argv[1], "-c") == 0) { - fd = open("/dev/log_main", O_WRONLY); - if (fd < 0) { - perror("Error opening /dev/log_main\n"); - return -1; - } - ioctl(fd, LOGGER_FLUSH_LOG); - close(fd); - return 0; - } else { - printf("Usage: %s [-c] [-h]\n", argv[0]); - printf("Options:\n"); - printf(" -c Clear the log\n"); - printf(" -h Show this help\n"); - return 0; - } - } - - fd = open("/dev/log_main", O_RDONLY); - if (fd < 0) { - perror("Error opening /dev/log_main\n"); - return -1; - } - - int pos; - while (1) { - numread = read(fd, &entry, LOGGER_ENTRY_MAX_LEN); - if (numread < 1) { - perror("Error: "); - strerror(errno); - return -1; - } - - char *tag = entry.msg; - char *prog = entry.msg + 1; - char *msg = entry.msg + strlen(entry.msg) + 1; - char tagbyte; - - switch (*tag) { - case ANDROID_LOG_UNKNOWN: - tagbyte = 'U'; - break; - - case ANDROID_LOG_DEFAULT: - tagbyte = '*'; - break; - - case ANDROID_LOG_VERBOSE: - tagbyte = 'V'; - break; - - case ANDROID_LOG_DEBUG: - tagbyte = 'D'; - break; - - case ANDROID_LOG_INFO: - tagbyte = 'I'; - break; - - case ANDROID_LOG_WARN: - tagbyte = 'W'; - break; - - case ANDROID_LOG_ERROR: - tagbyte = 'E'; - break; - - case ANDROID_LOG_FATAL: - tagbyte = 'F'; - break; - - case ANDROID_LOG_SILENT: - tagbyte = 'S'; - break; - - default: - tagbyte = '?'; - break; - } - - printf("%c/%s(%5d): %s", tagbyte, prog, entry.pid, msg); - } -}