From 38c6aedd52a6d661cc7ba5cbf5afc7eef124c5ee Mon Sep 17 00:00:00 2001 From: LeonMMcoset Date: Thu, 12 Nov 2026 11:52:24 +0000 Subject: [PATCH 1/3] refactor: remove kernel diagnostic integration Remove the system information activation gesture, control APIs and aliases, SDK exports, translations, and state migration entries. Drop the retired payload from kernel bundles, rootfs and installer requirements, update documentation and tests, and pin the ReliefNT removal commit. --- Documentation/admin-guide/console.rst | 1 - Documentation/kbuild/products.rst | 2 +- Documentation/userspace-api/abi.rst | 12 +++- Kbuild | 2 +- configs/header-export.list | 1 - configs/nls/po/leonos.pot | 16 ------ configs/nls/po/zh_CN.po | 28 ---------- include/leonos/kernel_debug.h | 22 -------- include/leonos/layout.h | 4 -- include/leonos/psf_font.h | 4 -- include/leonos/system.h | 14 ----- include/reliefos/kernel_debug.h | 21 ------- include/reliefos/layout.h | 4 -- include/reliefos/system.h | 1 - kernel/reliefnt | 2 +- scripts/reliefos/Makefile.boot | 17 +----- scripts/reliefos/Makefile.kernel | 18 +++--- scripts/reliefos/Makefile.rootfs | 2 +- .../rootfs/usr/lib/reliefos/reliefos-migrate | 2 - tests/build/brand-allowlist.tsv | 1 - tests/build/test-brand-identity.sh | 5 -- tests/build/test-desktop-backend.sh | 1 - tests/build/test-hda-products.sh | 8 --- tests/build/test-kernel-adapter.sh | 39 ++++++------- tests/build/test-motif-apps.sh | 8 +-- tests/build/test-submodule-rollback-build.sh | 4 +- tests/fixtures/brand-abi/old-sdk-exports.tsv | 4 -- .../fixtures/brand-abi/old-shared-symbols.tsv | 4 -- tests/host/test_motif_apps.c | 16 +----- tools/build/rootfs-stage.sh | 1 - tools/check_abi_migration.py | 2 +- tools/host/modules/bundle.c | 6 +- tools/host/modules/payload_stage.c | 8 +-- tools/reliefos_layout.py | 5 -- tools/test_installer_bundle_swap.py | 2 +- tools/test_installer_payload.py | 2 +- tools/test_kernel_module_tools.py | 5 +- tools/test_kernel_modules_stage.py | 3 +- tools/tests/installer_payload_test.c | 6 +- userland/apps/installer/install_ops.c | 1 - userland/apps/osver/Kbuild | 4 +- userland/apps/osver/debug_click.c | 17 ------ userland/apps/osver/debug_click.h | 14 ----- userland/apps/osver/main.cpp | 53 +----------------- userland/runtime/include/leonos/layout.h | 4 -- userland/runtime/src/kernel_bundle_check.c | 8 +-- userland/runtime/src/kernel_bundle_publish.c | 12 ++-- userland/runtime/src/libc.c | 56 ------------------- 48 files changed, 76 insertions(+), 396 deletions(-) delete mode 100644 include/leonos/kernel_debug.h delete mode 100644 include/reliefos/kernel_debug.h delete mode 100644 userland/apps/osver/debug_click.c delete mode 100644 userland/apps/osver/debug_click.h diff --git a/Documentation/admin-guide/console.rst b/Documentation/admin-guide/console.rst index dd5f9267..5c91262b 100644 --- a/Documentation/admin-guide/console.rst +++ b/Documentation/admin-guide/console.rst @@ -17,5 +17,4 @@ VT 与日志 Kernel panic 在当前文本 VT 输出诊断;在 GUI 中从左上角绘制黑底字符格, 保留其他像素。完整诊断继续写串口和 VT 历史。记录异常码、RIP、CR2/CR3、 CPU/任务、内核版本和源码身份,使用同一构建的调试符号定位。 -Kerneldebug 的产品信息入口使用 ``About ReliefOS``;诊断工具不能代替正常内核。 没有目标虚拟机故障注入的测试,不能宣称 panic 显示已在该平台通过。 diff --git a/Documentation/kbuild/products.rst b/Documentation/kbuild/products.rst index a0d1a20b..0f46d3de 100644 --- a/Documentation/kbuild/products.rst +++ b/Documentation/kbuild/products.rst @@ -7,7 +7,7 @@ 输出均相对于 O: -* ``kernel`` / ``kerneldebug``:generated/system 内核与调试载荷。 +* ``kernel``:generated/system 内核与独立调试符号。 * ``runtime`` / ``userland``:公共运行库与所选应用。 * ``sdk``:packages/reliefos-musl-sdk.tar.gz。 * ``apk-repo``:packages/apk/repository。 diff --git a/Documentation/userspace-api/abi.rst b/Documentation/userspace-api/abi.rst index 6a72660b..3f313611 100644 --- a/Documentation/userspace-api/abi.rst +++ b/Documentation/userspace-api/abi.rst @@ -59,10 +59,20 @@ X11 应用通过 Xorg 通信。未知或旧兼容路径不能当作新的公开 ============== 旧自研窗口、鼠标区域、外观广播和 UI 工具包导出已移除,不再提供转发或空实现。 -历史 ABI 快照保持不变;集成验证要求已移除的图形接口不存在,并继续检查 +集成验证要求已移除的图形接口不存在,并继续检查 其他接口的布局、符号类型和 SONAME。进程/时钟与 fbdev 辅助声明分别位于 ```` 和 ````,应用必须重新构建。 +引导与构建接口收敛 +================== + +开机前的交互诊断会话、独立载荷、SDK 控制接口和旧名称别名已整体移除。 +系统信息应用只显示版本信息,内核直接进入正常初始化流程。 +依赖已删除控制接口的程序必须移除调用并重新构建,不提供兼容空实现。 +ABI 清单同步删除这些已退役条目,其余结构布局、常量和符号约定保持不变。 +内核安装包只要求内核与独立符号文件;版本化启动目录保留内核、initramfs 和 +引导环境文件。构建调试配置、符号定位、串口日志及 panic 报告继续可用。 + 独立安装实例的引导接口 ====================== diff --git a/Kbuild b/Kbuild index a978f71e..5afb96eb 100644 --- a/Kbuild +++ b/Kbuild @@ -30,7 +30,7 @@ include $(srctree)/scripts/reliefos/Makefile.tests include $(srctree)/tools/host/Kbuild tools: $(RELIEFOS_HOST_TOOLS) -kernel: $(RELIEFOS_KERNEL_SYS) $(RELIEFOS_KERNEL_DEBUG) +kernel: $(RELIEFOS_KERNEL_SYS) $(RELIEFOS_KERNEL_SYMBOLS) test: test-tools test-build diff --git a/configs/header-export.list b/configs/header-export.list index 2cb03386..00ddf9ee 100644 --- a/configs/header-export.list +++ b/configs/header-export.list @@ -8,7 +8,6 @@ include/uapi/reliefos/driver_abi.h include/uapi/reliefos/fs_abi.h include/uapi/reliefos/gpu_abi.h include/uapi/reliefos/inputm_abi.h -include/uapi/reliefos/kernel_debug_abi.h include/uapi/reliefos/net_abi.h include/uapi/reliefos/net_control.h include/uapi/reliefos/pty_abi.h diff --git a/configs/nls/po/leonos.pot b/configs/nls/po/leonos.pot index 9310b16b..90cf42d9 100644 --- a/configs/nls/po/leonos.pot +++ b/configs/nls/po/leonos.pot @@ -2738,10 +2738,6 @@ msgstr "" msgid "Could not open the search result" msgstr "" -#: userland/apps/osver/main.cpp:29 -msgid "Could not persist kernel debug mode." -msgstr "" - #: userland/apps/reliefmail/window_actions.cpp:606 msgid "Could not prepare the bounded SMTP confirmation." msgstr "" @@ -6342,18 +6338,6 @@ msgstr "" msgid "Kernel" msgstr "" -#: userland/apps/osver/main.cpp:27 -msgid "Kernel debug mode" -msgstr "" - -#: userland/apps/osver/main.cpp:26 -msgid "Kernel debug mode enabled" -msgstr "" - -#: userland/apps/osver/main.cpp:28 -msgid "Kernel debug mode enabled. Reboot to enter it." -msgstr "" - #: userland/apps/devmgr/main.c:280 msgid "Kernel device list" msgstr "" diff --git a/configs/nls/po/zh_CN.po b/configs/nls/po/zh_CN.po index 23de6246..38be1d85 100644 --- a/configs/nls/po/zh_CN.po +++ b/configs/nls/po/zh_CN.po @@ -2779,10 +2779,6 @@ msgstr "无法打开指定路径" msgid "Could not open the search result" msgstr "无法打开搜索结果" -#: userland/apps/osver/main.cpp:29 -msgid "Could not persist kernel debug mode." -msgstr "无法保存内核调试模式状态。" - #: userland/apps/reliefmail/window_actions.cpp:606 msgid "Could not prepare the bounded SMTP confirmation." msgstr "无法准备受限大小的 SMTP 确认信息。" @@ -6425,18 +6421,6 @@ msgstr "开尔文 (K)" msgid "Kernel" msgstr "内核" -#: userland/apps/osver/main.cpp:27 -msgid "Kernel debug mode" -msgstr "内核调试模式" - -#: userland/apps/osver/main.cpp:26 -msgid "Kernel debug mode enabled" -msgstr "内核调试模式已启用" - -#: userland/apps/osver/main.cpp:28 -msgid "Kernel debug mode enabled. Reboot to enter it." -msgstr "已启用内核调试模式,重启后进入。" - #: userland/apps/devmgr/main.c:280 msgid "Kernel device list" msgstr "内核设备列表" @@ -14821,9 +14805,6 @@ msgstr "工作进程错误" #~ msgid "Invalid shortcut." #~ msgstr "快捷方式无效。" -#~ msgid "Kernel debugger" -#~ msgstr "内核调试工具" - #~ msgid "Label:" #~ msgstr "卷标:" @@ -14980,9 +14961,6 @@ msgstr "工作进程错误" #~ msgid "Restart ReliefOS now?" #~ msgstr "是否立即重启 ReliefOS?" -#~ msgid "Restart into kernel debugger" -#~ msgstr "重启并进入内核调试工具" - #~ msgid "Ring-3 desktop shadow blit" #~ msgstr "Ring-3 桌面阴影缓冲绘制" @@ -15355,9 +15333,6 @@ msgstr "工作进程错误" #~ msgid "Items deleted permanently" #~ msgstr "项目已永久删除" -#~ msgid "Kernel debug mode enabled. Use Start > Power to reboot into it." -#~ msgstr "内核调试模式已启用。请从开始菜单的电源页面重启进入。" - #~ msgid "Kernel driver modules" #~ msgstr "内核驱动模块" @@ -15569,9 +15544,6 @@ msgstr "工作进程错误" #~ msgid "You can inspect loaded modules, but cannot change them." #~ msgstr "可以查看模块,但不能修改它们。" -#~ msgid "boot, libraries, kerneldebug, EFI, docs, and drivers will be refreshed. Extra target applications and drivers are kept." -#~ msgstr "boot、运行库、kerneldebug、EFI、内置文档和驱动程序会刷新;目标中多出的应用和驱动会保留。" - #~ msgid "exFAT root cannot carry the current symlink layout; use a fresh ext2 install" #~ msgstr "exFAT 根分区无法承载当前符号链接布局,请改为 ext2 全新安装" diff --git a/include/leonos/kernel_debug.h b/include/leonos/kernel_debug.h deleted file mode 100644 index 4414fc48..00000000 --- a/include/leonos/kernel_debug.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Transitional compatibility forwarder (ReliefOS / ReliefNT rename). - * Canonical declarations: . - * No second layout definition exists behind these names. */ -#ifndef LEONOS_KERNEL_DEBUG_H -#define LEONOS_KERNEL_DEBUG_H -#include - -/* Old names alias the single canonical declaration. */ -#define LEONOS_KERNEL_DEBUG_CONTROL_ARM_NEXT_BOOT RELIEFOS_KERNEL_DEBUG_CONTROL_ARM_NEXT_BOOT -#define LEONOS_KERNEL_DEBUG_CONTROL_CLEAR RELIEFOS_KERNEL_DEBUG_CONTROL_CLEAR -#define LEONOS_KERNEL_DEBUG_CONTROL_GET_STATE RELIEFOS_KERNEL_DEBUG_CONTROL_GET_STATE -#define LEONOS_KERNEL_DEBUG_CONTROL_SET_ENABLED RELIEFOS_KERNEL_DEBUG_CONTROL_SET_ENABLED -#define LEONOS_KERNEL_DEBUG_STATE_ENABLED RELIEFOS_KERNEL_DEBUG_STATE_ENABLED -#define LEONOS_KERNEL_DEBUG_STATE_NEXT_BOOT RELIEFOS_KERNEL_DEBUG_STATE_NEXT_BOOT -#define LEONOS_KERNEL_DEBUG_VERSION RELIEFOS_KERNEL_DEBUG_VERSION -#define LEONOS_UAPI_KERNEL_DEBUG_ABI_H RELIEFOS_UAPI_KERNEL_DEBUG_ABI_H -#define leonos_kernel_debug_arm_next_boot reliefos_kernel_debug_arm_next_boot -#define leonos_kernel_debug_clear reliefos_kernel_debug_clear -#define leonos_kernel_debug_control reliefos_kernel_debug_control -#define leonos_kernel_debug_get_state reliefos_kernel_debug_get_state -#define leonos_kernel_debug_set_enabled reliefos_kernel_debug_set_enabled -#endif /* LEONOS_KERNEL_DEBUG_H */ diff --git a/include/leonos/layout.h b/include/leonos/layout.h index bad5d345..2f29b1b0 100644 --- a/include/leonos/layout.h +++ b/include/leonos/layout.h @@ -39,7 +39,6 @@ #define LEONOS_PATH_ACCOUNTS_DB RELIEFOS_PATH_ACCOUNTS_DB #define LEONOS_PATH_BOOT_DISPLAY_CONF RELIEFOS_PATH_BOOT_DISPLAY_CONF #define LEONOS_PATH_BOOT_KERNEL RELIEFOS_PATH_BOOT_KERNEL -#define LEONOS_PATH_BOOT_KERNELDEBUG_MARKER RELIEFOS_PATH_BOOT_KERNELDEBUG_MARKER #define LEONOS_PATH_BROWSER_CJK_FONT RELIEFOS_PATH_BROWSER_CJK_FONT #define LEONOS_PATH_BROWSER_FONT RELIEFOS_PATH_BROWSER_FONT #define LEONOS_PATH_CACERT RELIEFOS_PATH_CACERT @@ -48,9 +47,6 @@ #define LEONOS_PATH_FILEASSOC_CFG RELIEFOS_PATH_FILEASSOC_CFG #define LEONOS_PATH_GLIBC_INTERP RELIEFOS_PATH_GLIBC_INTERP #define LEONOS_PATH_HELP RELIEFOS_PATH_HELP -#define LEONOS_PATH_KERNELDEBUG_CONTROL RELIEFOS_PATH_KERNELDEBUG_CONTROL -#define LEONOS_PATH_KERNELDEBUG_ENABLED RELIEFOS_PATH_KERNELDEBUG_ENABLED -#define LEONOS_PATH_KERNELDEBUG_MODULE RELIEFOS_PATH_KERNELDEBUG_MODULE #define LEONOS_PATH_LEONOS_CONF RELIEFOS_PATH_RELIEFOS_CONF #define LEONOS_PATH_LESSKEY RELIEFOS_PATH_LESSKEY #define LEONOS_PATH_LIBC RELIEFOS_PATH_LIBC diff --git a/include/leonos/psf_font.h b/include/leonos/psf_font.h index 6ca0b095..b7777007 100644 --- a/include/leonos/psf_font.h +++ b/include/leonos/psf_font.h @@ -42,7 +42,6 @@ #define LEONOS_PATH_ACCOUNTS_DB RELIEFOS_PATH_ACCOUNTS_DB #define LEONOS_PATH_BOOT_DISPLAY_CONF RELIEFOS_PATH_BOOT_DISPLAY_CONF #define LEONOS_PATH_BOOT_KERNEL RELIEFOS_PATH_BOOT_KERNEL -#define LEONOS_PATH_BOOT_KERNELDEBUG_MARKER RELIEFOS_PATH_BOOT_KERNELDEBUG_MARKER #define LEONOS_PATH_BROWSER_CJK_FONT RELIEFOS_PATH_BROWSER_CJK_FONT #define LEONOS_PATH_BROWSER_FONT RELIEFOS_PATH_BROWSER_FONT #define LEONOS_PATH_CACERT RELIEFOS_PATH_CACERT @@ -51,9 +50,6 @@ #define LEONOS_PATH_FILEASSOC_CFG RELIEFOS_PATH_FILEASSOC_CFG #define LEONOS_PATH_GLIBC_INTERP RELIEFOS_PATH_GLIBC_INTERP #define LEONOS_PATH_HELP RELIEFOS_PATH_HELP -#define LEONOS_PATH_KERNELDEBUG_CONTROL RELIEFOS_PATH_KERNELDEBUG_CONTROL -#define LEONOS_PATH_KERNELDEBUG_ENABLED RELIEFOS_PATH_KERNELDEBUG_ENABLED -#define LEONOS_PATH_KERNELDEBUG_MODULE RELIEFOS_PATH_KERNELDEBUG_MODULE #define LEONOS_PATH_LEONOS_CONF RELIEFOS_PATH_RELIEFOS_CONF #define LEONOS_PATH_LESSKEY RELIEFOS_PATH_LESSKEY #define LEONOS_PATH_LIBC RELIEFOS_PATH_LIBC diff --git a/include/leonos/system.h b/include/leonos/system.h index e9e2171a..c18e88a7 100644 --- a/include/leonos/system.h +++ b/include/leonos/system.h @@ -6,14 +6,6 @@ #include /* Old names alias the single canonical declaration. */ -#define LEONOS_KERNEL_DEBUG_CONTROL_ARM_NEXT_BOOT RELIEFOS_KERNEL_DEBUG_CONTROL_ARM_NEXT_BOOT -#define LEONOS_KERNEL_DEBUG_CONTROL_CLEAR RELIEFOS_KERNEL_DEBUG_CONTROL_CLEAR -#define LEONOS_KERNEL_DEBUG_CONTROL_GET_STATE RELIEFOS_KERNEL_DEBUG_CONTROL_GET_STATE -#define LEONOS_KERNEL_DEBUG_CONTROL_SET_ENABLED RELIEFOS_KERNEL_DEBUG_CONTROL_SET_ENABLED -#define LEONOS_KERNEL_DEBUG_H RELIEFOS_KERNEL_DEBUG_H -#define LEONOS_KERNEL_DEBUG_STATE_ENABLED RELIEFOS_KERNEL_DEBUG_STATE_ENABLED -#define LEONOS_KERNEL_DEBUG_STATE_NEXT_BOOT RELIEFOS_KERNEL_DEBUG_STATE_NEXT_BOOT -#define LEONOS_KERNEL_DEBUG_VERSION RELIEFOS_KERNEL_DEBUG_VERSION #define LEONOS_MACHINE_IDENTITY_FLAG_BOOT_DISK_GUID RELIEFOS_MACHINE_IDENTITY_FLAG_BOOT_DISK_GUID #define LEONOS_MACHINE_IDENTITY_FLAG_BOOT_PARTITION_GUID RELIEFOS_MACHINE_IDENTITY_FLAG_BOOT_PARTITION_GUID #define LEONOS_MACHINE_IDENTITY_FLAG_PLATFORM_UUID RELIEFOS_MACHINE_IDENTITY_FLAG_PLATFORM_UUID @@ -30,13 +22,7 @@ #define LEONOS_SYSTEM_VERSION_LEN RELIEFOS_SYSTEM_VERSION_LEN #define LEONOS_TASK_AFFINITY_GET RELIEFOS_TASK_AFFINITY_GET #define LEONOS_TASK_AFFINITY_SET RELIEFOS_TASK_AFFINITY_SET -#define LEONOS_UAPI_KERNEL_DEBUG_ABI_H RELIEFOS_UAPI_KERNEL_DEBUG_ABI_H #define LEONOS_UAPI_SYSTEM_ABI_H RELIEFOS_UAPI_SYSTEM_ABI_H -#define leonos_kernel_debug_arm_next_boot reliefos_kernel_debug_arm_next_boot -#define leonos_kernel_debug_clear reliefos_kernel_debug_clear -#define leonos_kernel_debug_control reliefos_kernel_debug_control -#define leonos_kernel_debug_get_state reliefos_kernel_debug_get_state -#define leonos_kernel_debug_set_enabled reliefos_kernel_debug_set_enabled #define leonos_machine_identity reliefos_machine_identity #define leonos_perf_cpu_info reliefos_perf_cpu_info #define leonos_perf_info reliefos_perf_info diff --git a/include/reliefos/kernel_debug.h b/include/reliefos/kernel_debug.h deleted file mode 100644 index bdb569ab..00000000 --- a/include/reliefos/kernel_debug.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * ReliefOS kernel-debug control ABI. - * Lets trusted desktop applications arm the next Ring-0 diagnostic boot. - */ -#ifndef RELIEFOS_KERNEL_DEBUG_H -#define RELIEFOS_KERNEL_DEBUG_H - -/* - * Userland kernel-debug control API. The wire types and constants moved to the - * kernel UAPI (); this header re-exports them so - * existing `#include ` callers keep working. - */ -#include -#include - -int reliefos_kernel_debug_get_state(uint32_t *flags); -int reliefos_kernel_debug_set_enabled(int enabled); -int reliefos_kernel_debug_arm_next_boot(void); -int reliefos_kernel_debug_clear(void); - -#endif diff --git a/include/reliefos/layout.h b/include/reliefos/layout.h index 1320613b..6e73a679 100644 --- a/include/reliefos/layout.h +++ b/include/reliefos/layout.h @@ -84,8 +84,6 @@ #define RELIEFOS_PATH_STARTUP_DB RELIEFOS_LAYOUT_VAR_LIB_RELIEFOS "/startup.db" #define RELIEFOS_PATH_STARTUP_DENIALS_DB RELIEFOS_LAYOUT_VAR_LIB_RELIEFOS "/startup-denials.db" #define RELIEFOS_PATH_OOBE_DONE RELIEFOS_LAYOUT_VAR_LIB_RELIEFOS "/oobe.done" -#define RELIEFOS_PATH_KERNELDEBUG_ENABLED RELIEFOS_LAYOUT_VAR_LIB_RELIEFOS "/kerneldebug.enabled" -#define RELIEFOS_PATH_KERNELDEBUG_CONTROL RELIEFOS_LAYOUT_VAR_LIB_RELIEFOS "/kernel-debug" #define RELIEFOS_PATH_SESSION_USER RELIEFOS_LAYOUT_RUN_RELIEFOS "/session-user" /* Shared resources. */ @@ -109,12 +107,10 @@ #define RELIEFOS_PATH_LIBRELIEFOS RELIEFOS_LAYOUT_RELIEFOS_LIB "/libreliefos.so.2" #define RELIEFOS_PATH_LIBRELIEFOS_COMPAT RELIEFOS_LAYOUT_RELIEFOS_LIB "/libleonos.so.1" #define RELIEFOS_PATH_OLD_NATIVE_INTERP RELIEFOS_LAYOUT_RELIEFOS_LIB "/ld-leonos.elf" -#define RELIEFOS_PATH_KERNELDEBUG_MODULE RELIEFOS_LAYOUT_RELIEFOS_LIB "/kerneldebug.sys" /* Runtime view of the boot partition; the ESP itself normally mounts /boot. */ #define RELIEFOS_PATH_BOOT_KERNEL "/boot/reliefos/kernel.sys" #define RELIEFOS_PATH_BOOT_KERNEL_LEGACY "/boot/leonos/kernel.sys" -#define RELIEFOS_PATH_BOOT_KERNELDEBUG_MARKER "/boot/reliefos/state/kerneldebug.next" #define RELIEFOS_PATH_BOOT_DISPLAY_CONF "/boot/reliefos/config/display.conf" #endif /* RELIEFOS_LAYOUT_H */ diff --git a/include/reliefos/system.h b/include/reliefos/system.h index 808264a6..ea95973f 100644 --- a/include/reliefos/system.h +++ b/include/reliefos/system.h @@ -7,7 +7,6 @@ * `#include ` callers keep working. */ #include -#include #include int reliefos_system_info(struct reliefos_system_info *info); diff --git a/kernel/reliefnt b/kernel/reliefnt index 1dfd1eb8..336e2bc6 160000 --- a/kernel/reliefnt +++ b/kernel/reliefnt @@ -1 +1 @@ -Subproject commit 1dfd1eb8541bb31e51836aab40827694eb82fed2 +Subproject commit 336e2bc67c0842ad06176ad0188e730fcce5f33c diff --git a/scripts/reliefos/Makefile.boot b/scripts/reliefos/Makefile.boot index b03f8c5f..6b2b8219 100644 --- a/scripts/reliefos/Makefile.boot +++ b/scripts/reliefos/Makefile.boot @@ -1,14 +1,3 @@ -# Boot chain products: consumer only. -# -# Since phase 3 of the kernel/userland separation kerneldebug.sys is built by -# the standalone ReliefNT checkout and published to these legacy paths by the -# adapter in scripts/reliefos/Makefile.kernel. The device drivers are linked into kernel.sys itself -# and GRUB boots kernel.sys directly through its Multiboot2 header. Nothing -# here compiles; the targets below are product-presence consumers that pull the -# published files into existence (and fail if the adapter cannot produce them). - -KERNELDEBUG_SYS := $(O_GENERATED)/system/kerneldebug.sys - -.PHONY: kerneldebug boot -kerneldebug: $(KERNELDEBUG_SYS) -boot: kernel kerneldebug +# Boot products are built and published by the standalone ReliefNT adapter. +.PHONY: boot +boot: kernel diff --git a/scripts/reliefos/Makefile.kernel b/scripts/reliefos/Makefile.kernel index 704f9747..1d7e7401 100644 --- a/scripts/reliefos/Makefile.kernel +++ b/scripts/reliefos/Makefile.kernel @@ -2,8 +2,8 @@ # # Phase 3 of the kernel/userland separation: this repository no longer compiles # any kernel, driver or boot source. The standalone checkout named by -# RELIEFNT_DIR owns those sources and builds kernel.sys, kernel.debug, -# kerneldebug.sys and ABI-bound built-in/loadable driver products; +# RELIEFNT_DIR owns those sources and builds kernel.sys, kernel.debug +# and ABI-bound built-in/loadable driver products; # this fragment drives that build and publishes the results to the legacy # locations the rest of the parent build (rootfs, images, rpr) consumes. The # parent consumes only the sub-build's `install` output and its exported headers @@ -80,16 +80,14 @@ endif # Legacy product locations (kept stable for scripts/reliefos/Makefile.rootfs, scripts/reliefos/Makefile.images, # scripts/reliefos/Makefile.rpr and scripts/reliefos/Makefile.boot). RELIEFOS_KERNEL_SYS := $(O_GENERATED)/system/kernel.sys -RELIEFOS_KERNEL_DEBUG := $(O_GENERATED)/system/kernel.debug -RELIEFNT_KERNELDEBUG_SYS := $(O_GENERATED)/system/kerneldebug.sys +RELIEFOS_KERNEL_SYMBOLS := $(O_GENERATED)/system/kernel.debug # "legacy path below generated/:installed file name" per product; the sub-make's -# install writes the three products flat under $(RELIEFNT_DEST). -RELIEFNT_PUBLISH_PAIRS := system/kernel.sys:kernel.sys system/kernel.debug:kernel.debug \ - system/kerneldebug.sys:kerneldebug.sys +# install writes the two products flat under $(RELIEFNT_DEST). +RELIEFNT_PUBLISH_PAIRS := system/kernel.sys:kernel.sys system/kernel.debug:kernel.debug -RELIEFNT_PUBLISHED := $(RELIEFOS_KERNEL_SYS) $(RELIEFOS_KERNEL_DEBUG) \ - $(RELIEFNT_KERNELDEBUG_SYS) $(RELIEFNT_DEST)/install.bundle.json +RELIEFNT_PUBLISHED := $(RELIEFOS_KERNEL_SYS) $(RELIEFOS_KERNEL_SYMBOLS) \ + $(RELIEFNT_DEST)/install.bundle.json # Explicit defconfig must finish before another child invocation claims its O. $(RELIEFNT_PUBLISHED) $(O)/kernel-export/manifest.txt: $(filter defconfig,$(MAKECMDGOALS)) @@ -142,7 +140,7 @@ RELIEFNT_VERSION_PASSTHRU := $(strip $(foreach suffix,EXTRAVERSION LOCALVERSION, RELIEFNT_HEADER_EXPORT_LIST_FOR_KERNEL := $(if $(strip $(HEADER_EXPORT_LIST)),$(HEADER_EXPORT_LIST),$(RELIEFOS_SRC)/configs/header-export.list) RELIEFNT_HEADER_EXPORT_ENTRIES_FOR_KERNEL := $(shell sed -e 's/\#.*//' -e '/^[[:space:]]*$$/d' $(RELIEFNT_HEADER_EXPORT_LIST_FOR_KERNEL)) RELIEFNT_HEADER_EXPORTS_COMPLETE := $(shell for entry in $(RELIEFNT_HEADER_EXPORT_ENTRIES_FOR_KERNEL); do test -f '$(RELIEFNT_DIR)/'$$entry || exit 1; done; printf yes) -RELIEFNT_KERNEL_ONLY_GOALS := kernel all kerneldebug +RELIEFNT_KERNEL_ONLY_GOALS := kernel all boot RELIEFNT_NON_KERNEL_GOALS := $(filter-out $(RELIEFNT_KERNEL_ONLY_GOALS),$(MAKECMDGOALS)) RELIEFNT_KERNEL_HEADER_ORDER_ONLY := | $(O)/kernel-export/manifest.txt ifeq ($(strip $(RELIEFNT_NON_KERNEL_GOALS)),) diff --git a/scripts/reliefos/Makefile.rootfs b/scripts/reliefos/Makefile.rootfs index ee6aa532..935b9e42 100644 --- a/scripts/reliefos/Makefile.rootfs +++ b/scripts/reliefos/Makefile.rootfs @@ -23,7 +23,7 @@ ROOTFS_APP_PRODUCTS += $(RELIEFOS_KERNEL_PAYLOAD_MANIFEST) $(ROOTFS_RAW_STAMP) $(ROOTFS_MANIFEST): $(NLS_MO) $(NLS_MUSL_MO) $(RELIEFOS_SRC)/configs/nls/LINGUAS RELIEFOS_PARAMETERS_rootfs := epoch=$(SOURCE_DATE_EPOCH)|sources=$(O_META)/rootfs-sources.parameters|components=$(RELIEFOS_COMPONENTS_ENABLED) $(if $(RELIEFOS_PASSIVE),,$(eval $(call KBUILD_PARAMETERS,rootfs))) -$(ROOTFS_RAW_STAMP) $(ROOTFS_MANIFEST) &: $(RELIEFOS_SRC)/tools/build/rootfs-stage.sh $(RELIEFOS_SRC)/tools/build/reliefmath-resources-stage.sh $(RELIEFOS_SRC)/tools/build/busybox-links.sh $(RELIEFOS_SRC)/configs/app-icons.list $(RELIEFOS_STAGE_TOOL) $(RELIEFOS_LAYOUT_TOOL) $(O_META)/rootfs-sources.parameters $(ROOTFS_UPSTREAM_PRODUCTS) $(ROOTFS_APP_PRODUCTS) $(RUNTIME_SO) $(RUNTIME_COMPAT_SO) $(KERNELDEBUG_SYS) $(COMPONENT_METADATA) $(RELIEFOS_CONFIG_FILE) $(O_META)/rootfs.parameters $(wildcard $(RELIEFOS_SRC)/system/xorg/*) +$(ROOTFS_RAW_STAMP) $(ROOTFS_MANIFEST) &: $(RELIEFOS_SRC)/tools/build/rootfs-stage.sh $(RELIEFOS_SRC)/tools/build/reliefmath-resources-stage.sh $(RELIEFOS_SRC)/tools/build/busybox-links.sh $(RELIEFOS_SRC)/configs/app-icons.list $(RELIEFOS_STAGE_TOOL) $(RELIEFOS_LAYOUT_TOOL) $(O_META)/rootfs-sources.parameters $(ROOTFS_UPSTREAM_PRODUCTS) $(ROOTFS_APP_PRODUCTS) $(RUNTIME_SO) $(RUNTIME_COMPAT_SO) $(COMPONENT_METADATA) $(RELIEFOS_CONFIG_FILE) $(O_META)/rootfs.parameters $(wildcard $(RELIEFOS_SRC)/system/xorg/*) $(Q)ROOTFS_UPSTREAM_PACKAGES='$(UPSTREAM_PACKAGES)' sh $(RELIEFOS_SRC)/tools/build/rootfs-stage.sh $(RELIEFOS_SRC) $(abspath $(O)) $(abspath $(RELIEFOS_CONFIG_FILE)) $(abspath $(COMPONENT_METADATA)) $(abspath $(RELIEFOS_STAGE_TOOL)) $(abspath $(RELIEFOS_LAYOUT_TOOL)) $(abspath $(ROOTFS_RAW)) $(abspath $(ROOTFS_MANIFEST)) $(SOURCE_DATE_EPOCH) $(Q)touch $(ROOTFS_RAW_STAMP) .PHONY: rootfs-raw diff --git a/system/rootfs/usr/lib/reliefos/reliefos-migrate b/system/rootfs/usr/lib/reliefos/reliefos-migrate index e392f1e6..0ef0dc60 100755 --- a/system/rootfs/usr/lib/reliefos/reliefos-migrate +++ b/system/rootfs/usr/lib/reliefos/reliefos-migrate @@ -156,8 +156,6 @@ for pair in \ 'var/lib/leonos/startup.db var/lib/reliefos/startup.db' \ 'var/lib/leonos/startup-denials.db var/lib/reliefos/startup-denials.db' \ 'var/lib/leonos/oobe.done var/lib/reliefos/oobe.done' \ - 'var/lib/leonos/kerneldebug.enabled var/lib/reliefos/kerneldebug.enabled' \ - 'var/lib/leonos/kernel-debug var/lib/reliefos/kernel-debug' \ 'var/lib/leonos/browser/cookies.txt var/lib/reliefos/browser/cookies.txt' \ 'var/lib/leonos/browser/bookmarks.txt var/lib/reliefos/browser/bookmarks.txt'; do set -- $pair diff --git a/tests/build/brand-allowlist.tsv b/tests/build/brand-allowlist.tsv index 21eea2e2..d726d532 100644 --- a/tests/build/brand-allowlist.tsv +++ b/tests/build/brand-allowlist.tsv @@ -35,7 +35,6 @@ main compatibility include/leonos/gpu_sdk.h 逐文件确认含 canonical reliefo main compatibility include/leonos/http.h 逐文件确认含 canonical reliefos/reliefnt include;旧 guard/宏/类型名只转发别名,无第二份 struct/enum/typedef/extern 布局定义。 main compatibility include/leonos/ini.h 逐文件确认含 canonical reliefos/reliefnt include;旧 guard/宏/类型名只转发别名,无第二份 struct/enum/typedef/extern 布局定义。 main compatibility include/leonos/inputm.h 逐文件确认含 canonical reliefos/reliefnt include;旧 guard/宏/类型名只转发别名,无第二份 struct/enum/typedef/extern 布局定义。 -main compatibility include/leonos/kernel_debug.h 逐文件确认含 canonical reliefos/reliefnt include;旧 guard/宏/类型名只转发别名,无第二份 struct/enum/typedef/extern 布局定义。 main compatibility include/leonos/lat15_vga16.psf 旧 include/leonos/lat15_vga16.psf 入口转发 canonical reliefos/reliefnt 定义并提供旧宏/类型别名;不另定义 ABI main compatibility include/leonos/lat15_vga16_psf.inc 逐文件确认含 canonical reliefos/reliefnt include;旧 guard/宏/类型名只转发别名,无第二份 struct/enum/typedef/extern 布局定义。 main compatibility include/leonos/launch_result.h 逐文件确认含 canonical reliefos/reliefnt include;旧 guard/宏/类型名只转发别名,无第二份 struct/enum/typedef/extern 布局定义。 diff --git a/tests/build/test-brand-identity.sh b/tests/build/test-brand-identity.sh index e52e95b2..14ec3ac0 100755 --- a/tests/build/test-brand-identity.sh +++ b/tests/build/test-brand-identity.sh @@ -198,11 +198,6 @@ check_current_docs() { else fail 'browser guide must document about:reliefos' fi - if grep -q 'About ReliefOS' "$root/Documentation/admin-guide/console.rst"; then - ok 'kernel debugger guide uses the ReliefOS product name' - else - fail 'kernel debugger guide must use About ReliefOS' - fi } # Layer 2: canonical guest paths and service names. diff --git a/tests/build/test-desktop-backend.sh b/tests/build/test-desktop-backend.sh index e77732c0..24be4a6e 100755 --- a/tests/build/test-desktop-backend.sh +++ b/tests/build/test-desktop-backend.sh @@ -53,7 +53,6 @@ printf '%s\n' fixture > "$work/out/system/lib/libreliefos.so.2" legacy_brand=leon legacy_brand=${legacy_brand}os printf '%s\n' fixture > "$work/out/system/lib/lib${legacy_brand}.so.2" -printf '%s\n' fixture > "$work/out/generated/system/kerneldebug.sys" # This layout-only fixture represents the separately verified kernel bundle. # Real identity/checksum and dependency validation belongs to test-kernel-payload. mkdir -p "$work/out/stage/kernel-payload/lib/modules/desktop-fixture" \ diff --git a/tests/build/test-hda-products.sh b/tests/build/test-hda-products.sh index d619a822..f715f08c 100644 --- a/tests/build/test-hda-products.sh +++ b/tests/build/test-hda-products.sh @@ -13,12 +13,6 @@ for name in kernel.sys kernel.debug; do done cmp "$audio_out/generated/system/$name" "$audio_out/kernel-install/$name" done -for product in "$audio_out/generated/system/kerneldebug.sys" "$audio_out/kernel-install/kerneldebug.sys"; do - if [ ! -s "$product" ]; then - echo "FAIL missing product: $product" >&2 - exit 1 - fi -done if find "$audio_out/generated" "$audio_out/kernel-install" "$audio_root/usr/lib" -name '*.drv' | grep -q .; then echo "FAIL stale .drv driver modules are still produced or staged" >&2 exit 1 @@ -48,11 +42,9 @@ for name in bundle['modules']: assert (root/name).read_bytes()==(install/name).read_bytes(),name payload=json.loads((root/'usr/lib/reliefos/kernel'/release/'bundle.json').read_bytes()) assert payload['release']==release and payload['module_abi']==bundle['module_abi'] -assert (root/'usr/lib/reliefos/kernel'/release/'kerneldebug.sys').is_file() manifest=json.loads((out/'rootfs/manifest.json').read_bytes());text=json.dumps(manifest) assert 'usr/lib/reliefos/drivers' not in text, 'staged driver directory in manifest' assert '.drv' not in text, 'staged .drv driver module in manifest' -assert f'usr/lib/reliefos/kernel/{release}/kerneldebug.sys' in text print('Configured kernel products and staged manifest PASS') PY release=$(cat "$audio_out/rootfs/raw/usr/lib/reliefos/kernel/current-release") diff --git a/tests/build/test-kernel-adapter.sh b/tests/build/test-kernel-adapter.sh index c8905f91..3e5a3189 100755 --- a/tests/build/test-kernel-adapter.sh +++ b/tests/build/test-kernel-adapter.sh @@ -227,19 +227,19 @@ fi pass 'the baseline kernel build succeeds' expected_manifest="$work/expected-products" actual_manifest="$work/actual-products" -printf '%s\n' kernel.debug kernel.sys kerneldebug.sys \ +printf '%s\n' kernel.debug kernel.sys \ | LC_ALL=C sort > "$expected_manifest" awk '/^artifacts:$/ { artifacts=1; next } artifacts { print $2 }' \ "$O/kernel-install/manifest.txt" | LC_ALL=C sort > "$actual_manifest" if cmp -s "$expected_manifest" "$actual_manifest"; then - pass 'kernel manifest contains the three required product names' + pass 'kernel manifest contains the two required product names' else - fail 'kernel manifest contains the three required product names' \ + fail 'kernel manifest contains the two required product names' \ "want: $(tr '\n' ' ' < "$expected_manifest")" \ "have: $(tr '\n' ' ' < "$actual_manifest")" fi find "$O/generated" -type f -printf '%p %T@\n' | LC_ALL=C sort >"$work/published-before" -kerneldebug_hash_before=$(sha256sum "$O/generated/system/kerneldebug.sys" | cut -d' ' -f1) +symbols_hash_before=$(sha256sum "$O/generated/system/kernel.debug" | cut -d' ' -f1) advance_clock touch "$reliefnt/kernel/ipc/futex.c" @@ -255,22 +255,15 @@ else fail 'the sub-make relinks and refreshes the affected products' \ "$(grep -E '^ (CC|LD|IMAGE) ' "$work/dirty.log" | head -3 | tr '\n' ' ')" fi -if grep -qE 'kerneldebug\.sys' "$work/dirty.log"; then - fail 'a kernel source touch leaves the debug module alone' \ - "$(grep -E 'kerneldebug\.sys' "$work/dirty.log" | head -2 | tr '\n' ' ')" +if [ "$symbols_hash_before" = "$(sha256sum "$O/generated/system/kernel.debug" | cut -d' ' -f1)" ]; then + pass 'touching a source preserves symbol bytes' else - pass 'a kernel source touch leaves the debug module alone' -fi -if [ "$kerneldebug_hash_before" = "$(sha256sum "$O/generated/system/kerneldebug.sys" | cut -d' ' -f1)" ]; then - pass 'untouched products keep their bytes' -else - fail 'untouched products keep their bytes' 'kerneldebug.sys moved' + fail 'touching a source preserves symbol bytes' 'kernel.debug moved' fi # The publish path runs on every delegation; the published set must track what # the kernel checkout installed byte for byte. synced=yes -for pair in system/kernel.sys:kernel.sys system/kernel.debug:kernel.debug \ - system/kerneldebug.sys:kerneldebug.sys; do +for pair in system/kernel.sys:kernel.sys system/kernel.debug:kernel.debug; do rel=${pair%%:*} name=${pair#*:} cmp -s "$O/generated/$rel" "$O/kernel-install/$name" || synced=no @@ -284,12 +277,12 @@ fi printf '\n=== (c) a deleted published product is restored ===\n' kernel_checksum=$(sha256sum "$O/generated/system/kernel.sys" | cut -d' ' -f1) -rm -f "$O/generated/system/kernel.sys" "$O/generated/system/kerneldebug.sys" +rm -f "$O/generated/system/kernel.sys" "$O/generated/system/kernel.debug" if build "$work/restore.log" "$O" && - [ -s "$O/generated/system/kernel.sys" ] && [ -s "$O/generated/system/kerneldebug.sys" ]; then - pass 'the deleted kernel.sys and kerneldebug.sys are restored' + [ -s "$O/generated/system/kernel.sys" ] && [ -s "$O/generated/system/kernel.debug" ]; then + pass 'the deleted kernel.sys and kernel.debug are restored' else - fail 'the deleted kernel.sys and kerneldebug.sys are restored' 'still missing' + fail 'the deleted kernel.sys and kernel.debug are restored' 'still missing' fi if [ "$(sha256sum "$O/generated/system/kernel.sys" | cut -d' ' -f1)" = "$kernel_checksum" ]; then pass 'the restored kernel.sys is byte-identical' @@ -339,7 +332,7 @@ else "$(tail -c 300 "$work/fail.log")" fi if [ ! -e "$fail_out/generated/system/kernel.sys" ] && - [ ! -e "$fail_out/generated/system/kerneldebug.sys" ]; then + [ ! -e "$fail_out/generated/system/kernel.debug" ]; then pass 'the failed build publishes no half-products' else fail 'the failed build publishes no half-products' 'a product was published' @@ -380,7 +373,7 @@ fi # Failure after products exist: the published set must stay the old complete # set, not gain a half-published mix. -debug_checksum=$(sha256sum "$fail_out/generated/system/kerneldebug.sys" | cut -d' ' -f1) +debug_checksum=$(sha256sum "$fail_out/generated/system/kernel.debug" | cut -d' ' -f1) printf '\nthis is a deliberate syntax error in the fixture\n' >>"$broken" rm -f "$fail_out/generated/system/kernel.sys" if build "$work/fail2.log" "$fail_out" RELIEFNT_DIR="$fixture"; then @@ -393,11 +386,11 @@ if [ ! -e "$fail_out/generated/system/kernel.sys" ]; then else fail 'a failed build does not restore a deleted product' 'kernel.sys reappeared' fi -if [ "$(sha256sum "$fail_out/generated/system/kerneldebug.sys" | cut -d' ' -f1)" = \ +if [ "$(sha256sum "$fail_out/generated/system/kernel.debug" | cut -d' ' -f1)" = \ "$debug_checksum" ]; then pass 'surviving products keep their bytes across a failed build' else - fail 'surviving products keep their bytes across a failed build' 'kerneldebug.sys moved' + fail 'surviving products keep their bytes across a failed build' 'kernel.debug moved' fi printf '\n%s: %d checks, %d failures\n' 'test-kernel-adapter' "$checks" "$failures" diff --git a/tests/build/test-motif-apps.sh b/tests/build/test-motif-apps.sh index 4d1f384a..2d03ddbc 100644 --- a/tests/build/test-motif-apps.sh +++ b/tests/build/test-motif-apps.sh @@ -5,8 +5,8 @@ tmp_root=${TMPDIR:-$src/out/tmp} mkdir -p "$tmp_root" work=$(mktemp -d "$tmp_root/reliefos-fltk-apps.XXXXXX") trap 'rm -rf "$work"' EXIT HUP INT TERM -if [ ! -f "$src/userland/apps/calc/engine.c" ] || [ ! -f "$src/userland/apps/osver/debug_click.h" ]; then - printf 'FAIL - calculator and system information have no toolkit-independent behavior boundary\n' >&2 +if [ ! -f "$src/userland/apps/calc/engine.c" ]; then + printf 'FAIL - calculator has no toolkit-independent behavior boundary\n' >&2 exit 1 fi for app in taskmgr minesweeper leonmmcoset xiaobai paint imageview doomlauncher installer; do @@ -16,10 +16,10 @@ for app in taskmgr minesweeper leonmmcoset xiaobai paint imageview doomlauncher fi done ${HOSTCC:-cc} -std=c11 -Wall -Wextra -Werror -fsanitize=undefined -fno-sanitize-recover=all \ - -I"$src/userland/apps" -I"$src/userland/apps/calc" -I"$src/userland/apps/osver" \ + -I"$src/userland/apps" -I"$src/userland/apps/calc" \ -I"$src/userland/apps/taskmgr" \ "$src/tests/host/test_motif_apps.c" "$src/userland/apps/calc/engine.c" \ - "$src/userland/apps/osver/debug_click.c" "$src/userland/apps/taskmgr/model.c" \ + "$src/userland/apps/taskmgr/model.c" \ "$src/userland/apps/minesweeper/model.c" "$src/userland/apps/leonmmcoset/model.c" \ "$src/userland/apps/xiaobai/model.c" "$src/userland/apps/paint/model.c" \ "$src/userland/apps/imageview/model.c" "$src/userland/apps/doomlauncher/model.c" \ diff --git a/tests/build/test-submodule-rollback-build.sh b/tests/build/test-submodule-rollback-build.sh index d6afbbac..d7d444d5 100755 --- a/tests/build/test-submodule-rollback-build.sh +++ b/tests/build/test-submodule-rollback-build.sh @@ -78,7 +78,7 @@ else "see $work/build.log" "$(tail -n 5 "$work/build.log")" fi missing= -for product in system/kernel.sys system/kernel.debug system/kerneldebug.sys; do +for product in system/kernel.sys system/kernel.debug; do [ -f "$work/out/generated/$product" ] || missing="$missing $product" done if [ -z "$missing" ]; then @@ -88,7 +88,7 @@ else "missing:$missing" fi # The rolled-back pin may still install legacy loadable driver modules into the -# sub-make install directory; the current adapter publishes only the three kernel +# sub-make install directory; the current adapter publishes only the two kernel # products and leaves those unpublished. if find "$work/out/kernel-install" -name '*.drv' 2>/dev/null | grep -q .; then printf 'note - rolled-back pin installs legacy .drv modules; they stay unpublished\n' diff --git a/tests/fixtures/brand-abi/old-sdk-exports.tsv b/tests/fixtures/brand-abi/old-sdk-exports.tsv index 3303a42d..39253135 100644 --- a/tests/fixtures/brand-abi/old-sdk-exports.tsv +++ b/tests/fixtures/brand-abi/old-sdk-exports.tsv @@ -145,10 +145,6 @@ leonos_ipc_recv_fd T leonos_ipc_send T leonos_ipc_send_fd T leonos_ipc_set_nonblock T -leonos_kernel_debug_arm_next_boot T -leonos_kernel_debug_clear T -leonos_kernel_debug_get_state T -leonos_kernel_debug_set_enabled T leonos_launch_argv T leonos_launch_assoc_apps T leonos_launch_builtin_path T diff --git a/tests/fixtures/brand-abi/old-shared-symbols.tsv b/tests/fixtures/brand-abi/old-shared-symbols.tsv index 67cdcfd3..d82e5e8d 100644 --- a/tests/fixtures/brand-abi/old-shared-symbols.tsv +++ b/tests/fixtures/brand-abi/old-shared-symbols.tsv @@ -234,10 +234,6 @@ leonos_ipc_recv_fd T leonos_ipc_send T leonos_ipc_send_fd T leonos_ipc_set_nonblock T -leonos_kernel_debug_arm_next_boot T -leonos_kernel_debug_clear T -leonos_kernel_debug_get_state T -leonos_kernel_debug_set_enabled T leonos_launch_argv T leonos_launch_assoc_apps T leonos_launch_builtin_path T diff --git a/tests/host/test_motif_apps.c b/tests/host/test_motif_apps.c index 820d570c..0ad84969 100644 --- a/tests/host/test_motif_apps.c +++ b/tests/host/test_motif_apps.c @@ -1,5 +1,4 @@ #include "engine.h" -#include "debug_click.h" #include "taskmgr/model.h" #include "installer/model.h" #include "doomlauncher/model.h" @@ -62,19 +61,6 @@ int main(void) for (unsigned i = 0; i < 200; ++i) calc_input(&calc, "1"); assert(strlen(calc.expression) == CALC_EXPR_MAX - 1); - struct osver_debug_click clicks = {0}; - for (unsigned i = 0; i < 4; ++i) assert(!osver_debug_click(&clicks, 100 + i * 100, 1)); - assert(osver_debug_click(&clicks, 500, 1)); - assert(!osver_debug_click(&clicks, 600, 1)); - assert(!osver_debug_click(&clicks, 700, 0)); - for (unsigned i = 0; i < 4; ++i) assert(!osver_debug_click(&clicks, 800 + i * 100, 1)); - assert(!osver_debug_click(&clicks, 3001, 1)); - for (unsigned i = 0; i < 3; ++i) assert(!osver_debug_click(&clicks, 3100 + i * 100, 1)); - assert(osver_debug_click(&clicks, 3400, 1)); - clicks = (struct osver_debug_click){0}; - for (unsigned i = 0; i < 4; ++i) assert(!osver_debug_click(&clicks, UINT_MAX - 300 + i * 100, 1)); - assert(osver_debug_click(&clicks, 50, 1)); - /* Task manager model: formatting, utilization math, history ring and tree order. */ { char buf[32]; @@ -712,7 +698,7 @@ int main(void) assert(strcmp(secret, "中文") == 0); } - puts("ok - calculator arithmetic, editing, bounds and logo click timing"); + puts("ok - calculator arithmetic, editing and bounds"); puts("ok - task manager formatting, utilization, history ring and tree order"); puts("ok - minesweeper placement, reveal, flags, win/lose and sprite parsing"); puts("ok - easter egg image fitting for leonmmcoset and xiaobai"); diff --git a/tools/build/rootfs-stage.sh b/tools/build/rootfs-stage.sh index 3ea9e733..705fab0d 100644 --- a/tools/build/rootfs-stage.sh +++ b/tools/build/rootfs-stage.sh @@ -119,7 +119,6 @@ fi for package in musl mimalloc; do tree "$out/sysroot/musl/share/licenses/$package" "usr/share/licenses/$package" "$package"; done printf '/lib:/usr/local/lib:/usr/lib:/usr/lib/reliefos:/usr/lib/leonos\n' > "$work/data/ld.path" file "$work/data/ld.path" etc/ld-musl-x86_64.path 0644 musl -file "$out/generated/system/kerneldebug.sys" usr/lib/reliefos/kerneldebug.sys 0755 [ -f "$out/stage/kernel-payload/kernel-payload.json" ] || { echo 'rootfs-stage: matching kernel payload is missing' >&2; exit 1; } tree "$out/stage/kernel-payload/lib/modules" lib/modules reliefos-kernel tree "$out/stage/kernel-payload/usr/lib/reliefos/kernel" usr/lib/reliefos/kernel reliefos-kernel diff --git a/tools/check_abi_migration.py b/tools/check_abi_migration.py index 72e0b80a..85551dcc 100644 --- a/tools/check_abi_migration.py +++ b/tools/check_abi_migration.py @@ -40,7 +40,7 @@ r"LEONOS_IOCTL_DRIVER_|LEONOS_IOCTL_SYSTEM_INFO|LEONOS_IOCTL_TIME_|" r"LEONOS_IOCTL_MACHINE_IDENTITY|LEONOS_IOCTL_PERF_INFO|" r"LEONOS_IOCTL_TASK_AFFINITY|LEONOS_TEXT_IOCTL|LEONOS_IOCTL_LIST_DIR|" - r"LEONOS_SIGNAL_IOCTL|LEONOS_KERNEL_DEBUG_IOCTL)" + r"LEONOS_SIGNAL_IOCTL)" r"[A-Z0-9_]*\b" ) diff --git a/tools/host/modules/bundle.c b/tools/host/modules/bundle.c index 1fe58d27..93d62027 100644 --- a/tools/host/modules/bundle.c +++ b/tools/host/modules/bundle.c @@ -346,7 +346,7 @@ int kernel_bundle_open(struct kernel_bundle *bundle, const char *directory, json_int(json_member(properties, "size"), &size) || size < 0) return fail(bundle, "invalid installed product record: %s", file->name); if (strcmp(file->name, "kernel.sys") && strcmp(file->name, "kernel.debug") && - strcmp(file->name, "kerneldebug.sys") && strncmp(file->name, bundle->prefix, strlen(bundle->prefix))) + strncmp(file->name, bundle->prefix, strlen(bundle->prefix))) return fail(bundle, "product outside installed release: %s", file->name); file->size = (off_t)size; if ((long)file->size != size) return fail(bundle, "product size overflow: %s", file->name); @@ -359,8 +359,8 @@ int kernel_bundle_open(struct kernel_bundle *bundle, const char *directory, } static const char *const required[] = {"config", "module.abi", "Module.symvers", "System.map", "modules.order", "modules.builtin", "modules.builtin.modinfo"}; - if (!kernel_bundle_find(bundle, "kernel.sys") || !kernel_bundle_find(bundle, "kernel.debug") || - !kernel_bundle_find(bundle, "kerneldebug.sys")) return fail(bundle, "incomplete installed kernel products"); + if (!kernel_bundle_find(bundle, "kernel.sys") || !kernel_bundle_find(bundle, "kernel.debug")) + return fail(bundle, "incomplete installed kernel products"); for (size_t i = 0; i < sizeof(required) / sizeof(required[0]); ++i) { char name[sizeof(bundle->prefix) + 32]; snprintf(name, sizeof(name), "%s%s", bundle->prefix, required[i]); diff --git a/tools/host/modules/payload_stage.c b/tools/host/modules/payload_stage.c index bafce623..cb5f0131 100644 --- a/tools/host/modules/payload_stage.c +++ b/tools/host/modules/payload_stage.c @@ -122,11 +122,9 @@ int kernel_payload_stage(int argc, char **argv) if (kernel_stage_copy(module_root, name, stage.root_fd, name, hash, 0644)) goto out; } char prefix[96], member[128]; snprintf(prefix, sizeof(prefix), "usr/lib/reliefos/kernel/%s/", release); - const char *names[] = {"kernel.sys", "kerneldebug.sys"}; - for (size_t i = 0; i < 2; ++i) { - snprintf(member, sizeof(member), "%s%s", prefix, names[i]); - if (kernel_stage_copy(bundle.root_fd, names[i], stage.root_fd, member, kernel_bundle_find(&bundle, names[i])->sha256, 0644)) goto out; - } + snprintf(member, sizeof(member), "%skernel.sys", prefix); + if (kernel_stage_copy(bundle.root_fd, "kernel.sys", stage.root_fd, member, + kernel_bundle_find(&bundle, "kernel.sys")->sha256, 0644)) goto out; snprintf(member, sizeof(member), "%sinitramfs.cpio", prefix); if (kernel_stage_copy_fd(pair.archive, stage.root_fd, member, pair.archive_hash, 0644)) goto out; snprintf(member, sizeof(member), "%sboot.env", prefix); diff --git a/tools/reliefos_layout.py b/tools/reliefos_layout.py index c6734aa4..24dfb35c 100644 --- a/tools/reliefos_layout.py +++ b/tools/reliefos_layout.py @@ -169,22 +169,17 @@ def apply_root_symlinks(root: Path) -> None: P_STARTUP_DB = P_VAR_LIB_RELIEFOS + "/startup.db" P_STARTUP_DENIALS_DB = P_VAR_LIB_RELIEFOS + "/startup-denials.db" P_OOBE_DONE = P_VAR_LIB_RELIEFOS + "/oobe.done" -P_KERNELDEBUG_ENABLED = P_VAR_LIB_RELIEFOS + "/kerneldebug.enabled" -P_KERNELDEBUG_CONTROL = P_VAR_LIB_RELIEFOS + "/kernel-debug" P_SESSION_USER = P_RUN_RELIEFOS + "/session-user" # Runtime boot payload paths (the ESP is normally mounted at /boot). P_BOOT_KERNEL = "/boot/reliefos/kernel.sys" -P_BOOT_KERNELDEBUG_MARKER = "/boot/reliefos/state/kerneldebug.next" P_BOOT_DISPLAY_CONF = "/boot/reliefos/config/display.conf" -P_KERNELDEBUG_MODULE = P_RELIEFOS_LIB + "/kerneldebug.sys" # ESP-internal (EFI FAT) paths. GRUB and the kernel read these before any # root filesystem exists. kernel.sys carries the Multiboot2 header GRUB # searches for (``search --file /reliefos/kernel.sys``). ESP_KERNEL = "/reliefos/kernel.sys" ESP_KERNEL_LEGACY = "/leonos/kernel.sys" -ESP_KERNELDEBUG_MARKER = "/reliefos/state/kerneldebug.next" ESP_DISPLAY_CONF = "/reliefos/config/display.conf" ESP_DISPLAY_CONF_LEGACY = "/leonos/config/display.conf" diff --git a/tools/test_installer_bundle_swap.py b/tools/test_installer_bundle_swap.py index a99a261f..e4d7b69b 100644 --- a/tools/test_installer_bundle_swap.py +++ b/tools/test_installer_bundle_swap.py @@ -28,7 +28,7 @@ def make_bundle(root,config,corrupt=False): environment=("# GRUB Environment Block\nreliefos_generation=1\nreliefos_release="+RELEASE+ "\nreliefos_module_abi="+abi+"\nreliefos_kernel_sha256="+hashlib.sha256(kernel).hexdigest()+ "\nreliefos_initramfs_sha256="+hashlib.sha256(initramfs).hexdigest()+"\n").encode() - files={boot+"kernel.sys":kernel,boot+"kerneldebug.sys":b"debug\n",boot+"initramfs.cpio":initramfs, + files={boot+"kernel.sys":kernel,boot+"initramfs.cpio":initramfs, boot+"boot.env":environment+b"#"*(1024-len(environment)),modules+"config":config, modules+"module.abi":(abi+"\n").encode()} for name in ("Module.symvers","System.map","modules.order","modules.builtin","modules.builtin.modinfo", diff --git a/tools/test_installer_payload.py b/tools/test_installer_payload.py index 4d82e93b..3d056c01 100644 --- a/tools/test_installer_payload.py +++ b/tools/test_installer_payload.py @@ -49,7 +49,7 @@ def setUp(self): ): (self.root / "install/root" / name).mkdir(parents=True, exist_ok=True) for name in ( - "root/usr/lib/reliefos/kerneldebug.sys", "root/lib/ld-musl-x86_64.so.1", + "root/lib/ld-musl-x86_64.so.1", "root/lib/libc.so", "root/lib/libmimalloc.so.3", "root/usr/lib/reliefos/libreliefos.so.2", "root/usr/lib/leonos/libleonos.so.2", "esp/reliefos/kernel.sys", "esp/leonos/kernel.sys", diff --git a/tools/test_kernel_module_tools.py b/tools/test_kernel_module_tools.py index 45521654..60308af0 100644 --- a/tools/test_kernel_module_tools.py +++ b/tools/test_kernel_module_tools.py @@ -45,8 +45,7 @@ def setUp(self): self.prefix = "lib/modules/" + RELEASE + "/" self.modules = self.install / self.prefix (self.modules / "kernel").mkdir(parents=True) - for name, value in {"kernel.sys": b"native kernel", "kernel.debug": b"symbols", - "kerneldebug.sys": b"debug tool"}.items(): + for name, value in {"kernel.sys": b"native kernel", "kernel.debug": b"symbols"}.items(): (self.install / name).write_bytes(value) self.configuration = {"MODULES": "y", "EXT4_FS": "m", "FAT_FS": "y"} self.products = {"config": "".join("CONFIG_%s=%s\n" % item for item in self.configuration.items()), @@ -121,7 +120,7 @@ def test_identity_required_members_and_path_containment(self): original = json.loads(json.dumps(self.manifest)) for mutate in (lambda: self.manifest.update(module_abi="f" * 64), lambda: self.manifest.update(module_directory="lib/modules/other"), - lambda: self.manifest["files"].pop("kerneldebug.sys"), + lambda: self.manifest["files"].pop("kernel.debug"), lambda: self.manifest["files"].update({"../escape": {"sha256": "0" * 64, "size": 0}}), lambda: self.manifest["files"].update({self.prefix + "kernel/../escape": {"sha256": "0" * 64, "size": 0}})): self.manifest = json.loads(json.dumps(original)) diff --git a/tools/test_kernel_modules_stage.py b/tools/test_kernel_modules_stage.py index 382714c9..bd38d73e 100644 --- a/tools/test_kernel_modules_stage.py +++ b/tools/test_kernel_modules_stage.py @@ -29,8 +29,7 @@ def setUp(self): self.module_dir = self.install / "lib/modules" / RELEASE (self.module_dir / "kernel").mkdir(parents=True) self.output = self.work / "stage" - for name, data in {"kernel.sys": b"kernel fixture", "kerneldebug.sys": b"debug tool", - "kernel.debug": b"kernel symbols"}.items(): + for name, data in {"kernel.sys": b"kernel fixture", "kernel.debug": b"kernel symbols"}.items(): (self.install / name).write_bytes(data) for name, data in {"config": b"CONFIG_MODULES=y\nCONFIG_EXT4_FS=m\nCONFIG_FAT_FS=y\n", "module.abi": (ABI + "\n").encode(), "modules.order": b"", diff --git a/tools/tests/installer_payload_test.c b/tools/tests/installer_payload_test.c index 3ac84688..7d9f4831 100644 --- a/tools/tests/installer_payload_test.c +++ b/tools/tests/installer_payload_test.c @@ -1,9 +1,5 @@ #define _GNU_SOURCE -#include -#undef MNT_FORCE -#undef MNT_DETACH -#undef MNT_EXPIRE -#undef UMOUNT_NOFOLLOW +#include #define lstat fixture_lstat #define fopen fixture_fopen #include "../../userland/apps/installer/install_ops.c" diff --git a/userland/apps/installer/install_ops.c b/userland/apps/installer/install_ops.c index 3a9a4cb1..345a0047 100644 --- a/userland/apps/installer/install_ops.c +++ b/userland/apps/installer/install_ops.c @@ -1312,7 +1312,6 @@ static int check_payload_required(const char *root) RELIEFOS_LAYOUT_LICENSES, RELIEFOS_LAYOUT_ETC_SSL_CERTS, }; static const char *const root_files[] = { - RELIEFOS_LAYOUT_RELIEFOS_LIB "/kerneldebug.sys", RELIEFOS_LAYOUT_LIB "/ld-musl-x86_64.so.1", RELIEFOS_LAYOUT_LIB "/libc.so", RELIEFOS_LAYOUT_LIB "/libmimalloc.so.3", RELIEFOS_PATH_LIBRELIEFOS, "/usr/lib/leonos/libleonos.so.2", diff --git a/userland/apps/osver/Kbuild b/userland/apps/osver/Kbuild index 5f52798d..f6571363 100644 --- a/userland/apps/osver/Kbuild +++ b/userland/apps/osver/Kbuild @@ -1,6 +1,6 @@ RELIEFOS_APP_NAME := osver -RELIEFOS_APP_OBJECTS := debug_click.o main.o -RELIEFOS_APP_C_OBJECTS := debug_click.o +RELIEFOS_APP_OBJECTS := main.o +RELIEFOS_APP_C_OBJECTS := RELIEFOS_APP_CXX_OBJECTS := main.o RELIEFOS_APP_ASM_OBJECTS := ifneq ($(RELIEFOS_CAPTURE_APP_KBUILD),1) diff --git a/userland/apps/osver/debug_click.c b/userland/apps/osver/debug_click.c deleted file mode 100644 index 2acbe23e..00000000 --- a/userland/apps/osver/debug_click.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "debug_click.h" - -int osver_debug_click(struct osver_debug_click *state, uint32_t now_ms, - int inside_logo) -{ - if (!inside_logo) { - state->count = 0; - return 0; - } - if (!state->count || now_ms - state->window_start_ms > 2000U) { - state->count = 0; - state->window_start_ms = now_ms; - } - if (++state->count < 5U) return 0; - state->count = 0; - return 1; -} diff --git a/userland/apps/osver/debug_click.h b/userland/apps/osver/debug_click.h deleted file mode 100644 index 02afaa98..00000000 --- a/userland/apps/osver/debug_click.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef RELIEFOS_OSVER_DEBUG_CLICK_H -#define RELIEFOS_OSVER_DEBUG_CLICK_H - -#include - -struct osver_debug_click { - uint32_t count; - uint32_t window_start_ms; -}; - -int osver_debug_click(struct osver_debug_click *state, uint32_t now_ms, - int inside_logo); - -#endif diff --git a/userland/apps/osver/main.cpp b/userland/apps/osver/main.cpp index 9d03e56d..4df31de9 100644 --- a/userland/apps/osver/main.cpp +++ b/userland/apps/osver/main.cpp @@ -6,29 +6,12 @@ #include #include #include -#include #include extern "C" { -#include "debug_click.h" #include #include } -static Fl_Box *status_label; -static struct osver_debug_click clicks; - -static void enable_debug() -{ - uint32_t flags = 0; - if (reliefos_kernel_debug_get_state(&flags) == 0 && - (flags & RELIEFOS_KERNEL_DEBUG_STATE_ENABLED)) return; - bool success = reliefos_kernel_debug_set_enabled(1) == 0; - if (success) status_label->copy_label(T("Kernel debug mode enabled")); - fl_message_title(T("Kernel debug mode")); - fl_message("%s", success ? T("Kernel debug mode enabled. Reboot to enter it.") : - T("Could not persist kernel debug mode.")); -} - class Logo : public Fl_Widget { uint32_t *pixels_ = nullptr; uint32_t width_ = 0, height_ = 0; @@ -43,13 +26,6 @@ class Logo : public Fl_Widget { } } ~Logo() override { reliefos_png_free(pixels_); } - bool inside() const - { - return pixels_ && Fl::event_x() >= x() + (w() - draw_width_) / 2 && - Fl::event_x() < x() + (w() + draw_width_) / 2 && - Fl::event_y() >= y() + (h() - draw_height_) / 2 && - Fl::event_y() < y() + (h() + draw_height_) / 2; - } void draw() override { fl_color(FL_WHITE); fl_rectf(x(), y(), w(), h()); @@ -57,27 +33,6 @@ class Logo : public Fl_Widget { y() + (h()-draw_height_)/2, draw_width_, draw_height_); else { fl_font(FL_HELVETICA, 15); fl_color(FL_FOREGROUND_COLOR); fl_draw(T("Logo unavailable"), x(), y(), w(), h(), FL_ALIGN_CENTER); } } - int handle(int event) override - { - if (event == FL_PUSH && Fl::event_button() == FL_LEFT_MOUSE) { - timespec now{}; - if (clock_gettime(CLOCK_MONOTONIC, &now) == 0 && - osver_debug_click(&clicks, (uint64_t)now.tv_sec * 1000 + now.tv_nsec / 1000000, inside())) enable_debug(); - return 1; - } - return Fl_Widget::handle(event); - } -}; - -class About : public Fl_Double_Window { -public: - Logo *logo = nullptr; - About() : Fl_Double_Window(790, 390, T("About ReliefOS")) {} - int handle(int event) override - { - if (event == FL_PUSH && logo && !logo->inside()) osver_debug_click(&clicks, 0, 0); - return Fl_Double_Window::handle(event); - } }; int main() @@ -98,12 +53,10 @@ int main() if (!info.copyright[0]) snprintf(info.copyright, sizeof(info.copyright), "%s", RELIEFOS_COPYRIGHT); info.kernel_name[sizeof(info.kernel_name)-1] = info.kernel_version[sizeof(info.kernel_version)-1] = 0; info.build_time[sizeof(info.build_time)-1] = info.copyright[sizeof(info.copyright)-1] = 0; - uint32_t flags = 0; - if (reliefos_kernel_debug_get_state(&flags) == 0 && (flags & RELIEFOS_KERNEL_DEBUG_STATE_ENABLED)) status = T("Kernel debug mode enabled"); - About window; + Fl_Double_Window window(790, 390, T("About ReliefOS")); new Fl_Box(20, 12, 750, 32, "ReliefOS"); new Fl_Box(20, 46, 750, 28, T("About this operating system")); - window.logo = new Logo(22, 98); + new Logo(22, 98); const char *names[] = {T("Kernel"), T("Kernel version"), T("Build time"), T("Copyright")}; const char *values[] = {info.kernel_name, info.kernel_version, info.build_time, info.copyright}; for (int i = 0; i < 4; ++i) { @@ -113,7 +66,7 @@ int main() value->value(values[i]); value->textsize(14); } new Fl_Box(220, 292, 550, 28, T("Build and runtime components")); - status_label = new Fl_Box(20, 340, 630, 32, status); + Fl_Box *status_label = new Fl_Box(20, 340, 630, 32, status); status_label->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); Fl_Button *close = new Fl_Button(664, 340, 106, 32, T("Close")); close->callback([](Fl_Widget *widget, void *) { widget->window()->hide(); }); diff --git a/userland/runtime/include/leonos/layout.h b/userland/runtime/include/leonos/layout.h index bad5d345..2f29b1b0 100644 --- a/userland/runtime/include/leonos/layout.h +++ b/userland/runtime/include/leonos/layout.h @@ -39,7 +39,6 @@ #define LEONOS_PATH_ACCOUNTS_DB RELIEFOS_PATH_ACCOUNTS_DB #define LEONOS_PATH_BOOT_DISPLAY_CONF RELIEFOS_PATH_BOOT_DISPLAY_CONF #define LEONOS_PATH_BOOT_KERNEL RELIEFOS_PATH_BOOT_KERNEL -#define LEONOS_PATH_BOOT_KERNELDEBUG_MARKER RELIEFOS_PATH_BOOT_KERNELDEBUG_MARKER #define LEONOS_PATH_BROWSER_CJK_FONT RELIEFOS_PATH_BROWSER_CJK_FONT #define LEONOS_PATH_BROWSER_FONT RELIEFOS_PATH_BROWSER_FONT #define LEONOS_PATH_CACERT RELIEFOS_PATH_CACERT @@ -48,9 +47,6 @@ #define LEONOS_PATH_FILEASSOC_CFG RELIEFOS_PATH_FILEASSOC_CFG #define LEONOS_PATH_GLIBC_INTERP RELIEFOS_PATH_GLIBC_INTERP #define LEONOS_PATH_HELP RELIEFOS_PATH_HELP -#define LEONOS_PATH_KERNELDEBUG_CONTROL RELIEFOS_PATH_KERNELDEBUG_CONTROL -#define LEONOS_PATH_KERNELDEBUG_ENABLED RELIEFOS_PATH_KERNELDEBUG_ENABLED -#define LEONOS_PATH_KERNELDEBUG_MODULE RELIEFOS_PATH_KERNELDEBUG_MODULE #define LEONOS_PATH_LEONOS_CONF RELIEFOS_PATH_RELIEFOS_CONF #define LEONOS_PATH_LESSKEY RELIEFOS_PATH_LESSKEY #define LEONOS_PATH_LIBC RELIEFOS_PATH_LIBC diff --git a/userland/runtime/src/kernel_bundle_check.c b/userland/runtime/src/kernel_bundle_check.c index 5373d9bb..50c6f88d 100644 --- a/userland/runtime/src/kernel_bundle_check.c +++ b/userland/runtime/src/kernel_bundle_check.c @@ -42,14 +42,14 @@ static struct kernel_bundle_product *find_product(struct kernel_bundle_checked * /** @brief Reject checksum records outside this exact release's publication scope. * @param bundle Borrowed validated release identity. * @param name Canonical relative product name. - * @return Nonzero only for module products, the platform policy or four boot members. + * @return Nonzero only for module products, the platform policy or three boot members. */ static int allowed_product(const struct kernel_bundle_checked *bundle, const char *name) { if (!strncmp(name, bundle->modules, strlen(bundle->modules))) return 1; if (strncmp(name, bundle->prefix, strlen(bundle->prefix))) return 0; name += strlen(bundle->prefix); - return !strcmp(name, "kernel.sys") || !strcmp(name, "kerneldebug.sys") || + return !strcmp(name, "kernel.sys") || !strcmp(name, "initramfs.cpio") || !strcmp(name, "boot.env"); } @@ -98,7 +98,7 @@ static int checksum_list(struct kernel_bundle_checked *bundle) */ static int required_products(struct kernel_bundle_checked *bundle) { - const char *const boot[] = {"kernel.sys", "kerneldebug.sys", "initramfs.cpio", "boot.env"}; + const char *const boot[] = {"kernel.sys", "initramfs.cpio", "boot.env"}; const char *const modules[] = {"config", "module.abi", "Module.symvers", "System.map", "modules.order", "modules.builtin", "modules.builtin.modinfo", "modules.dep", "modules.alias", "modules.symbols", "modules-load.d/reliefnt-platform.conf"}; @@ -107,7 +107,7 @@ static int required_products(struct kernel_bundle_checked *bundle) snprintf(path, sizeof(path), "%s%s", bundle->prefix, boot[i]); struct kernel_bundle_product *product = find_product(bundle, path); if (!product) return -EINVAL; - const char *expected = i == 0 ? bundle->identity.kernel_sha256 : i == 2 ? bundle->identity.initramfs_sha256 : NULL; + const char *expected = i == 0 ? bundle->identity.kernel_sha256 : i == 1 ? bundle->identity.initramfs_sha256 : NULL; if (expected && strcmp(product->hash, expected)) return -EINVAL; } for (size_t i = 0; i < sizeof(modules) / sizeof(modules[0]); ++i) { diff --git a/userland/runtime/src/kernel_bundle_publish.c b/userland/runtime/src/kernel_bundle_publish.c index 37da1fc5..d5ed7483 100644 --- a/userland/runtime/src/kernel_bundle_publish.c +++ b/userland/runtime/src/kernel_bundle_publish.c @@ -90,23 +90,21 @@ static int sync_parent(int root, const char *relative) */ static int publish_version(const struct kernel_bundle_checked *bundle, int root) { - const char *names[] = {"kernel.sys", "initramfs.cpio", "kerneldebug.sys", "boot.env"}; - const char *hashes[4] = {bundle->identity.kernel_sha256, bundle->identity.initramfs_sha256, NULL, NULL}; + const char *names[] = {"kernel.sys", "initramfs.cpio", "boot.env"}; + const char *hashes[] = {bundle->identity.kernel_sha256, bundle->identity.initramfs_sha256, NULL}; char source[128]; - for (size_t i = 2; i < 4; ++i) { + for (size_t i = 2; i < sizeof(names) / sizeof(names[0]); ++i) { snprintf(source, sizeof(source), "%s%s", bundle->prefix, names[i]); for (size_t j = 0; j < bundle->count; ++j) if (!strcmp(source, bundle->products[j].name)) { hashes[i] = bundle->products[j].hash; break; } if (!hashes[i]) return -EINVAL; } - for (size_t i = 0; i < 4; ++i) { + for (size_t i = 0; i < sizeof(names) / sizeof(names[0]); ++i) { int result = copy_version(bundle, root, names[i], hashes[i]); if (result) return result; } char checksum[400], path[192], version[160]; - /* Match the original native-media format exactly; the debugger is verified - * before publication but is not a GRUB-loaded member of this checksum list. */ - int length = snprintf(checksum, sizeof(checksum), "%s kernel.sys\n%s initramfs.cpio\n%s boot.env\n", hashes[0], hashes[1], hashes[3]); + int length = snprintf(checksum, sizeof(checksum), "%s kernel.sys\n%s initramfs.cpio\n%s boot.env\n", hashes[0], hashes[1], hashes[2]); int result = reliefos_kernel_boot_directory(&bundle->identity, version, sizeof(version)); if (result) return result; snprintf(path, sizeof(path), "%s/SHA256SUMS", version); diff --git a/userland/runtime/src/libc.c b/userland/runtime/src/libc.c index cfe9b0a4..df5bd2c9 100644 --- a/userland/runtime/src/libc.c +++ b/userland/runtime/src/libc.c @@ -1637,58 +1637,6 @@ int reliefos_system_shutdown(void) return reliefos_auth_request_power(RB_POWER_OFF); } -int reliefos_kernel_debug_get_state(uint32_t *flags) -{ - char buffer[128] = {0}; - int fd; - if (!flags) return -1; - *flags = 0; - fd = open(RELIEFOS_PATH_KERNELDEBUG_CONTROL, RELIEFOS_O_RDONLY, 0); - if (fd < 0) return 0; - { - long got = read(fd, buffer, sizeof(buffer) - 1u); - if (got > 0) { - if (buffer[0] == '1') *flags |= RELIEFOS_KERNEL_DEBUG_STATE_ENABLED; - for (long i = 0; i + 1 < got; ++i) { - if (buffer[i] == 'a' && buffer[i+1] == 'r' && buffer[i+2] == 'm') { - *flags |= RELIEFOS_KERNEL_DEBUG_STATE_NEXT_BOOT; - } - } - } - } - close(fd); - return 0; -} - -static int reliefos_kernel_debug_write(const char *text) -{ - int fd = open(RELIEFOS_PATH_KERNELDEBUG_CONTROL, - RELIEFOS_O_WRONLY | RELIEFOS_O_CREAT | RELIEFOS_O_TRUNC, 0666); - uint32_t len = 0; - if (fd < 0) return fd; - while (text && text[len]) ++len; - { - long wrote = write(fd, text, len); - close(fd); - return wrote == (long)len ? 0 : -1; - } -} - -int reliefos_kernel_debug_set_enabled(int enabled) -{ - return reliefos_kernel_debug_write(enabled ? "1\n" : "0\n"); -} - -int reliefos_kernel_debug_arm_next_boot(void) -{ - return reliefos_kernel_debug_write("arm\n"); -} - -int reliefos_kernel_debug_clear(void) -{ - return reliefos_kernel_debug_write(""); -} - /* Published libleonos.so.2 aliases; keep these in the defining translation unit. */ extern __typeof__(reliefos_fs_acl_get) leonos_fs_acl_get __attribute__((alias("reliefos_fs_acl_get"))); extern __typeof__(reliefos_fs_acl_repair) leonos_fs_acl_repair __attribute__((alias("reliefos_fs_acl_repair"))); @@ -1699,10 +1647,6 @@ extern __typeof__(reliefos_http_download) leonos_http_download __attribute__((al extern __typeof__(reliefos_http_get) leonos_http_get __attribute__((alias("reliefos_http_get"))); extern __typeof__(reliefos_http_request) leonos_http_request __attribute__((alias("reliefos_http_request"))); extern __typeof__(reliefos_http_resolve_url) leonos_http_resolve_url __attribute__((alias("reliefos_http_resolve_url"))); -extern __typeof__(reliefos_kernel_debug_arm_next_boot) leonos_kernel_debug_arm_next_boot __attribute__((alias("reliefos_kernel_debug_arm_next_boot"))); -extern __typeof__(reliefos_kernel_debug_clear) leonos_kernel_debug_clear __attribute__((alias("reliefos_kernel_debug_clear"))); -extern __typeof__(reliefos_kernel_debug_get_state) leonos_kernel_debug_get_state __attribute__((alias("reliefos_kernel_debug_get_state"))); -extern __typeof__(reliefos_kernel_debug_set_enabled) leonos_kernel_debug_set_enabled __attribute__((alias("reliefos_kernel_debug_set_enabled"))); extern __typeof__(reliefos_stat_legacy) leonos_stat_legacy __attribute__((alias("reliefos_stat_legacy"))); extern __typeof__(reliefos_system_reboot) leonos_system_reboot __attribute__((alias("reliefos_system_reboot"))); extern __typeof__(reliefos_system_shutdown) leonos_system_shutdown __attribute__((alias("reliefos_system_shutdown"))); From 98f073380fbfd0905acc87ada083a24b755b4d16 Mon Sep 17 00:00:00 2001 From: LeonMMcoset Date: Thu, 12 Nov 2026 13:03:07 +0000 Subject: [PATCH 2/3] chore(deps): update exfatprogs to 1.4.4 --- NOTICE | 4 ++-- configs/dependencies.lock.json | 10 +++++----- configs/storage-upstream.json | 20 ++++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/NOTICE b/NOTICE index 639f8a3b..023fcfd8 100644 --- a/NOTICE +++ b/NOTICE @@ -39,8 +39,8 @@ Runtime, libraries, and applications * util-linux 2.41.6 (su/runuser and storage utilities/libraries): upstream GPL/LGPL and file-specific terms; see README.licensing. -* e2fsprogs 1.47.3: upstream GPL/LGPL/BSD/MIT and file-specific terms; - see NOTICE. dosfstools 4.2 and exfatprogs 1.4.3: see their COPYING files +* e2fsprogs 1.47.4: upstream GPL/LGPL/BSD/MIT and file-specific terms; + see NOTICE. dosfstools 4.2 and exfatprogs 1.4.4: see their COPYING files and individual source headers. Fixed archive references and checksums are in configs/storage-upstream.json; notices are installed under /usr/share/licenses//. diff --git a/configs/dependencies.lock.json b/configs/dependencies.lock.json index 0a55e88e..9e509a8c 100644 --- a/configs/dependencies.lock.json +++ b/configs/dependencies.lock.json @@ -2476,12 +2476,12 @@ { "id": "exfatprogs", "kind": "tarball", - "version": "1.4.3", - "url": "https://github.com/exfatprogs/exfatprogs/releases/download/1.4.3/exfatprogs-1.4.3.tar.xz", - "sha256": "57226a8ec1bfbce06d68a42cde8cd980414a9457882e691fbce4a4f86c8d5f08", - "directory": "exfatprogs-1.4.3", + "version": "1.4.4", + "url": "https://github.com/exfatprogs/exfatprogs/releases/download/1.4.4/exfatprogs-1.4.4.tar.xz", + "sha256": "102bbdfd934776c12c6d83743a31ec648f8c2f1ddfa1832b6e13b6efd09412cb", + "directory": "exfatprogs-1.4.4", "license_in_source": "COPYING", - "checksum_source": "https://api.github.com/repos/exfatprogs/exfatprogs/releases/tags/1.4.3", + "checksum_source": "https://api.github.com/repos/exfatprogs/exfatprogs/releases/tags/1.4.4", "script": "tools/build/upstream.sh", "target": "storage-upstream" }, diff --git a/configs/storage-upstream.json b/configs/storage-upstream.json index 1e6579b5..0ba69ca2 100644 --- a/configs/storage-upstream.json +++ b/configs/storage-upstream.json @@ -1,11 +1,11 @@ { "e2fsprogs": { - "version": "1.47.3", - "url": "https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.47.3/e2fsprogs-1.47.3.tar.xz", - "sha256": "857e6ef800feaa2bb4578fbc810214be5d3c88b072ea53c5384733a965737329", - "directory": "e2fsprogs-1.47.3", + "version": "1.47.4", + "url": "https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.47.4/e2fsprogs-1.47.4.tar.xz", + "sha256": "fd5bf388cbdbe006a3d3b318d983b2948382440acc85a87f1e7d108653e8db0b", + "directory": "e2fsprogs-1.47.4", "license_file": "NOTICE", - "checksum_source": "https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.47.3/sha256sums.asc" + "checksum_source": "https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.47.4/sha256sums.asc" }, "dosfstools": { "version": "4.2", @@ -16,11 +16,11 @@ "checksum_source": "https://raw.githubusercontent.com/buildroot/buildroot/2025.02/package/dosfstools/dosfstools.hash" }, "exfatprogs": { - "version": "1.4.3", - "url": "https://github.com/exfatprogs/exfatprogs/releases/download/1.4.3/exfatprogs-1.4.3.tar.xz", - "sha256": "57226a8ec1bfbce06d68a42cde8cd980414a9457882e691fbce4a4f86c8d5f08", - "directory": "exfatprogs-1.4.3", + "version": "1.4.4", + "url": "https://github.com/exfatprogs/exfatprogs/releases/download/1.4.4/exfatprogs-1.4.4.tar.xz", + "sha256": "102bbdfd934776c12c6d83743a31ec648f8c2f1ddfa1832b6e13b6efd09412cb", + "directory": "exfatprogs-1.4.4", "license_file": "COPYING", - "checksum_source": "https://api.github.com/repos/exfatprogs/exfatprogs/releases/tags/1.4.3" + "checksum_source": "https://api.github.com/repos/exfatprogs/exfatprogs/releases/tags/1.4.4" } } From 8b6960cdc63d5a4f08b92bf4bca906f6bb61033d Mon Sep 17 00:00:00 2001 From: LeonMMcoset Date: Thu, 12 Nov 2026 13:35:39 +0000 Subject: [PATCH 3/3] fix(deps): refresh Alpine Vim APK pins --- configs/dependencies.lock.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/configs/dependencies.lock.json b/configs/dependencies.lock.json index 9e509a8c..1aa18fb3 100644 --- a/configs/dependencies.lock.json +++ b/configs/dependencies.lock.json @@ -2046,25 +2046,25 @@ { "id": "alpine-vim", "kind": "apk", - "version": "9.2.1202-r0", - "url": "https://dl-cdn.alpinelinux.org/alpine/v3.24/community/x86_64/vim-9.2.1202-r0.apk", - "sha256": "922cdfce26e19a6413bbbd7110b7aa9460c7445caca41cf433341b243ad6cece", - "directory": "vim-9.2.1202-r0", + "version": "9.2.1310-r0", + "url": "https://dl-cdn.alpinelinux.org/alpine/v3.24/community/x86_64/vim-9.2.1310-r0.apk", + "sha256": "83f90479632e7abaf76dad16fa7a6b334dee2d01a87496d9310d49b993b23ca2", + "directory": "vim-9.2.1310-r0", "script": "tools/build/upstream-apk.sh", "target": "apk-root", - "note": "Alpine aports recipe commit 8dda40f62186710707d93e571f4fa7519b1538a0; .PKGINFO license = Vim", + "note": "Alpine aports recipe commit 7fc5a6e8b3e6afcb3fcfdc970633418453787640; .PKGINFO license = Vim", "license_in_source": ".PKGINFO" }, { "id": "alpine-vim-common", "kind": "apk", - "version": "9.2.1202-r0", - "url": "https://dl-cdn.alpinelinux.org/alpine/v3.24/community/x86_64/vim-common-9.2.1202-r0.apk", - "sha256": "1565a62139d4049e7ade4fbbf58964d99ec7f33b78a8328061b426364ca2c251", - "directory": "vim-common-9.2.1202-r0", + "version": "9.2.1310-r0", + "url": "https://dl-cdn.alpinelinux.org/alpine/v3.24/community/x86_64/vim-common-9.2.1310-r0.apk", + "sha256": "d3e6ab17dcda2e6f478c2889c47a6d0cc35a1454aa5dfd16822e81cccbd08966", + "directory": "vim-common-9.2.1310-r0", "script": "tools/build/upstream-apk.sh", "target": "apk-root", - "note": "Alpine aports recipe commit 8dda40f62186710707d93e571f4fa7519b1538a0; .PKGINFO license = Vim; runtime data required by alpine-vim", + "note": "Alpine aports recipe commit 7fc5a6e8b3e6afcb3fcfdc970633418453787640; .PKGINFO license = Vim; runtime data required by alpine-vim", "license_in_source": ".PKGINFO" }, { @@ -2356,13 +2356,13 @@ { "id": "alpine-xxd", "kind": "apk", - "version": "9.2.1202-r0", - "url": "https://dl-cdn.alpinelinux.org/alpine/v3.24/community/x86_64/xxd-9.2.1202-r0.apk", - "sha256": "22e8c267798e6b874b3efad6dee73048a5eef9ef993955af4ab4489186ceae8a", - "directory": "xxd-9.2.1202-r0", + "version": "9.2.1310-r0", + "url": "https://dl-cdn.alpinelinux.org/alpine/v3.24/community/x86_64/xxd-9.2.1310-r0.apk", + "sha256": "48e3ddfa817c91c64e9461bc247b61e5c685fc279afc4a36ae499ce9a90a8185", + "directory": "xxd-9.2.1310-r0", "script": "tools/build/upstream-apk.sh", "target": "apk-root", - "note": "Alpine aports recipe commit 8dda40f62186710707d93e571f4fa7519b1538a0; .PKGINFO license = Vim; required by alpine-vim", + "note": "Alpine aports recipe commit 7fc5a6e8b3e6afcb3fcfdc970633418453787640; .PKGINFO license = Vim; required by alpine-vim", "license_in_source": ".PKGINFO" }, {