From eb31db497ebc9c4dcb62674702edfcf84dda261e Mon Sep 17 00:00:00 2001 From: ZhouWeitao Date: Fri, 24 Mar 2023 11:38:00 +0800 Subject: [PATCH] make offline pkg for different aarch and x86_64 Signed-off-by: ZhouWeitao --- dist/.gitignore | 3 +- dist/README.md | 4 +- dist/download_offline_rpms.sh | 6 +-- dist/make_offline_dist.sh | 4 +- dist/repos_aarch64/Centos.repo | 41 +++++++++++++++++++ .../anolis-migration.repo | 0 dist/{repos => repos_aarch64}/epel.repo | 0 dist/{repos => repos_x86_64}/Centos.repo | 20 +++------ dist/repos_x86_64/anolis-migration.repo | 25 +++++++++++ dist/repos_x86_64/epel.repo | 23 +++++++++++ 10 files changed, 103 insertions(+), 23 deletions(-) create mode 100644 dist/repos_aarch64/Centos.repo rename dist/{repos => repos_aarch64}/anolis-migration.repo (100%) rename dist/{repos => repos_aarch64}/epel.repo (100%) rename dist/{repos => repos_x86_64}/Centos.repo (67%) create mode 100644 dist/repos_x86_64/anolis-migration.repo create mode 100644 dist/repos_x86_64/epel.repo diff --git a/dist/.gitignore b/dist/.gitignore index 9119a20..07a80c8 100644 --- a/dist/.gitignore +++ b/dist/.gitignore @@ -1,2 +1,3 @@ -anolis_migration_pkgs.tar.gz +anolis_migration_pkgs_aarch64.tar.gz +anolis_migration_pkgs_x86_64.tar.gz pkgs/ diff --git a/dist/README.md b/dist/README.md index 769091e..603ef24 100644 --- a/dist/README.md +++ b/dist/README.md @@ -7,13 +7,13 @@ chmod +x make_offline_dist.sh ./make_offline_dist.sh ``` -运行上述命令将会在本目录制作离线安装包,包名:anolis_migration_pkgs.tar.gz +分别在 x86_64, aarch64 环境运行上述命令将会在本目录制作离线安装包,包名:anolis_migration_pkgs_x86_64.tar.gz , anolis_migration_pkgs_aarch64.tar.gz ## 使用离线安装包 ```bash # 解压 -tar -zxvf anolis_migration_pkgs.tar.gz +tar -zxvf anolis_migration_pkgs_`uname -m`.tar.gz # 安装rpm cd pkgs diff --git a/dist/download_offline_rpms.sh b/dist/download_offline_rpms.sh index 5e5f5d8..af2770b 100755 --- a/dist/download_offline_rpms.sh +++ b/dist/download_offline_rpms.sh @@ -3,7 +3,7 @@ downloaddir=$1 yum install -y python-pip yum remove -y python-requests python-urllib3; pip uninstall requests urllib3 -y 2>/dev/null || echo "not installed" -yum update -y -xcentos-release -yum install -y leapp -yum remove -y leapp leapp-deps leapp-repository leapp-repository-deps python2-leapp snactor python2-psutil python3-psutil +yum update -y -xcentos-release --disablerepo=migration +yum install -y leapp --enablerepo=migration +yum remove -y leapp leapp-deps leapp-repository leapp-repository-deps python2-leapp snactor python2-psutil python3-psutil python36-psutil yum install --downloadonly --downloaddir=${downloaddir} leapp diff --git a/dist/make_offline_dist.sh b/dist/make_offline_dist.sh index 5d8efff..829cc75 100755 --- a/dist/make_offline_dist.sh +++ b/dist/make_offline_dist.sh @@ -5,7 +5,7 @@ rm -rf pkgs mkdir pkgs chmod +x download_offline_rpms.sh -sudo docker run --net=host --name download_offline --rm -v `pwd`/download_offline_rpms.sh:/root/download_offline_rpms.sh -v `pwd`/pkgs/:/mnt/ -v `pwd`/repos:/etc/yum.repos.d centos:7 bash -c '/root/download_offline_rpms.sh /mnt/' +sudo docker run --net=host --name download_offline --rm -v `pwd`/download_offline_rpms.sh:/root/download_offline_rpms.sh -v `pwd`/pkgs/:/mnt/ -v `pwd`/repos_`uname -m`:/etc/yum.repos.d centos:7 bash -c '/root/download_offline_rpms.sh /mnt/' echo "downloading rpms" sudo docker wait download_offline @@ -13,4 +13,4 @@ sudo docker wait download_offline #tmp solution wget https://gitee.com/src-anolis-sig/migrear/raw/master/migrear -O pkgs/migrear -tar -czvf anolis_migration_pkgs.tar.gz pkgs +tar -czvf anolis_migration_pkgs_`uname -m`.tar.gz pkgs diff --git a/dist/repos_aarch64/Centos.repo b/dist/repos_aarch64/Centos.repo new file mode 100644 index 0000000..1cca979 --- /dev/null +++ b/dist/repos_aarch64/Centos.repo @@ -0,0 +1,41 @@ +# CentOS-Base.repo +# +# The mirror system uses the connecting IP address of the client and the +# update status of each mirror to pick mirrors that are updated to and +# geographically close to the client. You should use this for CentOS updates +# unless you are manually picking other mirrors. +# +# If the mirrorlist= does not work for you, as a fall back you can try the +# remarked out baseurl= line instead. +# +# + +[base] +name=CentOS-$releasever - Base +baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/os/$basearch/ +gpgcheck=0 +gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 + +#released updates +[updates] +name=CentOS-$releasever - Updates +baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/updates/$basearch/ +gpgcheck=0 +gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 + +#additional packages that may be useful +[extras] +name=CentOS-$releasever - Extras +baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/extras/$basearch/ +gpgcheck=0 +gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 +enabled=1 + +#additional packages that extend functionality of existing packages +[centosplus] +name=CentOS-$releasever - Plus +baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/centosplus/$basearch/ +gpgcheck=0 +enabled=0 +gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 + diff --git a/dist/repos/anolis-migration.repo b/dist/repos_aarch64/anolis-migration.repo similarity index 100% rename from dist/repos/anolis-migration.repo rename to dist/repos_aarch64/anolis-migration.repo diff --git a/dist/repos/epel.repo b/dist/repos_aarch64/epel.repo similarity index 100% rename from dist/repos/epel.repo rename to dist/repos_aarch64/epel.repo diff --git a/dist/repos/Centos.repo b/dist/repos_x86_64/Centos.repo similarity index 67% rename from dist/repos/Centos.repo rename to dist/repos_x86_64/Centos.repo index df18245..55e658d 100644 --- a/dist/repos/Centos.repo +++ b/dist/repos_x86_64/Centos.repo @@ -14,9 +14,7 @@ name=CentOS-$releasever - Base - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/ - http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/ - http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/ -gpgcheck=1 +gpgcheck=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #released updates @@ -24,9 +22,7 @@ gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 name=CentOS-$releasever - Updates - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/ - http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/ - http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/ -gpgcheck=1 +gpgcheck=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful @@ -34,9 +30,7 @@ gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 name=CentOS-$releasever - Extras - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/ - http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/ - http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/ -gpgcheck=1 +gpgcheck=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages @@ -44,9 +38,7 @@ gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 name=CentOS-$releasever - Plus - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/ - http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/ - http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/ -gpgcheck=1 +gpgcheck=0 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 @@ -55,8 +47,6 @@ gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 name=CentOS-$releasever - Contrib - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/ - http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/ - http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/ -gpgcheck=1 +gpgcheck=0 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 diff --git a/dist/repos_x86_64/anolis-migration.repo b/dist/repos_x86_64/anolis-migration.repo new file mode 100644 index 0000000..022a55c --- /dev/null +++ b/dist/repos_x86_64/anolis-migration.repo @@ -0,0 +1,25 @@ +# Anolis OS migration repo + +[migration] +name=Anolis OS - migration repo +baseurl=https://mirrors.openanolis.cn/anolis/migration/$basearch/os/ +gpgcheck=1 +gpgkey=https://mirrors.openanolis.cn/anolis/RPM-GPG-KEY-ANOLIS +failovermethod=priority +enabled=1 + +[migration-debug] +name=Anolis OS - migration debug repo +baseurl=https://mirrors.openanolis.cn/anolis/migration/$basearch/debug/ +gpgcheck=1 +gpgkey=https://mirrors.openanolis.cn/anolis/RPM-GPG-KEY-ANOLIS +failovermethod=priority +enabled=0 + +[migration-source] +name=Anolis OS - migration source repo +baseurl=https://mirrors.openanolis.cn/anolis/migration/source/ +gpgcheck=1 +gpgkey=https://mirrors.openanolis.cn/anolis/RPM-GPG-KEY-ANOLIS +failovermethod=priority +enabled=0 diff --git a/dist/repos_x86_64/epel.repo b/dist/repos_x86_64/epel.repo new file mode 100644 index 0000000..687aa7d --- /dev/null +++ b/dist/repos_x86_64/epel.repo @@ -0,0 +1,23 @@ +[epel] +name=Extra Packages for Enterprise Linux 7 - $basearch +baseurl=http://mirrors.aliyun.com/epel/7/$basearch +failovermethod=priority +enabled=1 +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 + +[epel-debuginfo] +name=Extra Packages for Enterprise Linux 7 - $basearch - Debug +baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug +failovermethod=priority +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 +gpgcheck=0 + +[epel-source] +name=Extra Packages for Enterprise Linux 7 - $basearch - Source +baseurl=http://mirrors.aliyun.com/epel/7/SRPMS +failovermethod=priority +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 +gpgcheck=0 -- Gitee