加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-on-anolis-platform_id-should-be-an8-instead-of-el8.patch 3.52 KB
一键复制 编辑 原始数据 按行查看 历史
Meredith 提交于 2021-08-27 10:48 . add leapp-repository related files
From 1506fc7e88e504751eb7ceaecef4de4b849ff30c Mon Sep 17 00:00:00 2001
From: Chunmei Xu <xuchunmei@openanolis.org>
Date: Wed, 19 May 2021 16:23:19 +0800
Subject: [PATCH 3/3] on anolis platform_id should be an8 instead of el8
Signed-off-by: Chunmei Xu <xuchunmei@openanolis.org>
---
.../targetuserspacecreator/libraries/userspacegen.py | 10 +++++++++-
repos/system_upgrade/el7toel8/libraries/dnfplugin.py | 11 +++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/repos/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py
index 69b3e6a..b2d40aa 100644
--- a/repos/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py
+++ b/repos/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py
@@ -102,6 +102,14 @@ class _InputData(object):
raise StopActorExecutionError('No storage info available cannot proceed.')
+def get_platform_id(target_repoids):
+ platform_id = 'platform:el8'
+ for repo in target_repoids:
+ if repo.find('Anolis') != -1 or repo.find('anolis') != -1:
+ platform_id = 'platform:an8'
+ return platform_id
+ return platform_id
+
def prepare_target_userspace(context, userspace_dir, enabled_repos, packages):
"""
Implement the creation of the target userspace.
@@ -115,7 +123,7 @@ def prepare_target_userspace(context, userspace_dir, enabled_repos, packages):
'install',
'-y',
'--nogpgcheck',
- '--setopt=module_platform_id=platform:el8',
+ '--setopt=module_platform_id='+get_platform_id(enabled_repos),
'--setopt=keepcache=1',
'--releasever', api.current_actor().configuration.version.target,
'--installroot', '/el8target',
diff --git a/repos/system_upgrade/el7toel8/libraries/dnfplugin.py b/repos/system_upgrade/el7toel8/libraries/dnfplugin.py
index 719e916..d271212 100644
--- a/repos/system_upgrade/el7toel8/libraries/dnfplugin.py
+++ b/repos/system_upgrade/el7toel8/libraries/dnfplugin.py
@@ -30,6 +30,13 @@ def install(target_basedir):
message='Failed to install DNF plugin. Error: {}'.format(str(e))
)
+def get_platform_id(target_repoids):
+ platform_id = 'platform:el8'
+ for repo in target_repoids:
+ if repo.find('Anolis') != -1 or repo.find('anolis') != -1:
+ platform_id = 'platform:an8'
+ return platform_id
+ return platform_id
def build_plugin_data(target_repoids, debug, test, tasks, on_aws):
"""
@@ -50,7 +57,7 @@ def build_plugin_data(target_repoids, debug, test, tasks, on_aws):
'disable_repos': True,
'enable_repos': target_repoids,
'gpgcheck': False,
- 'platform_id': 'platform:el8',
+ 'platform_id': get_platform_id(target_repoids),
'releasever': api.current_actor().configuration.version.target,
'installroot': '/installroot',
'test_flag': test
@@ -175,7 +182,7 @@ def install_initramdisk_requirements(packages, target_userspace_info, used_repos
'install',
'-y',
'--nogpgcheck',
- '--setopt=module_platform_id=platform:el8',
+ '--setopt=module_platform_id='+get_platform_id(target_repoids),
'--setopt=keepcache=1',
'--releasever', api.current_actor().configuration.version.target,
'--disablerepo', '*'
--
2.29.2
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化