mirror of
https://github.com/bin456789/reinstall.git
synced 2025-06-08 21:39:58 +00:00
Compare commits
5 Commits
2b9c82e97d
...
4f5eaa70b6
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4f5eaa70b6 | ||
![]() |
e3ed8703ab | ||
![]() |
14ef2c8269 | ||
![]() |
6a57249015 | ||
![]() |
19198a6146 |
15
README.en.md
15
README.en.md
@ -15,7 +15,7 @@ One-Click Script to Reinstall System [中文](README.md)
|
|||||||
## Highlights
|
## Highlights
|
||||||
|
|
||||||
- One-click Linux installation: Supports 19 common distributions.
|
- One-click Linux installation: Supports 19 common distributions.
|
||||||
- One-click Windows installation: Uses the official ISO for installation instead of custom images. The script can automatically ~~retrieves the ISO link~~ and installs common drivers like `Virtio`.
|
- One-click Windows installation: Uses the official ISO for installation instead of custom images. The script can automatically retrieves the ISO link and installs common drivers like `Virtio`.
|
||||||
- Supports installation in any direction, i.e., `Linux to Linux`, `Linux to Windows`, `Windows to Windows`, `Windows to Linux`
|
- Supports installation in any direction, i.e., `Linux to Linux`, `Linux to Windows`, `Windows to Windows`, `Windows to Linux`
|
||||||
- No need to input IP parameters; automatically recognizes dynamic and static IPs, supports `/32`, `/128`, `gateway outside subnet`, `IPv6 only`, `dual NIC`
|
- No need to input IP parameters; automatically recognizes dynamic and static IPs, supports `/32`, `/128`, `gateway outside subnet`, `IPv6 only`, `dual NIC`
|
||||||
- Specially optimized for low-spec servers, requires less memory than the official netboot
|
- Specially optimized for low-spec servers, requires less memory than the official netboot
|
||||||
@ -128,7 +128,6 @@ certutil -urlcache -f -split https://cnb.cool/bin456789/reinstall/-/git/raw/main
|
|||||||
bash reinstall.sh anolis 7|8|23
|
bash reinstall.sh anolis 7|8|23
|
||||||
opencloudos 8|9|23
|
opencloudos 8|9|23
|
||||||
rocky 8|9
|
rocky 8|9
|
||||||
redhat 8|9 --img="http://xxx.com/xxx.qcow2"
|
|
||||||
oracle 8|9
|
oracle 8|9
|
||||||
almalinux 8|9
|
almalinux 8|9
|
||||||
centos 9|10
|
centos 9|10
|
||||||
@ -144,6 +143,7 @@ bash reinstall.sh anolis 7|8|23
|
|||||||
gentoo
|
gentoo
|
||||||
aosc
|
aosc
|
||||||
fnos
|
fnos
|
||||||
|
redhat --img="http://access.cdn.redhat.com/xxx.qcow2"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Optional Parameters
|
#### Optional Parameters
|
||||||
@ -211,7 +211,7 @@ bash reinstall.sh ubuntu --installer
|
|||||||
bash reinstall.sh dd --img "https://example.com/xxx.xz"
|
bash reinstall.sh dd --img "https://example.com/xxx.xz"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Optional parameters
|
#### Optional Parameters
|
||||||
|
|
||||||
- `--allow-ping` Configure Windows Firewall to Allow Ping Responses (DD Windows only)
|
- `--allow-ping` Configure Windows Firewall to Allow Ping Responses (DD Windows only)
|
||||||
- `--rdp-port PORT` Change RDP port (DD Windows only)
|
- `--rdp-port PORT` Change RDP port (DD Windows only)
|
||||||
@ -234,7 +234,7 @@ bash reinstall.sh dd --img "https://example.com/xxx.xz"
|
|||||||
bash reinstall.sh alpine --hold=1
|
bash reinstall.sh alpine --hold=1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Optional parameters
|
#### Optional Parameters
|
||||||
|
|
||||||
- `--password PASSWORD` Set password
|
- `--password PASSWORD` Set password
|
||||||
- `--ssh-port PORT` Change SSH port
|
- `--ssh-port PORT` Change SSH port
|
||||||
@ -278,10 +278,7 @@ bash reinstall.sh netboot.xyz
|
|||||||
- Hyper-V Server \*
|
- Hyper-V Server \*
|
||||||
- Azure Stack HCI \*
|
- Azure Stack HCI \*
|
||||||
|
|
||||||
#### ~~Method 1: Let the Script Automatically Search for ISO~~
|
#### Method 1: Let the Script Automatically Search for ISO
|
||||||
|
|
||||||
> [!CAUTION]
|
|
||||||
> The ISO repository currently prohibits direct link downloads, so this method is no longer effective.
|
|
||||||
|
|
||||||
- The script will search for ISOs from <https://massgrave.dev/genuine-installation-media>, a site that collects official ISOs.
|
- 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.
|
- Systems marked with \* do not support automatic ISO searching.
|
||||||
@ -384,7 +381,7 @@ bash reinstall.sh windows \
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
#### Optional parameters
|
#### Optional Parameters
|
||||||
|
|
||||||
- `--password PASSWORD` Set Password
|
- `--password PASSWORD` Set Password
|
||||||
- `--allow-ping` Configure Windows Firewall to Allow Ping Responses
|
- `--allow-ping` Configure Windows Firewall to Allow Ping Responses
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
## 亮点
|
## 亮点
|
||||||
|
|
||||||
- 一键安装 Linux,支持 19 种常见发行版
|
- 一键安装 Linux,支持 19 种常见发行版
|
||||||
- 一键安装 Windows,使用官方 ISO 安装而非自制镜像,~~脚本会自动获取 ISO 链接~~、自动安装 Virtio 等常见驱动
|
- 一键安装 Windows,使用官方 ISO 安装而非自制镜像,脚本会自动获取 ISO 链接、自动安装 Virtio 等常见驱动
|
||||||
- 支持任意方向重装,即 `Linux to Linux`、`Linux to Windows`、`Windows to Windows`、`Windows to Linux`
|
- 支持任意方向重装,即 `Linux to Linux`、`Linux to Windows`、`Windows to Windows`、`Windows to Linux`
|
||||||
- 无需填写 IP 参数,自动识别动静态,支持 `/32`、`/128`、`网关不在子网范围内`、`纯 IPv6`、`双网卡`
|
- 无需填写 IP 参数,自动识别动静态,支持 `/32`、`/128`、`网关不在子网范围内`、`纯 IPv6`、`双网卡`
|
||||||
- 专门适配低配小鸡,比官方 netboot 需要更少的内存
|
- 专门适配低配小鸡,比官方 netboot 需要更少的内存
|
||||||
@ -128,7 +128,6 @@ certutil -urlcache -f -split https://cnb.cool/bin456789/reinstall/-/git/raw/main
|
|||||||
bash reinstall.sh anolis 7|8|23
|
bash reinstall.sh anolis 7|8|23
|
||||||
opencloudos 8|9|23
|
opencloudos 8|9|23
|
||||||
rocky 8|9
|
rocky 8|9
|
||||||
redhat 8|9 --img="http://xxx.com/xxx.qcow2"
|
|
||||||
oracle 8|9
|
oracle 8|9
|
||||||
almalinux 8|9
|
almalinux 8|9
|
||||||
centos 9|10
|
centos 9|10
|
||||||
@ -144,6 +143,7 @@ bash reinstall.sh anolis 7|8|23
|
|||||||
gentoo
|
gentoo
|
||||||
aosc
|
aosc
|
||||||
fnos
|
fnos
|
||||||
|
redhat --img="http://access.cdn.redhat.com/xxx.qcow2"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 可选参数
|
#### 可选参数
|
||||||
@ -278,10 +278,7 @@ bash reinstall.sh netboot.xyz
|
|||||||
- Hyper-V Server \*
|
- Hyper-V Server \*
|
||||||
- Azure Stack HCI \*
|
- Azure Stack HCI \*
|
||||||
|
|
||||||
#### ~~方法 1: 让脚本自动查找 ISO~~
|
#### 方法 1: 让脚本自动查找 ISO
|
||||||
|
|
||||||
> [!CAUTION]
|
|
||||||
> 目前该 ISO 仓库禁止了直链下载,因此该方法已失效
|
|
||||||
|
|
||||||
- 脚本会从 <https://massgrave.dev/genuine-installation-media> 查找 ISO,该网站专门提供官方 ISO 下载
|
- 脚本会从 <https://massgrave.dev/genuine-installation-media> 查找 ISO,该网站专门提供官方 ISO 下载
|
||||||
- 上面带 \* 的系统不支持自动查找 ISO
|
- 上面带 \* 的系统不支持自动查找 ISO
|
||||||
|
125
reinstall.sh
125
reinstall.sh
@ -48,7 +48,6 @@ usage_and_exit() {
|
|||||||
Usage: $reinstall_____ anolis 7|8|23
|
Usage: $reinstall_____ anolis 7|8|23
|
||||||
opencloudos 8|9|23
|
opencloudos 8|9|23
|
||||||
rocky 8|9
|
rocky 8|9
|
||||||
redhat 8|9 --img="http://xxx.com/xxx.qcow2"
|
|
||||||
oracle 8|9
|
oracle 8|9
|
||||||
almalinux 8|9
|
almalinux 8|9
|
||||||
centos 9|10
|
centos 9|10
|
||||||
@ -64,6 +63,7 @@ Usage: $reinstall_____ anolis 7|8|23
|
|||||||
gentoo
|
gentoo
|
||||||
aosc
|
aosc
|
||||||
fnos
|
fnos
|
||||||
|
redhat --img="http://access.cdn.redhat.com/xxx.qcow2"
|
||||||
dd --img="http://xxx.com/yyy.zzz" (raw image stores in raw/vhd/tar/gz/xz/zst)
|
dd --img="http://xxx.com/yyy.zzz" (raw image stores in raw/vhd/tar/gz/xz/zst)
|
||||||
windows --image-name="windows xxx yyy" --lang=xx-yy
|
windows --image-name="windows xxx yyy" --lang=xx-yy
|
||||||
windows --image-name="windows xxx yyy" --iso="http://xxx.com/xxx.iso"
|
windows --image-name="windows xxx yyy" --iso="http://xxx.com/xxx.iso"
|
||||||
@ -93,14 +93,20 @@ info() {
|
|||||||
shift
|
shift
|
||||||
msg=$*
|
msg=$*
|
||||||
else
|
else
|
||||||
msg=$(to_upper <<<"$@")
|
msg="***** $(to_upper <<<"$*") *****"
|
||||||
fi
|
fi
|
||||||
|
echo_color_text '\e[32m' "$msg" >&2
|
||||||
echo_color_text '\e[32m' "***** $msg *****" >&2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
warn() {
|
warn() {
|
||||||
echo_color_text '\e[33m' "Warning: $*" >&2
|
local msg
|
||||||
|
if [ "$1" = false ]; then
|
||||||
|
shift
|
||||||
|
msg=$*
|
||||||
|
else
|
||||||
|
msg="Warning: $*"
|
||||||
|
fi
|
||||||
|
echo_color_text '\e[33m' "$msg" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
error() {
|
error() {
|
||||||
@ -838,11 +844,10 @@ find_windows_iso() {
|
|||||||
aarch64) arch_win=arm64 ;;
|
aarch64) arch_win=arm64 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
get_windows_iso_links
|
|
||||||
get_windows_iso_link
|
get_windows_iso_link
|
||||||
}
|
}
|
||||||
|
|
||||||
get_windows_iso_links() {
|
get_windows_iso_link() {
|
||||||
get_label_msdn() {
|
get_label_msdn() {
|
||||||
if [ -n "$server" ]; then
|
if [ -n "$server" ]; then
|
||||||
case "$version" in
|
case "$version" in
|
||||||
@ -872,7 +877,6 @@ get_windows_iso_links() {
|
|||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
homebasic | homepremium | business | ultimate) echo _ ;;
|
homebasic | homepremium | business | ultimate) echo _ ;;
|
||||||
enterprise) echo enterprise ;;
|
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
7)
|
7)
|
||||||
@ -882,18 +886,10 @@ get_windows_iso_links() {
|
|||||||
x86) echo ultimate ;;
|
x86) echo ultimate ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
professional) echo professional ;;
|
homebasic | homepremium | professional | ultimate) echo ultimate ;;
|
||||||
homebasic | homepremium | ultimate) echo ultimate ;;
|
|
||||||
enterprise) echo enterprise ;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
8.1)
|
|
||||||
case "$edition" in
|
|
||||||
'') ;; # massgrave 不提供 windows 8.1 家庭版链接
|
|
||||||
pro) echo pro ;;
|
|
||||||
enterprise) echo enterprise ;;
|
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
# 8.1 需到 msdl.gravesoft.dev 下载
|
||||||
10)
|
10)
|
||||||
case "$edition" in
|
case "$edition" in
|
||||||
home | 'home single language') echo consumer ;;
|
home | 'home single language') echo consumer ;;
|
||||||
@ -945,6 +941,25 @@ get_windows_iso_links() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_label_msdl() {
|
||||||
|
case "$version" in
|
||||||
|
8.1)
|
||||||
|
case "$edition" in
|
||||||
|
'' | pro) echo _ ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
11)
|
||||||
|
case "$edition" in
|
||||||
|
home | 'home single language' | pro | education | 'pro education' | 'pro for workstations')
|
||||||
|
case "$arch_win" in
|
||||||
|
arm64) echo _ ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
get_page() {
|
get_page() {
|
||||||
if [ "$arch_win" = arm64 ]; then
|
if [ "$arch_win" = arm64 ]; then
|
||||||
echo arm
|
echo arm
|
||||||
@ -967,6 +982,7 @@ get_windows_iso_links() {
|
|||||||
|
|
||||||
# 部分 bash 不支持 $() 里面嵌套case,所以定义成函数
|
# 部分 bash 不支持 $() 里面嵌套case,所以定义成函数
|
||||||
label_msdn=$(get_label_msdn)
|
label_msdn=$(get_label_msdn)
|
||||||
|
label_msdl=$(get_label_msdl)
|
||||||
label_vlsc=$(get_label_vlsc)
|
label_vlsc=$(get_label_vlsc)
|
||||||
page=$(get_page)
|
page=$(get_page)
|
||||||
|
|
||||||
@ -976,25 +992,32 @@ get_windows_iso_links() {
|
|||||||
echo "Version: $version"
|
echo "Version: $version"
|
||||||
echo "Edition: $edition"
|
echo "Edition: $edition"
|
||||||
echo "Label msdn: $label_msdn"
|
echo "Label msdn: $label_msdn"
|
||||||
|
echo "Label msdl: $label_msdl"
|
||||||
echo "Label vlsc: $label_vlsc"
|
echo "Label vlsc: $label_vlsc"
|
||||||
echo "List: $page_url"
|
echo "List: $page_url"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [ -z "$page" ] || { [ -z "$label_msdn" ] && [ -z "$label_vlsc" ]; }; then
|
if [ -z "$page" ] || { [ -z "$label_msdn" ] && [ -z "$label_msdl" ] && [ -z "$label_vlsc" ]; }; then
|
||||||
error_and_exit "Not support find this iso. Check if --image-name is wrong. If not, set --iso manually."
|
error_and_exit "Not support find this iso. Check if --image-name is wrong. If not, set --iso manually."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl -L "$page_url" | grep -ioP 'https://.*?.(iso|img)' >$tmp/win.list
|
if [ -n "$label_msdl" ]; then
|
||||||
|
iso=$(curl -L "$page_url" | grep -ioP 'https://.*?#[0-9]+' | head -1 | grep .)
|
||||||
# 如果不是 ltsc ,应该先去除 ltsc 链接,否则最终链接有 ltsc 的
|
|
||||||
# 例如查找 windows 10 iot enterprise,会得到
|
|
||||||
# en-us_windows_10_iot_enterprise_ltsc_2021_arm64_dvd_e8d4fc46.iso
|
|
||||||
# en-us_windows_10_iot_enterprise_version_22h2_arm64_dvd_39566b6b.iso
|
|
||||||
# sed -Ei 和 sed -iE 是不同的
|
|
||||||
if is_ltsc; then
|
|
||||||
sed -Ei '/ltsc|ltsb/!d' $tmp/win.list
|
|
||||||
else
|
else
|
||||||
sed -Ei '/ltsc|ltsb/d' $tmp/win.list
|
curl -L "$page_url" | grep -ioP 'https://.*?.(iso|img)' >$tmp/win.list
|
||||||
|
|
||||||
|
# 如果不是 ltsc ,应该先去除 ltsc 链接,否则最终链接有 ltsc 的
|
||||||
|
# 例如查找 windows 10 iot enterprise,会得到
|
||||||
|
# en-us_windows_10_iot_enterprise_ltsc_2021_arm64_dvd_e8d4fc46.iso
|
||||||
|
# en-us_windows_10_iot_enterprise_version_22h2_arm64_dvd_39566b6b.iso
|
||||||
|
# sed -Ei 和 sed -iE 是不同的
|
||||||
|
if is_ltsc; then
|
||||||
|
sed -Ei '/ltsc|ltsb/!d' $tmp/win.list
|
||||||
|
else
|
||||||
|
sed -Ei '/ltsc|ltsb/d' $tmp/win.list
|
||||||
|
fi
|
||||||
|
|
||||||
|
get_windows_iso_link_inner
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1003,7 +1026,7 @@ get_shortest_line() {
|
|||||||
awk '(NR == 1 || length($0) < length(shortest)) { shortest = $0 } END { print shortest }'
|
awk '(NR == 1 || length($0) < length(shortest)) { shortest = $0 } END { print shortest }'
|
||||||
}
|
}
|
||||||
|
|
||||||
get_windows_iso_link() {
|
get_windows_iso_link_inner() {
|
||||||
regexs=()
|
regexs=()
|
||||||
|
|
||||||
# msdn
|
# msdn
|
||||||
@ -1423,25 +1446,27 @@ Continue?
|
|||||||
if [[ "$iso" = magnet:* ]]; then
|
if [[ "$iso" = magnet:* ]]; then
|
||||||
: # 不测试磁力链接
|
: # 不测试磁力链接
|
||||||
else
|
else
|
||||||
iso_tested=false
|
# 需要用户输入 massgrave.dev 直链
|
||||||
|
if grep -Eiq '\.massgrave\.dev/.*\.(iso|img)$' <<<"$iso" ||
|
||||||
|
grep -Eiq '\.gravesoft\.dev/#[0-9]+$' <<<"$iso"; then
|
||||||
|
info "Set Direct link"
|
||||||
|
# MobaXterm 不支持
|
||||||
|
# printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'
|
||||||
|
|
||||||
# 获取 massgrave.dev 直链
|
# MobaXterm 不显示为超链接
|
||||||
if grep -Eiq '\.massgrave\.dev/.*\.(iso|img)' <<<"$iso"; then
|
# info false "请在浏览器中打开 $iso 获取直链并粘贴到这里。"
|
||||||
# 如果已经是 iso 直链则跳过下面的 iso 测试
|
# info false "Please open $iso in browser to get the direct link and paste it here."
|
||||||
if test_url_grace "$iso" iso; then
|
|
||||||
iso_tested=true
|
echo "请在浏览器中打开 $iso 获取直链并粘贴到这里。"
|
||||||
else
|
echo "Please open $iso in browser to get the direct link and paste it here."
|
||||||
msg="Could not find direct link for $iso"
|
IFS= read -r -p "Direct Link: " iso
|
||||||
if ! iso=$(grep -oE 'https?.*\.iso[^"]*' $tmp/img-test | sed 's/&/\&/g' | grep .); then
|
if [ -z "$iso" ]; then
|
||||||
error_and_exit "$msg"
|
error_and_exit "ISO Link is empty."
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 测试是否是 iso
|
# 测试是否是 iso
|
||||||
if ! $iso_tested; then
|
test_url "$iso" iso
|
||||||
test_url "$iso" iso
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 判断 iso 架构是否兼容
|
# 判断 iso 架构是否兼容
|
||||||
# https://gitlab.com/libosinfo/osinfo-db/-/tree/main/data/os/microsoft.com?ref_type=heads
|
# https://gitlab.com/libosinfo/osinfo-db/-/tree/main/data/os/microsoft.com?ref_type=heads
|
||||||
@ -1670,13 +1695,11 @@ Continue with DD?
|
|||||||
}
|
}
|
||||||
|
|
||||||
setos_redhat() {
|
setos_redhat() {
|
||||||
# el 10 需要 x86-64-v3
|
|
||||||
if [ "$basearch" = x86_64 ] && [ "$releasever" -ge 10 ]; then
|
|
||||||
assert_cpu_supports_x86_64_v3
|
|
||||||
fi
|
|
||||||
|
|
||||||
if is_use_cloud_image; then
|
if is_use_cloud_image; then
|
||||||
# ci
|
# el 10 需要 x86-64-v3
|
||||||
|
if [ "$basearch" = x86_64 ] && [[ "$img" = *rhel-10* ]]; then
|
||||||
|
assert_cpu_supports_x86_64_v3
|
||||||
|
fi
|
||||||
eval "${step}_img='$img'"
|
eval "${step}_img='$img'"
|
||||||
else
|
else
|
||||||
:
|
:
|
||||||
@ -1791,7 +1814,6 @@ verify_os_name() {
|
|||||||
'opencloudos 8|9|23' \
|
'opencloudos 8|9|23' \
|
||||||
'almalinux 8|9' \
|
'almalinux 8|9' \
|
||||||
'rocky 8|9' \
|
'rocky 8|9' \
|
||||||
'redhat 8|9' \
|
|
||||||
'oracle 8|9' \
|
'oracle 8|9' \
|
||||||
'fedora 41|42' \
|
'fedora 41|42' \
|
||||||
'nixos 24.11' \
|
'nixos 24.11' \
|
||||||
@ -1800,6 +1822,7 @@ verify_os_name() {
|
|||||||
'alpine 3.18|3.19|3.20|3.21' \
|
'alpine 3.18|3.19|3.20|3.21' \
|
||||||
'openeuler 20.03|22.03|24.03|25.03' \
|
'openeuler 20.03|22.03|24.03|25.03' \
|
||||||
'ubuntu 16.04|18.04|20.04|22.04|24.04|25.04' \
|
'ubuntu 16.04|18.04|20.04|22.04|24.04|25.04' \
|
||||||
|
'redhat' \
|
||||||
'kali' \
|
'kali' \
|
||||||
'arch' \
|
'arch' \
|
||||||
'gentoo' \
|
'gentoo' \
|
||||||
|
21
trans.sh
21
trans.sh
@ -6069,8 +6069,6 @@ EOF
|
|||||||
# 可改成直接从 github commit 下载 win7 173(sha1) 176(sha256) 全家桶?
|
# 可改成直接从 github commit 下载 win7 173(sha1) 176(sha256) 全家桶?
|
||||||
# 国内可使用 jsdelivr 加速 github
|
# 国内可使用 jsdelivr 加速 github
|
||||||
|
|
||||||
# 2008 安装的气球驱动不能用,需要到硬件管理器重新安装设备才能用,无需更新驱动
|
|
||||||
|
|
||||||
# 2k12
|
# 2k12
|
||||||
# https://github.com/virtio-win/virtio-win-pkg-scripts/issues/61
|
# https://github.com/virtio-win/virtio-win-pkg-scripts/issues/61
|
||||||
# 217 ~ 271 2k12 证书有问题,红帽的 virtio-win-1.9.45 没问题
|
# 217 ~ 271 2k12 证书有问题,红帽的 virtio-win-1.9.45 没问题
|
||||||
@ -6118,8 +6116,13 @@ EOF
|
|||||||
mkdir -p $drv/virtio
|
mkdir -p $drv/virtio
|
||||||
mount -o ro $drv/virtio.iso $drv/virtio
|
mount -o ro $drv/virtio.iso $drv/virtio
|
||||||
|
|
||||||
# -not -ipath "*/balloon/*"
|
# vista 如果安装气动驱动,会报错 windows could not configure one or more system components
|
||||||
cp_drivers $drv/virtio -ipath "*/$virtio_sys/$arch/*" "$@"
|
# 2008 安装的气球驱动不能用,需要到硬件管理器重新安装设备才能用,无需更新驱动
|
||||||
|
if [ "$product_ver" = vista ]; then
|
||||||
|
cp_drivers $drv/virtio -ipath "*/$virtio_sys/$arch/*" "$@" -not -ipath "*/balloon/*"
|
||||||
|
else
|
||||||
|
cp_drivers $drv/virtio -ipath "*/$virtio_sys/$arch/*" "$@"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# coreutils 的 cp mv rm 才有 -v 参数
|
# coreutils 的 cp mv rm 才有 -v 参数
|
||||||
apk add 7zip file coreutils
|
apk add 7zip file coreutils
|
||||||
@ -6449,14 +6452,14 @@ EOF
|
|||||||
|
|
||||||
# key
|
# key
|
||||||
if [ "$product_ver" = vista ]; then
|
if [ "$product_ver" = vista ]; then
|
||||||
# vista 需密钥,密钥可与 edition 不一致
|
# vista 无人值守安装需要密钥,密钥可与 edition 不一致
|
||||||
# TODO: 改成从网页获取?
|
|
||||||
# https://learn.microsoft.com/en-us/windows-server/get-started/kms-client-activation-keys
|
# https://learn.microsoft.com/en-us/windows-server/get-started/kms-client-activation-keys
|
||||||
key=VKK3X-68KWM-X2YGT-QR4M6-4BWMV
|
# 从镜像获取默认密钥
|
||||||
|
setup_cfg=$(get_path_in_correct_case /os/installer/sources/inf/setup.cfg)
|
||||||
|
key=$(del_cr <"$setup_cfg" | grep -Eix 'Value=([A-Z0-9]{5}-){4}[A-Z0-9]{5}' | cut -d= -f2 | grep .)
|
||||||
sed -i "s/%key%/$key/" /tmp/autounattend.xml
|
sed -i "s/%key%/$key/" /tmp/autounattend.xml
|
||||||
else
|
else
|
||||||
# shellcheck disable=SC2010
|
if [ -f "$(get_path_in_correct_case /os/installer/sources/ei.cfg)" ]; then
|
||||||
if ls -d /os/installer/sources/* | grep -iq ei.cfg; then
|
|
||||||
# 镜像有 ei.cfg,删除 key 字段
|
# 镜像有 ei.cfg,删除 key 字段
|
||||||
sed -i "/%key%/d" /tmp/autounattend.xml
|
sed -i "/%key%/d" /tmp/autounattend.xml
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user