diff --git a/0001-download-the-rpm-package-in-the-system.patch b/0001-download-the-rpm-package-in-the-system.patch new file mode 100644 index 0000000000000000000000000000000000000000..68aa7f4b36ac4905fcf5ffee7b163dce91d6b277 --- /dev/null +++ b/0001-download-the-rpm-package-in-the-system.patch @@ -0,0 +1,37 @@ +From d0e28ae440b4129eebff1b53d18f42d48ef0156c Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 14:59:04 +0800 +Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=BD=AF=E4=BB=B6=E5=8C=85?= + =?UTF-8?q?=E5=92=8C=E4=B8=8B=E8=BD=BD=E7=9A=84=E8=BD=AF=E4=BB=B6=E5=8C=85?= + =?UTF-8?q?=E5=AF=B9=E5=BA=94?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/Abisystmcompchk.py | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/sysmig_agent/Abisystmcompchk.py b/sysmig_agent/Abisystmcompchk.py +index 0b5c519..eab8322 100644 +--- a/sysmig_agent/Abisystmcompchk.py ++++ b/sysmig_agent/Abisystmcompchk.py +@@ -818,3 +818,15 @@ def switch_write_migrate_report(report_name, num, flag): + with open(abi_incomp_chk, 'r') as fr_incomp: + column_incomp_list = fr_incomp.readlines() + write_row_by_row(report_name, column_incomp_list, 2, 0, num) ++ ++ ++def get_system_unique_pkg(current_pkg_list, download_pkg_list): ++ # clean history data ++ if os.path.exists(current_system_unique): ++ os.remove(current_system_unique) ++ ++ fcw = open(current_system_unique, 'w') ++ for data in set(current_pkg_list).difference(set(download_pkg_list)): ++ fcw.write(data + '\n') ++ fcw.close() ++ +-- +2.20.1 + diff --git a/0001-use-kill-not-kill-INT-when-stop-service.patch b/0001-use-kill-not-kill-INT-when-stop-service.patch deleted file mode 100644 index d5136536511ebc42462e69dc79d1e2e00c738e79..0000000000000000000000000000000000000000 --- a/0001-use-kill-not-kill-INT-when-stop-service.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 192fd69de19a78afe81a5a2c5a8270057f12ee3d Mon Sep 17 00:00:00 2001 -From: lixin -Date: Mon, 18 Mar 2024 10:32:17 +0800 -Subject: [PATCH] use kill instead of kill-INT - ---- - server/migration-tools-server.service | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/server/migration-tools-server.service b/server/migration-tools-server.service -index 8cd53a3..dd16c95 100644 ---- a/server/migration-tools-server.service -+++ b/server/migration-tools-server.service -@@ -5,7 +5,7 @@ After=network-online.target - [Service] - Type=simple - ExecStart=/usr/bin/python3 /usr/lib/migration-tools-server/index.py --ExecStop=/bin/kill-INT $MAINPID -+ExecStop=/bin/kill -HUP $MAINPID - - [Install] - WantedBy=multi-user.target --- -2.41.0 - diff --git a/0002-get-information-before-migration.patch b/0002-get-information-before-migration.patch new file mode 100644 index 0000000000000000000000000000000000000000..aa8a386cd27bd6dadce49933e04a5c6e3488c95c --- /dev/null +++ b/0002-get-information-before-migration.patch @@ -0,0 +1,93 @@ +From acb29d91b7b13f56085bc9e9b511aef367de9a0b Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 15:04:12 +0800 +Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E5=89=8D=E8=BD=AF=E4=BB=B6?= + =?UTF-8?q?=E5=8C=85=E5=92=8C=E7=B3=BB=E7=BB=9F=E4=BF=A1=E6=81=AF=E5=87=86?= + =?UTF-8?q?=E5=A4=87?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/Abisystmcompchk.py | 68 +++++++++++++++++++++++++++++++++ + 1 file changed, 68 insertions(+) + +diff --git a/sysmig_agent/Abisystmcompchk.py b/sysmig_agent/Abisystmcompchk.py +index eab8322..d717cdf 100644 +--- a/sysmig_agent/Abisystmcompchk.py ++++ b/sysmig_agent/Abisystmcompchk.py +@@ -830,3 +830,71 @@ def get_system_unique_pkg(current_pkg_list, download_pkg_list): + fcw.write(data + '\n') + fcw.close() + ++ ++#Check the environment before migration and generate a detection report ++def migrate_before_abi_chk(q_query, task_status): ++ i=0 ++ Flag='0' ++ Oth='2' ++ global percentage ++ global total_rpm_nums ++ task_status_error = '2' ++ migration_download_list = [] ++ ++ log = logger_init() ++ log.info('============== START TIME :'+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')+' ==============') ++ ++ download_path = local_dir + 'uos/rpms' ++ current_packages_string = get_system_pkg_name(Flag, log) ++ if not current_packages_string: ++ msg_tup = ('0', task_status_error) ++ q_query.put(msg_tup) ++ log.info('The current progress exit:' + str(msg_tup)) ++ #return False ++ ++ os.system('yumdownloader --destdir=%s%s --skip-broken' %(download_path, current_packages_string)) ++ ++ download_list = get_system_pkg_list(migration_download_list) ++ if not download_list: ++ log.info('yumdownloader rpm pakcages failed ...') ++ msg_tup = ('0', task_status_error) ++ q_query.put(msg_tup) ++ log.info('The current progress exit:' + str(msg_tup)) ++ #return False ++ total_rpm_nums = len(download_list) ++ ++ current_list = get_system_pkg_name(Oth, log) ++ if not current_list: ++ msg_tup = ('0', task_status) ++ q_query.put(msg_tup) ++ log.info('The current progress exit:' + str(msg_tup_error)) ++ #return False ++ ++ get_system_unique_pkg(list(current_list), migration_download_list) ++ ++ cur_dir = os.getcwd() ++ os.chdir(download_path) ++ rst = MutilThread(download_list, q_query, log) ++ os.chdir(cur_dir) ++ ++ agent_ABI_check_result() ++ ++ migrate_before_report_name = create_migrate_report_name(Flag, log) ++ if not migrate_before_report_name: ++ msg_tup = ('0', task_status) ++ q_query.put(msg_tup) ++ log.info('The current progress exit:' + str(msg_tup)) ++ #return False ++ ++ while i < 4: ++ write_migrate_report_rst =switch_write_migrate_report(migrate_before_report_name, i, Flag) ++ i = i + 1 ++ ++ task_status = '0' ++ msg_tup = (percentage, task_status) ++ q_query.put(msg_tup) ++ log.info('The current progress has been completed:' + str(msg_tup)) ++ log.info('============== END TIME :'+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')+' ==============') ++ ++ return '0' ++ +-- +2.20.1 + diff --git a/0003-export-migration-check-report.patch b/0003-export-migration-check-report.patch new file mode 100644 index 0000000000000000000000000000000000000000..b860fd7508261ed4c8d5f64c5f8d44884efc43a2 --- /dev/null +++ b/0003-export-migration-check-report.patch @@ -0,0 +1,102 @@ +From 75714106374a4e62630c0e6b131f74a0717518bc Mon Sep 17 00:00:00 2001 +From: lixin +Date: Mon, 13 Nov 2023 15:17:47 +0800 +Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=A3=80=E6=B5=8B=E6=8A=A5?= + =?UTF-8?q?=E5=91=8A=E5=AF=BC=E5=87=BA?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + views/reports.py | 25 +++++++++++++++++++++++++ + views/server.py | 33 ++++++++++++++++++++++++++++++++- + 2 files changed, 57 insertions(+), 1 deletion(-) + create mode 100644 views/reports.py + +diff --git a/views/reports.py b/views/reports.py +new file mode 100644 +index 0000000..6295283 +--- /dev/null ++++ b/views/reports.py +@@ -0,0 +1,25 @@ ++import os ++from logger import * ++from connect_sql import DBHelper ++ ++ ++os.chdir('/usr/lib/uos-sysmig-server') ++migration_log = Logger('/var/tmp/uos-migration/migration.log', logging.DEBUG, logging.DEBUG) ++ ++ ++def migration_detection(data): ++ """ ++ 迁移检测报告 ++ :return: ++ """ ++ agent_ip = data.get('agent_ip') ++ info_sql = "select AES_DECRYPT(agent_passwd, 'coco'),agent_username from agent_info where agent_ip='%s'" % agent_ip ++ info = DBHelper().execute(info_sql).fetchall() ++ scp_log = "sshpass -p %s scp -r %s@%s:/var/tmp/uos-migration/UOS_analysis_report*.tar.gz /var/uos-migration/" % \ ++ (str(info[0][0], encoding="utf-8"), info[0][1], agent_ip) ++ try: ++ os.system(scp_log) ++ migration_log.info(scp_log) ++ except: ++ migration_log.error('export report scp error:%s' % scp_log) ++ return 'success' +\ No newline at end of file +diff --git a/views/server.py b/views/server.py +index 369a750..4cfab8f 100644 +--- a/views/server.py ++++ b/views/server.py +@@ -1,8 +1,13 @@ + import json ++import os + from datetime import datetime + + from connect_sql import DBHelper + from sysmig_agent.share import getSysMigConf ++from views import reports ++from logger import * ++ ++migration_log = Logger('/var/tmp/uos-migration/migration.log', logging.DEBUG, logging.DEBUG) + + def import_host_info(data): + """ +@@ -343,4 +348,30 @@ def get_storage_num(data): + faild = len(get_faild_num) + data = {'success': success, 'faild': faild} + json_data = json.dumps(data) +- return json_data +\ No newline at end of file ++ return json_data ++ ++ ++reports_type = { ++ "migration_detection": reports.migration_detection, ++} ++ ++def export_reports(data): ++ """ ++ 导出各种报告 ++ :param data: ++ :return: ++ """ ++ data = json.loads(data) ++ report_type = reports_type.get(data.get('reports_type')) ++ if report_type: ++ mkdir_log_pwd = "/var/uos-migration/" ++ isExists = os.path.exists(mkdir_log_pwd) ++ if not isExists: ++ try: ++ os.makedirs(mkdir_log_pwd) ++ migration_log.info(mkdir_log_pwd) ++ except: ++ migration_log.war("export report mkdir war:%s" % mkdir_log_pwd) ++ ++ report_type(data) ++ return 'success' +\ No newline at end of file +-- +2.20.1 + diff --git a/0004-complete-information-report-after-abi-detection.patch b/0004-complete-information-report-after-abi-detection.patch new file mode 100644 index 0000000000000000000000000000000000000000..630f613cd56ad968b305f2bb8f6c37222f451c6b --- /dev/null +++ b/0004-complete-information-report-after-abi-detection.patch @@ -0,0 +1,45 @@ +From 5787327a9f14de7b3f40945d328a2753b08a0f04 Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 15:19:25 +0800 +Subject: [PATCH] =?UTF-8?q?ABI=E6=A3=80=E6=B5=8B=E5=90=8E=E5=AE=8C?= + =?UTF-8?q?=E6=88=90=E6=95=B4=E5=90=88=E6=8A=A5=E5=91=8A=E4=BF=A1=E6=81=AF?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/Abisystmcompchk.py | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/sysmig_agent/Abisystmcompchk.py b/sysmig_agent/Abisystmcompchk.py +index d717cdf..493c09b 100644 +--- a/sysmig_agent/Abisystmcompchk.py ++++ b/sysmig_agent/Abisystmcompchk.py +@@ -898,3 +898,24 @@ def migrate_before_abi_chk(q_query, task_status): + + return '0' + ++ ++#Check the environment after the migration and generate a detection report ++def migrate_behind_abi_chk(): ++ i=0 ++ Flag='1' ++ ++ log = logger_init() ++ ++ current_install_uos_list = get_system_pkg_name(Flag, log) ++ if not current_install_uos_list: ++ return False ++ ++ migrate_behind_report_name = create_migrate_report_name(Flag, log) ++ if not migrate_behind_report_name: ++ return False ++ ++ while i < 4: ++ write_migrate_report_rst =switch_write_migrate_report(migrate_behind_report_name, i, Flag) ++ i = i + 1 ++ ++ return '0' +-- +2.20.1 + diff --git a/0005-abi-detection-through-multi-threads.patch b/0005-abi-detection-through-multi-threads.patch new file mode 100644 index 0000000000000000000000000000000000000000..1f36d07101ebc15fe2aa32472b19c58ec2773290 --- /dev/null +++ b/0005-abi-detection-through-multi-threads.patch @@ -0,0 +1,70 @@ +From ef8d18b5e61506b7450f1fb96ca895e704f9de7a Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 15:23:16 +0800 +Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E7=BA=BF=E7=A8=8B=E5=AE=8C=E6=88=90AB?= + =?UTF-8?q?I=E6=A3=80=E6=9F=A5?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/Abisystmcompchk.py | 46 +++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +diff --git a/sysmig_agent/Abisystmcompchk.py b/sysmig_agent/Abisystmcompchk.py +index 493c09b..79e6581 100644 +--- a/sysmig_agent/Abisystmcompchk.py ++++ b/sysmig_agent/Abisystmcompchk.py +@@ -919,3 +919,49 @@ def migrate_behind_abi_chk(): + i = i + 1 + + return '0' ++ ++ ++def MutilThread(nameList, Query, muth_logger): ++ global exitFlag ++ ++ # Default number of cpus ++ thread_num = int(cpu_count() * 1.5) ++ ++ threadList = ["Thread-%d" % (num) for num in range(0, thread_num)] ++ ++ threads = [] ++ threadID = 10 ++ # threadID = 1 ++ ++ fw = open(abi_incomp_chk, 'w') ++ fr = open(abi_comp_chk, 'w') ++ ++ # Creating new thread ++ for tName in threadList: ++ thread = myThread(threadID, tName, workQueue, queueLock, fw, fr, Query, muth_logger) ++ thread.start() ++ threads.append(thread) ++ threadID += 1 ++ ++ # Fill in the queue ++ queueLock.acquire() ++ for word in nameList: ++ workQueue.put(word) ++ queueLock.release() ++ ++ # Waiting queue clear ++ while not workQueue.empty(): ++ pass ++ ++ # Notifies the thread that it is time to exit ++ exitFlag = 1 ++ ++ # Wait for all threads to complete ++ for t in threads: ++ t.join() ++ muth_logger.info('========== Exit main thread...... ==========') ++ ++ fw.close() ++ fr.close() ++ ++ return True +-- +2.20.1 + diff --git a/0006-add-message-query-to-update-abi-process.patch b/0006-add-message-query-to-update-abi-process.patch new file mode 100644 index 0000000000000000000000000000000000000000..b8ecdb2c8633f1426047bff000a3e0a3897332e4 --- /dev/null +++ b/0006-add-message-query-to-update-abi-process.patch @@ -0,0 +1,64 @@ +From 8d24d1c2a6462c4516127024c933ec9e793c518d Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 15:48:30 +0800 +Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B6=88=E6=81=AF=E9=98=9F?= + =?UTF-8?q?=E5=88=97=E6=9B=B4=E6=96=B0abi=E6=A3=80=E6=B5=8B=E8=BF=9B?= + =?UTF-8?q?=E5=BA=A6?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/fork.py | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + create mode 100644 sysmig_agent/fork.py + +diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py +new file mode 100644 +index 0000000..a128722 +--- /dev/null ++++ b/sysmig_agent/fork.py +@@ -0,0 +1,40 @@ ++# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. ++# SPDX-License-Identifier: MulanPubL-2.0-or-later ++ ++import platform ++import threading ++from multiprocessing import Process, Queue ++from apscheduler.schedulers.background import BackgroundScheduler ++import time ++import os ++import sys ++from sysmig_agent.abi_weight import * ++from sysmig_agent.Abisystmcompchk import migrate_before_abi_chk, migrate_behind_abi_chk ++import socket ++#from share import * ++from sysmig_agent.short_task import * ++ ++from sysmig_agent.migration import * ++#sys.path.append("..") ++#from connect_sql import DBHelper ++from sysmig_agent.agent_request import post_server ++ ++# create message query ++q = Queue(maxsize=0) ++ ++ ++# 定时任务 ++def up_to_date_sql_abi(): ++ # 获得sql的任务ID ++ # ret_task = get_sql_message() ++ # print('Get message query : ' + str(ret_task[0])) ++ # 获得ABI消息队列信息tuple ++ ret_abi_info = get_abi_info() ++ if ret_abi_info: ++ abi_process = ret_abi_info[0] ++ abi_task = ret_abi_info[1] ++ else: ++ return 1 ++ # 获取abi progress 更新数据库内 ++ sql_abi_progress(abi_process) ++ return 0 +-- +2.20.1 + diff --git a/0007-start-task-to-check-migration.patch b/0007-start-task-to-check-migration.patch new file mode 100644 index 0000000000000000000000000000000000000000..c4756d14f0575a9f80ce0ebe3871f374ef53ca18 --- /dev/null +++ b/0007-start-task-to-check-migration.patch @@ -0,0 +1,47 @@ +From c10a2b4ab02efa9f3172aae2741f084a1c477adc Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 15:56:28 +0800 +Subject: [PATCH] =?UTF-8?q?agent=E8=BF=81=E7=A7=BB=E6=A3=80=E6=B5=8B?= + =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/fork.py | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py +index a128722..daea65f 100644 +--- a/sysmig_agent/fork.py ++++ b/sysmig_agent/fork.py +@@ -38,3 +38,26 @@ def up_to_date_sql_abi(): + # 获取abi progress 更新数据库内 + sql_abi_progress(abi_process) + return 0 ++ ++ ++# ABI系统检测 ++def timed_task_abi(task_id): ++ time_task = BackgroundScheduler(timezone='Asia/Shanghai') ++ task_id=str(task_id) ++ p = time_task.add_job(up_to_date_sql_abi, 'interval', seconds=3) ++ time_task.start() ++ try: ++ task_statue='1' ++ p_abi = Process(target=migrate_before_abi_chk, args=(q,task_statue,)) ++ p_abi.start() ++ p_abi.join() ++ # Determine whether the message queue is dead or empty to end the timer ++ while not q.empty(): ++ continue ++ time_task.shutdown() ++ except (KeyboardInterrupt, SystemExit): ++ # Not strictly necessary if daemonic mode is enabled but should be done if possible ++ time_task.shutdown() ++ print('Exit The Job!') ++ ++ +-- +2.20.1 + diff --git a/0008-add-system-migration-task.patch b/0008-add-system-migration-task.patch new file mode 100644 index 0000000000000000000000000000000000000000..3901e5028dd0aac55c5061329bdd7ae9e1d13df1 --- /dev/null +++ b/0008-add-system-migration-task.patch @@ -0,0 +1,97 @@ +From 5429befc45c4aff1517ee2346c16da3c2aafd8a4 Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 16:00:22 +0800 +Subject: [PATCH] =?UTF-8?q?agent=E7=9A=84=E7=B3=BB=E7=BB=9F=E8=BF=81?= + =?UTF-8?q?=E7=A7=BB=E4=BB=BB=E5=8A=A1?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/fork.py | 73 ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 73 insertions(+) + +diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py +index daea65f..615b3d5 100644 +--- a/sysmig_agent/fork.py ++++ b/sysmig_agent/fork.py +@@ -61,3 +61,76 @@ def timed_task_abi(task_id): + print('Exit The Job!') + + ++# 系统迁移 定时任务更新进度 ++def timed_task_migrate(task_id, kernel_version): ++ time_task_m = BackgroundScheduler(timezone='Asia/Shanghai') ++ p = time_task_m.add_job(up_to_date_sql_migrate, 'interval', seconds=3) ++ migInit_porgress() ++ time_task_m.start() ++ try: ++ while 8 > int(str(get_mig_state(task_id))[1]): ++ state = str(get_mig_state(task_id))[1] ++ if str(get_mig_state(task_id))[0] == '1': ++ ## ++ ## error , too many request systen migration ++ time_task_m.shutdown() ++ return 'error' ++ old_os_name = get_old_osname() ++ if '0' == state: ++ sql_mig_statue('10') ++ if ifnot_mig_kernel(kernel_version): ++ sql_mig_statue('18') ++ t = Process(target=centos8_main, args=(old_os_name, task_id,)) ++ t.start() ++ t.join() ++ elif '2' == state: ++ sql_mig_statue('12') ++ ## skip broken ++ skip = 0 ++ t = Process(target=mig_distro_sync, args=(skip, task_id,)) ++ t.start() ++ t.join() ++ elif '3' == state: ++ # Breakpoint ++ sql_mig_statue('05') ++ elif '4' == state: ++ sql_mig_statue('14') ++ mig_kernel(kernel_version) ++ main_conf(old_os_name) ++ # Migration report ++ try: ++ migrate_behind_abi_chk() ++ except: ++ # Generate analysis report error ++ pass ++ sql_mig_statue('05') ++ elif '5' == state: ++ sql_mig_statue('15') ++ # Migration state weight : 90 ++ res = mig_whether_success() ++ ++ # new system regen sql ++ get_new_osversion() ++ # tar.gz type ++ targz_mig_dir_log() ++ targz_mig_dir_report() ++ sql_abi_progress(100) ++ if 80 > int(res): ++ sql_task_statue('3', task_id) ++ sql_mig_statue('08') ++ return 1 ++ # data = ' 迁移失败。' ++ else: ++ sql_task_statue('2', task_id) ++ sql_mig_statue('09') ++ time_task_m.shutdown() ++ return 0 ++ # data = '迁移成功。' ++ time.sleep(3) # 其他任务是独立的线程执行 ++ time_task_m.shutdown() ++ return 0 ++ except (KeyboardInterrupt, SystemExit): ++ # Not strictly necessary if daemonic mode is enabled but should be done if possible ++ time_task_m.shutdown() ++ sql_task_statue('3', task_id) ++ +-- +2.20.1 + diff --git a/0009-get-abi-detection-process.patch b/0009-get-abi-detection-process.patch new file mode 100644 index 0000000000000000000000000000000000000000..1c54c13acf74a99f23e03bfcbc771874c44fdfda --- /dev/null +++ b/0009-get-abi-detection-process.patch @@ -0,0 +1,40 @@ +From 620114229af58823e27a370ad2839365b0f4535e Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 16:05:28 +0800 +Subject: [PATCH] =?UTF-8?q?agent=E8=8E=B7=E5=8F=96abi=E7=9A=84=E6=B6=88?= + =?UTF-8?q?=E6=81=AF=E9=98=9F=E5=88=97=E8=BF=9B=E5=BA=A6=E4=BF=A1=E6=81=AF?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/fork.py | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py +index 615b3d5..8c2f4b6 100644 +--- a/sysmig_agent/fork.py ++++ b/sysmig_agent/fork.py +@@ -134,3 +134,19 @@ def timed_task_migrate(task_id, kernel_version): + time_task_m.shutdown() + sql_task_statue('3', task_id) + ++ ++def get_abi_info(): ++ if q.empty(): ++ return None ++# print("Full :", q.full()) ++# print("Empty :", q.empty()) ++# print("QSize:", q.qsize()) ++ size = int(q.qsize()) ++ i=0 ++ msg = '' ++ while i < size: ++ i += 1 ++ msg = q.get() ++ return msg ++# if not q.empty(): ++ +-- +2.20.1 + diff --git a/0010-update-abi-result-to-database.patch b/0010-update-abi-result-to-database.patch new file mode 100644 index 0000000000000000000000000000000000000000..323e863235afe1915652b54bbdb39e0a7db3eb0a --- /dev/null +++ b/0010-update-abi-result-to-database.patch @@ -0,0 +1,72 @@ +From 1b94627aaa5a88b12e8d9d9ebf42be2dc08d7503 Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 16:08:31 +0800 +Subject: [PATCH] =?UTF-8?q?agent=E7=9A=84abi=E6=A3=80=E6=B5=8B=E7=BB=93?= + =?UTF-8?q?=E6=9E=9C=E6=9B=B4=E6=96=B0=E5=88=B0sql?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/fork.py | 48 ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 48 insertions(+) + +diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py +index 8c2f4b6..3447678 100644 +--- a/sysmig_agent/fork.py ++++ b/sysmig_agent/fork.py +@@ -150,3 +150,51 @@ def get_abi_info(): + return msg + # if not q.empty(): + ++ ++def process_time_task_abi(task_id): ++ # 定时任务启动并更新进度 ++ timed_task_abi(task_id) ++ # abi结果接入数据库内 ++ abi_file_sql(abi_file) ++ # p_timed_task = Process(target=timed_task_abi, args=(task_id,)) ++ # p_timed_task.start() ++ # p_timed_task.join() ++ ++ ++def structure_task(): ++ # 先获得mysql的任务 ++ ret_task = get_sql_task() ++ if not ret_task: ++ print('agent_task is None..') ++ pass ++ # 判断任务类型 ++ print(ret_task) ++ if 1 == ret_task: ++ # 调用ABI权重比函数 ++ ret_data = abi_check_priority() ++ # 更新mysql的任务状态 ++ put_sql_task(ret_data) ++ ++ ++ ++# ABI对比结果文件,存放数据库内 ++def abi_file_sql(path): ++ with open(path, 'r') as p: ++ ret = p.readlines() ++ p.close() ++ for i in range(len(ret)): ++ info = ret[i].split(',', 5) ++ info_str = '' ++ for n in range(len(info)): ++ if n < 9: ++ sinfo = '' ++ if info[n].strip().strip('\n'): ++ sinfo = info[n].strip().strip('\n') ++ info_str = info_str+"'{}'".format(sinfo) ++ else: ++ sinfo='NULL' ++ info_str = info_str+"{}".format(sinfo) ++ if n != (len(info)-1): ++ info_str = info_str+',' ++ abi_file_connect(info_str) ++ +-- +2.20.1 + diff --git a/0011-initializate-the-migration-status.patch b/0011-initializate-the-migration-status.patch new file mode 100644 index 0000000000000000000000000000000000000000..a226119e591c38071b00bbc147abd9c6af8527d8 --- /dev/null +++ b/0011-initializate-the-migration-status.patch @@ -0,0 +1,53 @@ +From 127580df37b9b0264af9b54e4618a9b0e1939dda Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 16:11:45 +0800 +Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E8=BF=81=E7=A7=BB?= + =?UTF-8?q?=E7=8A=B6=E6=80=81?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/fork.py | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py +index 3447678..3f81aea 100644 +--- a/sysmig_agent/fork.py ++++ b/sysmig_agent/fork.py +@@ -198,3 +198,31 @@ def abi_file_sql(path): + info_str = info_str+',' + abi_file_connect(info_str) + ++ ++def check_environment(data): ++ task_id = json.loads(data).get('task_id') ++ # 更新SQL任务状态 ++ sql_task_statue('1', task_id) ++ # 发送消息给Server更新任务流状态 ++ post_server('task_start', task_id) ++ process_time_task_abi(task_id) ++ # tar.gz types abi report ++ targz_mig_dir_abi() ++ sql_task_statue('2', task_id) ++ post_server('task_close', task_id) ++ ++ ++# 初始化进度阶段 ++def mig_modify_statue(task_id): ++ if not get_mig_state(task_id): ++ sql_mig_statue('00') ++ ''' ++ else: ++ # Too many migration requests ++ # If you need to continue the migration, please change the task_data of the Mysql ++ return 1 ++ ret = get_mig_state(task_id) ++ ret = re.sub('[0-9]', '0', ret[0]) + ret[1] ++ sql_mig_statue(ret) ++ # loggea ++ ''' +\ No newline at end of file +-- +2.20.1 + diff --git a/0012-get-agent-kernel-version.patch b/0012-get-agent-kernel-version.patch new file mode 100644 index 0000000000000000000000000000000000000000..c943c070b90f47ac3dafd487ded0d7c0d0779809 --- /dev/null +++ b/0012-get-agent-kernel-version.patch @@ -0,0 +1,40 @@ +From 939ef6edc6fb62922acafceb76139a0b0993fc3c Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 16:14:28 +0800 +Subject: [PATCH] =?UTF-8?q?agent=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0?= + =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=86=85=E6=A0=B8=E7=89=88=E6=9C=AC?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/fork.py | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py +index 3f81aea..cbc4165 100644 +--- a/sysmig_agent/fork.py ++++ b/sysmig_agent/fork.py +@@ -225,4 +225,17 @@ def mig_modify_statue(task_id): + ret = re.sub('[0-9]', '0', ret[0]) + ret[1] + sql_mig_statue(ret) + # loggea +- ''' +\ No newline at end of file ++ ''' ++ ++ ++ ++def get_info_version(data): ++ info = json.loads(data).get('info') ++ for i in range(len(info)): ++ agent_info = json.dumps(info[i]) ++ ip = json.loads(agent_info).get('agent_ip') ++ agent_ip = get_local_ip() ++ if ip == agent_ip: ++ version = json.loads(agent_info).get('kernel_version') ++ return version ++ +-- +2.20.1 + diff --git a/0013-set-agent-migration-task.patch b/0013-set-agent-migration-task.patch new file mode 100644 index 0000000000000000000000000000000000000000..5f868675ae9b374b6ca83249bbc9129c5a2f1ff7 --- /dev/null +++ b/0013-set-agent-migration-task.patch @@ -0,0 +1,41 @@ +From d5d7e0bed3bcfa893cf1907f2afbf8a3f05c679f Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 16:16:55 +0800 +Subject: [PATCH] =?UTF-8?q?agent=E7=B3=BB=E7=BB=9F=E8=BF=81=E7=A7=BB?= + =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/fork.py | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py +index cbc4165..23c10e2 100644 +--- a/sysmig_agent/fork.py ++++ b/sysmig_agent/fork.py +@@ -239,3 +239,20 @@ def get_info_version(data): + version = json.loads(agent_info).get('kernel_version') + return version + ++ ++def system_migration(data): ++ kernel_version = get_info_version(data) ++ if not kernel_version: ++ kernel_version = '0' ++ task_id = json.loads(data).get('task_id') ++ # 更新SQL任务状态 ++ sql_task_statue('1', task_id) ++ # 发送消息给Server更新任务流状态 ++ post_server('task_start', task_id) ++ # The migration status is modified, and the breakpoint continues ++ mig_modify_statue(task_id) ++ #sql_mig_statue('00') ++ # MIGRATION MAIN ++ timed_task_migrate(task_id, kernel_version) ++ post_server('task_close', task_id) ++ +-- +2.20.1 + diff --git a/0014-compare-with-request-agent-ip.patch b/0014-compare-with-request-agent-ip.patch new file mode 100644 index 0000000000000000000000000000000000000000..918c4f3a5f70ea06193ebf282d6bd8a18cf5f103 --- /dev/null +++ b/0014-compare-with-request-agent-ip.patch @@ -0,0 +1,34 @@ +From 3b4ff69c1c59e004fe8c8b60220cf98e0461d847 Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 16:24:00 +0800 +Subject: [PATCH] =?UTF-8?q?IP=E6=98=AF=E5=90=A6=E5=92=8C=E8=AF=B7=E6=B1=82?= + =?UTF-8?q?=E7=9A=84agent=E7=9A=84IP=E5=8C=B9=E9=85=8D?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/fork.py | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py +index 23c10e2..8ad6d59 100644 +--- a/sysmig_agent/fork.py ++++ b/sysmig_agent/fork.py +@@ -256,3 +256,13 @@ def system_migration(data): + timed_task_migrate(task_id, kernel_version) + post_server('task_close', task_id) + ++ ++def if_env_check(data): ++ agent_ips = list(json.loads(data).get('agent_ip')) ++ for n in range(len(agent_ips)): ++ ip = str(agent_ips[n]) ++ if ip == get_local_ip(): ++ return True ++ return False ++ ++ +-- +2.20.1 + diff --git a/0015-agent-sends-the-task-after-receving-the-request.patch b/0015-agent-sends-the-task-after-receving-the-request.patch new file mode 100644 index 0000000000000000000000000000000000000000..f6ae871418ecca172b4b5b29f2e90b104b5e6161 --- /dev/null +++ b/0015-agent-sends-the-task-after-receving-the-request.patch @@ -0,0 +1,41 @@ +From f9a676fb7297beb5e40af2fc39e1c872c33ffded Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 16:30:34 +0800 +Subject: [PATCH] =?UTF-8?q?agent=E6=94=B6=E5=88=B0=E8=AF=B7=E6=B1=82?= + =?UTF-8?q?=E5=90=8E=E5=88=86=E5=8F=91=E4=BB=BB=E5=8A=A1?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/fork.py | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py +index 8ad6d59..679fb21 100644 +--- a/sysmig_agent/fork.py ++++ b/sysmig_agent/fork.py +@@ -266,3 +266,20 @@ def if_env_check(data): + return False + + ++def post_task(data): ++ task_mod = json.loads(data).get('mod') ++ if 'check_info' == task_mod: ++ t = threading.Thread(target=check_info, args=[data]) ++ elif 'check_repo' == task_mod: ++ t = threading.Thread(target=check_repo, args=[data]) ++ elif 'check_kernel' == task_mod: ++ t = threading.Thread(target=check_kernel, args=[data]) ++ elif 'check_environment' == task_mod: ++ if if_env_check(data): ++ t = threading.Thread(target=check_environment, args=[data]) ++ elif 'system_migration' == task_mod: ++ t = threading.Thread(target=system_migration, args=[data]) ++ t.start() ++ return 'y' ++ ++ +-- +2.20.1 + diff --git a/0016-export-migration-log.patch b/0016-export-migration-log.patch new file mode 100644 index 0000000000000000000000000000000000000000..14f6a96860bab4e2fb5a229d04cefcf17bbf66aa --- /dev/null +++ b/0016-export-migration-log.patch @@ -0,0 +1,70 @@ +From fa9113d9f5c7ba0d80835d9e5dfb683aca9834a7 Mon Sep 17 00:00:00 2001 +From: lixin +Date: Mon, 13 Nov 2023 16:33:44 +0800 +Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=81=E7=A7=BB=E6=97=A5?= + =?UTF-8?q?=E5=BF=97=E5=AF=BC=E5=87=BA?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + index.py | 1 + + views/reports.py | 18 ++++++++++++++++++ + views/server.py | 1 + + 3 files changed, 20 insertions(+) + +diff --git a/index.py b/index.py +index 505e91f..a392531 100644 +--- a/index.py ++++ b/index.py +@@ -36,6 +36,7 @@ mods = { + 'get_environment_data': server.get_environment_data, + 'get_repo_arch_info': server.get_repo_arch_info, + 'get_storage_num': server.get_storage_num, ++ 'export_reports': server.export_reports, + } + + +diff --git a/views/reports.py b/views/reports.py +index 6295283..c616dfd 100644 +--- a/views/reports.py ++++ b/views/reports.py +@@ -22,4 +22,22 @@ def migration_detection(data): + migration_log.info(scp_log) + except: + migration_log.error('export report scp error:%s' % scp_log) ++ return 'success' ++ ++ ++def migration_logs(data): ++ """ ++ 迁移日志 ++ :return: ++ """ ++ agent_ip = data.get('agent_ip') ++ info_sql = "select AES_DECRYPT(agent_passwd, 'coco'),agent_username from agent_info where agent_ip='%s'" % agent_ip ++ info = DBHelper().execute(info_sql).fetchall() ++ scp_log = "sshpass -p %s scp -r %s@%s:/var/tmp/uos-migration/UOS_migration_log*.tar.gz /var/uos-migration/" % \ ++ (str(info[0][0], encoding="utf-8"), info[0][1], agent_ip) ++ try: ++ os.system(scp_log) ++ migration_log.info(scp_log) ++ except: ++ migration_log.error('export report scp error:%s' % scp_log) + return 'success' +\ No newline at end of file +diff --git a/views/server.py b/views/server.py +index 4cfab8f..7c17a2f 100644 +--- a/views/server.py ++++ b/views/server.py +@@ -353,6 +353,7 @@ def get_storage_num(data): + + reports_type = { + "migration_detection": reports.migration_detection, ++ "migration_logs": reports.migration_logs, + } + + def export_reports(data): +-- +2.20.1 + diff --git a/0017-add-task-to-check-repo.patch b/0017-add-task-to-check-repo.patch new file mode 100644 index 0000000000000000000000000000000000000000..5b9a27cad88000fcc62aee63982850841435db27 --- /dev/null +++ b/0017-add-task-to-check-repo.patch @@ -0,0 +1,272 @@ +From 0e6f8d8f1bb7dba15a206b7a02c9dc70ad9b1aba Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Mon, 13 Nov 2023 16:39:51 +0800 +Subject: [PATCH] =?UTF-8?q?agent=E6=A3=80=E6=B5=8Brepo=E4=BB=BB=E5=8A=A1?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/check.py | 93 ------------------------ + sysmig_agent/short_task.py | 144 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 144 insertions(+), 93 deletions(-) + +diff --git a/sysmig_agent/check.py b/sysmig_agent/check.py +index 141a734..1a21c52 100644 +--- a/sysmig_agent/check.py ++++ b/sysmig_agent/check.py +@@ -178,99 +178,6 @@ def check_user(data): + return re_data + + +-def init_remove_oldrepo(): +- backup_comment = '#This is a yum repository file that was disabled . \ +- \n' +- path = '/etc/yum.repos.d/' +- repos = os.listdir(path) +- for repo in repos: +- path_file = path+'/'+repo +- if not os.path.isfile(path_file): +- continue +- if not re.search('repo$',repo): +- continue +- with open(path_file, 'r') as fsrc: +- content = fsrc.read() +- with open(path_file+'.disabled','w') as fdst: +- fdst.write(repo+'\n'+backup_comment+content) +- fdst.close() +- fsrc.close() +- os.remove(path_file) +- +- +-#初始化repo文件 +-def initRepoFile(baseurl): +- os_version_ret = platform.dist() +- version = os_version_ret[1].split('.',-1) +- reposdir = '/etc/yum.repos.d/' +- h = 0 +- if re.match('file:',baseurl): +- str0, path = baseurl.split('://',1) +- path = '/' + path.strip('/') + '/' +- else: +- h = 1 +- if re.fullmatch('8',version[0]): +- path_appstream = baseurl+'/AppStream' +- path_baseos = baseurl+'/BaseOS' +- path_310 = baseurl+'/kernel-3.10' +- path_419 = baseurl+'/kernel419' +- path_510 = baseurl+'/kernel510' +- +- repostr_uos = '''[UniontechOS-AppStream]\nname = UniontechOS AppStream\nbaseurl = '''+path_appstream.strip('\n')+'''\nenabled = 1\ngpgcheck = 0\n\n[UniontechOS-BaseOS]\nname = UniontechOS BaseOS\nbaseurl = '''+path_baseos.strip('\n')+'''\nenabled = 1\ngpgcheck = 0\n\n[UniontechOS-kernel-4.19.0]\nname = UniontechOS Kernel-4.19.0\nbaseurl = '''+path_419.strip('\n')+'''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n\n[UniontechOS-kernel-5.10.0]\nname = UniontechOS Kernel-5.10.0\nbaseurl = '''+path_510.strip('\n')+'''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n\n +-''' +- else: +- path_310 = baseurl+'/kernel-3.10' +- repostr_uos = '''[UniontechOS-AppStream]\nname = UniontechOS AppStream\nbaseurl = '''+baseurl.strip('\n')+'''\nenabled = 1\ngpgcheck = 0\n\n[UniontechOS-kernel-3.10.0]\nname = UniontechOS Kernel-3.10.0\nbaseurl = '''+path_310.strip('\n')+'''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n +- ''' +- repofile = os.path.join(reposdir, 'switch-to-uos.repo') +- with open(repofile,'w') as f_repo: +- f_repo.write(repostr_uos) +- f_repo.close() +- +- +-#检测repo文件创建缓存 +-def checkRepoMakeCache(): +- os.system('yum clean all') +- os.system('yum makecache') +- os_version_ret = platform.dist() +- os_arch = platform.machine() +- version = os_version_ret[1].split('.',-1) +- ret = os.path.exists('/var/cache/dnf/UniontechOS-AppStream.solv') +- if ret: +- ret = os.path.exists('/var/cache/dnf/UniontechOS-BaseOS.solv') +- if ret or re.fullmatch('7',version[0]): +- return 0 +- else: +- return 1 +- else: +- if re.fullmatch('7',version[0]): +- ret = os.path.exists('/var/cache/yum/%s/7/UniontechOS-AppStream/repomd.xml' % os_arch) +- if ret: +- return 0 +- return 1 +- +- +-#检测repo +-def check_repo(data_j): +- uos_sysmig_conf = json.loads(getSysMigConf()) +- AGENT_IP = json.loads(uos_sysmig_conf).get('agentip').strip()[1:-1] +- baseurl = json.loads(data_j).get('repo_pwd') +- keylist = None +- valuelist = None +- data = None +- init_remove_oldrepo() +- initRepoFile(baseurl) +- state = checkRepoMakeCache() +- +- if state == 0: +- keylist = ['ip','res','data'] +- valuelist = [AGENT_IP,state,'连接成功'] +- else: +- data = '下载失败,请检查您的软件源' +- keylist = ['ip','res','error'] +- valuelist = [AGENT_IP,state,data] +- return list_to_json(keylist,valuelist) +- + + def check_os_kernel(data): + uos_sysmig_conf = json.loads(getSysMigConf()) +diff --git a/sysmig_agent/short_task.py b/sysmig_agent/short_task.py +index 11dd9ef..4e4dae3 100644 +--- a/sysmig_agent/short_task.py ++++ b/sysmig_agent/short_task.py +@@ -138,3 +138,147 @@ def get_agent_os(): + AGENT_OS = os_version_ret[0] + version[0] + return AGENT_OS + ++ ++ ++def init_remove_oldrepo(): ++ backup_comment = '#This is a yum repository file that was disabled . \ ++ \n' ++ path = '/etc/yum.repos.d/' ++ repos = os.listdir(path) ++ for repo in repos: ++ path_file = path+'/'+repo ++ if not os.path.isfile(path_file): ++ continue ++ if not re.search('repo$',repo): ++ continue ++ with open(path_file, 'r') as fsrc: ++ content = fsrc.read() ++ with open(path_file+'.disabled','w') as fdst: ++ fdst.write(repo+'\n'+backup_comment+content) ++ fdst.close() ++ fsrc.close() ++ os.remove(path_file) ++ ++ ++#初始化repo文件 ++def initRepoFile(baseurl): ++ os_version_ret = platform.dist() ++ version = os_version_ret[1].split('.',-1) ++ reposdir = '/etc/yum.repos.d/' ++ h = 0 ++ if re.match('file:',baseurl): ++ str0, path = baseurl.split('://',1) ++ path = '/' + path.strip('/') + '/' ++ else: ++ h = 1 ++ if re.fullmatch('8',version[0]): ++ path_appstream = baseurl+'/AppStream' ++ path_baseos = baseurl+'/BaseOS' ++ path_310 = baseurl+'/kernel-3.10' ++ path_419 = baseurl+'/kernel419' ++ path_510 = baseurl+'/kernel510' ++ ++ repostr_uos = '''[UniontechOS-AppStream]\nname = UniontechOS AppStream\nbaseurl = '''+path_appstream.strip('\n')+'''\nenabled = 1\ngpgcheck = 0\n\n[UniontechOS-BaseOS]\nname = UniontechOS BaseOS\nbaseurl = '''+path_baseos.strip('\n')+'''\nenabled = 1\ngpgcheck = 0\n\n[UniontechOS-kernel-4.19.0]\nname = UniontechOS Kernel-4.19.0\nbaseurl = '''+path_419.strip('\n')+'''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n\n[UniontechOS-kernel-5.10.0]\nname = UniontechOS Kernel-5.10.0\nbaseurl = '''+path_510.strip('\n')+'''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n\n ++''' ++ else: ++ path_310 = baseurl+'/kernel-3.10' ++ repostr_uos = '''[UniontechOS-AppStream]\nname = UniontechOS AppStream\nbaseurl = '''+baseurl.strip('\n')+'''\nenabled = 1\ngpgcheck = 0\n\n[UniontechOS-kernel-3.10.0]\nname = UniontechOS Kernel-3.10.0\nbaseurl = '''+path_310.strip('\n')+'''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n ++ ''' ++ repofile = os.path.join(reposdir, 'switch-to-uos.repo') ++ with open(repofile,'w') as f_repo: ++ f_repo.write(repostr_uos) ++ f_repo.close() ++ ++ ++#检测repo文件创建缓存 ++def checkRepoMakeCache(): ++ os.system('yum clean all') ++ os.system('yum makecache') ++ os_version_ret = platform.dist() ++ os_arch = platform.machine() ++ version = os_version_ret[1].split('.',-1) ++ ret = os.path.exists('/var/cache/dnf/UniontechOS-AppStream.solv') ++ if ret: ++ ret = os.path.exists('/var/cache/dnf/UniontechOS-BaseOS.solv') ++ if ret or re.fullmatch('7',version[0]): ++ return 0 ++ else: ++ return 1 ++ else: ++ if re.fullmatch('7',version[0]): ++ ret = os.path.exists('/var/cache/yum/%s/7/UniontechOS-AppStream/repomd.xml' % os_arch) ++ if ret: ++ return 0 ++ return 1 ++ ++ ++# 检测centos 8 系统上的 repo文件联通 ++def checkRepoFileHttp(baseurl): ++ try: ++ with request.urlopen(baseurl) as file: ++ # print(file.status) ++ # print(file.reason) ++ if re.match('OK', file.reason): ++ return 0 ++ except Exception as e: ++ if re.match('HTTP Error 404|[Errno 2]', str(e)): ++ return 1 ++ elif re.match('[Errno 21]', str(e)): ++ return 0 ++ else: ++ return 1 ++ ++ ++def repoFileCheck(baseurl): ++ if re.match('file\:\/\/', baseurl): ++ path = re.sub('file://', '', baseurl) ++ if os.path.exists(path): ++ return 0 ++ else: ++ return 1 ++ try: ++ dst_status = urllib.request.urlopen(baseurl, timeout=5).code ++ return 0 ++ except Exception as err: ++ return 1 ++ pass ++ ++def check_repo(data): ++ agent_os = get_agent_os() ++ if '7' in agent_os: ++ agent_os = 'centos7' ++ elif '8' in agent_os: ++ agent_os = 'centos8' ++ os_type = agent_os + '_' + platform.machine().strip('') ++ baseurl = json.loads(data).get(os_type) ++ if not baseurl: ++ baseurl = '1' ++ task_id = json.loads(data).get('task_id') ++ # 更新SQL任务状态 ++ statue = 1 ++ sql_task_statue(statue, task_id) ++ # 发送消息给Server更新任务流状态 ++ post_server('task_start', task_id) ++ # 初始化去除旧的repo文件 ++ init_remove_oldrepo() ++ # 传递baseurl,配置repo文件 ++ initRepoFile(baseurl) ++ # 建立软件源缓存,判断软件源是否可用 ++ state = checkRepoMakeCache() ++ sql = '' ++ repo_state = -1 ++ if state == 0: ++ repo_state = repoFileCheck(baseurl) ++ else: ++ repo_state = 1 ++ ++ sql = "UPDATE agent_info SET repo_status = {} WHERE agent_ip = '{}';".format(repo_state, get_local_ip()) ++ try: ++ ret = DBHelper().execute(sql) ++ statue = 2 ++ except: ++ statue = 2 ++ sql_task_statue(statue, task_id) ++ sql_task_statue(statue, task_id) ++ post_server('task_close', task_id) ++ return 'success' +-- +2.20.1 + diff --git a/0018-add-interface-in-agent.patch b/0018-add-interface-in-agent.patch new file mode 100644 index 0000000000000000000000000000000000000000..db6f0c093d6f71b81c76e7749ad50c6832b81c91 --- /dev/null +++ b/0018-add-interface-in-agent.patch @@ -0,0 +1,37 @@ +From 26c0cd76dff728aee9bb24aa23a62258eb76a1d8 Mon Sep 17 00:00:00 2001 +From: lixin +Date: Mon, 13 Nov 2023 17:15:51 +0800 +Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + index.py | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/index.py b/index.py +index a392531..06a44c3 100644 +--- a/index.py ++++ b/index.py +@@ -204,6 +204,17 @@ def export_reports(): + return Response(mod, content_type='application/json') + + ++@app.route('/get_page_data', methods=['GET', 'POST']) ++def get_page_data(): ++ """ ++ 定时获取可用空间页面数据 ++ :return: ++ """ ++ mod = check_methods() ++ if mod: ++ return Response(mod, content_type='application/json') ++ ++ + @app.route('/', methods=['GET', 'POST']) + def MT_index(): + """ +-- +2.20.1 + diff --git a/0019-update-the-initilization-repo-file.patch b/0019-update-the-initilization-repo-file.patch new file mode 100644 index 0000000000000000000000000000000000000000..c814fa7ecdee0389cce75d19b3657b2f7b714962 --- /dev/null +++ b/0019-update-the-initilization-repo-file.patch @@ -0,0 +1,86 @@ +From 0e49cc38358147a06f2ddcb0888553eb57e47274 Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Tue, 14 Nov 2023 09:37:02 +0800 +Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=9D=E5=A7=8B=E5=8C=96re?= + =?UTF-8?q?pos=E6=96=87=E4=BB=B6?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/short_task.py | 46 ++++++++++++++++++++++++-------------- + 1 file changed, 29 insertions(+), 17 deletions(-) + +diff --git a/sysmig_agent/short_task.py b/sysmig_agent/short_task.py +index 4e4dae3..2ef4ac6 100644 +--- a/sysmig_agent/short_task.py ++++ b/sysmig_agent/short_task.py +@@ -160,36 +160,48 @@ def init_remove_oldrepo(): + os.remove(path_file) + + +-#初始化repo文件 ++# 初始化repo文件 + def initRepoFile(baseurl): + os_version_ret = platform.dist() +- version = os_version_ret[1].split('.',-1) +- reposdir = '/etc/yum.repos.d/' ++ version = os_version_ret[1].split('.', -1) ++ AGENT_OS = os_version_ret[0] + version[0] ++ if re.search('7', AGENT_OS): ++ reposdir = '/etc/yum.repos.d/' ++ else: ++ reposdir = '/etc/yum.repos.d/' ++ # reposdir = dnf.Base().conf.get_reposdir + h = 0 +- if re.match('file:',baseurl): +- str0, path = baseurl.split('://',1) ++ if re.search('file', baseurl): ++ str0, path = baseurl.split('://', 1) + path = '/' + path.strip('/') + '/' + else: +- h = 1 +- if re.fullmatch('8',version[0]): +- path_appstream = baseurl+'/AppStream' +- path_baseos = baseurl+'/BaseOS' +- path_310 = baseurl+'/kernel-3.10' +- path_419 = baseurl+'/kernel419' +- path_510 = baseurl+'/kernel510' ++ h = 1 ++ if re.fullmatch('8', version[0]): ++ path_appstream = baseurl + '/AppStream' ++ path_baseos = baseurl + '/BaseOS' ++ path_310 = baseurl + '/kernel-3.10' ++ path_418 = baseurl + '/kernel-4.18' ++ path_419 = baseurl + '/kernel419' ++ path_510 = baseurl + '/kernel510' + +- repostr_uos = '''[UniontechOS-AppStream]\nname = UniontechOS AppStream\nbaseurl = '''+path_appstream.strip('\n')+'''\nenabled = 1\ngpgcheck = 0\n\n[UniontechOS-BaseOS]\nname = UniontechOS BaseOS\nbaseurl = '''+path_baseos.strip('\n')+'''\nenabled = 1\ngpgcheck = 0\n\n[UniontechOS-kernel-4.19.0]\nname = UniontechOS Kernel-4.19.0\nbaseurl = '''+path_419.strip('\n')+'''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n\n[UniontechOS-kernel-5.10.0]\nname = UniontechOS Kernel-5.10.0\nbaseurl = '''+path_510.strip('\n')+'''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n\n ++ repostr_uos = '''[UniontechOS-AppStream]\nname = UniontechOS AppStream\nbaseurl = ''' + path_appstream.strip( ++ '\n') + '''\nenabled = 1\ngpgcheck = 0\n\n[UniontechOS-BaseOS]\nname = UniontechOS BaseOS\nbaseurl = ''' + path_baseos.strip( ++ '\n') + '''\nenabled = 1\ngpgcheck = 0\n\n[UniontechOS-kernel-4.18.0]\nname = UniontechOS Kernel-4.18.0\nbaseurl = ''' + path_418.strip( ++ '\n') + '''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n\n[UniontechOS-kernel-4.19.0]\nname = UniontechOS Kernel-4.19.0\nbaseurl = ''' + path_419.strip( ++ '\n') + '''\nenabled = 1\ngpgcheck = 0\nskip_if_unavailable = 1\n\n[UniontechOS-kernel-5.10.0]\nname = UniontechOS Kernel-5.10.0\nbaseurl = ''' + path_510.strip( ++ '\n') + '''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n\n + ''' + else: +- path_310 = baseurl+'/kernel-3.10' +- repostr_uos = '''[UniontechOS-AppStream]\nname = UniontechOS AppStream\nbaseurl = '''+baseurl.strip('\n')+'''\nenabled = 1\ngpgcheck = 0\n\n[UniontechOS-kernel-3.10.0]\nname = UniontechOS Kernel-3.10.0\nbaseurl = '''+path_310.strip('\n')+'''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n ++ path_310 = baseurl + '/kernel-3.10' ++ repostr_uos = '''[UniontechOS-AppStream]\nname = UniontechOS AppStream\nbaseurl = ''' + baseurl.strip( ++ '\n') + '''\nenabled = 1\ngpgcheck = 0\n\n[UniontechOS-kernel-3.10.0]\nname = UniontechOS Kernel-3.10.0\nbaseurl = ''' + path_310.strip( ++ '\n') + '''\nenabled = 0\ngpgcheck = 0\nskip_if_unavailable = 1\n + ''' + repofile = os.path.join(reposdir, 'switch-to-uos.repo') +- with open(repofile,'w') as f_repo: ++ with open(repofile, 'w') as f_repo: + f_repo.write(repostr_uos) + f_repo.close() + +- + #检测repo文件创建缓存 + def checkRepoMakeCache(): + os.system('yum clean all') +-- +2.20.1 + diff --git a/100-CVE-2024-24892.patch b/100-CVE-2024-24892.patch deleted file mode 100644 index 25ac45aff0ff5d3adc5f0bb9f076706ef0a28d51..0000000000000000000000000000000000000000 --- a/100-CVE-2024-24892.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 27f65f5c5e38b6d0cee28db3591784266a47de9e Mon Sep 17 00:00:00 2001 -From: lixin -Date: Tue, 12 Mar 2024 10:42:07 +0800 -Subject: [PATCH] CVE-2024-24892 - ---- - index.py | 50 ++++++++++++++++++++++++++++++++------------------ - 1 file changed, 32 insertions(+), 18 deletions(-) - -diff --git a/index.py b/index.py -index 239148e..f604fc2 100644 ---- a/index.py -+++ b/index.py -@@ -4,6 +4,7 @@ - # SPDX-License-Identifier: MulanPubL-2.0-or-later - import os - import json -+import paramiko - from func import share - from urls import server_mods - from flask import Flask, render_template, request, Response -@@ -202,29 +203,42 @@ def export_migration_reports(): - :return: - """ - mod = check_methods() -- f = open("/usr/lib/migration-tools-server/.passwd.txt", "r") -- password = f.read() -- f.close() - if mod: - data = request.get_data() - json_data = json.loads(data) -- mkdir_log_pwd = "/var/uos-migration/" -- isExists=os.path.exists(mkdir_log_pwd) -- if not isExists: -- try: -- os.makedirs(mkdir_log_pwd) -- print(mkdir_log_pwd) -- except: -- print("export report mkdir error:%s" % mkdir_log_pwd) -- -+ user = json_data.get('info').split("|")[0] - info = mod.split(',') -- scp_log = "sshpass -p '%s'" % password + " scp -r %s" % json_data.get('info').split("|")[0] + "@%s" % info[1] \ -- + ":/var/tmp/uos-migration/UOS*.tar.gz /var/uos-migration/" -+ ip = info[1].strip('"') -+ port = 22 -+ -+ with open("/usr/lib/migration-tools-server/.passwd.txt", "r") as f: -+ password = f.read() -+ -+ remote_dir = local_dir = "/var/tmp/uos-migration" -+ if not os.path.exists(local_dir): -+ os.makedirs(local_dir) -+ -+ client = paramiko.SSHClient() -+ client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - try: -- os.system(scp_log) -- print(scp_log) -- except: -- print('export report scp error:%s' % scp_log) -+ client.connect(ip, port, user, password) -+ sftp = client.open_sftp() -+ -+ remote_files = sftp.listdir(remote_dir) -+ # 遍历远程文件列表 -+ for filename in remote_files: -+ if filename.endswith('.tar.gz'): -+ remote_file_path = os.path.join(remote_dir, filename) -+ local_file_path = os.path.join(local_dir, filename) -+ sftp.get(remote_file_path, local_file_path) -+ -+ except Exception as e: -+ print(f"Error: {e}") -+ -+ finally: -+ # 关闭连接 -+ if client: -+ client.close() - return Response(mod, content_type='application/json') - - --- -2.41.0 - diff --git a/migration-tools-1.0.2.tar.gz b/migration-tools-1.0.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4528a2527c52fc0413133c134c409b89ff3ce1bb Binary files /dev/null and b/migration-tools-1.0.2.tar.gz differ diff --git a/migration-tools-1.0.3.tar.gz b/migration-tools-1.0.3.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0329ae881b0edd4e89c5064a0a554ab2ce1d343e Binary files /dev/null and b/migration-tools-1.0.3.tar.gz differ diff --git a/migration-tools.spec b/migration-tools.spec index 7130ec7f2d02d3e053d47ed347ea5b95cae8bdf9..4366f10a44f1e8fd5f1a4671455169abb969d577 100644 --- a/migration-tools.spec +++ b/migration-tools.spec @@ -1,25 +1,32 @@ Name: migration-tools -Version: 1.0.1 -Release: 14 +Version: 1.0.3 +Release: 19 License: MulanPSL-2.0 Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system Source0: %{name}-%{version}.tar.gz Source1: requires.tar.gz Source2: xlwt-1.3.0-py2.py3-none-any.whl # patches -Patch0: 0001-use-kill-not-kill-INT-when-stop-service.patch -Patch1: 0002-modify-description.patch -Patch2: 0003-adjust-the-display-sequence.patch -Patch3: 0004-fix-cancel-button-function-in-tool.patch -Patch4: 0005-system-check-page-before-migration-displayed.patch -Patch5: 0006-return-button-after-successful-migration.patch -Patch6: 0007-user-name-input-diversity.patch -Patch7: 0008-software-source-input-box-diversity.patch -Patch8: 0009-disable-button-for-system-type-and-space.patch -Patch9: 0010-verify-user-password-disabled-by-button.patch - -# CVE patches: >= 100 -Patch100: 100-CVE-2024-24892.patch +Patch001: 0001-download-the-rpm-package-in-the-system.patch +Patch002: 0002-get-information-before-migration.patch +Patch003: 0003-export-migration-check-report.patch +Patch004: 0004-complete-information-report-after-abi-detection.patch +Patch005: 0005-abi-detection-through-multi-threads.patch +Patch006: 0006-add-message-query-to-update-abi-process.patch +Patch007: 0007-start-task-to-check-migration.patch +Patch008: 0008-add-system-migration-task.patch +Patch009: 0009-get-abi-detection-process.patch +Patch010: 0010-update-abi-result-to-database.patch +Patch011: 0011-initializate-the-migration-status.patch +Patch012: 0012-get-agent-kernel-version.patch +Patch013: 0013-set-agent-migration-task.patch +Patch014: 0014-compare-with-request-agent-ip.patch +Patch015: 0015-agent-sends-the-task-after-receving-the-request.patch +Patch016: 0016-export-migration-log.patch +Patch017: 0017-add-task-to-check-repo.patch +Patch018: 0018-add-interface-in-agent.patch +Patch019: 0019-update-the-initilization-repo-file.patch + BuildArch: noarch BuildRequires: systemd @@ -61,11 +68,11 @@ Migration software server side %prep %autosetup -p1 -%setup -c %if 0%{?openEuler} -cp -f %SOURCE1 %{name}-%{version}/agent-requires/ -cp -f %SOURCE2 %{name}-%{version}/agent-requires/ +mkdir -p agent-requires/ +cp -f %SOURCE1 agent-requires/ +cp -f %SOURCE2 agent-requires/ %endif %install @@ -74,17 +81,17 @@ mkdir -p $RPM_BUILD_ROOT/usr/lib/migration-tools-server mkdir -p $RPM_BUILD_ROOT/var/tmp/uos-migration mkdir -p $RPM_BUILD_ROOT/etc/migration-tools mkdir -p $RPM_BUILD_ROOT%{_unitdir} - -cp -r %{name}-%{version}/* $RPM_BUILD_ROOT/usr/lib/migration-tools-server/ +%{__cp} -r * $RPM_BUILD_ROOT/usr/lib/migration-tools-server/ %if 0%{?rhel} >= 7 mkdir -p $RPM_BUILD_ROOT/usr/lib/migration-tools-agent -cp -r %{name}-%{version}/* $RPM_BUILD_ROOT/usr/lib/migration-tools-agent/ +%{__cp} -r * $RPM_BUILD_ROOT/usr/lib/migration-tools-agent/ + %{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools-agent.service $RPM_BUILD_ROOT%{_unitdir} %endif # Install server config -%{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools.conf $RPM_BUILD_ROOT/etc/migration-tools +%{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/uos-sysmig.conf $RPM_BUILD_ROOT/etc/migration-tools %{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools-server.service $RPM_BUILD_ROOT%{_unitdir} %posttrans @@ -116,26 +123,317 @@ rm -rf /usr/bin/migration-tools %endif %changelog -* Wed Sep 11 2024 Xuezhixin - 1.0.1-14 -- Fix the problem of error when compiling rpm patch +* Mon Nov 11 2024 xuezhixin - 1.0.3-19 +- 0019-update-the-initilization-repo-file.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-18 +- 0018-add-interface-in-agent.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-17 +- 0017-add-task-to-check-repo.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-16 +- 0016-export-migration-log.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-15 +- 0015-agent-sends-the-task-after-receving-the-request.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-14 +- 0014-compare-with-request-agent-ip.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-13 +- 0013-set-agent-migration-task.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-12 +- 0012-get-agent-kernel-version.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-11 +- 0011-initializate-the-migration-status.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-10 +- 0010-update-abi-result-to-database.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-9 +- 0009-get-abi-detection-process.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-8 +- 0008-add-system-migration-task.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-7 +- 0007-start-task-to-check-migration.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-6 +- 0006-add-message-query-to-update-abi-process.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-5 +- 0005-abi-detection-through-multi-threads.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-4 +- 0004-complete-information-report-after-abi-detection.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-3 +- 0003-export-migration-check-report.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-2 +- 0002-get-information-before-migration.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-1 +- 0001-download-the-rpm-package-in-the-system.patch + +* Mon Nov 11 2024 xuezhixin - 1.0.3-0 +- update to 1.0.3 + +* Tue Nov 5 2024 xuezhixin - 1.0.2-84 +- 0084-divide-detection-report-into-mutiple-sheet-pages.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-83 +- 0083-add-basic-summary-information-to-the-report.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-82 +- 0082-write-the-data-of-each-row-and-column-into-report.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-81 +- 0081-add-interface-to-export-migration-check-report.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-80 +- 0080-write-the-data-of-each-row-into-report.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-79 +- 0079-get-agent-storage-information.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-78 +- 0078-fill-in-the-data-in-the-checked-templace.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-77 +- 0077-copy-from-unzip-rpm-diractory-and-system-file-to-compatility-diractory.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-76 +- 0076-detection-storage-interface.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-75 +- 0075-detection-basic-information-and-format-abi-compatibility-information-to-report.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-74 +- 0074-detection-basic-system-information.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-73 +- 0073-get-os-version-and-os-id.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-72 +- 0072-count-the-total-number-of-abi-compatible-lists.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-71 +- 0071-get-package-list-from-repository.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-70 +- 0070-interface-for-obtaining-repo-interface.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-69 +- 0069-get-package-list-downloaded-locally-from-the-software-repository.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-68 +- 0068-get-file-list-and-provide-file-path-to-compare.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-67 +- 0067-add-an-abi-comparation-function.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-66 +- 0066-check-if-file-is-binary.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-65 +- 0065-get-checking-envirnmnet-process.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-64 +- 0064-get-system-package-information-in-rpm-database.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-63 +- 0063-add-compare-with-package-result-in-abi-report.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-62 +- 0062-add-detection-ELF-content-in-abi-file.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-61 +- 0061-detection-abi-log.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-60 +- 0060-add-four-detection-item-to-abi-report.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-59 +- 0059-add-kernel-detection-result-to-abi-report.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-58 +- 0058-get-detection-envirnment-process-interface.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-57 +- 0057-abi-basic-data-for-report.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-56 +- 0056-modify-detection-envirnment-interface.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-55 +- 0055-add-envirnment-detection-interface-before-migration.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-54 +- 0054-removed-detection-abi-script.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-53 +- 0053-get-repository-detection-result.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-52 +- 0052-increase-the-weight-of-abi-detection-result.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-51 +- 0051-add-basic-system-detection-information-and-upload-the-database.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-50 +- 0050-check-free-space-in-system-disk.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-49 +- 0049-add-interface-to-check-repository-result.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-48 +- 0048-server-send-kernel-detection-task.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-47 +- 0047-check-kernel-version-in-repository.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-46 +- 0046-agent-sends-task-update-requrst-to-the-server.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-45 +- 0045-modify-repository-file.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-44 +- 0044-migrate-in-myutiple-steps.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-43 +- 0043-process-os-version-and-os-name.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-42 +- 0042-get-initial-os-version-from-agent_info-interface.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-41 +- 0041-get-migration-status-from-database.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-40 +- 0040-intial-logfile-and-tmpfile.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-39 +- 0039-repository-file-choose-kernel-version-to-migration.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-38 +- 0038-obtain-kernel-data.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-37 +- 0037-add-subprocess-function-and-loggin.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-36 +- 0036-add-an-interface-to-obtain-kernel-information.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-35 +- 0035-the-migration-process-can-choose-not-to-migrate-the-kernel.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-34 +- 0034-add-centos7-and-centos8-migration-interface.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-33 +- 0033-check-system-kernrel.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-32 +- 0032-add-migration.py-to-migration-function.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-31 +- 0031-migration-check-and-extract-macros.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-30 +- 0030-system-information-import-info-the-database-after-migration.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-29 +- 0029-json-and-list-format-interchange.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-28 +- 0028-send-agent-task.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-27 +- 0027-fix-grub-file-for-system-option.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-26 +- 0026-create-repository-and-disable-local-repofile.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-25 +- 0025-update-migration-status-to-database.patch + +* Tue Nov 5 2024 xuezhixin - 1.0.2-24 +- 0024-add-url-processing-function.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-23 +- 0023-update-the-status-of-the-migration-phase.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-22 +- 0022-udpate-agent-host-status-online.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-21 +- 0021-get-agent-ip-interface.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-20 +- 0020-get-task-process-and-migration-stage-information.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-19 +- 0019-update-abi-result-to-database.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-18 +- 0018-detection-of-imported-host-information-interface.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-17 +- 0017-add-process-data-in-database.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-16 +- 0016-get-local-ip-on-the-agent.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-15 +- 0015-delete-host-information-interface.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-14 +- 0014-modify-task-stream-interface.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-13 +- 0013-display-agent-host-information.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-12 +- 0012-add-agent_task-in-database.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-11 +- 0011-replace-agent-with-func-diractory.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-10 +- 0010-create-task-stream-interface.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-9 +- 0009-add-task_stream-table-in-database.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-8 +- 0008-add-agent_info-table-in-database.patch + +* Mon Nov 4 2024 xuezhixin - 1.0.2-7 +- 0007-add-function-to-import-machine.patch -* Wed Sep 04 2024 lihaipeng - 1.0.1-13 -- verify user password is disabled by button +* Mon Nov 4 2024 xuezhixin - 1.0.2-6 +- 0006-add-loger-interface-function.patch -* Wed Sep 04 2024 lihaipeng - 1.0.1-12 -- disable button for system type and space verification +* Fri Nov 1 2024 xuezhixin - 1.0.2-5 +- add 0005-execution-sql-function.patch -* Wed Sep 04 2024 lihaipeng - 1.0.1-11 -- software source repository input field diversity +* Fri Nov 1 2024 xuezhixin - 1.0.2-4 +- add 0004-connect-sql-function.patch -* Wed Sep 04 2024 lihaipeng - 1.0.1-10 -- user name input diversity +* Fri Nov 1 2024 xuezhixin - 1.0.2-3 +- add 0003-delete-redundant-code.patch -* Wed Sep 04 2024 lihaipeng - 1.0.1-9 -- return button after successful migration +* Fri Nov 1 2024 xuezhixin - 1.0.2-2 +- add 0002-modify-excel-report-content.patch -* Fri Aug 30 2024 lihaipeng - 1.0.1-8 -- the system check page before migration is displayed +* Thu Oct 31 2024 xuezhixin - 1.0.2-1 +- add 0001-stander-code.patch * Tue Aug 27 2024 lihaipeng - 1.0.1-7 - fix cancel button function in tool @@ -173,4 +471,4 @@ rm -rf /usr/bin/migration-tools - fix no migration detail error * Wed Aug 16 2023 lixin - 1.0.0-1 -- init + init