已合并
sync support-migration-to-2503 #190
xuezhizone创建于 9月1日
sync support-migration-to-2503 #190
已合并
共 4 个文件变更+89-7
| @@ -0,0 +1,81 @@ | |||
| 1 | +From 70139ab91a148090c1124595ec3a60d8118ab69f Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: yahaha <xuezhixin@uniontech.com> | ||
| 3 | +Date: Thu, 28 Aug 2025 02:37:37 -0400 | ||
| 4 | +Subject: [PATCH] support migration to 2503 | ||
| 5 | + | ||
| 6 | +--- | ||
| 7 | + .../centos7/openeuler/centos72openeuler.py | 40 +++++++++++++++++++++- | ||
| 8 | + 1 file changed, 39 insertions(+), 1 deletion(-) | ||
| 9 | + | ||
| 10 | +diff --git a/ut-Migration-tools-0.1/centos7/openeuler/centos72openeuler.py b/ut-Migration-tools-0.1/centos7/openeuler/centos72openeuler.py | ||
| 11 | +index e114d32..dd47376 100644 | ||
| 12 | +--- a/ut-Migration-tools-0.1/centos7/openeuler/centos72openeuler.py | ||
| 13 | ++++ b/ut-Migration-tools-0.1/centos7/openeuler/centos72openeuler.py | ||
| 14 | +@@ -8,11 +8,21 @@ import sys, re | ||
| 15 | + | ||
| 16 | + openeuler_repo = '''[openeuler] | ||
| 17 | + name = openeuler | ||
| 18 | +-baseurl = https://mirrors.tuna.tsinghua.edu.cn/openeuler/openEuler-20.03-LTS-SP4/OS/$basearch | ||
| 19 | ++baseurl = https://mirrors.tuna.tsinghua.edu.cn/openeuler/openEuler-25.03/everything/$basearch | ||
| 20 | + enabled = 1 | ||
| 21 | + gpgcheck = 0 | ||
| 22 | + ''' | ||
| 23 | + | ||
| 24 | ++openeuler_2403_repo = """ | ||
| 25 | ++[openEuler-2403] | ||
| 26 | ++name=openEuler-2403 | ||
| 27 | ++baseurl=https://mirrors.tuna.tsinghua.edu.cn/openeuler/openEuler-24.03-LTS-SP2/everything/$basearch | ||
| 28 | ++enabled=1 | ||
| 29 | ++gpgcheck=0 | ||
| 30 | ++""" | ||
| 31 | ++ | ||
| 32 | ++high_version_list = ["25.03", "25.09"] | ||
| 33 | ++ | ||
| 34 | + | ||
| 35 | + def local_disabled_release_repo(): | ||
| 36 | + path = '/etc/yum.repos.d' | ||
| 37 | +@@ -284,6 +294,27 @@ def main(): | ||
| 38 | + | ||
| 39 | + dnf_path = '/usr/bin/dnf' | ||
| 40 | + install_dir = os.path.join(os.path.dirname('/var/tmp'), 'DNF') | ||
| 41 | ++ | ||
| 42 | ++ | ||
| 43 | ++ # 检查 /etc/os-release 的 VERSION_ID 是否为 "25.03" | ||
| 44 | ++ version_id = None | ||
| 45 | ++ os_release_file = '/etc/os-release' | ||
| 46 | ++ if os.path.exists(os_release_file): | ||
| 47 | ++ with open(os_release_file, 'r') as f: | ||
| 48 | ++ for line in f: | ||
| 49 | ++ if line.startswith('VERSION_ID'): | ||
| 50 | ++ version_id = line.strip().split('=')[1].strip('"') | ||
| 51 | ++ break | ||
| 52 | ++ | ||
| 53 | ++ # 如果是 25.03 系统,重新配置 2403 的软件源 | ||
| 54 | ++ if version_id in high_version_list: | ||
| 55 | ++ # 写入 2403 的 repo 文件 | ||
| 56 | ++ if os.path.exists(repofile): | ||
| 57 | ++ os.remove(repofile) | ||
| 58 | ++ with open(repofile, 'w') as f: | ||
| 59 | ++ f.write(openeuler_2403_repo) | ||
| 60 | ++ | ||
| 61 | ++ | ||
| 62 | + if not os.path.exists(install_dir): | ||
| 63 | + os.makedirs(install_dir) | ||
| 64 | + else: | ||
| 65 | +@@ -293,6 +324,13 @@ def main(): | ||
| 66 | + install_dir) | ||
| 67 | + os.system(install_cmd) | ||
| 68 | + | ||
| 69 | ++ if version_id in high_version_list: | ||
| 70 | ++ # 写入 25.03 的 repo 文件 | ||
| 71 | ++ if os.path.exists(repofile): | ||
| 72 | ++ os.remove(repofile) | ||
| 73 | ++ with open(repofile, 'w') as f: | ||
| 74 | ++ f.write(openeuler_repo) | ||
| 75 | ++ | ||
| 76 | + # download dnf | ||
| 77 | + download_dnf = ["dnf", "python3-dnf", "dnf-help", "dnf-data"] | ||
| 78 | + [os.system('/usr/bin/yumdownloader {} --destdir={}'.format(i, os.path.join(install_dir, 'root'))) for i in download_dnf] | ||
| 79 | +-- | ||
| 80 | +1.8.3.1 | ||
| 81 | + | ||
Binary files do not support preview
| @@ -1,6 +1,6 @@ | |||
| 1 | Name: migration-tools | 1 | Name: migration-tools |
| 2 | Version: 1.0.3 | 2 | Version: 1.0.3 |
| 3 | -Release: 25 | 3 | +Release: 27 |
| 4 | License: MulanPSL-2.0 | 4 | License: MulanPSL-2.0 |
| 5 | Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system | 5 | Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system |
| 6 | Source0: %{name}-%{version}.tar.gz | 6 | Source0: %{name}-%{version}.tar.gz |
| @@ -31,6 +31,7 @@ Patch021: 0021-Solve-startup-issues.patch | |||
| 31 | Patch022: 0022-modify-web-success-migration-page.patch | 31 | Patch022: 0022-modify-web-success-migration-page.patch |
| 32 | Patch023: 0023-add-migrate-to-2403.patch | 32 | Patch023: 0023-add-migrate-to-2403.patch |
| 33 | Patch024: 0024-fix-2403-can-not-start-systemd-logind-service.patch | 33 | Patch024: 0024-fix-2403-can-not-start-systemd-logind-service.patch |
| 34 | +Patch025: 0025-support-migration-to-2503.patch | ||
| 34 | 35 | ||
| 35 | 36 | ||
| 36 | BuildArch: noarch | 37 | BuildArch: noarch |
| @@ -38,7 +39,6 @@ BuildRequires: systemd | |||
| 38 | %description | 39 | %description |
| 39 | UOS Migration Software | 40 | UOS Migration Software |
| 40 | 41 | ||
| 41 | -%if 0%{?rhel} >= 7 | ||
| 42 | %package -n migration-tools-agent | 42 | %package -n migration-tools-agent |
| 43 | Summary: migration-tools-agent | 43 | Summary: migration-tools-agent |
| 44 | License: MulanPSL-2.0 | 44 | License: MulanPSL-2.0 |
| @@ -58,7 +58,6 @@ Requires: /usr/bin/yumdownloader | |||
| 58 | 58 | ||
| 59 | %description -n migration-tools-agent | 59 | %description -n migration-tools-agent |
| 60 | Migration software agent side | 60 | Migration software agent side |
| 61 | -%endif | ||
| 62 | 61 | ||
| 63 | %package -n migration-tools-server | 62 | %package -n migration-tools-server |
| 64 | Summary: migration-tools-server | 63 | Summary: migration-tools-server |
| @@ -91,12 +90,10 @@ mkdir -p $RPM_BUILD_ROOT/etc/migration-tools | |||
| 91 | mkdir -p $RPM_BUILD_ROOT%{_unitdir} | 90 | mkdir -p $RPM_BUILD_ROOT%{_unitdir} |
| 92 | %{__cp} -r * $RPM_BUILD_ROOT/usr/lib/migration-tools-server/ | 91 | %{__cp} -r * $RPM_BUILD_ROOT/usr/lib/migration-tools-server/ |
| 93 | 92 | ||
| 94 | -%if 0%{?rhel} >= 7 | ||
| 95 | mkdir -p $RPM_BUILD_ROOT/usr/lib/migration-tools-agent | 93 | mkdir -p $RPM_BUILD_ROOT/usr/lib/migration-tools-agent |
| 96 | %{__cp} -r * $RPM_BUILD_ROOT/usr/lib/migration-tools-agent/ | 94 | %{__cp} -r * $RPM_BUILD_ROOT/usr/lib/migration-tools-agent/ |
| 97 | 95 | ||
| 98 | %{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools-agent.service $RPM_BUILD_ROOT%{_unitdir} | 96 | %{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools-agent.service $RPM_BUILD_ROOT%{_unitdir} |
| 99 | -%endif | ||
| 100 | 97 | ||
| 101 | # Install server config | 98 | # Install server config |
| 102 | %{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools.conf $RPM_BUILD_ROOT/etc/migration-tools | 99 | %{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools.conf $RPM_BUILD_ROOT/etc/migration-tools |
| @@ -124,15 +121,19 @@ rm -rf /usr/bin/migration-tools | |||
| 124 | /usr/lib/migration-tools-server | 121 | /usr/lib/migration-tools-server |
| 125 | %{_unitdir}/migration-tools-server.service | 122 | %{_unitdir}/migration-tools-server.service |
| 126 | 123 | ||
| 127 | -%if 0%{?rhel} >= 7 | ||
| 128 | %files -n migration-tools-agent | 124 | %files -n migration-tools-agent |
| 129 | /etc/migration-tools | 125 | /etc/migration-tools |
| 130 | /var/tmp/migration-tools | 126 | /var/tmp/migration-tools |
| 131 | /usr/lib/migration-tools-agent | 127 | /usr/lib/migration-tools-agent |
| 132 | %{_unitdir}/migration-tools-agent.service | 128 | %{_unitdir}/migration-tools-agent.service |
| 133 | -%endif | ||
| 134 | 129 | ||
| 135 | %changelog | 130 | %changelog |
| 131 | +* Tue Dec 02 2025 xuezhixin <xuezhixin@uniontech.com> - 1.0.3-27 | ||
| 132 | +- fix build error | ||
| 133 | + | ||
| 134 | +* Fri Aug 29 2025 xuezhixin <xuezhixin@uniontech.com> - 1.0.3-26 | ||
| 135 | +- add 0025-support-migration-to-2503.patch | ||
| 136 | + | ||
| 136 | * Tue Jul 29 2025 lixin <lixinb@uniontech.com> - 1.0.3-25 | 137 | * Tue Jul 29 2025 lixin <lixinb@uniontech.com> - 1.0.3-25 |
| 137 | - rename patches | 138 | - rename patches |
| 138 | 139 | ||