mirror of
https://github.com/bin456789/reinstall.git
synced 2026-05-21 05:27:41 +08:00
Compare commits
1 Commits
main
...
d95c492596
| Author | SHA1 | Date | |
|---|---|---|---|
| d95c492596 |
@ -58,7 +58,7 @@ The system requirements for the target system are as follows:
|
|||||||
| <img width="16" height="16" src="https://www.centos.org/assets/icons/favicon.svg" /> CentOS Stream | 9, 10 | 512 MB \* | 5 GB |
|
| <img width="16" height="16" src="https://www.centos.org/assets/icons/favicon.svg" /> CentOS Stream | 9, 10 | 512 MB \* | 5 GB |
|
||||||
| <img width="16" height="16" src="https://fedoraproject.org/favicon.ico" /> Fedora | 43, 44 | 512 MB \* | 5 GB |
|
| <img width="16" height="16" src="https://fedoraproject.org/favicon.ico" /> Fedora | 43, 44 | 512 MB \* | 5 GB |
|
||||||
| <img width="16" height="16" src="https://www.openeuler.org/favicon.ico" /> openEuler | 20.03 LTS - 24.03 LTS | 512 MB \* | 5 GB |
|
| <img width="16" height="16" src="https://www.openeuler.org/favicon.ico" /> openEuler | 20.03 LTS - 24.03 LTS | 512 MB \* | 5 GB |
|
||||||
| <img width="16" height="16" src="https://static.opensuse.org/favicon.ico" /> openSUSE | Leap 16.0, Tumbleweed (Rolling) | 512 MB \* | 5 GB |
|
| <img width="16" height="16" src="https://static.opensuse.org/favicon.ico" /> openSUSE | Leap 15.6, 16.0, Tumbleweed (Rolling) | 512 MB \* | 5 GB |
|
||||||
| <img width="16" height="16" src="https://nixos.org/favicon.svg" /> NixOS | 25.11 | 512 MB | 5 GB |
|
| <img width="16" height="16" src="https://nixos.org/favicon.svg" /> NixOS | 25.11 | 512 MB | 5 GB |
|
||||||
| <img width="16" height="16" src="https://archlinux.org/static/favicon.png" /> Arch | Rolling | 512 MB | 5 GB |
|
| <img width="16" height="16" src="https://archlinux.org/static/favicon.png" /> Arch | Rolling | 512 MB | 5 GB |
|
||||||
| <img width="16" height="16" src="https://www.gentoo.org/assets/img/logo/gentoo-g.png" /> Gentoo | Rolling | 512 MB | 5 GB |
|
| <img width="16" height="16" src="https://www.gentoo.org/assets/img/logo/gentoo-g.png" /> Gentoo | Rolling | 512 MB | 5 GB |
|
||||||
@ -165,9 +165,9 @@ bash reinstall.sh anolis 7|8|23
|
|||||||
nixos 25.11
|
nixos 25.11
|
||||||
fedora 43|44
|
fedora 43|44
|
||||||
debian 9|10|11|12|13
|
debian 9|10|11|12|13
|
||||||
opensuse 16.0|tumbleweed
|
|
||||||
openeuler 20.03|22.03|24.03
|
openeuler 20.03|22.03|24.03
|
||||||
alpine 3.20|3.21|3.22|3.23
|
alpine 3.20|3.21|3.22|3.23
|
||||||
|
opensuse 15.6|16.0|tumbleweed
|
||||||
ubuntu 18.04|20.04|22.04|24.04|26.04 [--minimal]
|
ubuntu 18.04|20.04|22.04|24.04|26.04 [--minimal]
|
||||||
kali
|
kali
|
||||||
arch
|
arch
|
||||||
|
|||||||
@ -58,7 +58,7 @@
|
|||||||
| <img width="16" height="16" src="https://www.centos.org/assets/icons/favicon.svg" /> CentOS Stream | 9, 10 | 512 MB \* | 5 GB |
|
| <img width="16" height="16" src="https://www.centos.org/assets/icons/favicon.svg" /> CentOS Stream | 9, 10 | 512 MB \* | 5 GB |
|
||||||
| <img width="16" height="16" src="https://fedoraproject.org/favicon.ico" /> Fedora | 43, 44 | 512 MB \* | 5 GB |
|
| <img width="16" height="16" src="https://fedoraproject.org/favicon.ico" /> Fedora | 43, 44 | 512 MB \* | 5 GB |
|
||||||
| <img width="16" height="16" src="https://www.openeuler.org/favicon.ico" /> openEuler | 20.03 LTS - 24.03 LTS | 512 MB \* | 5 GB |
|
| <img width="16" height="16" src="https://www.openeuler.org/favicon.ico" /> openEuler | 20.03 LTS - 24.03 LTS | 512 MB \* | 5 GB |
|
||||||
| <img width="16" height="16" src="https://static.opensuse.org/favicon.ico" /> openSUSE | Leap 16.0, Tumbleweed (滚动) | 512 MB \* | 5 GB |
|
| <img width="16" height="16" src="https://static.opensuse.org/favicon.ico" /> openSUSE | Leap 15.6, 16.0, Tumbleweed (滚动) | 512 MB \* | 5 GB |
|
||||||
| <img width="16" height="16" src="https://nixos.org/favicon.svg" /> NixOS | 25.11 | 512 MB | 5 GB |
|
| <img width="16" height="16" src="https://nixos.org/favicon.svg" /> NixOS | 25.11 | 512 MB | 5 GB |
|
||||||
| <img width="16" height="16" src="https://archlinux.org/static/favicon.png" /> Arch | 滚动 | 512 MB | 5 GB |
|
| <img width="16" height="16" src="https://archlinux.org/static/favicon.png" /> Arch | 滚动 | 512 MB | 5 GB |
|
||||||
| <img width="16" height="16" src="https://www.gentoo.org/assets/img/logo/gentoo-g.png" /> Gentoo | 滚动 | 512 MB | 5 GB |
|
| <img width="16" height="16" src="https://www.gentoo.org/assets/img/logo/gentoo-g.png" /> Gentoo | 滚动 | 512 MB | 5 GB |
|
||||||
@ -165,9 +165,9 @@ bash reinstall.sh anolis 7|8|23
|
|||||||
nixos 25.11
|
nixos 25.11
|
||||||
fedora 43|44
|
fedora 43|44
|
||||||
debian 9|10|11|12|13
|
debian 9|10|11|12|13
|
||||||
opensuse 16.0|tumbleweed
|
|
||||||
openeuler 20.03|22.03|24.03
|
openeuler 20.03|22.03|24.03
|
||||||
alpine 3.20|3.21|3.22|3.23
|
alpine 3.20|3.21|3.22|3.23
|
||||||
|
opensuse 15.6|16.0|tumbleweed
|
||||||
ubuntu 18.04|20.04|22.04|24.04|26.04 [--minimal]
|
ubuntu 18.04|20.04|22.04|24.04|26.04 [--minimal]
|
||||||
kali
|
kali
|
||||||
arch
|
arch
|
||||||
|
|||||||
@ -170,6 +170,47 @@ GatewayOnLink=yes
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fix_wicked_conf() {
|
||||||
|
# https://github.com/openSUSE/wicked/wiki/FAQ#q-why-wicked-does-not-set-my-default-static-route
|
||||||
|
|
||||||
|
# 修改前
|
||||||
|
# default 1.1.1.1 - -
|
||||||
|
# default 2602::1 - -
|
||||||
|
|
||||||
|
# 修改后
|
||||||
|
# 1.1.1.1 - -
|
||||||
|
# 2602::1 - -
|
||||||
|
# default 1.1.1.1 - -
|
||||||
|
# default 2602::1 - -
|
||||||
|
|
||||||
|
if ! confs=$(ls "$os_dir/etc/sysconfig/network/ifroute-"* 2>/dev/null); then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
for conf in $confs; do
|
||||||
|
# 判断 bug 是否已经修复
|
||||||
|
if grep -v 'default' "$conf" | grep -q '-'; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 获取网关
|
||||||
|
gateways=$(awk '$1=="default" {print $2}' "$conf")
|
||||||
|
if [ -z "$gateways" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 创建新条目
|
||||||
|
for gateway in $gateways; do
|
||||||
|
echo "$gateway - -"
|
||||||
|
done | insert_into_file "$conf" head
|
||||||
|
done
|
||||||
|
|
||||||
|
# 重新应用配置
|
||||||
|
if systemctl -q is-enabled wicked; then
|
||||||
|
systemctl restart wicked
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# ubuntu 18.04 cloud-init 版本 23.1.2,因此不用处理
|
# ubuntu 18.04 cloud-init 版本 23.1.2,因此不用处理
|
||||||
|
|
||||||
# debian 10/11 云镜像原本用 ifupdown + resolvconf,脚本改成用 netplan + networkd/resolved
|
# debian 10/11 云镜像原本用 ifupdown + resolvconf,脚本改成用 netplan + networkd/resolved
|
||||||
@ -183,3 +224,6 @@ fix_netplan_conf
|
|||||||
# 只需对云镜像处理
|
# 只需对云镜像处理
|
||||||
# 因为普通安装用的是 alpine 的 cloud-init,版本够新,不用处理
|
# 因为普通安装用的是 alpine 的 cloud-init,版本够新,不用处理
|
||||||
fix_networkd_conf
|
fix_networkd_conf
|
||||||
|
|
||||||
|
# opensuse 15.5: ifcfg + netconfig (dns) + wicked
|
||||||
|
fix_wicked_conf
|
||||||
|
|||||||
@ -9,6 +9,10 @@ Before=network.service
|
|||||||
Before=networking.service
|
Before=networking.service
|
||||||
Before=systemd-networkd.service
|
Before=systemd-networkd.service
|
||||||
Before=NetworkManager.service
|
Before=NetworkManager.service
|
||||||
|
Before=wickedd-auto4.service
|
||||||
|
Before=wickedd-dhcp4.service
|
||||||
|
Before=wickedd-dhcp6.service
|
||||||
|
Before=wickedd.service
|
||||||
|
|
||||||
Before=network.target
|
Before=network.target
|
||||||
|
|
||||||
|
|||||||
@ -86,9 +86,9 @@ Usage: $reinstall_____ anolis 7|8|23
|
|||||||
nixos 25.11
|
nixos 25.11
|
||||||
fedora 43|44
|
fedora 43|44
|
||||||
debian 9|10|11|12|13
|
debian 9|10|11|12|13
|
||||||
opensuse 16.0|tumbleweed
|
|
||||||
openeuler 20.03|22.03|24.03
|
openeuler 20.03|22.03|24.03
|
||||||
alpine 3.20|3.21|3.22|3.23
|
alpine 3.20|3.21|3.22|3.23
|
||||||
|
opensuse 15.6|16.0|tumbleweed
|
||||||
ubuntu 18.04|20.04|22.04|24.04|26.04 [--minimal]
|
ubuntu 18.04|20.04|22.04|24.04|26.04 [--minimal]
|
||||||
kali
|
kali
|
||||||
arch
|
arch
|
||||||
@ -1479,11 +1479,13 @@ Continue?
|
|||||||
# leap
|
# leap
|
||||||
dir=distribution/leap/$releasever/appliances
|
dir=distribution/leap/$releasever/appliances
|
||||||
case "$releasever" in
|
case "$releasever" in
|
||||||
|
15.6) file=openSUSE-Leap-$releasever-Minimal-VM.$basearch-Cloud.qcow2 ;;
|
||||||
16.0) file=Leap-$releasever-Minimal-VM.$basearch-Cloud.qcow2 ;;
|
16.0) file=Leap-$releasever-Minimal-VM.$basearch-Cloud.qcow2 ;;
|
||||||
# 16.0) file=Leap-$releasever-Minimal-VM.$basearch-kvm$(if [ "$basearch" = x86_64 ]; then echo '-and-xen'; fi).qcow2 ;;
|
# 16.0) file=Leap-$releasever-Minimal-VM.$basearch-kvm$(if [ "$basearch" = x86_64 ]; then echo '-and-xen'; fi).qcow2 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# https://src.opensuse.org/openSUSE/Leap-Images/src/branch/leap-16.0/kiwi-templates-Minimal/Minimal.kiwi
|
# https://src.opensuse.org/openSUSE/Leap-Images/src/branch/leap-16.0/kiwi-templates-Minimal/Minimal.kiwi
|
||||||
|
# https://build.opensuse.org/projects/Virtualization:Appliances:Images:openSUSE-Leap-15.6/packages/kiwi-templates-Minimal/files/Minimal.kiwi
|
||||||
# https://build.opensuse.org/projects/Virtualization:Appliances:Images:openSUSE-Tumbleweed/packages/kiwi-templates-Minimal/files/Minimal.kiwi
|
# https://build.opensuse.org/projects/Virtualization:Appliances:Images:openSUSE-Tumbleweed/packages/kiwi-templates-Minimal/files/Minimal.kiwi
|
||||||
# 有专门的kvm镜像,openSUSE-Leap-15.5-Minimal-VM.x86_64-kvm-and-xen.qcow2,里面没有cloud-init
|
# 有专门的kvm镜像,openSUSE-Leap-15.5-Minimal-VM.x86_64-kvm-and-xen.qcow2,里面没有cloud-init
|
||||||
# file=openSUSE-Leap-15.5-Minimal-VM.x86_64-kvm-and-xen.qcow2
|
# file=openSUSE-Leap-15.5-Minimal-VM.x86_64-kvm-and-xen.qcow2
|
||||||
@ -1911,7 +1913,7 @@ verify_os_name() {
|
|||||||
'fedora 43|44' \
|
'fedora 43|44' \
|
||||||
'nixos 25.11' \
|
'nixos 25.11' \
|
||||||
'debian 9|10|11|12|13' \
|
'debian 9|10|11|12|13' \
|
||||||
'opensuse 16.0|tumbleweed' \
|
'opensuse 15.6|16.0|tumbleweed' \
|
||||||
'alpine 3.20|3.21|3.22|3.23' \
|
'alpine 3.20|3.21|3.22|3.23' \
|
||||||
'openeuler 20.03|22.03|24.03' \
|
'openeuler 20.03|22.03|24.03' \
|
||||||
'ubuntu 18.04|20.04|22.04|24.04|26.04' \
|
'ubuntu 18.04|20.04|22.04|24.04|26.04' \
|
||||||
@ -4194,7 +4196,7 @@ recreate_grub_or_extlinux_cfg() {
|
|||||||
/nix/var/nix/profiles/system/bin/switch-to-configuration boot
|
/nix/var/nix/profiles/system/bin/switch-to-configuration boot
|
||||||
# 手动启用 41_custom
|
# 手动启用 41_custom
|
||||||
nixos_grub_home="$(dirname "$(readlink -f "$(get_cmd_path grub-mkconfig)")")/.."
|
nixos_grub_home="$(dirname "$(readlink -f "$(get_cmd_path grub-mkconfig)")")/.."
|
||||||
$nixos_grub_home/etc/grub.d/41_custom >>"$(dirname "$target_cfg")/grub.cfg"
|
$nixos_grub_home/etc/grub.d/41_custom >>$target_cfg
|
||||||
elif is_have_cmd update-grub; then
|
elif is_have_cmd update-grub; then
|
||||||
update-grub
|
update-grub
|
||||||
else
|
else
|
||||||
|
|||||||
172
trans.sh
172
trans.sh
@ -1682,21 +1682,6 @@ install_nixos() {
|
|||||||
export USER=root
|
export USER=root
|
||||||
export HOME=/root
|
export HOME=/root
|
||||||
|
|
||||||
configure_nix_substituters() {
|
|
||||||
if ! is_in_china; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
nix_conf=/etc/nix/nix.conf
|
|
||||||
mkdir -p "$(dirname "$nix_conf")"
|
|
||||||
|
|
||||||
if [ -f "$nix_conf" ]; then
|
|
||||||
sed -i '/^[[:space:]]*substituters[[:space:]]*=/d' "$nix_conf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "substituters = $mirror/store" >>"$nix_conf"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$nix_from" in
|
case "$nix_from" in
|
||||||
alpine)
|
alpine)
|
||||||
apk add nix
|
apk add nix
|
||||||
@ -1705,7 +1690,9 @@ install_nixos() {
|
|||||||
# https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/nix/APKBUILD#L125
|
# https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/nix/APKBUILD#L125
|
||||||
sed -i '/max-jobs/d' /etc/nix/nix.conf
|
sed -i '/max-jobs/d' /etc/nix/nix.conf
|
||||||
echo "max-jobs = $threads" >>/etc/nix/nix.conf
|
echo "max-jobs = $threads" >>/etc/nix/nix.conf
|
||||||
configure_nix_substituters
|
if is_in_china; then
|
||||||
|
echo "substituters = $mirror/store" >>/etc/nix/nix.conf
|
||||||
|
fi
|
||||||
rc-service -q nix-daemon restart
|
rc-service -q nix-daemon restart
|
||||||
# 添加 nix-env 安装的软件到 PATH
|
# 添加 nix-env 安装的软件到 PATH
|
||||||
PATH="/root/.nix-profile/bin:$PATH"
|
PATH="/root/.nix-profile/bin:$PATH"
|
||||||
@ -1756,7 +1743,6 @@ install_nixos() {
|
|||||||
apk del xz
|
apk del xz
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
. /root/.nix-profile/etc/profile.d/nix.sh
|
. /root/.nix-profile/etc/profile.d/nix.sh
|
||||||
configure_nix_substituters
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -3767,11 +3753,61 @@ EOF
|
|||||||
# 禁用 selinux
|
# 禁用 selinux
|
||||||
disable_selinux $os_dir
|
disable_selinux $os_dir
|
||||||
|
|
||||||
|
# opensuse leap 15.6 用 wicked
|
||||||
# opensuse leap 16.0 / tumbleweed 用 NetworkManager
|
# opensuse leap 16.0 / tumbleweed 用 NetworkManager
|
||||||
# 可以直接用 alpine 的 cloud-init 生成 Network Manager 配置
|
if chroot $os_dir rpm -qi wicked; then
|
||||||
create_cloud_init_network_config /net.cfg
|
# sysconfig ifcfg
|
||||||
create_network_manager_config /net.cfg "$os_dir"
|
create_cloud_init_network_config $os_dir/net.cfg
|
||||||
rm /net.cfg
|
chroot $os_dir cloud-init devel net-convert \
|
||||||
|
-p /net.cfg -k yaml -d out -D opensuse -O sysconfig
|
||||||
|
|
||||||
|
# 删除
|
||||||
|
# Created by cloud-init on instance boot automatically, do not edit.
|
||||||
|
#
|
||||||
|
sed -i '/^#/d' "$os_dir/out/etc/sysconfig/network/ifcfg-eth"*
|
||||||
|
|
||||||
|
for ethx in $(get_eths); do
|
||||||
|
# 1. 修复甲骨文云重启后 ipv6 丢失
|
||||||
|
# https://github.com/openSUSE/wicked/issues/1058
|
||||||
|
# 还要注意 wicked dhcpv6 获取到的 ipv6 是 /64,其他 DHCPv6 程序获取到的是 /128
|
||||||
|
echo DHCLIENT6_USE_LAST_LEASE=no >>$os_dir/out/etc/sysconfig/network/ifcfg-$ethx
|
||||||
|
|
||||||
|
# 2. 修复 onlink 网关
|
||||||
|
for prefix in '' 'default '; do
|
||||||
|
if is_staticv4; then
|
||||||
|
get_netconf_to ipv4_gateway
|
||||||
|
echo "${prefix}${ipv4_gateway} - -" >>$os_dir/out/etc/sysconfig/network/ifroute-$ethx
|
||||||
|
fi
|
||||||
|
if is_staticv6; then
|
||||||
|
get_netconf_to ipv6_gateway
|
||||||
|
echo "${prefix}${ipv6_gateway} - -" >>$os_dir/out/etc/sysconfig/network/ifroute-$ethx
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
# 复制配置
|
||||||
|
for file in \
|
||||||
|
"$os_dir/out/etc/sysconfig/network/ifcfg-eth"* \
|
||||||
|
"$os_dir/out/etc/sysconfig/network/ifroute-eth"*; do
|
||||||
|
# 动态 ip 没有 ifroute-eth*
|
||||||
|
if [ -f $file ]; then
|
||||||
|
cp $file $os_dir/etc/sysconfig/network/
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# 清理
|
||||||
|
rm -rf $os_dir/net.cfg $os_dir/out
|
||||||
|
|
||||||
|
else
|
||||||
|
# 如果使用 cloud-init 则需要 touch NetworkManager.conf
|
||||||
|
# 更新到 cloud-init 24.1 后删除
|
||||||
|
# touch $os_dir/etc/NetworkManager/NetworkManager.conf
|
||||||
|
|
||||||
|
# 可以直接用 alpine 的 cloud-init 生成 Network Manager 配置
|
||||||
|
create_cloud_init_network_config /net.cfg
|
||||||
|
create_network_manager_config /net.cfg "$os_dir"
|
||||||
|
rm /net.cfg
|
||||||
|
fi
|
||||||
|
|
||||||
# 选择新内核
|
# 选择新内核
|
||||||
# 只有 leap 有 kernel-azure
|
# 只有 leap 有 kernel-azure
|
||||||
@ -5681,58 +5717,49 @@ get_aws_repo() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_client_name_by_build_ver() {
|
||||||
|
build_ver=$1
|
||||||
|
|
||||||
|
if [ "$build_ver" -ge 22000 ]; then
|
||||||
|
echo 11
|
||||||
|
elif [ "$build_ver" -ge 10240 ]; then
|
||||||
|
echo 10
|
||||||
|
elif [ "$build_ver" -ge 9600 ]; then
|
||||||
|
echo 8.1
|
||||||
|
elif [ "$build_ver" -ge 9200 ]; then
|
||||||
|
echo 8
|
||||||
|
elif [ "$build_ver" -ge 7600 ]; then
|
||||||
|
echo 7
|
||||||
|
elif [ "$build_ver" -ge 6000 ]; then
|
||||||
|
echo vista
|
||||||
|
else
|
||||||
|
error_and_exit "Unknown Build Version: $build_ver"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# 将 AC/SAC 版本号 转换为 LTSC 版本号
|
# 将 AC/SAC 版本号 转换为 LTSC 版本号
|
||||||
# 用于查找驱动
|
# 用于查找驱动
|
||||||
get_windows_name_by_version() {
|
get_server_name_by_build_ver() {
|
||||||
local nt_ver=$1
|
build_ver=$1
|
||||||
local build_ver=$2
|
|
||||||
local windows_type=$3
|
|
||||||
|
|
||||||
local windows_name
|
if [ "$build_ver" -ge 26100 ]; then
|
||||||
windows_name=$(
|
echo 2025
|
||||||
case "$windows_type" in
|
elif [ "$build_ver" -ge 20348 ]; then
|
||||||
client)
|
echo 2022
|
||||||
case "$nt_ver" in
|
elif [ "$build_ver" -ge 17763 ]; then
|
||||||
10.0)
|
echo 2019
|
||||||
if [ "$build_ver" -ge 22000 ]; then
|
elif [ "$build_ver" -ge 14393 ]; then
|
||||||
echo 11
|
echo 2016
|
||||||
else
|
elif [ "$build_ver" -ge 9600 ]; then
|
||||||
echo 10
|
echo 2012 r2
|
||||||
fi
|
elif [ "$build_ver" -ge 9200 ]; then
|
||||||
;;
|
echo 2012
|
||||||
6.3) echo 8.1 ;;
|
elif [ "$build_ver" -ge 7600 ]; then
|
||||||
6.2) echo 8 ;;
|
echo 2008 r2
|
||||||
6.1) echo 7 ;;
|
elif [ "$build_ver" -ge 6001 ]; then
|
||||||
6.0) echo vista ;;
|
echo 2008
|
||||||
esac
|
|
||||||
;;
|
|
||||||
|
|
||||||
server)
|
|
||||||
case "$nt_ver" in
|
|
||||||
10.0)
|
|
||||||
if [ "$build_ver" -ge 26100 ]; then
|
|
||||||
echo 2025
|
|
||||||
elif [ "$build_ver" -ge 20348 ]; then
|
|
||||||
echo 2022
|
|
||||||
elif [ "$build_ver" -ge 17763 ]; then
|
|
||||||
echo 2019
|
|
||||||
else
|
|
||||||
echo 2016
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
6.3) echo '2012 r2' ;;
|
|
||||||
6.2) echo '2012' ;;
|
|
||||||
6.1) echo '2008 r2' ;;
|
|
||||||
6.0) echo '2008' ;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
)
|
|
||||||
|
|
||||||
if [ -n "$windows_name" ]; then
|
|
||||||
echo "$windows_name"
|
|
||||||
else
|
else
|
||||||
error_and_exit "Unknown Windows Version: $nt_ver $build_ver $windows_type"
|
error_and_exit "Unknown Build Version: $build_ver"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6041,7 +6068,12 @@ install_windows() {
|
|||||||
# 检测 client/server,并转换成标准版 windows 名称
|
# 检测 client/server,并转换成标准版 windows 名称
|
||||||
# 用于将 Hyper-V Server / Azure Stack HCI / Windows Server AC 的版本号转换成对应的 LTSC 版本号,用于查找驱动
|
# 用于将 Hyper-V Server / Azure Stack HCI / Windows Server AC 的版本号转换成对应的 LTSC 版本号,用于查找驱动
|
||||||
windows_type=$(get_windows_type_from_windows_drive /wim)
|
windows_type=$(get_windows_type_from_windows_drive /wim)
|
||||||
product_ver=$(get_windows_name_by_version "$nt_ver" "$build_ver" "$windows_type")
|
product_ver=$(
|
||||||
|
case "$windows_type" in
|
||||||
|
client) get_client_name_by_build_ver "$build_ver" ;;
|
||||||
|
server) get_server_name_by_build_ver "$build_ver" ;;
|
||||||
|
esac
|
||||||
|
)
|
||||||
|
|
||||||
# 检测 sac 和 nvme
|
# 检测 sac 和 nvme
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user