Skip to content

Commit

Permalink
linux: 为物理机安装 firmware 和 microcode
Browse files Browse the repository at this point in the history
  • Loading branch information
bin456789 committed Oct 20, 2024
1 parent 3854e0c commit 3b74fb6
Show file tree
Hide file tree
Showing 4 changed files with 221 additions and 62 deletions.
4 changes: 2 additions & 2 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ bash reinstall.sh centos 9
- `--hold 2` Prevent reboot after installation completes, allowing SSH login to modify system content; the system is mounted at `/os` (this feature is not supported on Debian/Kali).

> [!TIP]
> When installing Debian / Kali, x86 architectures can monitor the installation progress through VNC in the background, while ARM architectures can use the serial console.
> When installing Debian/Kali, x86 architectures can monitor the installation progress through VNC in the background, while ARM architectures can use the serial console.
>
> When installing other systems, can monitor the progress through various methods (SSH, HTTP 80 port, VNC in the background, serial console).
> <br />Even if errors occur during the installation process, you can still install to Alpine via SSH by running `/trans.sh alpine`
Expand Down Expand Up @@ -213,7 +213,7 @@ bash reinstall.sh dd --img https://example.com/xxx.xz
- `--rdp-port PORT` Change RDP port (DD Windows only)
- `--ssh-port PORT` Change SSH port (for log observation during installation)
- `--web-port PORT` Change Web port (for log observation during installation)
- `--hold 2` Prevent entering the system after DD completion. You can connect via SSH to modify system content, with the system mounted at `/os`.
- `--hold 2` Prevent reboot after the DD process finishes, allowing SSH login to modify system content. The Windows system will be mounted at `/os`, but Linux systems will **NOT** be automatically mounted.

> [!TIP]
> Can monitor the progress through various methods (SSH, HTTP 80 port, VNC in the background, serial console).
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ bash reinstall.sh centos 9
- `--password PASSWORD` 设置密码
- `--ssh-port PORT` 修改 SSH 端口(安装期间观察日志用,也用于新系统)
- `--web-port PORT` 修改 Web 端口(安装期间观察日志用)
- `--hold 2` 安装结束后不重启,此时可以 SSH 登录修改系统内容,系统挂载在 `/os` (此功能不支持 Debian / Kali)
- `--hold 2` 安装结束后不重启,此时可以 SSH 登录修改系统内容,系统挂载在 `/os` (此功能不支持 Debian/Kali)

> [!TIP]
> 安装 Debian / Kali 时,x86 可通过后台 VNC 查看安装进度,ARM 可通过串行控制台查看安装进度。
> 安装 Debian/Kali 时,x86 可通过后台 VNC 查看安装进度,ARM 可通过串行控制台查看安装进度。
>
> 安装其它系统时,可通过多种方式(SSH、HTTP 80 端口、后台 VNC、串行控制台)查看安装进度。
> <br />即使安装过程出错,也能通过 SSH 运行 `/trans.sh alpine` 安装到 Alpine。
Expand Down Expand Up @@ -213,7 +213,7 @@ bash reinstall.sh dd --img https://example.com/xxx.xz
- `--rdp-port PORT` 修改 RDP 端口 (仅限 DD Windows)
- `--ssh-port PORT` 修改 SSH 端口(安装期间观察日志用)
- `--web-port PORT` 修改 Web 端口(安装期间观察日志用)
- `--hold 2` DD 结束后不重启,此时可以 SSH 登录修改系统内容,系统挂载在 `/os`
- `--hold 2` DD 结束后不重启,此时可以 SSH 登录修改系统内容,Windows 系统会挂载在 `/os`,Linux 系统**不会**自动挂载

> [!TIP]
> 可通过多种方式(SSH、HTTP 80 端口、后台 VNC、串行控制台)查看安装进度。
Expand Down
15 changes: 9 additions & 6 deletions reinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ setos() {
}

setos_debian() {
is_debian_eol() {
is_debian_elts() {
[ "$releasever" -le 10 ]
}

Expand All @@ -877,11 +877,14 @@ setos() {

if is_use_cloud_image; then
# cloud image
# debian --ci 用此标记要是否要换 elts 源
# shellcheck disable=SC2034
is_debian_elts && elts=1 || elts=0
is_virt && ci_type=genericcloud || ci_type=generic
eval ${step}_img=$cdimage_mirror/cloud/$codename/latest/debian-$releasever-$ci_type-$basearch_alt.qcow2
else
# 传统安装
if is_debian_eol; then
if is_debian_elts; then
# https://github.com/tuna/issues/issues/1999
# nju 也没同步
if false && is_in_china; then
Expand Down Expand Up @@ -2465,7 +2468,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 force_old_windows_setup cloud_image main_disk \
for key in confhome hold force force_old_windows_setup cloud_image main_disk elts \
ssh_port rdp_port web_port allow_ping; do
value=${!key}
if [ -n "$value" ]; then
Expand Down Expand Up @@ -2517,8 +2520,8 @@ build_nextos_cmdline() {
nextos_cmdline+=" mirror/http/hostname=$nextos_hostname"
nextos_cmdline+=" mirror/http/directory=/$nextos_directory"
nextos_cmdline+=" base-installer/kernel/image=$nextos_kernel"
# eol 的 debian 不能用 security 源,否则安装过程会提示无法访问
if [ "$nextos_distro" = debian ] && is_debian_eol; then
# elts 的 debian 不能用 security 源,否则安装过程会提示无法访问
if [ "$nextos_distro" = debian ] && is_debian_elts; then
nextos_cmdline+=" apt-setup/services-select="
fi
# kali 安装好后网卡是 eth0 这种格式,但安装时不是
Expand Down Expand Up @@ -2750,7 +2753,7 @@ EOF
chmod a+x cdrom/simple-cdd/kali.postinst
fi

if [ "$distro" = debian ] && is_debian_eol; then
if [ "$distro" = debian ] && is_debian_elts; then
curl -Lo usr/share/keyrings/debian-archive-keyring.gpg https://deb.freexian.com/extended-lts/archive-key.gpg
fi

Expand Down
Loading

0 comments on commit 3b74fb6

Please sign in to comment.