From 23466ddc09f3aa32f91ffb119cc6fa1f7d8af08b Mon Sep 17 00:00:00 2001 From: xueZhixin Date: Thu, 28 Aug 2025 16:43:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A00024-support-migration-to-250?= =?UTF-8?q?3.patch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 0024-support-migration-to-2503.patch | 81 ++++++++++++++++++++++++++++ migration-tools.spec | 7 ++- 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 0024-support-migration-to-2503.patch diff --git a/0024-support-migration-to-2503.patch b/0024-support-migration-to-2503.patch new file mode 100644 index 0000000..bc68a63 --- /dev/null +++ b/0024-support-migration-to-2503.patch @@ -0,0 +1,81 @@ +From 70139ab91a148090c1124595ec3a60d8118ab69f Mon Sep 17 00:00:00 2001 +From: yahaha +Date: Thu, 28 Aug 2025 02:37:37 -0400 +Subject: [PATCH] support migration to 2503 + +--- + .../centos7/openeuler/centos72openeuler.py | 40 +++++++++++++++++++++- + 1 file changed, 39 insertions(+), 1 deletion(-) + +diff --git a/ut-Migration-tools-0.1/centos7/openeuler/centos72openeuler.py b/ut-Migration-tools-0.1/centos7/openeuler/centos72openeuler.py +index e114d32..dd47376 100644 +--- a/ut-Migration-tools-0.1/centos7/openeuler/centos72openeuler.py ++++ b/ut-Migration-tools-0.1/centos7/openeuler/centos72openeuler.py +@@ -8,11 +8,21 @@ import sys, re + + openeuler_repo = '''[openeuler] + name = openeuler +-baseurl = https://mirrors.tuna.tsinghua.edu.cn/openeuler/openEuler-20.03-LTS-SP4/OS/$basearch ++baseurl = https://mirrors.tuna.tsinghua.edu.cn/openeuler/openEuler-25.03/everything/$basearch + enabled = 1 + gpgcheck = 0 + ''' + ++openeuler_2403_repo = """ ++[openEuler-2403] ++name=openEuler-2403 ++baseurl=https://mirrors.tuna.tsinghua.edu.cn/openeuler/openEuler-24.03-LTS-SP2/everything/$basearch ++enabled=1 ++gpgcheck=0 ++""" ++ ++high_version_list = ["25.03", "25.09"] ++ + + def local_disabled_release_repo(): + path = '/etc/yum.repos.d' +@@ -284,6 +294,27 @@ def main(): + + dnf_path = '/usr/bin/dnf' + install_dir = os.path.join(os.path.dirname('/var/tmp'), 'DNF') ++ ++ ++ # 检查 /etc/os-release 的 VERSION_ID 是否为 "25.03" ++ version_id = None ++ os_release_file = '/etc/os-release' ++ if os.path.exists(os_release_file): ++ with open(os_release_file, 'r') as f: ++ for line in f: ++ if line.startswith('VERSION_ID'): ++ version_id = line.strip().split('=')[1].strip('"') ++ break ++ ++ # 如果是 25.03 系统,重新配置 2403 的软件源 ++ if version_id in high_version_list: ++ # 写入 2403 的 repo 文件 ++ if os.path.exists(repofile): ++ os.remove(repofile) ++ with open(repofile, 'w') as f: ++ f.write(openeuler_2403_repo) ++ ++ + if not os.path.exists(install_dir): + os.makedirs(install_dir) + else: +@@ -293,6 +324,13 @@ def main(): + install_dir) + os.system(install_cmd) + ++ if version_id in high_version_list: ++ # 写入 25.03 的 repo 文件 ++ if os.path.exists(repofile): ++ os.remove(repofile) ++ with open(repofile, 'w') as f: ++ f.write(openeuler_repo) ++ + # download dnf + download_dnf = ["dnf", "python3-dnf", "dnf-help", "dnf-data"] + [os.system('/usr/bin/yumdownloader {} --destdir={}'.format(i, os.path.join(install_dir, 'root'))) for i in download_dnf] +-- +1.8.3.1 + diff --git a/migration-tools.spec b/migration-tools.spec index d0b6038..7d63d35 100644 --- a/migration-tools.spec +++ b/migration-tools.spec @@ -1,6 +1,6 @@ Name: migration-tools Version: 1.0.3 -Release: 24 +Release: 25 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 @@ -30,6 +30,8 @@ Patch020: 0020-rebrand-for-openeuler.patch Patch021: 0021-Solve-startup-issues.patch Patch022: 0001-modify-web-success-migration-page.patch Patch023: 0022-add-migrate-to-2403.patch +Patch024: 0023-fix-2403-can-not-start-systemd-logind-service.patch +Patch025: 0024-support-migration-to-2503.patch BuildArch: noarch @@ -132,6 +134,9 @@ rm -rf /usr/bin/migration-tools %endif %changelog +* Thu Aug 28 2025 xuezhixin - 1.0.3-25 +- add 0024-support-migration-to-2503.patch + * Thu Mar 20 2025 xuezhixin - 1.0.3-24 - update requres -- Gitee