mirror of
https://github.com/bin456789/reinstall.git
synced 2026-03-22 04:24:17 +08:00
core: 不重要的更改
This commit is contained in:
@ -23,3 +23,6 @@ charset = utf-8-bom
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[reinstall.sh]
|
||||
shell_variant = bash
|
||||
|
||||
38
README.en.md
38
README.en.md
@ -464,7 +464,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 +478,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
|
||||
@ -546,28 +545,15 @@ 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. |
|
||||
| ❌ | Google Cloud | t2a | Missing network card drivers |
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Loading Graphics Driver on Oracle Cloud</summary>
|
||||
|
||||
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.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
</details>
|
||||
| Compatibility | Cloud Provider | Instance Type | Issues |
|
||||
| ------------- | -------------- | ----------------------- | ----------------------------------------------------------------------------------- |
|
||||
| ✔️ | Azure | B2pts_v2 | |
|
||||
| ✔️ | AWS | T4g | |
|
||||
| ✔️ | Scaleway | COPARM1 | |
|
||||
| ✔️ | Gcore | | |
|
||||
| ❔ | 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 |
|
||||
|
||||
## Parameter Format
|
||||
|
||||
|
||||
38
README.md
38
README.md
@ -464,7 +464,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 +478,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
|
||||
@ -546,28 +545,15 @@ 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 />安装后还需要手动加载显卡驱动 |
|
||||
| ❌ | 谷歌云 | t2a | 缺少网卡驱动 |
|
||||
|
||||
<details>
|
||||
|
||||
<summary>甲骨文云加载显卡驱动</summary>
|
||||
|
||||
使用远程桌面登录到服务器,打开设备管理器,找到显卡,选择更新驱动,在列表中选择 `Red Hat VirtIO GPU DOD controller` 即可。不需要提前下载驱动。
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
</details>
|
||||
| 兼容性 | 云服务商 | 实例类型 | 问题 |
|
||||
| ------ | -------- | ----------------------- | ------------------------------------------ |
|
||||
| ✔️ | Azure | B2pts_v2 | |
|
||||
| ✔️ | AWS | T4g | |
|
||||
| ✔️ | Scaleway | COPARM1 | |
|
||||
| ✔️ | Gcore | | |
|
||||
| ❔ | 阿里云 | g6r, c6r, g8y, c8y, r8y | 有几率重启时卡开机 Logo,强制重启即可 |
|
||||
| ❔ | 甲骨文云 | A1.Flex | 不一定能安装成功,越新创建的实例越容易成功 |
|
||||
| ❌ | 谷歌云 | t2a | 缺少网卡驱动 |
|
||||
|
||||
## 参数格式
|
||||
|
||||
|
||||
41
reinstall.sh
41
reinstall.sh
@ -1,7 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
# nixos 默认的配置不会生成 /bin/bash
|
||||
#!/usr/bin/env sh
|
||||
# shellcheck shell=bash
|
||||
# shellcheck disable=SC2086
|
||||
|
||||
# nixos 默认的配置不会生成 /bin/bash,因此需要用 /usr/bin/env
|
||||
# alpine 默认没有 bash,因此 shebang 用 sh,再 exec 切换到 bash
|
||||
|
||||
set -eE
|
||||
confhome=https://raw.githubusercontent.com/bin456789/reinstall/main
|
||||
confhome_cn=https://cnb.cool/bin456789/reinstall/-/git/raw/main
|
||||
@ -24,18 +27,18 @@ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
|
||||
|
||||
# 如果不是 bash 的话,继续执行会有语法错误,因此在这里判断是否 bash
|
||||
if [ -z "$BASH" ]; then
|
||||
if [ -f /etc/alpine-release ]; then
|
||||
if ! apk add bash; then
|
||||
echo "Error while install bash." >&2
|
||||
if ! command -v bash >/dev/null; then
|
||||
if [ -f /etc/alpine-release ]; then
|
||||
if ! apk add bash; then
|
||||
echo "Error while install bash." >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Please run this script with bash." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if command -v bash >/dev/null; then
|
||||
exec bash "$0" "$@"
|
||||
else
|
||||
echo "Please run this script with bash." >&2
|
||||
exit 1
|
||||
fi
|
||||
exec bash "$0" "$@"
|
||||
fi
|
||||
|
||||
# 记录日志,过滤含有 password 的行
|
||||
@ -469,10 +472,11 @@ fix_file_type() {
|
||||
-e 's/[,;#]//g' \
|
||||
-e 's/^[[:space:]]*//' \
|
||||
-e 's/(POSIX|Unicode|UTF-8|ASCII)//gi' \
|
||||
-e 's/DOS\/MBR boot sector/raw/i' \
|
||||
-e 's/x86 boot sector/raw/i' \
|
||||
-e 's/Zstandard/zstd/i' \
|
||||
-e 's/Windows imaging \(WIM\) image/wim/i' |
|
||||
-e 's/^DOS\/MBR boot sector/raw/i' \
|
||||
-e 's/^x86 boot sector/raw/i' \
|
||||
-e 's/^Zstandard/zstd/i' \
|
||||
-e 's/^UDF/iso/i' \
|
||||
-e 's/^Windows imaging \(WIM\) image/wim/i' |
|
||||
awk '{print $1}' | to_lower
|
||||
}
|
||||
|
||||
@ -1159,7 +1163,10 @@ get_windows_iso_link_inner() {
|
||||
# SW_DVD5_Win_10_IOT_Enterprise_2015_LTSB_64Bit_EMB_English_OEM_X20-20063.IMG
|
||||
# SW_DVD9_Win_Pro_10_22H2.15_Arm64_English_Pro_Ent_EDU_N_MLF_X23-67223.ISO
|
||||
# SWDVD9_WinSrvSTDCORE2025_24H2.16_64Bit_English_DC_STD_MLF_RTMUpdJan26_X24-26760.iso
|
||||
if [ -n "$label_vlsc" ]; then
|
||||
|
||||
# 先判断 full_lang 是否为空
|
||||
# 因为假如用户输入的 lang 不正确,full_lang 就为空,正则表达式就无法只匹配当前语言
|
||||
if [ -n "$label_vlsc" ] && [ -n "$full_lang" ]; then
|
||||
regex="sw_?dvd[59]_win_?${label_vlsc}_?${version}.*${arch_win_vlsc}_${full_lang}.*.(iso|img)"
|
||||
regexs+=("$regex")
|
||||
fi
|
||||
@ -4166,7 +4173,7 @@ EOF
|
||||
|
||||
if ! [ -d "$inf_or_dir" ] &&
|
||||
! { [ -f "$inf_or_dir" ] && [[ "$inf_or_dir" =~ \.[iI][nN][fF]$ ]]; }; then
|
||||
ssh_key_error_and_exit "Not a inf or dir: $2"
|
||||
error_and_exit "Not a inf or dir: $2"
|
||||
fi
|
||||
|
||||
# 转为绝对路径
|
||||
|
||||
17
trans.sh
17
trans.sh
@ -1161,11 +1161,12 @@ EOF
|
||||
# 额外的 IPv6 地址(子网不含网关的地址)
|
||||
get_netconf_to ipv6_extra_addrs
|
||||
if [ -n "$ipv6_extra_addrs" ]; then
|
||||
_old_ifs=$IFS; IFS=','
|
||||
for _addr in $ipv6_extra_addrs; do
|
||||
echo " post-up ip -6 addr add $_addr dev $ethx" >>$conf_file
|
||||
done
|
||||
IFS=$_old_ifs
|
||||
(
|
||||
IFS=','
|
||||
for _addr in $ipv6_extra_addrs; do
|
||||
echo " post-up ip -6 addr add $_addr dev $ethx" >>$conf_file
|
||||
done
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -3544,8 +3545,8 @@ EOF
|
||||
wget https://deb.freexian.com/extended-lts/archive-key.gpg \
|
||||
-O $os_dir/etc/apt/trusted.gpg.d/freexian-archive-extended-lts.gpg
|
||||
|
||||
codename=$(grep '^VERSION_CODENAME=' $os_dir/etc/os-release | cut -d= -f2)
|
||||
# shellcheck disable=SC2154
|
||||
# shellcheck disable=SC1091
|
||||
codename=$({ . "$os_dir/etc/os-release" && echo "$VERSION_CODENAME"; })
|
||||
if [ -f $os_dir/etc/apt/sources.list.d/debian.sources ]; then
|
||||
cat <<EOF >$os_dir/etc/apt/sources.list.d/debian.sources
|
||||
Types: deb
|
||||
@ -3884,7 +3885,7 @@ setup_nocloud() {
|
||||
|
||||
# 1. 配置 NoCloud-only datasource
|
||||
mkdir -p "$os_dir/etc/cloud/cloud.cfg.d"
|
||||
cat > "$os_dir/etc/cloud/cloud.cfg.d/99-datasource.cfg" << 'EOF'
|
||||
cat >"$os_dir/etc/cloud/cloud.cfg.d/99-datasource.cfg" <<'EOF'
|
||||
datasource_list: [ NoCloud, None ]
|
||||
datasource:
|
||||
NoCloud:
|
||||
|
||||
Reference in New Issue
Block a user