diff --git a/README.en.md b/README.en.md index f26bed5..efd9b38 100644 --- a/README.en.md +++ b/README.en.md @@ -581,11 +581,12 @@ bash reinstall.sh windows \ - `--add-driver INF_OR_DIR` Add additional driver, specifying .inf path, or the folder contains .inf file. - The driver must be downloaded to current system first. - This parameter can be set multiple times to add different driver. +- `--no-auto-drivers` Prevent the script automatically download drivers. You need to use `--add-driver` to add the missing drivers. - `--frpc-config PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL of the configuration file. - `--hold 1` Reboot only into install environment, without running installer, only for SSH connect to test network connection. - `--hold 2` Allow SSH connections for modifying `boot.wim`, `install.wim` or other contents before rebooting into the official Windows installation program, with the disk mounted at `/os`. -#### The following drivers will automatic download and install as needed, without the need for manual addition +#### The following drivers will be downloaded and installed automatically as needed; use `--no-auto-drivers` to disable this feature - VirtIO ([Community][virtio-virtio], [Alibaba Cloud][virtio-aliyun], [Tencent Cloud][virtio-qcloud], [GCP][virtio-gcp], [GCP (Win7/2008 SHA-1)][virtio-gcp-win6.1sha1])) - XEN ([~~Community~~][xen-xen] (unsigned), [Citrix][xen-citrix], [AWS][xen-aws]) diff --git a/README.md b/README.md index e811c38..c792c02 100644 --- a/README.md +++ b/README.md @@ -581,11 +581,12 @@ bash reinstall.sh windows \ - `--add-driver INF_OR_DIR` 添加额外驱动,填写 .inf 路径,或者 .inf 所在的文件夹 - 需先下载驱动到当前系统 - 可多次设置该参数以添加不同的驱动 +- `--no-auto-drivers` 禁止脚本自动下载驱动,你需要用 `--add-driver` 补全驱动 - `--frpc-config PATH` 添加 frpc 内网穿透,参数填配置文件的本地路径或 HTTP 链接 - `--hold 1` 仅重启到安装环境,不运行安装,用于 SSH 登录验证网络连通性 - `--hold 2` 用于在进入 Windows 官方安装程序之前,SSH 登录修改 `boot.wim`、`install.wim` 或者其它内容,硬盘挂载在 `/os` -#### 以下驱动会自动按需下载安装,无需手动添加 +#### 以下驱动会自动按需下载安装,使用 `--no-auto-drivers` 可禁止此功能 - VirtIO ([社区版][virtio-virtio], [阿里云][virtio-aliyun], [腾讯云][virtio-qcloud], [GCP][virtio-gcp], [GCP (Win7/2008 SHA-1)][virtio-gcp-win6.1sha1]) - XEN ([~~社区版~~][xen-xen] (未签名), [Citrix][xen-citrix], [AWS][xen-aws]) diff --git a/reinstall.sh b/reinstall.sh index f08eba6..2b5f86a 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -117,10 +117,11 @@ Usage: $reinstall_____ anolis 7|8|23 For Windows Only: [--allow-ping] [--rdp-port PORT] - [--add-driver INF_OR_DIR] + [--add-driver INF_OR_DIR] (only for iso installation) + [--no-auto-drivers] (only for iso installation) For Linux Only: - [--no-cloud-kernel] (Debian/Ubuntu/Alpine) + [--no-cloud-kernel] (only for Debian/Ubuntu/Alpine) Manual: https://github.com/bin456789/reinstall @@ -724,6 +725,7 @@ is_cpu_supports_x86_64_v3() { # /proc/cpuinfo 不显示 lzcnt, 可用 abm 代替,但 cygwin 也不显示 abm # /proc/cpuinfo 不显示 osxsave, 故用 xsave 代替 + # 在 32 位 cygwin 上也能正常识别 need_flags="avx avx2 bmi1 bmi2 f16c fma movbe xsave" had_flags=$(grep -m 1 ^flags /proc/cpuinfo | awk -F': ' '{print $2}') @@ -3537,7 +3539,7 @@ build_extra_cmdline() { # 会将 extra.xxx=yyy 写入新系统的 /etc/modprobe.d/local.conf # https://answers.launchpad.net/ubuntu/+question/249456 # https://salsa.debian.org/installer-team/rootskel/-/blob/master/src/lib/debian-installer-startup.d/S02module-params?ref_type=heads - for key in confhome hold force_boot_mode force_cn force_old_windows_setup cloud_image no_cloud_kernel main_disk \ + for key in confhome hold force_boot_mode force_cn force_old_windows_setup cloud_image no_cloud_kernel no_auto_drivers main_disk \ elts deb_mirror \ username ssh_port rdp_port web_port web_path allow_ping; do value=${!key} @@ -4773,7 +4775,7 @@ fi # 整理参数 long_opts= -for o in ci installer debug minimal no-cloud-kernel allow-ping force-cn help \ +for o in ci installer debug minimal no-cloud-kernel no-auto-drivers allow-ping force-cn help \ add-driver: \ hold: sleep: \ iso: \ @@ -4873,6 +4875,10 @@ while true; do no_cloud_kernel=1 shift ;; + --no-auto-drivers) + no_auto_drivers=1 + shift + ;; --allow-ping) allow_ping=1 shift diff --git a/trans.sh b/trans.sh index bc7508e..a80d5ae 100644 --- a/trans.sh +++ b/trans.sh @@ -6921,6 +6921,14 @@ install_windows() { drv=/os/drivers mkdir_clear "$drv" + # 自定义驱动 + add_driver_custom + + # shellcheck disable=SC2154 + if [ "$no_auto_drivers" = 1 ]; then + return + fi + # 这里有坑 # $(get_cloud_vendor) 调用了 cache_dmi_and_virt # 但是 $(get_cloud_vendor) 运行在 subshell 里面 @@ -7026,9 +7034,6 @@ install_windows() { grep -iq 8086 /sys/class/net/e*/device/vendor; then add_driver_intel_nic fi - - # 自定义驱动 - add_driver_custom } add_driver_intel_nic() {