From 892e159df7998624a149bdfb364742a87fe64348 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Wed, 23 Sep 2026 21:42:55 +0800 Subject: [PATCH] =?UTF-8?q?debian/opensuse:=20=E5=AE=8C=E5=96=84=E4=BA=91?= =?UTF-8?q?=E5=86=85=E6=A0=B8=E9=A9=B1=E5=8A=A8=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 2 +- README.md | 2 +- reinstall.sh | 21 ++++++++++++++++----- trans.sh | 19 +++++++++++++------ 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/README.en.md b/README.en.md index 1d82d8c..1b45823 100644 --- a/README.en.md +++ b/README.en.md @@ -189,7 +189,7 @@ bash reinstall.sh anolis 7|8|23 - `--ssh-port PORT` Change the SSH port - `--web-port PORT` Change the Web port (for log observation during installation only) - `--frpc-config PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL of the configuration file. -- `--no-cloud-kernel` Avoid using cloud kernel to prevent black or glitch screens on certain machines; applicable to Debian, Ubuntu, and Alpine. +- `--no-cloud-kernel` Avoid using cloud kernel to prevent black or glitch screens on certain machines; applicable to Debian, Ubuntu, Alpine and openSUSE. - `--hold 1` Reboot only into install environment, without running installer, only for SSH connect to test network connection. - `--hold 2` Prevent reboot after installation completes, allowing SSH login to modify system content; the system is mounted at `/target` for Debian/Kali and `/os` for other distros. diff --git a/README.md b/README.md index 15f176e..2fb9d3d 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ bash reinstall.sh anolis 7|8|23 - `--ssh-port PORT` 修改 SSH 端口 - `--web-port PORT` 修改 Web 端口(安装期间观察日志用) - `--frpc-config PATH` 添加 frpc 内网穿透,参数填配置文件的本地路径或 HTTP 链接 -- `--no-cloud-kernel` 不使用云内核,避免部分机器黑屏/花屏,适用于 Debian、Ubuntu、Alpine +- `--no-cloud-kernel` 不使用云内核,避免部分机器黑屏/花屏,适用于 Debian、Ubuntu、Alpine、openSUSE - `--hold 1` 仅重启到安装环境,不运行安装,用于 SSH 登录验证网络连通性 - `--hold 2` 安装结束后不重启,用于 SSH 登录修改系统内容,Debian/Kali 会挂载在 `/target`,其它系统会挂载在 `/os` diff --git a/reinstall.sh b/reinstall.sh index a68209f..5f663c1 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -11,7 +11,7 @@ confhome_cn=https://cnb.cool/bin456789/reinstall/-/git/raw/main # confhome_cn=https://www.ghproxy.cc/https://raw.githubusercontent.com/bin456789/reinstall/main # 用于判断 reinstall.sh 和 trans.sh 是否兼容 -SCRIPT_VERSION=4BACD833-A585-23BA-6CBB-9AA4E08E0004 +SCRIPT_VERSION=4BACD833-A585-23BA-6CBB-9AA4E08E0005 # 记录要用到的 windows 程序,运行时输出删除 \r WINDOWS_EXES='cmd powershell wmic reg diskpart netsh bcdedit mountvol' @@ -4187,9 +4187,18 @@ exit_if_cant_use_cloud_kernel() { can_use_cloud_kernel() { # initrd 下也要使用,不要用 <<< - # 有些虚拟机用了 ahci,但云内核没有 ahci 驱动 - cloud_eth_modules='ena|gve|mana|virtio_net|xen_netfront|hv_netvsc|vmxnet3|mlx4_en|mlx4_core|mlx5_core|ixgbevf' - cloud_blk_modules='ata_generic|ata_piix|pata_legacy|nvme|virtio_blk|virtio_scsi|xen_blkfront|xen_scsifront|hv_storvsc|vmw_pvscsi' + if [ "$distro" = opensuse ]; then + # kernel-default-base 缺少 ena gve mlx mana 驱动 + cloud_eth_modules='virtio_net|xen_netfront|hv_netvsc|vmxnet3|e100|e1000|e1000e|8139cp|8139too' + cloud_blk_modules='ata_generic|ata_piix|ahci|nvme|virtio_blk|virtio_scsi|xen_blkfront|xen_scsifront|hv_storvsc|vmw_pvscsi' + else + # debian kali + cloud_eth_modules='ena|gve|mana|virtio_net|xen_netfront|hv_netvsc|vmxnet3|mlx4_en|mlx4_core|mlx5_core|ixgbevf' + cloud_blk_modules='ata_generic|ata_piix|pata_legacy|nvme|virtio_blk|virtio_scsi|xen_blkfront|xen_scsifront|hv_storvsc|vmw_pvscsi' + if { [ "$distro" = debian ] && [ "$releasever" -ge 13 ]; } || [ "$distro" = kali ]; then + cloud_blk_modules="$cloud_blk_modules|ahci" + fi + fi # disk drivers="$(get_disk_drivers $1)" @@ -4221,6 +4230,8 @@ create_can_use_cloud_kernel_sh() { $(get_function get_disk_drivers) $(get_function can_use_cloud_kernel) + distro="$distro" + releasever="$releasever" can_use_cloud_kernel "\$@" EOF } @@ -4335,7 +4346,7 @@ EOF EOF # 判断云镜像 debain 能否用云内核 - if is_distro_like_debian; then + if is_distro_like_debian || [ "$distro" = opensuse ]; then create_can_use_cloud_kernel_sh can_use_cloud_kernel.sh insert_into_file init before '^exec (/bin/busybox )?switch_root' <