feat(system): 系统框架一期 — 专项服务(性能/电源)+IPC+电源CLI+电菜单改经服务(agent-155)

- meow_svc_power: 单一二进制(svcd空参IPC常驻 /usr/data/meow_power.sock + root CLI免鉴权), 12命令(shutdown/reboot强制=0/upgrade/set-default-hiby/reboot--hiby + set-default-meow/status/screen/dac(status仅)/battery/reboot-reason/upgrade-status); 动作同源sys_do_reboot/set_boot_default_hiby/mtd5=ota:kernel2; dac on/off无控制点不支持
- meow_svc_perf: IPC(/usr/data/meow_perf.sock MSG_PERF_*) + CLI, 聚合/proc/df/thermal/version/uname JSON(与MEOWPANEL_PROTOCOL对齐)
- power_menu.c 改经 meow_power_action(launcher先转储再IPC), 删sys_do_reboot/set_boot_default_hiby; 4动作+8s强关+confirm_reboot_player+3处长按强关全经服务; launcher内 sys_do_reboot/bootmode.sh/set_boot_default_hiby 0调用
- meow_ipc.h 仅加 MSG_PERF_QUERY/RESULT(0x50/51)+MSG_POWER_ACTION/STATUS(0x60/61)+POWER_*(12)+m_perf/power_t; 未动既有
- S89meow_svcd 预置 meow_svc_perf/power.conf(trigger=boot); 各独立socket
- IPC鉴权一期=SO_PEERCRED uid==0基础(完整os.meow.*二期); 通知转储=launcher先转储再IPC(二期补launcher→服务通道); 失败安全(服务不可达→按取消,不静默不直连)
- meow_svc_power=32d6be92/meow_svc_perf=7b0f3b64/launcher=d90f09e9/svcd=fb2d608b(未动)/meow_ui.a=92e61fb8(未改); 全0warning; 备份power_menu.c.pre-svc.bak回退
This commit is contained in:
MeowOS committed 2026-08-30 23:16:12 +08:00
1 parent 898bc176c9
commit 23727cf400
16 files changed
+1559 -41

No files matched your search

+56
View File
@@ -52,6 +52,10 @@ enum {
MSG_ACT_BACK = 0x0034, /* ↑ 上报回到根/无 activity(清 keep_awake,M2.17) */
MSG_NAV = 0x0040, /* ↑ 上报导航/请求退出 */
MSG_SHOW_ACTIVITY= 0x0041, /* ↓ 令前端应用显示某屏 */
MSG_PERF_QUERY = 0x0050, /* ↑ 性能/系统聚合查询(专项服务 meow_svc_perf) */
MSG_PERF_RESULT = 0x0051, /* ↓ 聚合 JSON(perf/system 子集) */
MSG_POWER_ACTION = 0x0060, /* ↑ 电源/系统动作信号(专项服务 meow_svc_power) */
MSG_POWER_STATUS = 0x0061, /* ↓ 动作受理/结果 + 状态文本 */
MSG_SYS = 0x00F0 /* ↓ 系统事件(守护关闭/服务死亡/播放器状态) */
};
@@ -165,4 +169,56 @@ typedef struct m_notify_progress {
int32_t progress; /* 0-100;<0=清除进度条 */
} m_notify_progress_t; /* 8 B */
/* ================= 专项服务 IPC(SYSTEM_FRAMEWORK_SERVICES §2.2/§2.3)= */
/* ---- MSG_PERF_QUERY 子集位(0=全部)---- */
#define PERF_SUBSET_PERF (1u << 0) /* cpu/mem/uptime/temp/storage/tfcard */
#define PERF_SUBSET_SYSTEM (1u << 1) /* system(version/hostname/kernel/arch) */
/* MSG_PERF_QUERY ↑:性能/系统聚合查询(服务端 meow_svc_perf) */
typedef struct m_perf_query {
uint32_t subset; /* 0=全部;PERF_SUBSET_* 组合 */
} m_perf_query_t; /* 4 B */
/* MSG_PERF_RESULT ↓:聚合 JSON(payload 为 NUL 结尾 JSON 文本) */
typedef struct m_perf_result {
uint32_t code; /* MEOW_OK / MEOW_ERR_* */
uint32_t subset; /* 回显请求 subset */
uint16_t json_len; /* json 有效字节(不含 NUL) */
uint16_t pad;
char json[MEOW_IPC_MAX - 12]; /* 聚合 JSON(.data 形状,§2.2) */
} m_perf_result_t;
/* ---- POWER_* 动作枚举(m_power_action_t.cmd;与 CLI §2.4 同源)---- */
enum {
POWER_SHUTDOWN = 0, /* 关机 */
POWER_REBOOT = 1, /* 重启回 MeowOS(强制写 boot_default=0) */
POWER_UPGRADE = 2, /* 写 mtd5=ota:kernel2 进升级模式 */
POWER_BACK_HIBY = 3, /* 写 boot_default=1 + reboot(回 HiBy) */
POWER_SET_DEFAULT_MEOW = 4, /* 只写 boot_default=0,不重启 */
POWER_SET_DEFAULT_HIBY = 5, /* 只写 boot_default=1,不重启 */
POWER_STATUS = 6, /* 综合状态查询 */
POWER_BATTERY = 7, /* 电池查询 */
POWER_REBOOT_REASON = 8, /* 上次重启原因 */
POWER_UPGRADE_STATUS = 9, /* 升级标志(mtd5=ota:kernel2?) */
POWER_SCREEN = 10, /* 屏幕电源:flag 0=off/1=on/2=timeout(秒取 arg) */
POWER_DAC = 11 /* DAC:flag 0=off/1=on/2=status */
};
/* MSG_POWER_ACTION ↑:电源/系统动作信号(服务端 meow_svc_power) */
typedef struct m_power_action {
uint32_t cmd; /* POWER_* 枚举 */
uint32_t flag; /* 随 cmd;POWER_SCREEN/DAC 用 */
char arg[32]; /* 可选文本参数(如 screen timeout 秒数字符串) */
} m_power_action_t; /* 40 B */
/* MSG_POWER_STATUS ↓:动作受理/结果 + 状态文本(CLI/IPC 展示) */
typedef struct m_power_status {
uint32_t code; /* MEOW_OK / MEOW_ERR_PERM / MEOW_ERR_INVAL / MEOW_ERR_NODEV */
uint32_t cmd; /* 回显 cmd */
uint16_t msg_len; /* msg 有效字节(不含 NUL) */
uint16_t pad;
char msg[96]; /* 结果/状态文本 */
} m_power_status_t;
#endif /* MEOW_IPC_H */