mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-18 20:39:14 +08:00
core: alma 更改为 almalinux
This commit is contained in:
parent
0693dbbc64
commit
d3b40f3393
2
.github/workflows/run_reinstall.yml
vendored
2
.github/workflows/run_reinstall.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- run: |
|
||||
${{ matrix.command }} centos
|
||||
${{ matrix.command }} alma-8
|
||||
${{ matrix.command }} almalinux 8
|
||||
${{ matrix.command }} rocky 9
|
||||
${{ matrix.command }} fedora
|
||||
${{ matrix.command }} ubuntu
|
||||
|
44
README.en.md
44
README.en.md
@ -30,26 +30,26 @@ The original system can be any system listed in the table.
|
||||
|
||||
The system requirements for the target system are as follows:
|
||||
|
||||
| Target System | Version | Memory | Disk |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------- | ---------------------- |
|
||||
| <img width="16" height="16" src="https://www.alpinelinux.org/alpine-logo.ico" /> Alpine | 3.17, 3.18, 3.19, 3.20 | 256 MB | 1 GB |
|
||||
| <img width="16" height="16" src="https://www.debian.org/favicon.ico" /> Debian | 9, 10, 11, 12 | 256 MB | 1 ~ 1.5 GB ^ |
|
||||
| <img width="16" height="16" src="https://github.com/bin456789/reinstall/assets/7548515/f74b3d5b-085f-4df3-bcc9-8a9bd80bb16d" /> Kali | Rolling | 256 MB | 1 ~ 1.5 GB ^ |
|
||||
| <img width="16" height="16" src="https://canonical-subiquity.readthedocs-hosted.com/en/latest/_static/favicon.png" /> Ubuntu | 16.04, 18.04, 20.04, 22.04, 24.04 | 512 MB \* | 2 GB |
|
||||
| <img width="16" height="16" src="https://www.centos.org/assets/img/favicon.png" /> CentOS | 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://img.alicdn.com/imgextra/i1/O1CN01oJnJZg1yK4RzI4Rx2_!!6000000006559-2-tps-118-118.png" /> Anolis | 7, 8 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.redhat.com/favicon.ico" /> RedHat <img width="16" height="16" src="https://almalinux.org/fav/favicon.ico" /> Alma <img width="16" height="16" src="https://rockylinux.org/favicon.png" /> Rocky | 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://opencloudos.org/qq.ico" /> OpenCloudOS | 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.oracle.com/asset/web/favicons/favicon-32.png" /> Oracle | 7, 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://fedoraproject.org/favicon.ico" /> Fedora | 40, 41 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.openeuler.org/favicon.ico" /> openEuler | 20.03, 22.03, 24.03 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://static.opensuse.org/favicon.ico" /> openSUSE | 15.5, 15.6, Tumbleweed (Rolling) | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://nixos.org/_astro/flake-blue.Bf2X2kC4_Z1yqDoT.svg" /> NixOS | 24.05 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://archlinux.org/static/favicon.png" /> Arch | Rolling | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.gentoo.org/assets/img/logo/gentoo-g.png" /> Gentoo | Rolling | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (DD) | Any | 512 MB | Depending on the image |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (ISO) | Vista, 7, 8.x (Server 2008 ~ 2012 R2) | 512 MB | 25 GB |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (ISO) | 10, 11 (Server 2016 ~ 2025) | 1 GB | 25 GB |
|
||||
| Target System | Version | Memory | Disk |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------- | ---------------------- |
|
||||
| <img width="16" height="16" src="https://www.alpinelinux.org/alpine-logo.ico" /> Alpine | 3.17, 3.18, 3.19, 3.20 | 256 MB | 1 GB |
|
||||
| <img width="16" height="16" src="https://www.debian.org/favicon.ico" /> Debian | 9, 10, 11, 12 | 256 MB | 1 ~ 1.5 GB ^ |
|
||||
| <img width="16" height="16" src="https://github.com/bin456789/reinstall/assets/7548515/f74b3d5b-085f-4df3-bcc9-8a9bd80bb16d" /> Kali | Rolling | 256 MB | 1 ~ 1.5 GB ^ |
|
||||
| <img width="16" height="16" src="https://canonical-subiquity.readthedocs-hosted.com/en/latest/_static/favicon.png" /> Ubuntu | 16.04, 18.04, 20.04, 22.04, 24.04 | 512 MB \* | 2 GB |
|
||||
| <img width="16" height="16" src="https://www.centos.org/assets/img/favicon.png" /> CentOS | 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://img.alicdn.com/imgextra/i1/O1CN01oJnJZg1yK4RzI4Rx2_!!6000000006559-2-tps-118-118.png" /> Anolis | 7, 8 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.redhat.com/favicon.ico" /> RedHat <img width="16" height="16" src="https://almalinux.org/fav/favicon.ico" /> AlmaLinux <img width="16" height="16" src="https://rockylinux.org/favicon.png" /> Rocky | 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://opencloudos.org/qq.ico" /> OpenCloudOS | 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.oracle.com/asset/web/favicons/favicon-32.png" /> Oracle | 7, 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://fedoraproject.org/favicon.ico" /> Fedora | 40, 41 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.openeuler.org/favicon.ico" /> openEuler | 20.03, 22.03, 24.03 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://static.opensuse.org/favicon.ico" /> openSUSE | 15.5, 15.6, Tumbleweed (Rolling) | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://nixos.org/_astro/flake-blue.Bf2X2kC4_Z1yqDoT.svg" /> NixOS | 24.05 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://archlinux.org/static/favicon.png" /> Arch | Rolling | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.gentoo.org/assets/img/logo/gentoo-g.png" /> Gentoo | Rolling | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (DD) | Any | 512 MB | Depending on the image |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (ISO) | Vista, 7, 8.x (Server 2008 ~ 2012 R2) | 512 MB | 25 GB |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (ISO) | 10, 11 (Server 2016 ~ 2025) | 1 GB | 25 GB |
|
||||
|
||||
\* Indicates installation using cloud images, not traditional network installation.
|
||||
|
||||
@ -126,7 +126,7 @@ certutil -urlcache -f -split https://www.ghproxy.cc/https://raw.githubuserconten
|
||||
```bash
|
||||
bash reinstall.sh centos 9
|
||||
anolis 7|8
|
||||
alma 8|9
|
||||
almalinux 8|9
|
||||
rocky 8|9
|
||||
redhat 8|9 --img='http://xxx.com/xxx.qcow2'
|
||||
opencloudos 8|9
|
||||
@ -168,7 +168,7 @@ Install Debian using a cloud image
|
||||
bash reinstall.sh debian --ci
|
||||
```
|
||||
|
||||
Install CentOS, Alma, Rocky, Fedora using ISO
|
||||
Install CentOS, AlmaLinux, Rocky, Fedora using ISO
|
||||
|
||||
- Only supports machines with more than 2G of memory and dynamic IP.
|
||||
- Password is `123@@@`, and the SSH port is `22`; modifying them using parameters is not supported.
|
||||
|
44
README.md
44
README.md
@ -30,26 +30,26 @@
|
||||
|
||||
目标系统的配置要求如下:
|
||||
|
||||
| 目标系统 | 版本 | 内存 | 硬盘 |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------- | ------------ |
|
||||
| <img width="16" height="16" src="https://www.alpinelinux.org/alpine-logo.ico" /> Alpine | 3.17, 3.18, 3.19, 3.20 | 256 MB | 1 GB |
|
||||
| <img width="16" height="16" src="https://www.debian.org/favicon.ico" /> Debian | 9, 10, 11, 12 | 256 MB | 1 ~ 1.5 GB ^ |
|
||||
| <img width="16" height="16" src="https://github.com/bin456789/reinstall/assets/7548515/f74b3d5b-085f-4df3-bcc9-8a9bd80bb16d" /> Kali | 滚动 | 256 MB | 1 ~ 1.5 GB ^ |
|
||||
| <img width="16" height="16" src="https://canonical-subiquity.readthedocs-hosted.com/en/latest/_static/favicon.png" /> Ubuntu | 16.04, 18.04, 20.04, 22.04, 24.04 | 512 MB \* | 2 GB |
|
||||
| <img width="16" height="16" src="https://www.centos.org/assets/img/favicon.png" /> CentOS | 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://img.alicdn.com/imgextra/i1/O1CN01oJnJZg1yK4RzI4Rx2_!!6000000006559-2-tps-118-118.png" /> Anolis | 7, 8 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.redhat.com/favicon.ico" /> RedHat <img width="16" height="16" src="https://almalinux.org/fav/favicon.ico" /> Alma <img width="16" height="16" src="https://rockylinux.org/favicon.png" /> Rocky | 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://opencloudos.org/qq.ico" /> OpenCloudOS | 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.oracle.com/asset/web/favicons/favicon-32.png" /> Oracle | 7, 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://fedoraproject.org/favicon.ico" /> Fedora | 40, 41 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.openeuler.org/favicon.ico" /> openEuler | 20.03, 22.03, 24.03 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://static.opensuse.org/favicon.ico" /> openSUSE | 15.5, 15.6, Tumbleweed (滚动) | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://nixos.org/_astro/flake-blue.Bf2X2kC4_Z1yqDoT.svg" /> NixOS | 24.05 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://archlinux.org/static/favicon.png" /> Arch | 滚动 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.gentoo.org/assets/img/logo/gentoo-g.png" /> Gentoo | 滚动 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (DD) | 任何 | 512 MB | 取决于镜像 |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (ISO) | Vista, 7, 8.x (Server 2008 ~ 2012 R2) | 512 MB | 25 GB |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (ISO) | 10, 11 (Server 2016 ~ 2025) | 1 GB | 25 GB |
|
||||
| 目标系统 | 版本 | 内存 | 硬盘 |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------- | ------------ |
|
||||
| <img width="16" height="16" src="https://www.alpinelinux.org/alpine-logo.ico" /> Alpine | 3.17, 3.18, 3.19, 3.20 | 256 MB | 1 GB |
|
||||
| <img width="16" height="16" src="https://www.debian.org/favicon.ico" /> Debian | 9, 10, 11, 12 | 256 MB | 1 ~ 1.5 GB ^ |
|
||||
| <img width="16" height="16" src="https://github.com/bin456789/reinstall/assets/7548515/f74b3d5b-085f-4df3-bcc9-8a9bd80bb16d" /> Kali | 滚动 | 256 MB | 1 ~ 1.5 GB ^ |
|
||||
| <img width="16" height="16" src="https://canonical-subiquity.readthedocs-hosted.com/en/latest/_static/favicon.png" /> Ubuntu | 16.04, 18.04, 20.04, 22.04, 24.04 | 512 MB \* | 2 GB |
|
||||
| <img width="16" height="16" src="https://www.centos.org/assets/img/favicon.png" /> CentOS | 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://img.alicdn.com/imgextra/i1/O1CN01oJnJZg1yK4RzI4Rx2_!!6000000006559-2-tps-118-118.png" /> Anolis | 7, 8 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.redhat.com/favicon.ico" /> RedHat <img width="16" height="16" src="https://almalinux.org/fav/favicon.ico" /> AlmaLinux <img width="16" height="16" src="https://rockylinux.org/favicon.png" /> Rocky | 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://opencloudos.org/qq.ico" /> OpenCloudOS | 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.oracle.com/asset/web/favicons/favicon-32.png" /> Oracle | 7, 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://fedoraproject.org/favicon.ico" /> Fedora | 40, 41 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.openeuler.org/favicon.ico" /> openEuler | 20.03, 22.03, 24.03 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://static.opensuse.org/favicon.ico" /> openSUSE | 15.5, 15.6, Tumbleweed (滚动) | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://nixos.org/_astro/flake-blue.Bf2X2kC4_Z1yqDoT.svg" /> NixOS | 24.05 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://archlinux.org/static/favicon.png" /> Arch | 滚动 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.gentoo.org/assets/img/logo/gentoo-g.png" /> Gentoo | 滚动 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (DD) | 任何 | 512 MB | 取决于镜像 |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (ISO) | Vista, 7, 8.x (Server 2008 ~ 2012 R2) | 512 MB | 25 GB |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (ISO) | 10, 11 (Server 2016 ~ 2025) | 1 GB | 25 GB |
|
||||
|
||||
\* 表示使用云镜像安装,非传统网络安装
|
||||
|
||||
@ -126,7 +126,7 @@ certutil -urlcache -f -split https://www.ghproxy.cc/https://raw.githubuserconten
|
||||
```bash
|
||||
bash reinstall.sh centos 9
|
||||
anolis 7|8
|
||||
alma 8|9
|
||||
almalinux 8|9
|
||||
rocky 8|9
|
||||
redhat 8|9 --img='http://xxx.com/xxx.qcow2'
|
||||
opencloudos 8|9
|
||||
@ -168,7 +168,7 @@ bash reinstall.sh centos 9
|
||||
bash reinstall.sh debian --ci
|
||||
```
|
||||
|
||||
ISO 安装 CentOS, Alma, Rocky, Fedora
|
||||
ISO 安装 CentOS, AlmaLinux, Rocky, Fedora
|
||||
|
||||
- 仅支持内存大于 2G 且为动态 IP 的机器
|
||||
- 密码 `123@@@`,SSH 端口 `22`,不支持用参数修改
|
||||
|
34
reinstall.sh
34
reinstall.sh
@ -44,7 +44,7 @@ usage_and_exit() {
|
||||
cat <<EOF
|
||||
Usage: $reinstall_____ centos 9
|
||||
anolis 7|8
|
||||
alma 8|9
|
||||
almalinux 8|9
|
||||
rocky 8|9
|
||||
redhat 8|9 --img='http://xxx.com/xxx.qcow2'
|
||||
opencloudos 8|9
|
||||
@ -1363,20 +1363,20 @@ Continue with DD?
|
||||
eval "${step}_img_type_warp='$img_type_warp'"
|
||||
}
|
||||
|
||||
setos_centos_alma_rocky_fedora() {
|
||||
setos_centos_almalinux_rocky_fedora() {
|
||||
if is_use_cloud_image; then
|
||||
# ci
|
||||
if is_in_china; then
|
||||
case $distro in
|
||||
"centos") ci_mirror="https://mirror.nju.edu.cn/centos-cloud/centos" ;;
|
||||
"alma") ci_mirror="https://mirror.nju.edu.cn/almalinux/$releasever/cloud/$basearch/images" ;;
|
||||
"almalinux") ci_mirror="https://mirror.nju.edu.cn/almalinux/$releasever/cloud/$basearch/images" ;;
|
||||
"rocky") ci_mirror="https://mirror.nju.edu.cn/rocky/$releasever/images/$basearch" ;;
|
||||
"fedora") ci_mirror="https://mirror.nju.edu.cn/fedora/releases/$releasever/Cloud/$basearch/images" ;;
|
||||
esac
|
||||
else
|
||||
case $distro in
|
||||
"centos") ci_mirror="https://cloud.centos.org/centos" ;;
|
||||
"alma") ci_mirror="https://repo.almalinux.org/almalinux/$releasever/cloud/$basearch/images" ;;
|
||||
"almalinux") ci_mirror="https://repo.almalinux.org/almalinux/$releasever/cloud/$basearch/images" ;;
|
||||
"rocky") ci_mirror="https://download.rockylinux.org/pub/rocky/$releasever/images/$basearch" ;;
|
||||
"fedora") ci_mirror="https://dl.fedoraproject.org/pub/fedora/linux/releases/$releasever/Cloud/$basearch/images" ;;
|
||||
esac
|
||||
@ -1392,7 +1392,7 @@ Continue with DD?
|
||||
"9") ci_image=$ci_mirror/$releasever-stream/$basearch/images/CentOS-Stream-GenericCloud-$releasever-latest.$basearch.qcow2 ;;
|
||||
esac
|
||||
;;
|
||||
"alma") ci_image=$ci_mirror/AlmaLinux-$releasever-GenericCloud-latest.$basearch.qcow2 ;;
|
||||
"almalinux") ci_image=$ci_mirror/AlmaLinux-$releasever-GenericCloud-latest.$basearch.qcow2 ;;
|
||||
"rocky") ci_image=$ci_mirror/Rocky-$releasever-GenericCloud-Base.latest.$basearch.qcow2 ;;
|
||||
"fedora")
|
||||
# Fedora-Cloud-Base-39-1.5.x86_64.qcow2
|
||||
@ -1413,12 +1413,12 @@ Continue with DD?
|
||||
# 传统安装
|
||||
case $distro in
|
||||
"centos") mirrorlist="https://mirrors.centos.org/mirrorlist?repo=centos-baseos-$releasever-stream&arch=$basearch" ;;
|
||||
"alma") mirrorlist="https://mirrors.almalinux.org/mirrorlist/$releasever/baseos" ;;
|
||||
"almalinux") mirrorlist="https://mirrors.almalinux.org/mirrorlist/$releasever/baseos" ;;
|
||||
"rocky") mirrorlist="https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever" ;;
|
||||
"fedora") mirrorlist="https://mirrors.fedoraproject.org/mirrorlist?arch=$basearch&repo=fedora-$releasever" ;;
|
||||
esac
|
||||
|
||||
# rocky/centos9 需要删除第一行注释, alma 需要替换$basearch
|
||||
# rocky/centos9 需要删除第一行注释, almalinux 需要替换$basearch
|
||||
for cur_mirror in $(curl -L $mirrorlist | sed "/^#/d" | sed "s,\$basearch,$basearch,"); do
|
||||
host=$(get_host_by_url $cur_mirror)
|
||||
if is_host_has_ipv4_and_ipv6 $host &&
|
||||
@ -1516,7 +1516,7 @@ Continue with DD?
|
||||
eval ${step}_releasever=$releasever
|
||||
|
||||
case "$distro" in
|
||||
centos | alma | rocky | fedora) setos_centos_alma_rocky_fedora ;;
|
||||
centos | almalinux | rocky | fedora) setos_centos_almalinux_rocky_fedora ;;
|
||||
*) setos_$distro ;;
|
||||
esac
|
||||
|
||||
@ -1538,7 +1538,7 @@ is_distro_like_redhat() {
|
||||
else
|
||||
_distro=$distro
|
||||
fi
|
||||
[ "$_distro" = redhat ] || [ "$_distro" = centos ] || [ "$_distro" = alma ] || [ "$_distro" = rocky ] || [ "$_distro" = fedora ] || [ "$_distro" = oracle ]
|
||||
[ "$_distro" = redhat ] || [ "$_distro" = centos ] || [ "$_distro" = almalinux ] || [ "$_distro" = rocky ] || [ "$_distro" = fedora ] || [ "$_distro" = oracle ]
|
||||
}
|
||||
|
||||
is_distro_like_debian() {
|
||||
@ -1560,7 +1560,7 @@ verify_os_name() {
|
||||
for os in \
|
||||
'centos 7|9' \
|
||||
'anolis 7|8' \
|
||||
'alma 8|9' \
|
||||
'almalinux 8|9' \
|
||||
'rocky 8|9' \
|
||||
'redhat 8|9' \
|
||||
'opencloudos 8|9' \
|
||||
@ -1713,10 +1713,10 @@ install_pkg() {
|
||||
esac
|
||||
}
|
||||
|
||||
# 系统 package名称 repo名称
|
||||
# centos/alma/rocky/fedora/anolis epel-release epel
|
||||
# oracle linux oracle-epel-release ol9_developer_EPEL
|
||||
# opencloudos epol-release EPOL
|
||||
# 系统 package名称 repo名称
|
||||
# centos/almalinux/rocky/fedora/anolis epel-release epel
|
||||
# oracle linux oracle-epel-release ol9_developer_EPEL
|
||||
# opencloudos epol-release EPOL
|
||||
check_is_need_epel() {
|
||||
is_need_epel() {
|
||||
case "$pkg" in
|
||||
@ -1825,7 +1825,7 @@ check_ram() {
|
||||
netboot.xyz) echo 0 ;;
|
||||
alpine | debian | kali | dd) echo 256 ;;
|
||||
arch | gentoo | nixos | windows) echo 512 ;;
|
||||
redhat | centos | alma | rocky | fedora | oracle | ubuntu | anolis | opencloudos | openeuler) echo 1024 ;;
|
||||
redhat | centos | almalinux | rocky | fedora | oracle | ubuntu | anolis | opencloudos | openeuler) echo 1024 ;;
|
||||
opensuse) echo -1 ;; # 没有安装模式
|
||||
esac
|
||||
)
|
||||
@ -1840,7 +1840,7 @@ check_ram() {
|
||||
|
||||
has_cloud_image=$(
|
||||
case "$distro" in
|
||||
redhat | centos | alma | rocky | oracle | fedora | debian | ubuntu | opensuse | anolis | openeuler) echo true ;;
|
||||
redhat | centos | almalinux | rocky | oracle | fedora | debian | ubuntu | opensuse | anolis | openeuler) echo true ;;
|
||||
netboot.xyz | alpine | dd | arch | gentoo | nixos | kali | windows) echo false ;;
|
||||
esac
|
||||
)
|
||||
@ -3532,7 +3532,7 @@ dd | windows | netboot.xyz | kali | alpine | arch | gentoo | nixos)
|
||||
oracle | opensuse | anolis | opencloudos | openeuler)
|
||||
cloud_image=1
|
||||
;;
|
||||
redhat | centos | alma | rocky | fedora | ubuntu)
|
||||
redhat | centos | almalinux | rocky | fedora | ubuntu)
|
||||
if is_force_use_installer; then
|
||||
unset cloud_image
|
||||
else
|
||||
|
18
trans.sh
18
trans.sh
@ -1961,7 +1961,7 @@ create_part() {
|
||||
elif is_use_cloud_image; then
|
||||
installer_part_size="$(get_cloud_image_part_size)"
|
||||
# 这几个系统不使用dd,而是复制文件
|
||||
if [ "$distro" = centos ] || [ "$distro" = alma ] || [ "$distro" = rocky ] ||
|
||||
if [ "$distro" = centos ] || [ "$distro" = almalinux ] || [ "$distro" = rocky ] ||
|
||||
[ "$distro" = oracle ] || [ "$distro" = redhat ] ||
|
||||
[ "$distro" = anolis ] || [ "$distro" = opencloudos ] || [ "$distro" = openeuler ] ||
|
||||
[ "$distro" = ubuntu ]; then
|
||||
@ -2474,7 +2474,7 @@ is_need_ucode_firmware() {
|
||||
|
||||
get_ucode_firmware_pkgs() {
|
||||
case "$distro" in
|
||||
centos | alma | rocky | oracle | redhat | anolis | opencloudos | openeuler) os=elol ;;
|
||||
centos | almalinux | rocky | oracle | redhat | anolis | opencloudos | openeuler) os=elol ;;
|
||||
*) os=$distro ;;
|
||||
esac
|
||||
|
||||
@ -3038,7 +3038,7 @@ get_os_fs() {
|
||||
case "$distro" in
|
||||
ubuntu) echo ext4 ;;
|
||||
anolis | openeuler) echo ext4 ;;
|
||||
centos | alma | rocky | oracle | redhat) echo xfs ;;
|
||||
centos | almalinux | rocky | oracle | redhat) echo xfs ;;
|
||||
opencloudos) echo xfs ;;
|
||||
esac
|
||||
}
|
||||
@ -3173,7 +3173,7 @@ install_qcow_by_copy() {
|
||||
connect_qcow
|
||||
|
||||
# 镜像分区格式
|
||||
# centos/rocky/alma/rhel: xfs
|
||||
# centos/rocky/almalinux/rhel: xfs
|
||||
# oracle x86_64: lvm + xfs
|
||||
# oracle aarch64 cloud: xfs
|
||||
|
||||
@ -3191,7 +3191,7 @@ install_qcow_by_copy() {
|
||||
os_part=$(lsblk /dev/nbd0p* --sort SIZE -no NAME,FSTYPE | grep -E 'ext4|xfs' | tail -1 | awk '{print $1}')
|
||||
efi_part=$(lsblk /dev/nbd0p* --sort SIZE -no NAME,PARTTYPE | grep -i "$EFI_UUID" | awk '{print $1}')
|
||||
# 排除前两个,再选择最大分区
|
||||
# alma 9 boot 分区的类型不是规定的 uuid
|
||||
# almalinux9 boot 分区的类型不是规定的 uuid
|
||||
# openeuler boot 分区是 fat 格式
|
||||
boot_part=$(lsblk /dev/nbd0p* --sort SIZE -no NAME,FSTYPE | grep -E 'ext4|xfs|fat' | awk '{print $1}' |
|
||||
grep -vx "$os_part" | grep -vx "$efi_part" | tail -1 | awk '{print $1}')
|
||||
@ -3361,7 +3361,7 @@ install_qcow_by_copy() {
|
||||
EOF
|
||||
|
||||
# fstab 删除多余分区
|
||||
# alma/rocky 镜像有 boot 分区
|
||||
# almalinux/rocky 镜像有 boot 分区
|
||||
# oracle 镜像有 swap 分区
|
||||
sed -i '/[[:space:]]\/boot[[:space:]]/d' /os/etc/fstab
|
||||
sed -i '/[[:space:]]swap[[:space:]]/d' /os/etc/fstab
|
||||
@ -3428,7 +3428,7 @@ EOF
|
||||
fi
|
||||
|
||||
# blscfg 启动项
|
||||
# rocky/alma镜像是独立的boot分区,但我们不是
|
||||
# rocky/almalinux镜像是独立的boot分区,但我们不是
|
||||
# 因此要添加boot目录
|
||||
if ls /os/boot/loader/entries/*.conf 2>/dev/null &&
|
||||
! grep -q 'initrd /boot/' /os/boot/loader/entries/*.conf; then
|
||||
@ -5041,7 +5041,7 @@ trans() {
|
||||
create_part
|
||||
download_qcow
|
||||
case "$distro" in
|
||||
centos | alma | rocky | oracle | redhat | anolis | opencloudos | openeuler)
|
||||
centos | almalinux | rocky | oracle | redhat | anolis | opencloudos | openeuler)
|
||||
# 这几个系统云镜像系统盘是8~9g xfs,而我们的目标是能在5g硬盘上运行,因此改成复制系统文件
|
||||
install_qcow_by_copy
|
||||
;;
|
||||
@ -5096,7 +5096,7 @@ trans() {
|
||||
create_part
|
||||
mount_part_for_iso_installer
|
||||
case "$distro" in
|
||||
centos | alma | rocky | fedora | ubuntu | redhat) install_redhat_ubuntu ;;
|
||||
centos | almalinux | rocky | fedora | ubuntu | redhat) install_redhat_ubuntu ;;
|
||||
windows) install_windows ;;
|
||||
esac
|
||||
;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user