merge upstream 1.2.1

This commit is contained in:
szm-min 2022-08-02 09:38:59 +08:00
parent c7ab761a5e
commit e6d10de472
7 changed files with 9561 additions and 6 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
libkysdk-system (1.2.1) yangtze; urgency=medium
* 升级版本号
-- szm-min <shaozhimin@kylinos.cn> Tue, 02 Aug 2022 09:33:58 +0800
libkysdk-system (1.2.0kylin4-ok4~0720) yangtze; urgency=medium
* 合并主线v1.2.1到openkylin

BIN
debian/patches/0001-Update.patch vendored Normal file

Binary file not shown.

111
debian/patches/0002-fix-bug-125453.patch vendored Normal file
View File

@ -0,0 +1,111 @@
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
Date: Mon, 27 Jun 2022 03:50:55 +0000
Subject: =?utf-8?b?Zml4IGJ1ZyMxMjU0NTMs5o6n5Yi26Z2i5p2/6LSm5oi35qih5Z2X57y6?=
=?utf-8?b?5bCRIui0puaIt+S/oeaBryLorr7nva7pobk=?=
---
src/disk/CMakeLists.txt | 1 +
src/filesystem/filewatcher/CMakeLists.txt | 1 +
src/hardware/CMakeLists.txt | 1 +
src/kdkocr/CMakeLists.txt | 1 +
src/packages/CMakeLists.txt | 1 +
src/powermanagement/CMakeLists.txt | 1 +
src/proc/CMakeLists.txt | 1 +
src/systeminfo/CMakeLists.txt | 1 +
8 files changed, 8 insertions(+)
diff --git a/src/disk/CMakeLists.txt b/src/disk/CMakeLists.txt
index 38661f7..2663b7e 100644
--- a/src/disk/CMakeLists.txt
+++ b/src/disk/CMakeLists.txt
@@ -1,5 +1,6 @@
aux_source_directory(. SOURCESCODE)
add_library(kydiskinfo SHARED ${SOURCESCODE})
+set_target_properties(kydiskinfo PROPERTIES VERSION 1.2.0 SOVERSION 1)
add_executable(test-getdiskinfo test/getdiskinfo.c)
add_executable(test-getdisklist test/getdisklist.c)
find_library(UDEV_LIB udev)
diff --git a/src/filesystem/filewatcher/CMakeLists.txt b/src/filesystem/filewatcher/CMakeLists.txt
index d5bc184..4f23d76 100644
--- a/src/filesystem/filewatcher/CMakeLists.txt
+++ b/src/filesystem/filewatcher/CMakeLists.txt
@@ -5,6 +5,7 @@ aux_source_directory(. SOURCECODE)
find_package(Qt5Core)
include_directories(${Qt5Core_INCLUDE_DIRS})
add_library(kyfilewatcher SHARED ${SOURCECODE})
+set_target_properties(kyfilewatcher PROPERTIES VERSION 1.2.0 SOVERSION 1)
add_executable(kyfilewatcher-test test/kyfilewatcher-test.cpp)
target_link_libraries(kyfilewatcher kylog kyconf systemd pthread ${Qt5Core_LIBRARIES})
target_link_libraries(kyfilewatcher-test kyfilewatcher)
diff --git a/src/hardware/CMakeLists.txt b/src/hardware/CMakeLists.txt
index ccb9831..916423f 100644
--- a/src/hardware/CMakeLists.txt
+++ b/src/hardware/CMakeLists.txt
@@ -1,6 +1,7 @@
aux_source_directory(. SOURCESCODE)
include_directories(.)
add_library(kyhw SHARED ${SOURCESCODE})
+set_target_properties(kyhw PROPERTIES VERSION 1.2.0 SOVERSION 1)
add_executable(kync-test test/kync-test.c)
add_executable(kycpu-test test/kycpu-test.c)
target_link_libraries(kyhw kylog kyconf pthread systemd)
diff --git a/src/kdkocr/CMakeLists.txt b/src/kdkocr/CMakeLists.txt
index 5a2c516..a3ee095 100644
--- a/src/kdkocr/CMakeLists.txt
+++ b/src/kdkocr/CMakeLists.txt
@@ -168,6 +168,7 @@ if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "loongarch64")
else()
add_library(kyocr SHARED libkyocr.cpp ocr_main.cpp utility.cpp preprocess_op.cpp postprocess_op.cpp)
endif()
+set_target_properties(kyocr PROPERTIES VERSION 1.2.0 SOVERSION 1)
#target_link_libraries(kdkOCR -lleptonica)
target_link_libraries(kyocr ${OpenCV_LIBS} ${DEPS})
target_link_libraries(kyocr ${kyocr_libraries})
diff --git a/src/packages/CMakeLists.txt b/src/packages/CMakeLists.txt
index 0ab21e2..1225379 100644
--- a/src/packages/CMakeLists.txt
+++ b/src/packages/CMakeLists.txt
@@ -1,6 +1,7 @@
aux_source_directory(. SOURCESCODE)
include_directories(.)
add_library(kypackage SHARED ${SOURCESCODE})
+set_target_properties(kypackage PROPERTIES VERSION 1.2.0 SOVERSION 1)
add_executable(kypackage-test test/kypackage-test.c)
target_link_libraries(kypackage-test kypackage)
diff --git a/src/powermanagement/CMakeLists.txt b/src/powermanagement/CMakeLists.txt
index 282681d..7a495fc 100644
--- a/src/powermanagement/CMakeLists.txt
+++ b/src/powermanagement/CMakeLists.txt
@@ -5,6 +5,7 @@ project(kypowermanagement LANGUAGES CXX)
set(POWERMANAGEMENT_TOP_DIR ${CMAKE_CURRENT_LIST_DIR})
add_library(${PROJECT_NAME} SHARED)
+set_target_properties(kypowermanagement PROPERTIES VERSION 1.2.0 SOVERSION 1)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -g)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
diff --git a/src/proc/CMakeLists.txt b/src/proc/CMakeLists.txt
index 322fcf6..5833e23 100644
--- a/src/proc/CMakeLists.txt
+++ b/src/proc/CMakeLists.txt
@@ -1,6 +1,7 @@
aux_source_directory(. SOURCESCODE)
include_directories(.)
add_library(kyrtinfo SHARED ${SOURCESCODE})
+set_target_properties(kyrtinfo PROPERTIES VERSION 1.2.0 SOVERSION 1)
add_executable(kyrtinfo-test test/kyrtinfo-test.c)
target_link_libraries(kyrtinfo-test kyrtinfo)
diff --git a/src/systeminfo/CMakeLists.txt b/src/systeminfo/CMakeLists.txt
index cd6378f..c1392eb 100644
--- a/src/systeminfo/CMakeLists.txt
+++ b/src/systeminfo/CMakeLists.txt
@@ -4,6 +4,7 @@ find_library(GLIBC_LIB glib-2.0)
find_library(DBUS_LIB dbus-1)
find_library(DBUS_GLIB_LIB dbus-glib-1)
add_library(kysysinfo SHARED ${SOURCESCODE})
+set_target_properties(kysysinfo PROPERTIES VERSION 1.2.0 SOVERSION 1)
add_executable(kysysinfo-test test/kysysinfo_test.c)
target_link_libraries(kysysinfo kylog systemd kyconf ${GLIBC_LIB} ${DBUS_LIB} ${DBUS_GLIB_LIB})
target_link_libraries(kysysinfo-test kysysinfo)

