From 62ff8a732b47f3c26d7007ce511b1781f91b9a91 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Mon, 21 Oct 2024 00:22:08 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E4=B8=8D=E9=87=8D=E8=A6=81=E7=9A=84?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/trans.sh b/trans.sh index 3e2355295..681f13038 100644 --- a/trans.sh +++ b/trans.sh @@ -246,7 +246,7 @@ setup_websocketd() { web_port=80 fi - killall websocketd || true + pkill websocketd || true # websocketd 遇到 \n 才推送,因此要转换 \r 为 \n websocketd --port "$web_port" --loglevel=fatal --staticdir=/tmp \ stdbuf -oL -eL sh -c "tail -fn+0 /reinstall.log | tr '\r' '\n'" & @@ -416,6 +416,8 @@ clear_previous() { dmsetup remove_all fi disconnect_qcow + # 安装 arch 有 gpg-agent 进程驻留 + pkill gpg-agent || true rc-service -q --ifexists --ifstarted nix-daemon stop swapoff -a umount_all @@ -1539,6 +1541,13 @@ install_arch_gentoo() { apk add arch-install-scripts + # 为了二次运行时 /etc/pacman.conf 未修改 + if [ -f /etc/pacman.conf.orig ]; then + cp /etc/pacman.conf.orig /etc/pacman.conf + else + cp /etc/pacman.conf /etc/pacman.conf.orig + fi + # 设置 repo insert_into_file /etc/pacman.conf before '\[core\]' <$os_dir/etc/machine-id + fi + + rm -f $os_dir/var/lib/systemd/random-seed } download_cloud_init_config() { @@ -2501,7 +2525,7 @@ EOF download_cloud_init_config $os_dir - truncate_machine_id $os_dir + clear_machine_id $os_dir # el/ol/fedora/国产fork # 1. 禁用 selinux kdump @@ -3256,8 +3280,8 @@ install_qcow_by_copy() { # selinux kdump disable_selinux_kdump /os - # 部分镜像例如 centos7 要手动删除 machine-id - truncate_machine_id /os + # centos7 删除 machine-id 后不会自动重建 + clear_machine_id /os # el7 yum 可能会使用 ipv6,即使没有 ipv6 网络 if [ "$releasever" = 7 ]; then