mirror of
https://github.com/bin456789/reinstall.git
synced 2026-10-03 22:17:46 +08:00
core: 添加参数禁止安装云内核
This commit is contained in:
@@ -189,6 +189,7 @@ bash reinstall.sh anolis 7|8|23
|
|||||||
- `--ssh-port PORT` Change the SSH port
|
- `--ssh-port PORT` Change the SSH port
|
||||||
- `--web-port PORT` Change the Web port (for log observation during installation only)
|
- `--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.
|
- `--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.
|
||||||
- `--hold 1` Reboot only into install environment, without running installer, only for SSH connect to test network connection.
|
- `--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.
|
- `--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.
|
||||||
|
|
||||||
|
|||||||
@@ -189,6 +189,7 @@ bash reinstall.sh anolis 7|8|23
|
|||||||
- `--ssh-port PORT` 修改 SSH 端口
|
- `--ssh-port PORT` 修改 SSH 端口
|
||||||
- `--web-port PORT` 修改 Web 端口(安装期间观察日志用)
|
- `--web-port PORT` 修改 Web 端口(安装期间观察日志用)
|
||||||
- `--frpc-config PATH` 添加 frpc 内网穿透,参数填配置文件的本地路径或 HTTP 链接
|
- `--frpc-config PATH` 添加 frpc 内网穿透,参数填配置文件的本地路径或 HTTP 链接
|
||||||
|
- `--no-cloud-kernel` 不使用云内核,避免部分机器黑屏/花屏,适用于 Debian、Ubuntu、Alpine
|
||||||
- `--hold 1` 仅重启到安装环境,不运行安装,用于 SSH 登录验证网络连通性
|
- `--hold 1` 仅重启到安装环境,不运行安装,用于 SSH 登录验证网络连通性
|
||||||
- `--hold 2` 安装结束后不重启,用于 SSH 登录修改系统内容,Debian/Kali 会挂载在 `/target`,其它系统会挂载在 `/os`
|
- `--hold 2` 安装结束后不重启,用于 SSH 登录修改系统内容,Debian/Kali 会挂载在 `/target`,其它系统会挂载在 `/os`
|
||||||
|
|
||||||
|
|||||||
+19
-4
@@ -119,7 +119,10 @@ Usage: $reinstall_____ anolis 7|8|23
|
|||||||
[--rdp-port PORT]
|
[--rdp-port PORT]
|
||||||
[--add-driver INF_OR_DIR]
|
[--add-driver INF_OR_DIR]
|
||||||
|
|
||||||
Manual: https://github.com/bin456789/reinstall
|
For Linux Only:
|
||||||
|
[--no-cloud-kernel] (Debian/Ubuntu/Alpine)
|
||||||
|
|
||||||
|
Manual: https://github.com/bin456789/reinstall
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
exit 1
|
||||||
@@ -1470,11 +1473,19 @@ Continue?
|
|||||||
# cloud.debian.org 同样在瑞典,不是 cdn
|
# cloud.debian.org 同样在瑞典,不是 cdn
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# kernel
|
||||||
|
if [ "$no_cloud_kernel" = 1 ]; then
|
||||||
|
flavour=
|
||||||
|
else
|
||||||
is_virt && flavour=-cloud || flavour=
|
is_virt && flavour=-cloud || flavour=
|
||||||
|
|
||||||
# debian 10 云内核 vultr efi vnc 没有显示
|
# debian 10 云内核 vultr efi vnc 没有显示
|
||||||
[ "$releasever" -le 10 ] && flavour=
|
# 现在改成手动 --no-cloud-kernel 规避
|
||||||
|
# [ "$releasever" -le 10 ] && flavour=
|
||||||
|
|
||||||
# 甲骨文 arm64 cloud 内核 vnc 没有显示
|
# 甲骨文 arm64 cloud 内核 vnc 没有显示
|
||||||
[ "$basearch_alt" = arm64 ] && flavour=
|
[ "$basearch_alt" = arm64 ] && flavour=
|
||||||
|
fi
|
||||||
|
|
||||||
if is_use_cloud_image; then
|
if is_use_cloud_image; then
|
||||||
# cloud image
|
# cloud image
|
||||||
@@ -3526,7 +3537,7 @@ build_extra_cmdline() {
|
|||||||
# 会将 extra.xxx=yyy 写入新系统的 /etc/modprobe.d/local.conf
|
# 会将 extra.xxx=yyy 写入新系统的 /etc/modprobe.d/local.conf
|
||||||
# https://answers.launchpad.net/ubuntu/+question/249456
|
# 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
|
# 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 main_disk \
|
for key in confhome hold force_boot_mode force_cn force_old_windows_setup cloud_image no_cloud_kernel main_disk \
|
||||||
elts deb_mirror \
|
elts deb_mirror \
|
||||||
username ssh_port rdp_port web_port web_path allow_ping; do
|
username ssh_port rdp_port web_port web_path allow_ping; do
|
||||||
value=${!key}
|
value=${!key}
|
||||||
@@ -4762,7 +4773,7 @@ fi
|
|||||||
|
|
||||||
# 整理参数
|
# 整理参数
|
||||||
long_opts=
|
long_opts=
|
||||||
for o in ci installer debug minimal allow-ping force-cn help \
|
for o in ci installer debug minimal no-cloud-kernel allow-ping force-cn help \
|
||||||
add-driver: \
|
add-driver: \
|
||||||
hold: sleep: \
|
hold: sleep: \
|
||||||
iso: \
|
iso: \
|
||||||
@@ -4858,6 +4869,10 @@ while true; do
|
|||||||
minimal=1
|
minimal=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--no-cloud-kernel)
|
||||||
|
no_cloud_kernel=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--allow-ping)
|
--allow-ping)
|
||||||
allow_ping=1
|
allow_ping=1
|
||||||
shift
|
shift
|
||||||
|
|||||||
@@ -1613,11 +1613,16 @@ install_alpine() {
|
|||||||
rc-update add acpid
|
rc-update add acpid
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 如果是 vm 就用 virt 内核
|
# 内核
|
||||||
if is_virt; then
|
# shellcheck disable=SC2154
|
||||||
kernel_flavor="virt"
|
if [ "$no_cloud_kernel" = 1 ]; then
|
||||||
|
kernel_flavor=lts
|
||||||
else
|
else
|
||||||
kernel_flavor="lts"
|
if is_virt; then
|
||||||
|
kernel_flavor=virt
|
||||||
|
else
|
||||||
|
kernel_flavor=lts
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 重置为官方仓库配置
|
# 重置为官方仓库配置
|
||||||
@@ -8306,6 +8311,13 @@ get_ubuntu_kernel_flavor() {
|
|||||||
# https://github.com/canonical/cloud-init/blob/main/tools/ds-identify
|
# https://github.com/canonical/cloud-init/blob/main/tools/ds-identify
|
||||||
# http://git.annexia.org/?p=virt-what.git;a=blob;f=virt-what.in;hb=HEAD
|
# http://git.annexia.org/?p=virt-what.git;a=blob;f=virt-what.in;hb=HEAD
|
||||||
|
|
||||||
|
is_ubuntu_lts && suffix=-hwe-$releasever || suffix=
|
||||||
|
|
||||||
|
if [ "$no_cloud_kernel" = 1 ]; then
|
||||||
|
echo generic$suffix
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
# 这里有坑
|
# 这里有坑
|
||||||
# $(get_cloud_vendor) 调用了 cache_dmi_and_virt
|
# $(get_cloud_vendor) 调用了 cache_dmi_and_virt
|
||||||
# 但是 $(get_cloud_vendor) 运行在 subshell 里面
|
# 但是 $(get_cloud_vendor) 运行在 subshell 里面
|
||||||
@@ -8316,7 +8328,6 @@ get_ubuntu_kernel_flavor() {
|
|||||||
case "$vendor" in
|
case "$vendor" in
|
||||||
aws | gcp | oracle | azure | ibm) echo $vendor ;;
|
aws | gcp | oracle | azure | ibm) echo $vendor ;;
|
||||||
*)
|
*)
|
||||||
is_ubuntu_lts && suffix=-hwe-$releasever || suffix=
|
|
||||||
if is_virt; then
|
if is_virt; then
|
||||||
echo virtual$suffix
|
echo virtual$suffix
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user