9344
debian/patches/0003-update-changelog.patch vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
From: szm-min <shaozhimin@kylinos.cn>
Date: Thu, 28 Jul 2022 06:58:47 +0000
Subject: =?utf-8?q?!4_=E4=BF=AE=E6=94=B9systime=E7=9A=84dbus=E7=9A=84interf?=
=?utf-8?q?ace_Merge_pull_request_!4_from_szm-min/openkylin/yangtze?=
---
src/systemtime/m_systime.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/systemtime/m_systime.c b/src/systemtime/m_systime.c
index 993a972..dbb3ac2 100644
--- a/src/systemtime/m_systime.c
+++ b/src/systemtime/m_systime.c
@@ -233,7 +233,15 @@ const char *server_introspection_xml =
" </interface>\n"
" <interface name='org.freedesktop.DBus.Properties'>\n"
- " <method name=timerfd"
+ " <method name='Get'>\n"
+ " <arg name='interface' type='s' direction='in' />\n"
+ " <arg name='property' type='s' direction='in' />\n"
+ " <arg name='value' type='s' direction='out' />\n"
+ " </method>\n"
+ " <method name='GetAll'>\n"
+ " <arg name='interface' type='s' direction='in'/>\n"
+ " <arg name='properties' type='a{sv}' direction='out'/>\n"
+ " </method>\n"
" </interface>\n"
" <interface name='com.kylin.kysdk.TimeInterface'>\n"

