mirror of
https://github.com/bin456789/reinstall.git
synced 2025-06-16 17:29:55 +00:00
Compare commits
2 Commits
daa835dddc
...
d7540ff59c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d7540ff59c | ||
![]() |
c42fee9204 |
@ -414,7 +414,7 @@ bash reinstall.sh windows \
|
|||||||
[gcp-gvnic]: https://cloud.google.com/compute/docs/networking/using-gvnic
|
[gcp-gvnic]: https://cloud.google.com/compute/docs/networking/using-gvnic
|
||||||
[gcp-gga]: https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display
|
[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
|
[azure-mana]: https://learn.microsoft.com/azure/virtual-network/accelerated-networking-mana-windows
|
||||||
[intel-vmd]: https://www.intel.com/content/www/us/en/download/720755/intel-rapid-storage-technology-driver-installation-software-with-intel-optane-memory-11th-up-to-13th-gen-platforms.html
|
[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-nic-7-sha1]: https://www.intel.com/content/www/us/en/download/15590/29323/intel-network-adapter-driver-for-windows-7-final-release.html
|
[intel-nic-7-sha1]: https://www.intel.com/content/www/us/en/download/15590/29323/intel-network-adapter-driver-for-windows-7-final-release.html
|
||||||
[intel-nic-7-sha256]: https://www.intel.com/content/www/us/en/download/15590/intel-network-adapter-driver-for-windows-7-final-release.html
|
[intel-nic-7-sha256]: https://www.intel.com/content/www/us/en/download/15590/intel-network-adapter-driver-for-windows-7-final-release.html
|
||||||
[intel-nic-8]: https://www.intel.com/content/www/us/en/download/16765/intel-network-adapter-driver-for-windows-8-final-release.html
|
[intel-nic-8]: https://www.intel.com/content/www/us/en/download/16765/intel-network-adapter-driver-for-windows-8-final-release.html
|
||||||
|
@ -414,7 +414,7 @@ bash reinstall.sh windows \
|
|||||||
[gcp-gvnic]: https://cloud.google.com/compute/docs/networking/using-gvnic
|
[gcp-gvnic]: https://cloud.google.com/compute/docs/networking/using-gvnic
|
||||||
[gcp-gga]: https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display
|
[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
|
[azure-mana]: https://learn.microsoft.com/azure/virtual-network/accelerated-networking-mana-windows
|
||||||
[intel-vmd]: https://www.intel.com/content/www/us/en/download/720755/intel-rapid-storage-technology-driver-installation-software-with-intel-optane-memory-11th-up-to-13th-gen-platforms.html
|
[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-nic-7-sha1]: https://www.intel.com/content/www/us/en/download/15590/29323/intel-network-adapter-driver-for-windows-7-final-release.html
|
[intel-nic-7-sha1]: https://www.intel.com/content/www/us/en/download/15590/29323/intel-network-adapter-driver-for-windows-7-final-release.html
|
||||||
[intel-nic-7-sha256]: https://www.intel.com/content/www/us/en/download/15590/intel-network-adapter-driver-for-windows-7-final-release.html
|
[intel-nic-7-sha256]: https://www.intel.com/content/www/us/en/download/15590/intel-network-adapter-driver-for-windows-7-final-release.html
|
||||||
[intel-nic-8]: https://www.intel.com/content/www/us/en/download/16765/intel-network-adapter-driver-for-windows-8-final-release.html
|
[intel-nic-8]: https://www.intel.com/content/www/us/en/download/16765/intel-network-adapter-driver-for-windows-8-final-release.html
|
||||||
|
@ -2164,7 +2164,7 @@ to_lower() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
del_cr() {
|
del_cr() {
|
||||||
sed 's/\r//g'
|
sed 's/\r$//'
|
||||||
}
|
}
|
||||||
|
|
||||||
del_empty_lines() {
|
del_empty_lines() {
|
||||||
|
18
trans.sh
18
trans.sh
@ -776,7 +776,7 @@ to_lower() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
del_cr() {
|
del_cr() {
|
||||||
sed 's/\r//g'
|
sed 's/\r$//'
|
||||||
}
|
}
|
||||||
|
|
||||||
del_comment_lines() {
|
del_comment_lines() {
|
||||||
@ -5456,10 +5456,11 @@ install_windows() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# vmd
|
# vmd
|
||||||
# 改进: 像检测 virtio 那样直接从 /sys 检测设备
|
# RST v17 不支持 vmd
|
||||||
# inf 有要求 19041 或以上
|
# RST v18 inf 要求 15063 或以上
|
||||||
if [ "$build_ver" -ge 19041 ] && [ "$arch_wim" = x86_64 ] &&
|
# RST v19 inf 要求 15063 或以上
|
||||||
is_lspci_contains 'Volume Management Device'; then
|
# RST v20 inf 要求 19041 或以上
|
||||||
|
if [ -d /sys/module/vmd ] && [ "$build_ver" -ge 15063 ] && [ "$arch_wim" = x86_64 ]; then
|
||||||
add_driver_vmd
|
add_driver_vmd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -6049,7 +6050,12 @@ EOF
|
|||||||
|
|
||||||
add_driver_vmd() {
|
add_driver_vmd() {
|
||||||
apk add 7zip
|
apk add 7zip
|
||||||
download https://downloadmirror.intel.com/820815/SetupRST.exe $drv/SetupRST.exe
|
if [ "$build_ver" -ge 19041 ]; then
|
||||||
|
url=https://downloadmirror.intel.com/849939/SetupRST.exe # RST v20
|
||||||
|
elif [ "$build_ver" -ge 15063 ]; then
|
||||||
|
url=https://downloadmirror.intel.com/849934/SetupRST.exe # RST v19
|
||||||
|
fi
|
||||||
|
download $url $drv/SetupRST.exe
|
||||||
7z x $drv/SetupRST.exe -o$drv/SetupRST -i!.text
|
7z x $drv/SetupRST.exe -o$drv/SetupRST -i!.text
|
||||||
7z x $drv/SetupRST/.text -o$drv/vmd
|
7z x $drv/SetupRST/.text -o$drv/vmd
|
||||||
cp_drivers $drv/vmd
|
cp_drivers $drv/vmd
|
||||||
|
@ -1,16 +1,42 @@
|
|||||||
#!/bin/ash
|
#!/bin/ash
|
||||||
# shellcheck shell=dash
|
# shellcheck shell=dash
|
||||||
# shellcheck disable=SC3001,SC3010
|
# shellcheck disable=SC3001,SC3003,SC3010
|
||||||
# reinstall.sh / trans.sh 共用此文件
|
# reinstall.sh / trans.sh 共用此文件
|
||||||
|
|
||||||
# inf 是 utf-16-le 编码会有问题?要用 rg 或者 grep -a a.b.c.d ?
|
# grep 无法处理 UTF-16LE 编码的 inf,有以下几种解决方法
|
||||||
|
# 1. 使用 ripgrep (rg) 或者 ugrep,但 cygwin 没有
|
||||||
|
# 2. grep -a a.b.c.d
|
||||||
|
# 3. iconv -f UTF-16 -t UTF-8
|
||||||
|
|
||||||
del_inf_comment() {
|
del_inf_comment() {
|
||||||
sed 's/;.*//'
|
sed 's/;.*//'
|
||||||
}
|
}
|
||||||
|
|
||||||
simply_inf() {
|
simply_inf() {
|
||||||
del_cr | del_inf_comment | trim | del_empty_lines
|
convert_file_to_utf8 "$1" | del_cr | del_inf_comment | trim | del_empty_lines
|
||||||
|
}
|
||||||
|
|
||||||
|
convert_file_to_utf8() {
|
||||||
|
# ash 用 * 比较字符串有问题
|
||||||
|
# [[ $'\xEF\xBB' = $'\xEF\xBB*' ]] && echo 1
|
||||||
|
|
||||||
|
# UTF-16LE without BOM 要处理吗? windows 支持这种编码的 inf?
|
||||||
|
|
||||||
|
# UTF-16LE with BOM
|
||||||
|
if [ "$(head -c2 "$1")" = $'\xFF\xFE' ]; then
|
||||||
|
# -f UTF-16LE -t UTF-8 会添加 UTF-8 BOM
|
||||||
|
iconv -f UTF-16 -t UTF-8 "$1"
|
||||||
|
|
||||||
|
# UTF-8 with BOM
|
||||||
|
elif [ "$(head -c3 "$1")" = $'\xEF\xBB\xBF' ]; then
|
||||||
|
# busybox sed 不支持
|
||||||
|
# sed '1s/^\xEF\xBB\xBF//' "$1"
|
||||||
|
tail -c +4 "$1"
|
||||||
|
|
||||||
|
# 其它
|
||||||
|
else
|
||||||
|
cat "$1"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
simply_inf_word() {
|
simply_inf_word() {
|
||||||
@ -35,7 +61,7 @@ list_files_from_inf() {
|
|||||||
local mix_x86_x86_64=$3
|
local mix_x86_x86_64=$3
|
||||||
|
|
||||||
# 所有字段不区分大小写
|
# 所有字段不区分大小写
|
||||||
inf_txts=$(simply_inf <"$inf" | to_lower)
|
inf_txts=$(simply_inf "$inf" | to_lower)
|
||||||
|
|
||||||
is_match_section() {
|
is_match_section() {
|
||||||
local section=$1
|
local section=$1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user