mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
取消模式选择
This commit is contained in:
parent
8c4d422e53
commit
6ac1feb025
17
.github/workflows/run_reinstall.yml
vendored
17
.github/workflows/run_reinstall.yml
vendored
@ -24,25 +24,18 @@ jobs:
|
|||||||
- run: |
|
- run: |
|
||||||
${{ matrix.command }} centos 7
|
${{ matrix.command }} centos 7
|
||||||
${{ matrix.command }} alma-8
|
${{ matrix.command }} alma-8
|
||||||
${{ matrix.command }} rocky 8
|
${{ matrix.command }} rocky 9
|
||||||
${{ matrix.command }} fedora
|
${{ matrix.command }} fedora
|
||||||
${{ matrix.command }} ubuntu
|
${{ matrix.command }} ubuntu
|
||||||
${{ matrix.command }} debian 12
|
${{ matrix.command }} debian
|
||||||
${{ matrix.command }} alpine
|
${{ matrix.command }} alpine
|
||||||
${{ matrix.command }} netboot.xyz
|
|
||||||
${{ matrix.command }} dd --img=https://download.opensuse.org/tumbleweed/appliances/openSUSE-MicroOS.x86_64-SelfInstall.raw.xz
|
|
||||||
|
|
||||||
# 测试 cloud image
|
|
||||||
${{ matrix.command }} centos --ci
|
|
||||||
${{ matrix.command }} alma --ci
|
|
||||||
${{ matrix.command }} rocky --ci
|
|
||||||
${{ matrix.command }} fedora-40 --ci
|
|
||||||
${{ matrix.command }} ubuntu 22.04 --ci
|
|
||||||
${{ matrix.command }} debian --ci
|
|
||||||
${{ matrix.command }} opensuse
|
${{ matrix.command }} opensuse
|
||||||
${{ matrix.command }} arch
|
${{ matrix.command }} arch
|
||||||
${{ matrix.command }} gentoo
|
${{ matrix.command }} gentoo
|
||||||
|
|
||||||
|
${{ matrix.command }} netboot.xyz
|
||||||
|
${{ matrix.command }} dd --img=https://download.opensuse.org/tumbleweed/appliances/openSUSE-MicroOS.x86_64-SelfInstall.raw.xz
|
||||||
|
|
||||||
# 测试失败例子
|
# 测试失败例子
|
||||||
# ${{ matrix.command }} wrong-os
|
# ${{ matrix.command }} wrong-os
|
||||||
# ${{ matrix.command }} dd --img=https://github.com/
|
# ${{ matrix.command }} dd --img=https://github.com/
|
||||||
|
18
README.en.md
18
README.en.md
@ -63,9 +63,7 @@ All features can be used on both Linux and Windows.
|
|||||||
|
|
||||||
### Feature 1: Install Linux
|
### Feature 1: Install Linux
|
||||||
|
|
||||||
- The parameter --ci indicates forced usage of the cloud image for installation.
|
- If no version number is entered, the latest version will be installed.
|
||||||
- Machines with static IP installing CentOS, Alma, Rocky, Fedora, Ubuntu must include the parameter `--ci`.
|
|
||||||
- If it is uncertain whether the machine has a static or dynamic IP, you can also add the parameter `--ci`.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash reinstall.sh centos 7|8|9 (8|9 for the stream version)
|
bash reinstall.sh centos 7|8|9 (8|9 for the stream version)
|
||||||
@ -78,14 +76,6 @@ bash reinstall.sh centos 7|8|9 (8|9 for the stream version)
|
|||||||
alpine 3.16|3.17|3.18|3.19
|
alpine 3.16|3.17|3.18|3.19
|
||||||
arch
|
arch
|
||||||
gentoo
|
gentoo
|
||||||
|
|
||||||
If no version number is entered, the latest version will be installed.
|
|
||||||
```
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
--ci Force the use of the cloud image
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Feature 2: DD
|
### Feature 2: DD
|
||||||
@ -192,11 +182,11 @@ Use `Dism++` File menu > Open Image File, select the iso to be installed to get
|
|||||||
|
|
||||||
| System | Traditional Installation | Cloud Image |
|
| System | Traditional Installation | Cloud Image |
|
||||||
| ------------------------------------- | ------------------------ | ----------- |
|
| ------------------------------------- | ------------------------ | ----------- |
|
||||||
| Debian | 256M | 512M |
|
| CentOS / Alma / Rocky | - | 512M |
|
||||||
| Ubuntu | 1G | 512M |
|
|
||||||
| CentOS / Alma / Rocky | 1G | 512M |
|
|
||||||
| Fedora | - | 512M |
|
| Fedora | - | 512M |
|
||||||
| openSUSE | - | 512M |
|
| openSUSE | - | 512M |
|
||||||
|
| Ubuntu | - | 512M |
|
||||||
|
| Debian | 256M | |
|
||||||
| Alpine | 256M | - |
|
| Alpine | 256M | - |
|
||||||
| Arch | 512M | - |
|
| Arch | 512M | - |
|
||||||
| Gentoo | 512M | - |
|
| Gentoo | 512M | - |
|
||||||
|
18
README.md
18
README.md
@ -63,9 +63,7 @@ certutil -urlcache -f -split https://mirror.ghproxy.com/https://raw.githubuserco
|
|||||||
|
|
||||||
### 功能 1: 安装 Linux
|
### 功能 1: 安装 Linux
|
||||||
|
|
||||||
- 参数 `--ci` 表示强制使用云镜像安装
|
- 不输入版本号,则安装最新版
|
||||||
- 静态 IP 的机器安装 CentOS、Alma、Rocky、Fedora、Ubuntu,必须使用 `--ci` 参数
|
|
||||||
- 如果不清楚机器是静态 IP 还是动态 IP,也可使用 `--ci`
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash reinstall.sh centos 7|8|9 (8|9 为 stream 版本)
|
bash reinstall.sh centos 7|8|9 (8|9 为 stream 版本)
|
||||||
@ -78,14 +76,6 @@ bash reinstall.sh centos 7|8|9 (8|9 为 stream 版本)
|
|||||||
alpine 3.16|3.17|3.18|3.19
|
alpine 3.16|3.17|3.18|3.19
|
||||||
arch
|
arch
|
||||||
gentoo
|
gentoo
|
||||||
|
|
||||||
不输入版本号,则安装最新版
|
|
||||||
```
|
|
||||||
|
|
||||||
参数:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
--ci 强制使用云镜像
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 功能 2: DD
|
### 功能 2: DD
|
||||||
@ -192,11 +182,11 @@ Windows Server 2022 SERVERDATACENTER
|
|||||||
|
|
||||||
| 系统 | 传统安装 | 云镜像 |
|
| 系统 | 传统安装 | 云镜像 |
|
||||||
| ----------------------------------- | -------- | ------ |
|
| ----------------------------------- | -------- | ------ |
|
||||||
| Debian | 256M | 512M |
|
| CentOS / Alma / Rocky | - | 512M |
|
||||||
| Ubuntu | 1G | 512M |
|
|
||||||
| CentOS / Alma / Rocky | 1G | 512M |
|
|
||||||
| Fedora | - | 512M |
|
| Fedora | - | 512M |
|
||||||
| openSUSE | - | 512M |
|
| openSUSE | - | 512M |
|
||||||
|
| Ubuntu | - | 512M |
|
||||||
|
| Debian | 256M | - |
|
||||||
| Alpine | 256M | - |
|
| Alpine | 256M | - |
|
||||||
| Arch | 512M | - |
|
| Arch | 512M | - |
|
||||||
| Gentoo | 512M | - |
|
| Gentoo | 512M | - |
|
||||||
|
14
reinstall.sh
14
reinstall.sh
@ -1266,7 +1266,8 @@ check_ram() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ram_cloud_image=512
|
# 未测试
|
||||||
|
ram_cloud_image=256
|
||||||
|
|
||||||
has_cloud_image=$(
|
has_cloud_image=$(
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
@ -2266,6 +2267,9 @@ mod_initrd() {
|
|||||||
|
|
||||||
mod_initrd_$nextos_distro
|
mod_initrd_$nextos_distro
|
||||||
|
|
||||||
|
# 显示精简前的大小
|
||||||
|
du -sh .
|
||||||
|
|
||||||
# 删除 initrd 里面没用的文件/驱动
|
# 删除 initrd 里面没用的文件/驱动
|
||||||
if is_virt && ! is_alpine_live; then
|
if is_virt && ! is_alpine_live; then
|
||||||
rm -rf bin/brltty
|
rm -rf bin/brltty
|
||||||
@ -2313,6 +2317,9 @@ mod_initrd() {
|
|||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 显示精简后的大小
|
||||||
|
du -sh .
|
||||||
|
|
||||||
# 重建
|
# 重建
|
||||||
# 注意要用 cpio -H newc 不要用 cpio -c ,不同版本的 -c 作用不一样,很坑
|
# 注意要用 cpio -H newc 不要用 cpio -c ,不同版本的 -c 作用不一样,很坑
|
||||||
# -c Use the old portable (ASCII) archive format
|
# -c Use the old portable (ASCII) archive format
|
||||||
@ -2321,7 +2328,6 @@ mod_initrd() {
|
|||||||
# (ASCII) archive format, use "-H odc" instead.
|
# (ASCII) archive format, use "-H odc" instead.
|
||||||
find . | cpio --quiet -o -H newc | gzip -1 >/reinstall-initrd
|
find . | cpio --quiet -o -H newc | gzip -1 >/reinstall-initrd
|
||||||
cd - >/dev/null
|
cd - >/dev/null
|
||||||
ls -lh /reinstall-initrd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# 脚本入口
|
# 脚本入口
|
||||||
@ -2426,13 +2432,13 @@ mkdir -p "$tmp"
|
|||||||
|
|
||||||
# 强制忽略/强制添加 --ci 参数
|
# 强制忽略/强制添加 --ci 参数
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
dd | windows | netboot.xyz | alpine | arch | gentoo)
|
dd | windows | netboot.xyz | debian | alpine | arch | gentoo)
|
||||||
if is_use_cloud_image; then
|
if is_use_cloud_image; then
|
||||||
echo "ignored --ci"
|
echo "ignored --ci"
|
||||||
cloud_image=0
|
cloud_image=0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
fedora | opensuse)
|
centos | alma | rocky | ubuntu | fedora | opensuse)
|
||||||
cloud_image=1
|
cloud_image=1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
x
Reference in New Issue
Block a user