Files
MeowOS Dev 245bee2946 MeowOS for HiBy R3 Pro II — 公共发布版本(历史已重置)
• 全新单提交:清除含敏感信息的旧历史(sudo 口令、内网 IP、SSH 密钥路径、热点 SSID、设备 MAC)
• 本地开发文档/测试记录/构建脚本全部移入 gitignored 的 devdocs/ 与 scripts/build/(不入库)
• 保留:MeowOS 源码(launcher/watchdog/bootmenu/meow_svcd/SDK)、项目规范文档、mips-repo
增补组件:SDK 统一日志+通知 API、meow_svcd 服务管理器、mips-repo 软件仓库
2026-08-30 01:12:34 +08:00

67 lines
1.9 KiB
Bash
Raw Permalink 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.
#!/bin/sh
#
# S92_03_start_music_player - Boot Selector phase 0 · M2 兜底 patch
#
# 正常路径:rcS 被 S90meow_bootmenu 阻塞(fork 播放器后父进程监督,或 exec
# meow_launcherd),本脚本**不会执行**。
# 兜底路径:S90 崩溃/选单 fork 失败导致 rcS 推进到本脚本时,读 /tmp/meow_boot_mode
# + pidof 判断,安全拉起播放器或跳过。
#
# 红线:* 仅经 pidof 判断,不 killall hiby_player(触发 sh 看门狗 reboot);
# * 禁 SIGUSR1;* 兜底拉起才用 hiby_player.sh(官方行为,含 sleep 1; reboot
# 看门狗——只在播放器无人接管时兜底,正常 HibyOS 由 bootmenu 直拉二进制)。
#
PL01=/usr/bin/hiby_player.sh
case "$1" in
start)
echo -n "Starting $0 : begin "
# 若 S90 已把模式写成 /tmp/meow_boot_mode,优先按其决策兜底
if [ -f /tmp/meow_boot_mode ]; then
case "$(cat /tmp/meow_boot_mode)" in
meow)
echo "MeowOS mode: skip player (launcher should have taken over)"
exit 0
;;
hiby)
if pidof hiby_player >/dev/null 2>&1; then
echo "player already up (bootmenu fork), skip"
exit 0
fi
[ -f $PL01 ] && ( $PL01 & ) || echo " file <$PL01> don't exist."
;;
*)
# 未知 mode:按官方兜底
if pidof hiby_player >/dev/null 2>&1; then
echo "unknown mode, player already up, skip"
exit 0
fi
[ -f $PL01 ] && ( $PL01 & ) || echo " file <$PL01> don't exist."
;;
esac
else
# 无模式标记:选单崩/未写,官方兜底(先 pidof 防双拉竞态)
if pidof hiby_player >/dev/null 2>&1; then
echo "no mode file, player already up, skip"
exit 0
fi
[ -f $PL01 ] && ( $PL01 & ) || echo " file <$PL01> don't exist."
fi
echo -n "Starting $0 : end "
;;
stop)
echo -n "Stopping $0 : "
echo "OK"
;;
restart|reload)
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?