windows: 完善 iso 查找
This commit is contained in:
parent
f2a723830e
commit
3ba90cdd27
58
reinstall.sh
58
reinstall.sh
@ -340,7 +340,7 @@ en_us() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# fr-ca 到 fr
|
# fr-ca 到 ca
|
||||||
us() {
|
us() {
|
||||||
# 葡萄牙准确对应 pp
|
# 葡萄牙准确对应 pp
|
||||||
if [ "$lang" = pt-pt ]; then
|
if [ "$lang" = pt-pt ]; then
|
||||||
@ -371,7 +371,7 @@ en_en() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# zh-cn 到 zh
|
# fr-ca 到 fr
|
||||||
en() {
|
en() {
|
||||||
# 巴西/葡萄牙回落到葡萄牙语
|
# 巴西/葡萄牙回落到葡萄牙语
|
||||||
if [ "$lang" = pt-br ] || [ "$lang" = pt-br ]; then
|
if [ "$lang" = pt-br ] || [ "$lang" = pt-br ]; then
|
||||||
@ -529,15 +529,25 @@ get_windows_iso_links() {
|
|||||||
case "$version" in
|
case "$version" in
|
||||||
vista)
|
vista)
|
||||||
case "$edition" in
|
case "$edition" in
|
||||||
enterprise) echo _ ;;
|
starter)
|
||||||
|
case "$arch_win" in
|
||||||
|
x86) echo _ ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
homebasic | homepremium | business | ultimate) echo _ ;;
|
homebasic | homepremium | business | ultimate) echo _ ;;
|
||||||
|
enterprise) echo enterprise ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
7)
|
7)
|
||||||
case "$edition" in
|
case "$edition" in
|
||||||
|
starter)
|
||||||
|
case "$arch_win" in
|
||||||
|
x86) echo ultimate ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
professional) echo professional ;;
|
professional) echo professional ;;
|
||||||
business | enterprise) echo enterprise ;;
|
|
||||||
homebasic | homepremium | ultimate) echo ultimate ;;
|
homebasic | homepremium | ultimate) echo ultimate ;;
|
||||||
|
enterprise) echo enterprise ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
8.1)
|
8.1)
|
||||||
@ -552,8 +562,7 @@ get_windows_iso_links() {
|
|||||||
home | 'home single language') echo consumer ;;
|
home | 'home single language') echo consumer ;;
|
||||||
pro | 'pro for workstations' | education | 'pro education' | enterprise) echo business ;;
|
pro | 'pro for workstations' | education | 'pro education' | enterprise) echo business ;;
|
||||||
'iot enterprise') echo 'iot enterprise' ;;
|
'iot enterprise') echo 'iot enterprise' ;;
|
||||||
'enterprise 2015 ltsb' | 'enterprise 2016 ltsb') echo "$edition" ;;
|
'enterprise 2015 ltsb' | 'enterprise 2016 ltsb' | 'enterprise ltsc 2019') echo "$edition" ;;
|
||||||
'enterprise ltsc 2019' | 'iot enterprise ltsc 2019' | 'iot enterprise ltsc 2021') echo "$edition" ;;
|
|
||||||
'enterprise ltsc 2021')
|
'enterprise ltsc 2021')
|
||||||
# arm64 的 enterprise ltsc 2021 要下载 iot enterprise ltsc 2021 iso
|
# arm64 的 enterprise ltsc 2021 要下载 iot enterprise ltsc 2021 iso
|
||||||
case "$arch_win" in
|
case "$arch_win" in
|
||||||
@ -561,6 +570,7 @@ get_windows_iso_links() {
|
|||||||
x86 | x64) echo 'enterprise ltsc 2021' ;;
|
x86 | x64) echo 'enterprise ltsc 2021' ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
'iot enterprise ltsc 2019' | 'iot enterprise ltsc 2021') echo "$edition" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
11)
|
11)
|
||||||
@ -588,10 +598,16 @@ get_windows_iso_links() {
|
|||||||
label_msdn=$(get_label_msdn)
|
label_msdn=$(get_label_msdn)
|
||||||
label_vlsc=$(get_label_vlsc)
|
label_vlsc=$(get_label_vlsc)
|
||||||
|
|
||||||
|
if grep -Ewq 'ltsb|ltsc' <<<"$edition"; then
|
||||||
|
is_ltsc=true
|
||||||
|
else
|
||||||
|
is_ltsc=false
|
||||||
|
fi
|
||||||
|
|
||||||
page=$(
|
page=$(
|
||||||
if [ "$arch_win" = arm64 ]; then
|
if [ "$arch_win" = arm64 ]; then
|
||||||
echo arm
|
echo arm
|
||||||
elif grep -Ewq 'ltsb|ltsc' <<<"$edition"; then
|
elif $is_ltsc; then
|
||||||
echo ltsc
|
echo ltsc
|
||||||
elif [ "$server" = 'server' ]; then
|
elif [ "$server" = 'server' ]; then
|
||||||
echo server
|
echo server
|
||||||
@ -613,18 +629,22 @@ get_windows_iso_links() {
|
|||||||
echo "List: $page_url"
|
echo "List: $page_url"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [ -n "$page" ] && { [ -n "$label_msdn" ] || [ -n "$label_vlsc" ]; }; then
|
if [ -z "$page" ] || { [ -z "$label_msdn" ] && [ -z "$label_vlsc" ]; }; then
|
||||||
if [ "$label_msdn" = _ ]; then
|
|
||||||
label_msdn=
|
|
||||||
fi
|
|
||||||
if [ "$label_vlsc" = _ ]; then
|
|
||||||
label_vlsc=
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
error_and_exit "Not support find this iso. Check --image-name or set --iso manually."
|
error_and_exit "Not support find this iso. Check --image-name or set --iso manually."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl -L "$page_url" | grep -ioP 'https://.*?.iso' | awk -F/ '{print $NF}' >$tmp/win.list
|
curl -L "$page_url" | grep -ioP 'https://.*?.iso' | awk -F/ '{print $NF}' >$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_shortest_line() {
|
get_shortest_line() {
|
||||||
@ -636,6 +656,10 @@ get_windows_iso_link() {
|
|||||||
regexs=()
|
regexs=()
|
||||||
|
|
||||||
# msdn
|
# msdn
|
||||||
|
if [ -n "$label_msdn" ]; then
|
||||||
|
if [ "$label_msdn" = _ ]; then
|
||||||
|
label_msdn=
|
||||||
|
fi
|
||||||
for lang in $langs; do
|
for lang in $langs; do
|
||||||
regex=
|
regex=
|
||||||
for i in ${lang} windows ${server} ${version} ${label_msdn}; do
|
for i in ${lang} windows ${server} ${version} ${label_msdn}; do
|
||||||
@ -644,13 +668,15 @@ get_windows_iso_link() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
regex+=".*${arch_win}.*.iso"
|
regex+=".*${arch_win}.*.iso"
|
||||||
|
|
||||||
regexs+=("$regex")
|
regexs+=("$regex")
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# vlsc
|
# vlsc
|
||||||
|
if [ -n "$label_vlsc" ]; then
|
||||||
regex="sw_dvd9_win_${label_vlsc}_${version}.*${arch_win}_${full_lang}.*.iso"
|
regex="sw_dvd9_win_${label_vlsc}_${version}.*${arch_win}_${full_lang}.*.iso"
|
||||||
regexs+=("$regex")
|
regexs+=("$regex")
|
||||||
|
fi
|
||||||
|
|
||||||
# 查找
|
# 查找
|
||||||
for regex in "${regexs[@]}"; do
|
for regex in "${regexs[@]}"; do
|
||||||
|
5
trans.sh
5
trans.sh
@ -122,13 +122,14 @@ download() {
|
|||||||
# return
|
# return
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
|
# --user-agent=Wget/1.21.1 \
|
||||||
|
|
||||||
echo "$url"
|
echo "$url"
|
||||||
for i in $(seq 5); do
|
for i in $(seq 5); do
|
||||||
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 \
|
|
||||||
--max-tries 1 \
|
--max-tries 1 \
|
||||||
$save $url && return
|
$save $url && return
|
||||||
sleep 1
|
sleep 1
|
||||||
@ -1928,7 +1929,7 @@ disable_selinux_kdump() {
|
|||||||
chroot $os_dir grubby --update-kernel ALL --args crashkernel=no
|
chroot $os_dir grubby --update-kernel ALL --args crashkernel=no
|
||||||
if [ "$releasever" -eq 7 ]; then
|
if [ "$releasever" -eq 7 ]; then
|
||||||
# el7 上面那条 grubby 命令不能设置 /etc/default/grub
|
# el7 上面那条 grubby 命令不能设置 /etc/default/grub
|
||||||
sed -iE 's/crashkernel=[^ "]*/crashkernel=no/' $os_dir/etc/default/grub
|
sed -i 's/crashkernel=[^ "]*/crashkernel=no/' $os_dir/etc/default/grub
|
||||||
fi
|
fi
|
||||||
rm -rf $os_dir/etc/systemd/system/multi-user.target.wants/kdump.service
|
rm -rf $os_dir/etc/systemd/system/multi-user.target.wants/kdump.service
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user