Compare commits

...

22 Commits

Author SHA1 Message Date
2d676731bb windows: 修复 frpc 无法启动
fixes #589
2026-03-29 17:01:44 +08:00
93e83dfc58 nixos: 在使用DHCP的时候显式设置useDHCP=true; (#587) 2026-03-26 22:02:19 +08:00
e93d71680c fnos: 用 parted 创建系统分区时,末端设为 100%,安装系统后再缩小
解决系统盘设为 8G 时空间不足 #585
2026-03-26 21:01:25 +08:00
f0fc83a060 windows: 对初始系统为 linux 的 aws xen 实例使用旧版本驱动
否则安装 ws2022/ws2025 时会 IRQL_NOT_LESS_OR_EQUAL 蓝屏
2026-03-24 19:17:16 +08:00
07d8018db3 core: 精确地按编号选择分区
避免同时有 mmcblk0p1 和 mmcblk0boot1 时导致错误
fixes #581
2026-03-24 13:16:38 +08:00
e104735538 core: 使用 fedora 的 grub efi
关联 #577
2026-03-17 11:33:48 +08:00
43e226cc5c windows: 移除旧版本系统的 iso 查找
massgrave 网站移除了旧版系统的 Iso
2026-03-16 22:50:42 +08:00
c6000c16ab core: 修复在 windows 下打包 initramfs 时, 修改了 rdisc6 的 owner 导致 rdisc6 无法运行
造成 ipv6 统一配置成静态

> rdisc6 ens5
Raw IPv6 socket: Operation not permitted

> ls -l /usr/bin/rdisc6
-rwsr-xr-x 1 197108 197121 26648 Jan 14 2024 /usr/bin/rdisc6
2026-03-15 23:43:52 +08:00
8dd873d7dd core: 将 grep --text 改成 -a
避免脚本早期运行时在 alpine 下报错
2026-03-15 23:32:51 +08:00
41c4df9fdb windows: 修复 image-name 有特殊符号时出错
fixes #575
2026-03-15 17:19:22 +08:00
f0b3a475fc windows: 修复 iso 里面文件大小写引起的引导问题
1. iso 里面的 boot 文件夹字母不是全小写,导致用 grub-install --boot-directory=/os/boot 安装后无法从 boot 文件夹读取模块
2. iso 里面的 boot bootmgr 的 boot 大小写不一致导致没有复制 bootmgr

fixes #568
2026-03-10 01:07:20 +08:00
5e2f46444c fnos: 允许指定 iso 链接
fixes #567
2026-03-10 01:06:10 +08:00
c784479408 core: 添加 reset 模式取消重装 2026-03-10 00:09:05 +08:00
ca11ab5ef8 core: 不重要的更改 2026-03-10 00:09:05 +08:00
2c6b28108a core: 支持 frpc.ini 2026-03-08 23:50:50 +08:00
28119bb0c5 windows: 对旧版本 windows 使用旧版 frpc 2026-03-08 23:50:50 +08:00
53e699fa11 windows: 更准确地下载 vmd 驱动版本 2026-03-08 23:50:50 +08:00
b2f2927c4e windows: 用 winload.exe/efi 版本号判断 vista/win7 是否支持 sha256 2026-03-08 23:50:49 +08:00
13e3155d02 windows: 只从注册表获取系统版本号 2026-03-08 23:50:49 +08:00
5b1b9103f4 windows: 支持 install.swm 2026-03-08 23:50:49 +08:00
5b0d91c633 fix: select correct primary IPv6 address whose subnet contains the gateway (#561)
* fix: select correct primary IPv6 address whose subnet contains the gateway

When a system has multiple IPv6 addresses with different prefix lengths
(e.g., /44 and /96), the script previously selected the first address
as primary regardless of whether its subnet contained the default gateway.
This caused the gateway to be unreachable after reinstallation.

This change:
- Adds pure shell expand_ipv6 and ip_addr_contains_gw functions to
  determine which IPv6 subnet contains the gateway (no python dependency)
- Modifies collect_netconf to select the correct primary IPv6 address
- Stores remaining addresses as ipv6_extra_addrs
- Adds extra IPv6 addresses via post-up in create_ifupdown_config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: address review feedback for IPv6 extra addrs and edge cases

- Pass ipv6_extra_addrs through initrd-network.sh (receive as $7,
  add extra addresses in add_missing_ipv6_config, write to netconf)
  so that trans.sh can read them via get_netconf_to
- Fix cut -c1-0 error when prefix_len < 4 in ip_addr_contains_gw
- Use grep -Fxve for exact string matching instead of regex

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: use subshell for IFS modification to avoid leaking to outer scope

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: avoid global IFS modification when iterating extra IPv6 addresses

Replace subshell IFS trick with tr+while read to split comma-separated
ipv6_extra_addrs, avoiding any modification of the IFS variable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: use ip route get instead of subnet matching for IPv6 primary address selection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:17:59 +08:00
ecacaab103 gentoo: 修复运行 getuto 时找不到 ebegin
fixes #566
2026-03-07 23:19:00 +08:00
11 changed files with 1180 additions and 670 deletions

View File

@ -23,3 +23,6 @@ charset = utf-8-bom
[*.{yml,yaml}]
indent_size = 2
[reinstall.sh]
shell_variant = bash

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.
@ -181,7 +182,7 @@ bash reinstall.sh anolis 7|8|23
- `--ssh-key KEY` Set up SSH login public key, [formatted as follows](#--ssh-key). When using public key, password is empty.
- `--ssh-port PORT` Change the SSH port (for log observation during installation and for the new system)
- `--web-port PORT` Change the Web port (for log observation during installation only)
- `--frpc-toml PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL
- `--frpc-config PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL of the configuration file.
- `--hold 1` Reboot only into install environment, without running installer, only for SSH connect to test network connection.
- `--hold 2` Prevent reboot after installation completes, allowing SSH login to modify system content; the system is mounted at `/target` for Debian/Kali and `/os` for other distros.
@ -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.
@ -247,7 +248,7 @@ bash reinstall.sh dd --img "https://example.com/xxx.xz"
- `--rdp-port PORT` Change RDP port (DD Windows only)
- `--ssh-port PORT` Change SSH port (for log observation during installation)
- `--web-port PORT` Change Web port (for log observation during installation)
- `--frpc-toml PATH` Add frpc for intranet tunneling (DD Windows only). Parameter can be local filepath or HTTP URL
- `--frpc-config PATH` Add frpc for intranet tunneling (DD Windows only). Parameter can be local filepath or HTTP URL of the configuration file.
- `--cloud-data PATH_OR_URL` Inject cloud-init NoCloud configuration into the DD'd Linux image (DD Linux only)
- `--hold 1` Reboot only into install environment, without running installer, only for SSH connect to test network connection.
- `--hold 2` Prevent reboot after the DD process finishes. For SSH login to modify system content. The Windows system will be mounted at `/os`, but Linux systems will **NOT** be automatically mounted.
@ -298,7 +299,7 @@ bash reinstall.sh alpine --hold 1
- `--password PASSWORD` Set password
- `--ssh-port PORT` Change SSH port
- `--ssh-key KEY` Set up SSH login public key, [formatted as follows](#--ssh-key). When using public key, password is empty.
- `--frpc-toml PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL
- `--frpc-config PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL of the configuration file.
### Feature 4: Reboot to <img width="16" height="16" src="https://netboot.xyz/img/favicon.ico" /> netboot.xyz
@ -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`.
@ -336,15 +337,15 @@ bash reinstall.sh netboot.xyz
- Windows (Vista ~ 11)
- Windows Server (2008 ~ 2025)
- Windows Server Essentials \*
- Windows Server (Semi) Annual Channel \*
- Hyper-V Server \*
- Azure Local (Azure Stack HCI) \*
- Windows Server Essentials
- Windows Server (Semi) Annual Channel
- Hyper-V Server
- Azure Local (Azure Stack HCI)
#### Method 1: Let the Script Automatically Search for ISO
- The script will search for ISOs from <https://massgrave.dev/genuine-installation-media>, a site that collects official ISOs.
- Systems marked with \* do not support automatic ISO searching.
- Only supports ISOs searching for Windows 10, 11, Server 2019, 2022, 2025.
```bash
bash reinstall.sh windows \
@ -453,7 +454,7 @@ bash reinstall.sh windows \
- `--add-driver INF_OR_DIR` Add additional driver, specifying .inf path, or the folder contains .inf file.
- The driver must be downloaded to current system first.
- This parameter can be set multiple times to add different driver.
- `--frpc-toml PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL
- `--frpc-config PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL of the configuration file.
- `--hold 1` Reboot only into install environment, without running installer, only for SSH connect to test network connection.
- `--hold 2` Allow SSH connections for modifying `boot.wim`, `install.wim` or other contents before rebooting into the official Windows installation program, with the disk mounted at `/os`.
@ -464,7 +465,7 @@ bash reinstall.sh windows \
- AWS ([ENA Network Adapter][aws-ena], [NVME Storage Controller][aws-nvme])
- GCP ([gVNIC Network Adapter][gcp-gvnic], [GGA Display Adapter][gcp-gga])
- Azure ([MANA Network Adapter][azure-mana])
- Intel ([VMD Storage Controller][intel-vmd], Network Adapter: [7][intel-nic-7], [8][intel-nic-8], [8.1][intel-nic-8.1], [10][intel-nic-10], [11][intel-nic-11], [2008 R2][intel-nic-2008-r2], [2012][intel-nic-2012], [2012 R2][intel-nic-2012-r2], [2016][intel-nic-2016], [2019][intel-nic-2019], [2022][intel-nic-2022], [2025][intel-nic-2025])
- Intel (VMD Storage Controller: [11th Gen Core][intel-vmd-gen11], [12th-15th Gen Core][intel-vmd-gen12-to-gen15], Network Adapter: [7][intel-nic-7], [8.x][intel-nic-8.1], [10][intel-nic-10], [11][intel-nic-11], [2008 R2][intel-nic-7], [2012][intel-nic-2012], [2012 R2][intel-nic-2012-r2], [2016][intel-nic-2016], [2019][intel-nic-2019], [2022][intel-nic-2022], [2025][intel-nic-2025])
[virtio-virtio]: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/
[virtio-aliyun]: https://www.alibabacloud.com/help/ecs/user-guide/install-the-virtio-driver-1
@ -478,13 +479,12 @@ bash reinstall.sh windows \
[gcp-gvnic]: https://cloud.google.com/compute/docs/networking/using-gvnic
[gcp-gga]: https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display
[azure-mana]: https://learn.microsoft.com/azure/virtual-network/accelerated-networking-mana-windows
[intel-vmd]: https://www.intel.com/content/www/us/en/download/849936/intel-rapid-storage-technology-driver-installation-software-with-intel-optane-memory-12th-to-15th-gen-platforms.html
[intel-vmd-gen11]: https://www.intel.com/content/www/us/en/download/849933/intel-rapid-storage-technology-driver-installation-software-with-intel-optane-memory-12th-to-13th-gen-platforms.html
[intel-vmd-gen12-to-gen15]: https://www.intel.com/content/www/us/en/download/849936/intel-rapid-storage-technology-driver-installation-software-with-intel-optane-memory-12th-to-15th-gen-platforms.html
[intel-nic-7]: https://www.intel.com/content/www/us/en/download/15590/intel-network-adapter-driver-for-windows-7-final-release.html
[intel-nic-8]: https://web.archive.org/web/20250501043104/https://www.intel.com/content/www/us/en/download/16765/intel-network-adapter-driver-for-windows-8-final-release.html
[intel-nic-8.1]: https://www.intel.com/content/www/us/en/download/17479/intel-network-adapter-driver-for-windows-8-1.html
[intel-nic-10]: https://www.intel.com/content/www/us/en/download/18293/intel-network-adapter-driver-for-windows-10.html
[intel-nic-11]: https://www.intel.com/content/www/us/en/download/727998/intel-network-adapter-driver-for-microsoft-windows-11.html
[intel-nic-2008-r2]: https://web.archive.org/web/20250501002542/https://www.intel.com/content/www/us/en/download/15591/intel-network-adapter-driver-for-windows-server-2008-r2-final-release.html
[intel-nic-2012]: https://www.intel.com/content/www/us/en/download/16789/intel-network-adapter-driver-for-windows-server-2012.html
[intel-nic-2012-r2]: https://www.intel.com/content/www/us/en/download/17480/intel-network-adapter-driver-for-windows-server-2012-r2.html
[intel-nic-2016]: https://www.intel.com/content/www/us/en/download/18737/intel-network-adapter-driver-for-windows-server-2016.html
@ -547,27 +547,23 @@ Most ARM machines support installing latest Windows 11.
During the installation process, you might encounter a black screen, and the serial console may display `ConvertPages: failed to find range`, but neither issue affects the installation.
| Compatibility | Cloud Provider | Instance Type | Issues |
| ------------- | -------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ------------- | -------------- | ----------------------- | ----------------------------------------------------------------------------------- |
| ✔️ | Azure | B2pts_v2 | |
| ✔️ | Alibaba Cloud | g6r, c6r | |
| ✔️ | Alibaba Cloud | g8y, c8y, r8y | There is a chance of hanging at the boot logo during restart; forced reboot will resolve it. |
| ✔️ | AWS | T4g | |
| ✔️ | Scaleway | COPARM1 | |
| ✔️ | Gcore | | |
| ❔ | Oracle Cloud | A1.Flex | Installation success is not guaranteed; newer instances are more likely to succeed.<br />Manual loading of GPU drivers is required after installation. |
| ❔ | Alibaba Cloud | g6r, c6r, g8y, c8y, r8y | Might hanging at the boot logo during restart; forced reboot will resolve it. |
| ❔ | Oracle Cloud | A1.Flex | Installation success is not guaranteed; newer instances are more likely to succeed. |
| ❌ | Google Cloud | t2a | Missing network card drivers |
<details>
### Cancel the reinstallation
<summary>Loading Graphics Driver on Oracle Cloud</summary>
- If the script was run by mistake, you can run this command to cancel the reinstallation operation.
- Must be run before rebooting.
Log in to the server using Remote Desktop, open Device Manager, locate the graphics card, select "Update Driver," and choose `Red Hat VirtIO GPU DOD controller` from the list. There's no need to download the drivers in advance.
![virtio-gpu-1](https://github.com/user-attachments/assets/503e1d82-4fa9-4486-917e-73326ad7c988)
![virtio-gpu-2](https://github.com/user-attachments/assets/bf3a9af6-13d8-4f93-9d6c-d3b2dbddb37d)
![virtio-gpu-3](https://github.com/user-attachments/assets/a9006a78-838f-45bf-a556-2dba193d3c03)
</details>
```bash
bash reinstall.sh reset
```
## Parameter Format

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`,脚本会提示输入密码,不输入则使用随机密码
- 安装最新版可不输入版本号
@ -181,7 +182,7 @@ bash reinstall.sh anolis 7|8|23
- `--ssh-key KEY` 设置 SSH 登录公钥,[格式如下](#--ssh-key)。当使用公钥时,密码为空
- `--ssh-port PORT` 修改 SSH 端口(安装期间观察日志用,也作用于新系统)
- `--web-port PORT` 修改 Web 端口(安装期间观察日志用)
- `--frpc-toml PATH` 添加 frpc 内网穿透,参数填本地路径或 HTTP 链接
- `--frpc-config PATH` 添加 frpc 内网穿透,参数填配置文件的本地路径或 HTTP 链接
- `--hold 1` 仅重启到安装环境,不运行安装,用于 SSH 登录验证网络连通性
- `--hold 2` 安装结束后不重启,用于 SSH 登录修改系统内容Debian/Kali 会挂载在 `/target`,其它系统会挂载在 `/os`
@ -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可能首次开机几分钟后才生效
@ -247,7 +248,7 @@ bash reinstall.sh dd --img "https://example.com/xxx.xz"
- `--rdp-port PORT` 修改 RDP 端口 (仅限 DD Windows)
- `--ssh-port PORT` 修改 SSH 端口(安装期间观察日志用)
- `--web-port PORT` 修改 Web 端口(安装期间观察日志用)
- `--frpc-toml PATH` 添加 frpc 内网穿透(仅限 DD Windows参数填本地路径或 HTTP 链接
- `--frpc-config PATH` 添加 frpc 内网穿透(仅限 DD Windows参数填配置文件的本地路径或 HTTP 链接
- `--cloud-data PATH_OR_URL` 为 DD Linux 镜像注入 cloud-init NoCloud 配置(仅限 DD Linux
- `--hold 1` 仅重启到安装环境,不运行安装,用于 SSH 登录验证网络连通性
- `--hold 2` DD 结束后不重启,用于 SSH 登录修改系统内容Windows 系统会挂载在 `/os`Linux 系统**不会**自动挂载
@ -298,7 +299,7 @@ bash reinstall.sh alpine --hold 1
- `--password PASSWORD` 设置密码
- `--ssh-port PORT` 修改 SSH 端口
- `--ssh-key KEY` 设置 SSH 登录公钥,[格式如下](#--ssh-key)。当使用公钥时,密码为空
- `--frpc-toml PATH` 添加 frpc 内网穿透,参数填本地路径或 HTTP 链接
- `--frpc-config PATH` 添加 frpc 内网穿透,参数填配置文件的本地路径或 HTTP 链接
### 功能 4: 重启到 <img width="16" height="16" src="https://netboot.xyz/img/favicon.ico" /> netboot.xyz
@ -324,7 +325,7 @@ bash reinstall.sh netboot.xyz
>
> 此功能会清除当前系统**整个硬盘**的全部数据(包含其它分区)!
>
> 数据无价,请三思而后行!
> 如果不小心运行了脚本,可以在重启前运行 `bash reinstall.sh reset` 取消重装
- 用户名为 `administrator`,脚本会提示输入密码,不输入则使用随机密码
- 如果远程登录失败,可以尝试使用用户名 `.\administrator`
@ -336,15 +337,15 @@ bash reinstall.sh netboot.xyz
- Windows (Vista ~ 11)
- Windows Server (2008 ~ 2025)
- Windows Server Essentials \*
- Windows Server (Semi) Annual Channel \*
- Hyper-V Server \*
- Azure Local (Azure Stack HCI) \*
- Windows Server Essentials
- Windows Server (Semi) Annual Channel
- Hyper-V Server
- Azure Local (Azure Stack HCI)
#### 方法 1: 让脚本自动查找 ISO
- 脚本会从 <https://massgrave.dev/genuine-installation-media> 查找 ISO该网站专门提供官方 ISO 下载
- 上面带 \* 的系统不支持自动查找 ISO
- 只支持查找 Windows 10, 11, Server 2019, 2022, 2025 的 ISO
```bash
bash reinstall.sh windows \
@ -453,7 +454,7 @@ bash reinstall.sh windows \
- `--add-driver INF_OR_DIR` 添加额外驱动,填写 .inf 路径,或者 .inf 所在的文件夹
- 需先下载驱动到当前系统
- 可多次设置该参数以添加不同的驱动
- `--frpc-toml PATH` 添加 frpc 内网穿透,参数填本地路径或 HTTP 链接
- `--frpc-config PATH` 添加 frpc 内网穿透,参数填配置文件的本地路径或 HTTP 链接
- `--hold 1` 仅重启到安装环境,不运行安装,用于 SSH 登录验证网络连通性
- `--hold 2` 用于在进入 Windows 官方安装程序之前SSH 登录修改 `boot.wim``install.wim` 或者其它内容,硬盘挂载在 `/os`
@ -464,7 +465,7 @@ bash reinstall.sh windows \
- AWS ([ENA 网卡][aws-ena], [NVME 存储控制器][aws-nvme])
- GCP ([gVNIC 网卡][gcp-gvnic], [GGA 显卡][gcp-gga])
- Azure ([MANA 网卡][azure-mana])
- Intel ([VMD 存储控制器][intel-vmd], 网卡: [7][intel-nic-7], [8][intel-nic-8], [8.1][intel-nic-8.1], [10][intel-nic-10], [11][intel-nic-11], [2008 R2][intel-nic-2008-r2], [2012][intel-nic-2012], [2012 R2][intel-nic-2012-r2], [2016][intel-nic-2016], [2019][intel-nic-2019], [2022][intel-nic-2022], [2025][intel-nic-2025])
- Intel (VMD 存储控制器: [11代酷睿][intel-vmd-gen11], [12-15代酷睿][intel-vmd-gen12-to-gen15], 网卡: [7][intel-nic-7], [8.x][intel-nic-8.1], [10][intel-nic-10], [11][intel-nic-11], [2008 R2][intel-nic-7], [2012][intel-nic-2012], [2012 R2][intel-nic-2012-r2], [2016][intel-nic-2016], [2019][intel-nic-2019], [2022][intel-nic-2022], [2025][intel-nic-2025])
[virtio-virtio]: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/
[virtio-aliyun]: https://www.alibabacloud.com/help/ecs/user-guide/install-the-virtio-driver-1
@ -478,13 +479,12 @@ bash reinstall.sh windows \
[gcp-gvnic]: https://cloud.google.com/compute/docs/networking/using-gvnic
[gcp-gga]: https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display
[azure-mana]: https://learn.microsoft.com/azure/virtual-network/accelerated-networking-mana-windows
[intel-vmd]: https://www.intel.com/content/www/us/en/download/849936/intel-rapid-storage-technology-driver-installation-software-with-intel-optane-memory-12th-to-15th-gen-platforms.html
[intel-vmd-gen11]: https://www.intel.com/content/www/us/en/download/849933/intel-rapid-storage-technology-driver-installation-software-with-intel-optane-memory-12th-to-13th-gen-platforms.html
[intel-vmd-gen12-to-gen15]: https://www.intel.com/content/www/us/en/download/849936/intel-rapid-storage-technology-driver-installation-software-with-intel-optane-memory-12th-to-15th-gen-platforms.html
[intel-nic-7]: https://www.intel.com/content/www/us/en/download/15590/intel-network-adapter-driver-for-windows-7-final-release.html
[intel-nic-8]: https://web.archive.org/web/20250501043104/https://www.intel.com/content/www/us/en/download/16765/intel-network-adapter-driver-for-windows-8-final-release.html
[intel-nic-8.1]: https://www.intel.com/content/www/us/en/download/17479/intel-network-adapter-driver-for-windows-8-1.html
[intel-nic-10]: https://www.intel.com/content/www/us/en/download/18293/intel-network-adapter-driver-for-windows-10.html
[intel-nic-11]: https://www.intel.com/content/www/us/en/download/727998/intel-network-adapter-driver-for-microsoft-windows-11.html
[intel-nic-2008-r2]: https://web.archive.org/web/20250501002542/https://www.intel.com/content/www/us/en/download/15591/intel-network-adapter-driver-for-windows-server-2008-r2-final-release.html
[intel-nic-2012]: https://www.intel.com/content/www/us/en/download/16789/intel-network-adapter-driver-for-windows-server-2012.html
[intel-nic-2012-r2]: https://www.intel.com/content/www/us/en/download/17480/intel-network-adapter-driver-for-windows-server-2012-r2.html
[intel-nic-2016]: https://www.intel.com/content/www/us/en/download/18737/intel-network-adapter-driver-for-windows-server-2016.html
@ -547,27 +547,23 @@ Windows Server 2025 SERVERDATACENTER
安装过程可能会黑屏,串行控制台可能会显示 `ConvertPages: failed to find range`,均不影响正常安装
| 兼容性 | 云服务商 | 实例类型 | 问题 |
| ------ | -------- | ------------- | ---------------------------------------------------------------------------- |
| ------ | -------- | ----------------------- | ------------------------------------------ |
| ✔️ | Azure | B2pts_v2 | |
| ✔️ | 阿里云 | g6r, c6r | |
| ✔️ | 阿里云 | g8y, c8y, r8y | 有几率重启时卡开机 Logo强制重启即可 |
| ✔️ | AWS | T4g | |
| ✔️ | Scaleway | COPARM1 | |
| ✔️ | Gcore | | |
| ❔ | 甲骨文云 | A1.Flex | 不一定能安装成功,越新创建的实例越容易成功<br />安装后还需要手动加载显卡驱动 |
| ❔ | 阿里云 | g6r, c6r, g8y, c8y, r8y | 有几率重启时卡开机 Logo强制重启即可 |
| ❔ | 甲骨文云 | A1.Flex | 不一定能安装成功,越新创建的实例越容易成功 |
| ❌ | 谷歌云 | t2a | 缺少网卡驱动 |
<details>
### 取消重装
<summary>甲骨文云加载显卡驱动</summary>
- 如果不小心运行了脚本,可以运行以下命令取消重装
- 需要在重启前运行
使用远程桌面登录到服务器,打开设备管理器,找到显卡,选择更新驱动,在列表中选择 `Red Hat VirtIO GPU DOD controller` 即可。不需要提前下载驱动。
![virtio-gpu-1](https://github.com/user-attachments/assets/503e1d82-4fa9-4486-917e-73326ad7c988)
![virtio-gpu-2](https://github.com/user-attachments/assets/bf3a9af6-13d8-4f93-9d6c-d3b2dbddb37d)
![virtio-gpu-3](https://github.com/user-attachments/assets/a9006a78-838f-45bf-a556-2dba193d3c03)
</details>
```bash
bash reinstall.sh reset
```
## 参数格式

View File

@ -206,7 +206,7 @@ d-i preseed/early_command string true; \
ssh-keygen -A; \
run_as_service_with_screen /usr/sbin/sshd -D; \
if [ -s /configs/frpc.toml ]; then \
if ls /configs/frpc.* >/dev/null 2>&1; then \
url=$(sh /get-frpc-url.sh linux); \
mkdir -p /usr/local/bin; \
mkdir -p /usr/local/etc/frpc; \
@ -217,8 +217,8 @@ d-i preseed/early_command string true; \
sleep 5; \
done; \
chmod a+x /usr/local/bin/frpc; \
cp /configs/frpc.toml /usr/local/etc/frpc/; \
run_as_service_with_screen /usr/local/bin/frpc -c /usr/local/etc/frpc/frpc.toml; \
cp /configs/frpc.* /usr/local/etc/frpc/; \
run_as_service_with_screen /usr/local/bin/frpc -c /usr/local/etc/frpc/frpc.*; \
fi; \
if [ -d /cdrom/simple-cdd ]; then \
@ -296,11 +296,11 @@ d-i preseed/late_command string true; \
echo "Port $ssh_port" >>/target/etc/ssh/sshd_config; \
fi; \
if [ -s /configs/frpc.toml ]; then \
if ls /configs/frpc.* >/dev/null 2>&1; then \
mkdir -p /target/usr/local/bin; \
mkdir -p /target/usr/local/etc/frpc; \
cp /usr/local/bin/frpc /target/usr/local/bin/; \
cp /usr/local/etc/frpc/frpc.toml /target/usr/local/etc/frpc/; \
cp /usr/local/etc/frpc/frpc.* /target/usr/local/etc/frpc/; \
chmod a+x /target/usr/local/bin/frpc; \
cp /frpc.service /target/etc/systemd/system/; \
in-target systemctl enable frpc; \

View File

@ -10,8 +10,8 @@ Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/bin/frpc -c /usr/local/etc/frpc/frpc.toml
ExecReload=/usr/local/bin/frpc reload -c /usr/local/etc/frpc/frpc.toml
ExecStart=/usr/local/bin/frpc -c /usr/local/etc/frpc/frpc.conf
ExecReload=/usr/local/bin/frpc reload -c /usr/local/etc/frpc/frpc.conf
[Install]
WantedBy=multi-user.target

View File

@ -17,14 +17,41 @@ get_frpc_url() {
# 传入 windows 或者 linux
local os_type=$1
local nt_ver=$2
local os_bit=${3:-64}
get_old_version() {
# 脚本不支持安装 32 位 linux 系统,因此不用管
if [ "$os_type" = windows ]; then
# 最早支持 toml 的版本是 0.52.0
# 最后支持 vista 的版本是 0.29.0
# 最后支持 32 位的版本是 0.51.3
# 最后支持 win7 的版本是 0.54.0
case "$os_bit" in
32)
case "$nt_ver" in
6.0) echo 0.29.0 ;; # vista
*) echo 0.51.3 ;; # win7+
esac
;;
64)
case "$nt_ver" in
6.0) echo 0.29.0 ;; # vista
6.1) echo 0.54.0 ;; # win7
# 目前最新版本 v0.66.0 依然可以在 win8 上运行
esac
;;
esac
fi
}
is_need_old_version() {
[ "$nt_ver" = "6.0" ] || [ "$nt_ver" = "6.1" ]
[ -n "$(get_old_version)" ]
}
version=$(
if is_need_old_version; then
echo 0.54.0
get_old_version
else
# debian 11 initrd 没有 xargs awk
# debian 12 initrd 没有 xargs
@ -46,7 +73,7 @@ get_frpc_url() {
)
if [ -z "$version" ]; then
echo 'cannot find version'
echo 'cannot find version' >&2
return 1
fi
@ -64,7 +91,7 @@ get_frpc_url() {
# jsdelivr 不支持 github releases 文件
if is_ipv6_only; then
if is_need_old_version; then
echo 'NOT_SUPPORT'
echo 'NOT_SUPPORT' >&2
return 1
else
echo https://mirrors.nju.edu.cn/github-release/fatedier/frp
@ -84,7 +111,12 @@ get_frpc_url() {
arch=$(
case "$(uname -m)" in
x86_64) echo amd64 ;;
x86_64)
case "$os_bit" in
32) echo 386 ;;
64) echo amd64 ;;
esac
;;
aarch64) echo arm64 ;;
esac
)

View File

@ -11,6 +11,7 @@ ipv4_gateway=$3
ipv6_addr=$4
ipv6_gateway=$5
is_in_china=$6
ipv6_extra_addrs=$7
DHCP_TIMEOUT=15
DNS_FILE_TIMEOUT=5
@ -171,6 +172,15 @@ add_missing_ipv6_config() {
ip -6 route add default via "$ipv6_gateway" dev "$ethx" onlink
fi
fi
# 添加额外的 IPv6 地址(逗号分隔)
if [ -n "$ipv6_extra_addrs" ]; then
printf '%s\n' "$ipv6_extra_addrs" | tr ',' '\n' | while IFS= read -r addr; do
if [ -n "$addr" ]; then
ip -6 addr add "$addr" dev "$ethx" 2>/dev/null || true
fi
done
fi
fi
}
@ -506,5 +516,6 @@ echo "$ipv4_addr" >"$netconf/ipv4_addr"
echo "$ipv4_gateway" >"$netconf/ipv4_gateway"
echo "$ipv6_addr" >"$netconf/ipv6_addr"
echo "$ipv6_gateway" >"$netconf/ipv6_gateway"
echo "$ipv6_extra_addrs" >"$netconf/ipv6_extra_addrs"
$ipv4_has_internet && echo 1 >"$netconf/ipv4_has_internet" || echo 0 >"$netconf/ipv4_has_internet"
$ipv6_has_internet && echo 1 >"$netconf/ipv6_has_internet" || echo 0 >"$netconf/ipv6_has_internet"

File diff suppressed because it is too large Load Diff

558
trans.sh

File diff suppressed because it is too large Load Diff

Binary file not shown.