View File

@ -13,6 +13,8 @@
#include <semaphore.h>
#include <sys/timerfd.h>
#include <errno.h>
// 20020721新增时区变化监听
#include <sys/inotify.h>
pthread_mutex_t lock;
u_int8_t g_Flag; // 控制启用常驻定时器还是临时定时器
@ -39,12 +41,16 @@ static void *printClock(void *ptr)
time_t current;
time(&current);
now = localtime(&current);
// struct timeval tx;
// struct timezone tz;
// gettimeofday(&tx,&tz);
// zone = tz.tz_minuteswest/60;
// printf("时差:%d\n",zone);
// 如果时间发生改变发送TimeChangeSignal信号
if (g_TimeChanged == 1)
{
char *buf = calloc(1, 128);
sprintf(buf, "%04d/%02d/%02d %02d:%02d:%02d", now->tm_year + 1900, now->tm_mon, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec);
sprintf(buf, "%04d/%02d/%02d %02d:%02d:%02d", now->tm_year + 1900, now->tm_mon+1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec);
printf("%s\n", buf);
msg = dbus_message_new_signal("/com/kylin/kysdk/Timer",
@ -83,7 +89,7 @@ static void *printClock(void *ptr)
else
{
char *buf = calloc(1, 128);
sprintf(buf, "%04d/%02d/%02d %02d:%02d:%02d", now->tm_year + 1900, now->tm_mon, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec);
sprintf(buf, "%04d/%02d/%02d %02d:%02d:%02d", now->tm_year + 1900, now->tm_mon+1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec);
// printf("%s\n", buf);
msg = dbus_message_new_signal("/com/kylin/kysdk/Timer",
@ -148,7 +154,7 @@ void *startBroadcastSystemTimePerMin(void *tmp)
int monitorSystemTimeChange()
{
#define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1)
// printf("monitorSystemTimeChange\n");
struct itimerspec its = {.it_value.tv_sec = TIME_T_MAX};
int fd = timerfd_create(CLOCK_REALTIME, TFD_CLOEXEC);
if (fd < 0)
@ -190,6 +196,57 @@ void *actionTimeChanged(void *ptr)
return NULL;
}
// 20020721新增时区变化监听
int monitorSystemTimeZoneChange(){
char buf[BUFSIZ];
int fd = inotify_init();
buf[sizeof(buf) - 1] = 0;
struct inotify_event *event;
if (fd < 0)
{
return -1;
}
int ftimezone = inotify_add_watch(fd,"/etc/timezone",IN_DELETE_SELF);
if (ftimezone < 0)
{
close(fd);
return -1;
}
int ret = read(fd, buf, sizeof(buf) - 1);
close(fd);
event = (struct inotify_event *)&buf[0];
if (ret)
{
fprintf(stdout, "%s --- %s\n", event->name, "IN_DELETE_SELF");
return 1;
}
return 0;
}
// 20020721新增时区变化监听
void *actionTimeZoneChanged(void *ptr)
{
DBusConnection *conn = ptr;
while (!g_Quit)
{
if (monitorSystemTimeZoneChange() == 1)
{
printf("System Time Changed.\n");
if (g_Flag)
{
g_TimeChanged = 1;
g_Flag = 0;
printClock(conn);
}
}
}
return NULL;
}
const char *version = "0.1";
GMainLoop *mainloop;
@ -450,13 +507,20 @@ int main(void)
sem_init(&g_Wait, 0, 1);
pthread_mutex_init(&lock, NULL);
pthread_attr_t attr;
pthread_t tid;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_create(&tid, &attr, actionTimeChanged, conn);
pthread_mutex_init(&lock, NULL);
// 20020721新增时区变化监听
pthread_attr_t timezone_attr;
pthread_t timezone_id;
pthread_attr_init(&timezone_attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_create(&timezone_id, &timezone_attr, actionTimeZoneChanged, conn);
/* connect to the daemon bus */