Files
chromebox_10th_audio_driver/scripts/remove-kaisa-ucm-overlay.sh
jack bda6b60c15 docs(kaisa): make UCM HiFi the only supported path
Promote UCM2/HiFi (Jack-driven) as the primary delivery, add HISTORY.md,
remove ProAudio/REPRO docs and non-UCM scripts, and fix repo-wide references.

Made-with: Cursor
2026-04-08 15:22:45 +08:00

56 lines
1.9 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 卸载本仓库安装的 Kaisa UCM2 overlay 与系统级 60-kaisa-ucm.lua需 sudo
# 不卸载 alsa-ucm-conf 整包;仅删除 install-kaisa-ucm-overlay.sh 写入的路径。
# 用法:在仓库根目录执行 ./scripts/remove-kaisa-ucm-overlay.sh
# 卸载后请按发行版默认策略重新选择输出配置。
set -euo pipefail
if ! command -v sudo &>/dev/null; then
echo "需要 sudo。" >&2
exit 1
fi
removed=0
echo ">>> 删除 /usr/share/alsa/ucm2/GoogleKaisa/(若存在)"
if [[ -d /usr/share/alsa/ucm2/GoogleKaisa ]]; then
sudo rm -rf -- /usr/share/alsa/ucm2/GoogleKaisa
removed=1
echo " 已删除。"
else
echo " (不存在,跳过)"
fi
echo ">>> 删除 /usr/share/alsa/ucm2/conf.d/sof-rt5682/(若存在)"
if [[ -d /usr/share/alsa/ucm2/conf.d/sof-rt5682 ]]; then
sudo rm -rf -- /usr/share/alsa/ucm2/conf.d/sof-rt5682
removed=1
echo " 已删除。"
else
echo " (不存在,跳过)"
fi
LUA="/usr/share/wireplumber/main.lua.d/60-kaisa-ucm.lua"
echo ">>> 禁用 $LUA(若存在)"
if [[ -f "$LUA" ]]; then
sudo mv -n -- "$LUA" "${LUA}.disabled"
removed=1
echo " 已移至 ${LUA}.disabled"
elif [[ -f "${LUA}.disabled" ]]; then
echo " (已是 .disabled跳过"
else
echo " (不存在,跳过)"
fi
if systemctl --user is-system-running &>/dev/null; then
echo ">>> systemctl --user restart wireplumber pipewire pipewire-pulse"
systemctl --user restart wireplumber pipewire pipewire-pulse
else
echo "(无 user 会话,请登录后执行: systemctl --user restart wireplumber pipewire pipewire-pulse" >&2
fi
echo "完成。sof-rt5682 将不再使用本仓库的 HiFi UCMHDMI1/2/3 等端口名来自该 overlay。"
if [[ "$removed" -eq 1 ]]; then
echo "提示:卸载后将回到发行版默认音频配置;如需继续使用 HDMI请按 docs/linux-hdmi/OPERATION_PipeWire_Kaisa_UCM_HiFi.md 重新安装。"
fi