mirror of
https://github.com/bin456789/reinstall.git
synced 2025-06-08 05:19:57 +00:00
core: 不重要的优化
- ubuntu: 支持 24.10 minimal - core: 添加 -h --help 参数
This commit is contained in:
parent
eb98bc34a2
commit
7e3f12690e
@ -394,8 +394,8 @@ bash reinstall.sh windows \
|
||||
|
||||
#### The following drivers will automatic download and install as needed, without the need for manual addition
|
||||
|
||||
- Virtio ([Virtio](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/), [Alibaba Cloud](https://www.alibabacloud.com/help/ecs/user-guide/update-red-hat-virtio-drivers-of-windows-instances))
|
||||
- XEN ([XEN](https://xenproject.org/resources/downloads/), [Citrix](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Upgrading_PV_drivers.html#win2008-citrix-upgrade), [AWS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/xen-drivers-overview.html))
|
||||
- Virtio ([Virtio](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/), [Alibaba Cloud](https://www.alibabacloud.com/help/ecs/user-guide/install-the-virtio-driver-1))
|
||||
- XEN ([~~XEN~~(unsigned)](https://xenproject.org/resources/downloads/), [Citrix](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Upgrading_PV_drivers.html#win2008-citrix-upgrade), [AWS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/xen-drivers-overview.html))
|
||||
- AWS ([ENA Network Adapter](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ena-driver-releases-windows.html), [NVMe Storage Controller](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-driver-version-history.html))
|
||||
- GCP ([gVNIC Network Adapter](https://cloud.google.com/compute/docs/networking/using-gvnic), [GGA Display Adapter](https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display))
|
||||
- Azure ([MANA Network Adapter](https://learn.microsoft.com/azure/virtual-network/accelerated-networking-mana-windows))
|
||||
|
@ -394,8 +394,8 @@ bash reinstall.sh windows \
|
||||
|
||||
#### 以下驱动会自动按需下载安装,无需手动添加
|
||||
|
||||
- Virtio ([Virtio](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/)、[阿里云](https://www.alibabacloud.com/help/ecs/user-guide/update-red-hat-virtio-drivers-of-windows-instances))
|
||||
- XEN ([XEN](https://xenproject.org/resources/downloads/)、[Citrix](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Upgrading_PV_drivers.html#win2008-citrix-upgrade)、[AWS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/xen-drivers-overview.html))
|
||||
- Virtio ([Virtio](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/)、[阿里云](https://www.alibabacloud.com/help/ecs/user-guide/install-the-virtio-driver-1))
|
||||
- XEN ([~~XEN~~(未签名)](https://xenproject.org/resources/downloads/)、[Citrix](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Upgrading_PV_drivers.html#win2008-citrix-upgrade)、[AWS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/xen-drivers-overview.html))
|
||||
- AWS ([ENA 网卡](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ena-driver-releases-windows.html)、[NVME 存储控制器](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-driver-version-history.html))
|
||||
- GCP ([gVNIC 网卡](https://cloud.google.com/compute/docs/networking/using-gvnic)、[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))
|
||||
|
32
reinstall.sh
32
reinstall.sh
@ -153,10 +153,10 @@ is_in_china() {
|
||||
# 备用 www.garmin.com.cn
|
||||
# 备用 www.autodesk.com.cn
|
||||
# 备用 www.keysight.com.cn
|
||||
_loc=$(curl -L http://www.visa.cn/cdn-cgi/trace | grep '^loc=' | cut -d= -f2)
|
||||
if [ -z "$_loc" ]; then
|
||||
if ! _loc=$(curl -L http://www.visa.cn/cdn-cgi/trace | grep '^loc=' | cut -d= -f2 | grep .); then
|
||||
error_and_exit "Can not get location."
|
||||
fi
|
||||
echo "Location: $_loc" >&2
|
||||
fi
|
||||
[ "$_loc" = CN ]
|
||||
}
|
||||
@ -341,7 +341,7 @@ test_url_real() {
|
||||
real_type=$(file_enhanced $tmp_file)
|
||||
echo "File type: $real_type"
|
||||
|
||||
# debian 9 ubuntu 16.04 可能会将 iso 识别成 raw
|
||||
# debian 9 ubuntu 16.04-20.04 可能会将 iso 识别成 raw
|
||||
for type in $expect_types $([ "$expect_types" = iso ] && echo raw); do
|
||||
if [[ ."$real_type" = *."$type" ]]; then
|
||||
# 如果要设置变量
|
||||
@ -1214,17 +1214,11 @@ Continue?
|
||||
ci_mirror=https://cloud-images.ubuntu.com
|
||||
fi
|
||||
|
||||
# 22.04 和以下没有 minimal aarch64 镜像
|
||||
# 以下版本有 minimal 镜像
|
||||
# amd64 所有
|
||||
# arm64 24.04 和以上
|
||||
is_have_minimal_image() {
|
||||
[ "$basearch_alt" = amd64 ] || [ "$releasever" = 24.04 ]
|
||||
}
|
||||
|
||||
is_should_use_minimal_cloud_image() {
|
||||
if [ "$minimal" = 1 ] && ! is_have_minimal_image; then
|
||||
echo "Fallback to normal cloud image."
|
||||
return 1
|
||||
fi
|
||||
[ "$minimal" = 1 ]
|
||||
[ "$basearch_alt" = amd64 ] || [ "${releasever%.*}" -ge 24 ]
|
||||
}
|
||||
|
||||
get_suffix() {
|
||||
@ -1237,7 +1231,10 @@ Continue?
|
||||
fi
|
||||
}
|
||||
|
||||
if is_should_use_minimal_cloud_image; then
|
||||
if [ "$minimal" = 1 ]; then
|
||||
if ! is_have_minimal_image; then
|
||||
error_and_exit "Minimal cloud image is not available for $releasever $basearch_alt."
|
||||
fi
|
||||
eval ${step}_img="$ci_mirror/minimal/releases/$codename/release/ubuntu-$releasever-minimal-cloudimg-$basearch_alt$(get_suffix).img"
|
||||
else
|
||||
eval ${step}_img="$ci_mirror/releases/$releasever/release/ubuntu-$releasever-server-cloudimg-$basearch_alt$(get_suffix).img"
|
||||
@ -3629,7 +3626,7 @@ else
|
||||
fi
|
||||
|
||||
long_opts=
|
||||
for o in ci installer debug minimal allow-ping force-cn \
|
||||
for o in ci installer debug minimal allow-ping force-cn help \
|
||||
add-driver: \
|
||||
hold: sleep: \
|
||||
iso: \
|
||||
@ -3651,7 +3648,7 @@ for o in ci installer debug minimal allow-ping force-cn \
|
||||
done
|
||||
|
||||
# 整理参数
|
||||
if ! opts=$(getopt -n $0 -o "" --long "$long_opts" -- "$@"); then
|
||||
if ! opts=$(getopt -n $0 -o "h" --long "$long_opts" -- "$@"); then
|
||||
exit
|
||||
fi
|
||||
|
||||
@ -3659,6 +3656,9 @@ eval set -- "$opts"
|
||||
# shellcheck disable=SC2034
|
||||
while true; do
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
usage_and_exit
|
||||
;;
|
||||
--commit)
|
||||
commit=$2
|
||||
shift 2
|
||||
|
Loading…
x
Reference in New Issue
Block a user