From c99d1e4906e2018c8e1b6b96b13d6444824b5822 Mon Sep 17 00:00:00 2001 From: qz_cx Date: Mon, 20 Oct 2025 11:31:08 +0800 Subject: [PATCH] Remove the kytuning boot path after the system installation is completed, as some machines may reinstall it after installation. --- appStore/utils/clear_kytuning_efibootmgr.sh | 16 ++++++++++++++++ appStore/utils/kytuning-ks.cfg | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 appStore/utils/clear_kytuning_efibootmgr.sh diff --git a/appStore/utils/clear_kytuning_efibootmgr.sh b/appStore/utils/clear_kytuning_efibootmgr.sh new file mode 100644 index 0000000..5bc796d --- /dev/null +++ b/appStore/utils/clear_kytuning_efibootmgr.sh @@ -0,0 +1,16 @@ +#!/bin/bash +mkdir wqz +# 获取所有包含 "Kytuning" 的引导项的引导号 +boot_entries=$(sudo efibootmgr | awk '/Kytuning/ {print $1}') + +if [ -n "$boot_entries" ]; then + # 删除每个引导项 + for entry in $boot_entries; do + # 清理引导号中的无效字符*并去掉 "Boot" 字段 + clean_entry=$(echo "$entry" | tr -cd '[:alnum:]' | sed 's/Boot//') + + # 删除引导项 + sudo efibootmgr -b "$clean_entry" -B + echo "已成功删除引导项 '$clean_entry'" + done +fi \ No newline at end of file diff --git a/appStore/utils/kytuning-ks.cfg b/appStore/utils/kytuning-ks.cfg index 4e16c5e..51ccdcc 100644 --- a/appStore/utils/kytuning-ks.cfg +++ b/appStore/utils/kytuning-ks.cfg @@ -54,7 +54,8 @@ systemctl disable multipathd.service if [ -e /bin/.kylin-post-actions ];then /bin/bash -x /bin/.kylin-post-actions &> /var/log/.kylin-post-actions.log fi -reboot +# reboot +/bin/bash run/install/repo/clear_kytuning_efibootmgr.sh %end # Environment groups -- Gitee