core: 添加 reset 模式取消重装

This commit is contained in:
bin456789
2026-03-10 00:09:05 +08:00
parent ca11ab5ef8
commit c784479408
4 changed files with 557 additions and 312 deletions

View File

@ -39,6 +39,8 @@ jobs:
${{ matrix.command }} dd --img=https://download.opensuse.org/tumbleweed/appliances/openSUSE-MicroOS.x86_64-SelfInstall.raw.xz
${{ matrix.command }} windows --image-name='Windows Server blah' --iso https://aka.ms/HCIReleaseImage
${{ matrix.command }} reset
# 测试失败例子
# ${{ matrix.command }} wrong-os
# ${{ matrix.command }} dd --img=https://github.com/

View File

@ -38,6 +38,7 @@ If this helped you, you can buy me a milk tea.
- [Feature 3. One-click reboot to Alpine Live OS](#feature-3-reboot-to--alpine-live-os)
- [Feature 4. One-click reboot to netboot.xyz](#feature-4-reboot-to--netbootxyz)
- [Feature 5. One-click reinstallation to Windows](#feature-5-install--windows-iso)
- [Cancel the reinstallation](#cancel-the-reinstallation)
## System Requirements
@ -144,7 +145,7 @@ certutil -urlcache -f -split https://cnb.cool/bin456789/reinstall/-/git/raw/main
>
> This feature will erase **the entire hard disk** of the current system (including other partitions)!
>
> Data is priceless — please think twice before proceeding!
> If the script was run by mistake, you can run `bash reinstall.sh reset` before rebooting to cancel the reinstallation operation.
- Username `root`. The script prompts for a password. If left blank, a random one is generated.
- When installing the latest version, the version number does not need to be specified.
@ -231,7 +232,7 @@ bash reinstall.sh ubuntu --installer
>
> This feature will erase **the entire hard disk** of the current system (including other partitions)!
>
> Data is priceless — please think twice before proceeding!
> If the script was run by mistake, you can run `bash reinstall.sh reset` before rebooting to cancel the reinstallation operation.
- Supports `raw` and fixed-size `vhd` image formats. Either uncompressed or compressed as `.gz`, `.xz`, `.zst`, `.tar`, `.tar.gz`, `.tar.xz`, `.tar.zst`.
- When deploy a Windows image, the system disk will be automatically expanded, and machines with a static IP will have their IP configured, and may take a few minutes after the first boot for the configuration to take effect.
@ -324,7 +325,7 @@ bash reinstall.sh netboot.xyz
>
> This feature will erase **the entire hard disk** of the current system (including other partitions)!
>
> Data is priceless — please think twice before proceeding!
> If the script was run by mistake, you can run `bash reinstall.sh reset` before rebooting to cancel the reinstallation operation.
- Username `administrator`. The script prompts for a password. If left blank, a random one is generated.
- If remote login fails, try using the username `.\administrator`.
@ -555,6 +556,15 @@ During the installation process, you might encounter a black screen, and the ser
| ❔ | Oracle Cloud | A1.Flex | Installation success is not guaranteed; newer instances are more likely to succeed. |
| ❌ | Google Cloud | t2a | Missing network card drivers |
### Cancel the reinstallation
- If the script was run by mistake, you can run this command to cancel the reinstallation operation.
- Must be run before rebooting.
```bash
bash reinstall.sh reset
```
## Parameter Format
### --ssh-key

View File

@ -38,6 +38,7 @@
- [功能 3. 一键引导到 Alpine Live OS 内存系统](#功能-3-重启到--alpine-live-os内存系统)
- [功能 4. 一键引导到 netboot.xyz](#功能-4-重启到--netbootxyz)
- [功能 5. 一键重装到 Windows](#功能-5-安装--windows-iso)
- [取消重装](#取消重装)
## 系统要求
@ -144,7 +145,7 @@ certutil -urlcache -f -split https://cnb.cool/bin456789/reinstall/-/git/raw/main
>
> 此功能会清除当前系统**整个硬盘**的全部数据(包含其它分区)!
>
> 数据无价,请三思而后行!
> 如果不小心运行了脚本,可以在重启前运行 `bash reinstall.sh reset` 取消重装
- 用户名为 `root`,脚本会提示输入密码,不输入则使用随机密码
- 安装最新版可不输入版本号
@ -231,7 +232,7 @@ bash reinstall.sh ubuntu --installer
>
> 此功能会清除当前系统**整个硬盘**的全部数据(包含其它分区)!
>
> 数据无价,请三思而后行!
> 如果不小心运行了脚本,可以在重启前运行 `bash reinstall.sh reset` 取消重装
- 支持 `raw` 和固定大小的 `vhd` 镜像。未压缩或者压缩成 `.gz` `.xz` `.zst` `.tar` `.tar.gz` `.tar.xz` `.tar.zst`
- DD Windows 镜像时,会自动扩展系统盘,静态 IP 的机器会配置好 IP可能首次开机几分钟后才生效
@ -324,7 +325,7 @@ bash reinstall.sh netboot.xyz
>
> 此功能会清除当前系统**整个硬盘**的全部数据(包含其它分区)!
>
> 数据无价,请三思而后行!
> 如果不小心运行了脚本,可以在重启前运行 `bash reinstall.sh reset` 取消重装
- 用户名为 `administrator`,脚本会提示输入密码,不输入则使用随机密码
- 如果远程登录失败,可以尝试使用用户名 `.\administrator`
@ -555,6 +556,15 @@ Windows Server 2025 SERVERDATACENTER
| ❔ | 甲骨文云 | A1.Flex | 不一定能安装成功,越新创建的实例越容易成功 |
| ❌ | 谷歌云 | t2a | 缺少网卡驱动 |
### 取消重装
- 如果不小心运行了脚本,可以运行以下命令取消重装
- 需要在重启前运行
```bash
bash reinstall.sh reset
```
## 参数格式
### --ssh-key

File diff suppressed because it is too large Load Diff