Support Rocky Linux 8

[GitHub link #49]
This commit is contained in:
Aoran Zeng 2024-08-22 17:13:50 +08:00
parent 94b3c15781
commit 10d376885c
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
2 changed files with 34 additions and 7 deletions

View File

@ -6,7 +6,7 @@
* Contributors : Shengwei Chen <414685209@qq.com>
* |
* Created on : <2023-08-29>
* Last modified : <2024-08-17>
* Last modified : <2024-08-22>
*
*
* ------------------------------------------------------------*/
@ -163,6 +163,7 @@ typedef struct TargetInfo_t {
// 大部分target还不支持reset所以暂时先默认设置为NULL来过渡
#define def_target(t) TargetInfo t##_target = {def_target_inner_gs(t),def_target_sourcesn(t)}
#define def_target_gs(t) TargetInfo t##_target = {def_target_inner_gs(t),def_target_sourcesn(t)}
#define def_target_gsr(t) TargetInfo t##_target = {def_target_inner_gsr(t),def_target_sourcesn(t)}
#define def_target_gsf(t) TargetInfo t##_target = {def_target_inner_gsf(t),def_target_sourcesn(t)}
#define def_target_gsrf(t) TargetInfo t##_target = {def_target_inner_gsrf(t),def_target_sourcesn(t)}

View File

@ -4,7 +4,7 @@
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Nil Null <nil@null.org>
* Created On : <2023-09-24>
* Last Modified : <2024-08-16>
* Last Modified : <2024-08-22>
* ------------------------------------------------------------*/
/**
@ -13,6 +13,7 @@
static SourceInfo
os_rockylinux_sources[] = {
{&Upstream, NULL},
{&MirrorZ, "https://mirrors.cernet.edu.cn/rocky"},
{&Ali, "https://mirrors.aliyun.com/rockylinux"},
{&Volcengine, "https://mirrors.volces.com/rockylinux"},
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/rocky"},
@ -35,14 +36,39 @@ os_rockylinux_setsrc (char *option)
chsrc_yield_source_and_confirm (os_rockylinux);
char *cmd = xy_strjoin (3,
"sed -e 's|^mirrorlist=|#mirrorlist=|g' "
"-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=", source.url, "|g' "
"-i.bak /etc/yum.repos.d/rocky-extras.repo /etc/yum.repos.d/rocky.repo"
);
char *version_str = xy_run ("sed -nr 's/ROCKY_SUPPORT_PRODUCT_VERSION=(.*)/\\1/p' " ETC_os_release, 0, NULL);
version_str = xy_str_delete_suffix (version_str, "\n");
double version = atof (version_str);
char *cmd = NULL;
if (version < 9)
{
cmd = xy_strjoin (3,
"sed -e 's|^mirrorlist=|#mirrorlist=|g' "
"-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=", source.url, "|g' "
"-i.bak /etc/yum.repos.d/Rocky-*.repo"
);
// Rocky-AppStream.repo
// Rocky-BaseOS.repo
// Rocky-Extras
// Rocky-PowerTools
}
else
{
cmd = xy_strjoin (3,
"sed -e 's|^mirrorlist=|#mirrorlist=|g' "
"-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=", source.url, "|g' "
"-i.bak /etc/yum.repos.d/rocky-extras.repo /etc/yum.repos.d/rocky.repo"
);
}
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, ChsrcTypeUntested);
}
def_target_s(os_rockylinux);