mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
windows: win7 使用 sha1 签名的驱动
This commit is contained in:
parent
152d7f644f
commit
34b9b3a186
10
reinstall.sh
10
reinstall.sh
@ -66,7 +66,7 @@ curl() {
|
|||||||
# 添加 -f, --fail,不然 404 退出码也为0
|
# 添加 -f, --fail,不然 404 退出码也为0
|
||||||
# 32位 cygwin 已停止更新,证书可能有问题,先添加 --insecure
|
# 32位 cygwin 已停止更新,证书可能有问题,先添加 --insecure
|
||||||
grep -o 'http[^ ]*' <<<"$@" >&2
|
grep -o 'http[^ ]*' <<<"$@" >&2
|
||||||
command curl --insecure --connect-timeout 5 --retry 2 --retry-delay 1 -f "$@"
|
command curl --insecure --connect-timeout 10 --retry 5 --retry-delay 1 -f "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
is_in_china() {
|
is_in_china() {
|
||||||
@ -653,12 +653,6 @@ verify_os_args() {
|
|||||||
if [ -z "$iso" ] || [ -z "$image_name" ]; then
|
if [ -z "$iso" ] || [ -z "$image_name" ]; then
|
||||||
error_and_exit "Install Windows need --iso and --image-name"
|
error_and_exit "Install Windows need --iso and --image-name"
|
||||||
fi
|
fi
|
||||||
# 防止常见错误
|
|
||||||
# --image-name 肯定大于等于3个单词
|
|
||||||
if [ "$(echo "$image_name" | wc -w)" -lt 3 ] ||
|
|
||||||
[[ "$(to_lower <<<"$image_name")" != windows* ]]; then
|
|
||||||
error_and_exit "--image-name wrong."
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@ -992,7 +986,7 @@ get_disk_by_part() {
|
|||||||
|
|
||||||
get_part_num_by_part() {
|
get_part_num_by_part() {
|
||||||
dev_part=$1
|
dev_part=$1
|
||||||
grep -o '[0-9]*' <<<"$dev_part" | tail -1
|
grep -oE '[0-9]*$' <<<"$dev_part"
|
||||||
}
|
}
|
||||||
|
|
||||||
grep_efi_index() {
|
grep_efi_index() {
|
||||||
|
28
trans.sh
28
trans.sh
@ -55,7 +55,7 @@ add_community_repo() {
|
|||||||
|
|
||||||
# busybox 的 wget 没有重试功能
|
# busybox 的 wget 没有重试功能
|
||||||
wget() {
|
wget() {
|
||||||
for i in 1 2 3; do
|
for i in $(seq 5); do
|
||||||
command wget "$@" && return
|
command wget "$@" && return
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -102,17 +102,20 @@ download() {
|
|||||||
# Exception: [AbstractCommand.cc:351] errorCode=1 URI=https://aka.ms/manawindowsdrivers
|
# Exception: [AbstractCommand.cc:351] errorCode=1 URI=https://aka.ms/manawindowsdrivers
|
||||||
# -> [SocketCore.cc:1019] errorCode=1 SSL/TLS handshake failure: `not signed by known authorities or invalid'
|
# -> [SocketCore.cc:1019] errorCode=1 SSL/TLS handshake failure: `not signed by known authorities or invalid'
|
||||||
|
|
||||||
|
# 用 if 的话,报错不会中断脚本
|
||||||
|
# if aria2c xxx; then
|
||||||
|
# return
|
||||||
|
# fi
|
||||||
|
|
||||||
echo "$url"
|
echo "$url"
|
||||||
for i in 1 2 3; do
|
for i in $(seq 5); do
|
||||||
if stdbuf -oL -eL \
|
stdbuf -oL -eL \
|
||||||
aria2c -x4 \
|
aria2c -x4 \
|
||||||
--allow-overwrite=true \
|
--allow-overwrite=true \
|
||||||
--summary-interval=0 \
|
--summary-interval=0 \
|
||||||
--user-agent=Wget/1.21.1 \
|
--user-agent=Wget/1.21.1 \
|
||||||
--max-tries 1 \
|
--max-tries 1 \
|
||||||
$save $url; then
|
$save $url && return
|
||||||
return
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,7 +123,7 @@ update_part() {
|
|||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
# 玄学
|
# 玄学
|
||||||
for i in 1 2 3; do
|
for i in $(seq 3); do
|
||||||
sync
|
sync
|
||||||
partprobe /dev/$xda 2>/dev/null
|
partprobe /dev/$xda 2>/dev/null
|
||||||
|
|
||||||
@ -1961,19 +1964,21 @@ install_windows() {
|
|||||||
# aws nitro
|
# aws nitro
|
||||||
# 只有 x64 位驱动
|
# 只有 x64 位驱动
|
||||||
# 可能不支持 vista
|
# 可能不支持 vista
|
||||||
|
# 未打补丁的 win7 无法使用 sha256 签名的驱动
|
||||||
# https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/WindowsGuide/aws-nvme-drivers.html
|
# https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/WindowsGuide/aws-nvme-drivers.html
|
||||||
# https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/WindowsGuide/enhanced-networking-ena.html
|
# https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/WindowsGuide/enhanced-networking-ena.html
|
||||||
|
|
||||||
nvme_ver=$(
|
nvme_ver=$(
|
||||||
case "$nt_ver" in
|
case "$nt_ver" in
|
||||||
6.0 | 6.1) echo 1.3.2 ;;
|
6.0 | 6.1) echo 1.3.2 ;; # sha1 签名
|
||||||
*) echo Latest ;;
|
*) echo Latest ;;
|
||||||
esac
|
esac
|
||||||
)
|
)
|
||||||
|
|
||||||
ena_ver=$(
|
ena_ver=$(
|
||||||
case "$nt_ver" in
|
case "$nt_ver" in
|
||||||
6.0 | 6.1) echo 2.2.3 ;;
|
6.0 | 6.1) echo 2.1.4 ;; # sha1 签名
|
||||||
|
# 6.0 | 6.1) echo 2.2.3 ;; # sha256 签名
|
||||||
6.2 | 6.3) echo 2.6.0 ;;
|
6.2 | 6.3) echo 2.6.0 ;;
|
||||||
*) echo Latest ;;
|
*) echo Latest ;;
|
||||||
esac
|
esac
|
||||||
@ -1995,7 +2000,8 @@ install_windows() {
|
|||||||
|
|
||||||
aws_pv_ver=$(
|
aws_pv_ver=$(
|
||||||
case "$nt_ver" in
|
case "$nt_ver" in
|
||||||
6.0 | 6.1) echo 8.3.5 ;;
|
6.0 | 6.1) echo 8.3.2 ;; # sha1 签名
|
||||||
|
# 6.0 | 6.1) echo 8.3.5 ;; # sha256 签名
|
||||||
*) echo Latest ;;
|
*) echo Latest ;;
|
||||||
esac
|
esac
|
||||||
)
|
)
|
||||||
@ -2092,7 +2098,7 @@ install_windows() {
|
|||||||
grep -i EVAL "$ei_cfg"; then
|
grep -i EVAL "$ei_cfg"; then
|
||||||
# 评估版 iso 需要删除 autounattend.xml 里面的 <Key><Key/>
|
# 评估版 iso 需要删除 autounattend.xml 里面的 <Key><Key/>
|
||||||
# 否则会出现 Windows Cannot find Microsoft software license terms
|
# 否则会出现 Windows Cannot find Microsoft software license terms
|
||||||
sed -i "/%Key%/d" /tmp/autounattend.xml
|
sed -i "/%key%/d" /tmp/autounattend.xml
|
||||||
else
|
else
|
||||||
# vista 需密钥,密钥可与 edition 不一致
|
# vista 需密钥,密钥可与 edition 不一致
|
||||||
# 其他系统要空密钥
|
# 其他系统要空密钥
|
||||||
|
Loading…
x
Reference in New Issue
Block a user