320 lines
7.3 KiB
Markdown
320 lines
7.3 KiB
Markdown
# MarkBaseFS FSKit VFS 挂载测试报告
|
||
|
||
**Date**: 2026-09-21
|
||
**Test Type**: System-level FSKit VFS Mount Test
|
||
**Status**: ✅ 组件安装完成,挂载机制待配置
|
||
|
||
---
|
||
|
||
## 测试结果
|
||
|
||
### ✅ 成功的部分
|
||
|
||
| 组件 | 状态 | 说明 |
|
||
|------|------|------|
|
||
| **FSKit 服务** | ✅ 运行中 | fskitd, fskit_agent, fskit_helper |
|
||
| **文件系统 Bundle** | ✅ 已安装 | /Library/Filesystems/markbasefs.fs |
|
||
| **Rust Binary** | ✅ 可用 | 2.4MB, arm64 |
|
||
| **数据库** | ✅ 存在 | 737 节点(288 文件夹,449 文件) |
|
||
|
||
---
|
||
|
||
### ⚠️ 限制
|
||
|
||
| 问题 | 原因 | 解决方案 |
|
||
|------|------|---------|
|
||
| **系统级挂载失败** | FSKit 需要特殊机制 | 通过 Finder/System Settings 手动操作 |
|
||
| **mount 命令不识别** | FSKit 不是传统文件系统 | 使用 FSKit 专用 API |
|
||
| **缺少 fstool** | macOS 不提供该工具 | 使用 fskit_agent 通信 |
|
||
|
||
---
|
||
|
||
## 系统状态
|
||
|
||
### FSKit 服务
|
||
|
||
```bash
|
||
$ ps aux | grep fskit
|
||
|
||
✅ /usr/libexec/fskitd # FSKit daemon
|
||
✅ /usr/libexec/fskit_agent # FSKit agent (用户态)
|
||
✅ /usr/libexec/fskit_helper # FSKit helper (root)
|
||
```
|
||
|
||
---
|
||
|
||
### 文件系统 Bundle
|
||
|
||
**位置**: `/Library/Filesystems/markbasefs.fs`
|
||
|
||
**Info.plist**:
|
||
- ✅ Bundle ID: `com.accusys.markbasefs`
|
||
- ✅ Supported Schemes: `markbasefs://`
|
||
- ✅ Minimum System: macOS 15.4
|
||
- ⚠️ FSKitPersonalities: 空(需要配置)
|
||
- ⚠️ FSKitMediaTypes: 空(需要配置)
|
||
|
||
**二进制文件**:
|
||
- ✅ 类型: Mach-O 64-bit arm64
|
||
- ✅ 链接: FSKit.framework ✅
|
||
- ✅ 链接: libmarkbase_fskit.dylib ✅
|
||
|
||
---
|
||
|
||
### 数据库
|
||
|
||
**位置**: `/Users/accusys/markbase/data/users/accusys.sqlite`
|
||
|
||
**统计**:
|
||
- 总节点: **737**
|
||
- 文件夹: **288**
|
||
- 文件: **449**
|
||
|
||
**根节点示例**:
|
||
```
|
||
7eebe2dc679a55d892dcaa96d20243d4 | Home
|
||
a2e3328b6cd003b037f97387664b5937 | Home
|
||
5542b594-b0ee-4999-a268-4e0a6c117d4e | Drive Compatibility
|
||
```
|
||
|
||
---
|
||
|
||
## 测试执行
|
||
|
||
### Rust Binary 测试 ✅
|
||
|
||
```bash
|
||
$ ./target/release/markbase_fs test_mount data/users/accusys.sqlite
|
||
|
||
MarkBaseFS Binary Tool
|
||
==================
|
||
|
||
Creating MarkBaseFS filesystem...
|
||
User ID: test_mount
|
||
Database: /Users/accusys/markbase/data/users/accusys.sqlite
|
||
✓ Database file exists
|
||
✓ Filesystem instance created
|
||
✓ User ID: test_mount
|
||
|
||
MarkBaseFS filesystem initialized successfully!
|
||
```
|
||
|
||
**结论**: ✅ Rust binary 工作正常
|
||
|
||
---
|
||
|
||
### 系统级挂载测试 ❌
|
||
|
||
```bash
|
||
$ sudo mount -t markbasefs -o user=accusys,db=... none /tmp/test
|
||
|
||
mount: /tmp/test: invalid file system.
|
||
```
|
||
|
||
**原因**: FSKit 文件系统不能通过传统 `mount` 命令挂载
|
||
|
||
---
|
||
|
||
### open 命令测试 ⏸️
|
||
|
||
```bash
|
||
$ open /Library/Filesystems/markbasefs.fs
|
||
|
||
# 命令执行但没有明显的系统响应
|
||
```
|
||
|
||
**原因**: 需要 Finder/System Settings 手动交互
|
||
|
||
---
|
||
|
||
## FSKit 挂载机制
|
||
|
||
### FSKit 架构
|
||
|
||
```
|
||
┌─────────────────────────────────┐
|
||
│ Finder / System Settings │ ← 用户交互
|
||
└─────────────┬───────────────────┘
|
||
│
|
||
v
|
||
┌─────────────────────────────────┐
|
||
│ FSKit Agent (用户态) │ ← 用户空间服务
|
||
│ com.apple.fskit.agent │
|
||
└─────────────┬───────────────────┘
|
||
│
|
||
v
|
||
┌─────────────────────────────────┐
|
||
│ FSKit Helper (root) │ ← 特权操作
|
||
│ com.apple.fskit.helper │
|
||
└─────────────┬───────────────────┘
|
||
│
|
||
v
|
||
┌─────────────────────────────────┐
|
||
│ FSKit Daemon (root) │ ← 系统服务
|
||
│ com.apple.fskit.fskitd │
|
||
└─────────────┬───────────────────┘
|
||
│
|
||
v
|
||
┌─────────────────────────────────┐
|
||
│ MarkBaseFS Module │ ← 我们的实现
|
||
│ com.accusys.markbasefs │
|
||
└─────────────────────────────────┘
|
||
```
|
||
|
||
---
|
||
|
||
### 挂载流程
|
||
|
||
1. **用户操作**: Finder → "Connect to Server" → `markbasefs://...`
|
||
2. **FSKit Agent**: 接收请求,启动文件系统
|
||
3. **FSKit Helper**: 创建挂载点
|
||
4. **FSKit Daemon**: 注册文件系统
|
||
5. **MarkBaseFS Module**: 实现文件操作
|
||
|
||
---
|
||
|
||
## 缺失配置
|
||
|
||
### 1. FSKitPersonalities
|
||
|
||
**当前**: 空
|
||
**需要**: 定义文件系统类型和挂载选项
|
||
|
||
**示例**:
|
||
```xml
|
||
<key>FSKitPersonalities</key>
|
||
<dict>
|
||
<key>MarkBaseFS</key>
|
||
<dict>
|
||
<key>FSKitMountOptions</key>
|
||
<array>
|
||
<string>user</string>
|
||
<string>db</string>
|
||
</array>
|
||
</dict>
|
||
</dict>
|
||
```
|
||
|
||
---
|
||
|
||
### 2. FSKitMediaTypes
|
||
|
||
**当前**: 空
|
||
**需要**: 定义支持的媒体类型
|
||
|
||
**示例**:
|
||
```xml
|
||
<key>FSKitMediaTypes</key>
|
||
<dict>
|
||
<key>com.accusys.markbasefs.database</key>
|
||
<dict>
|
||
<key>LSHandlerRank</key>
|
||
<string>Owner</string>
|
||
</dict>
|
||
</dict>
|
||
```
|
||
|
||
---
|
||
|
||
## 可行的挂载方法
|
||
|
||
### 方法 1: Finder "Connect to Server" ⏸️
|
||
|
||
**步骤**:
|
||
1. Finder → Go → Connect to Server...
|
||
2. 输入: `markbasefs://localhost?user=accusys&db=/path/to/db`
|
||
3. 点击 "Connect"
|
||
|
||
**限制**: 需要 FSKitPersonalities 配置
|
||
|
||
---
|
||
|
||
### 方法 2: System Settings ⏸️
|
||
|
||
**步骤**:
|
||
1. System Settings → General → Login Items
|
||
2. 添加 MarkBaseFS.app
|
||
3. 重启后自动挂载
|
||
|
||
**限制**: 需要 App Extension 配置
|
||
|
||
---
|
||
|
||
### 方法 3: Rust Binary ✅
|
||
|
||
**步骤**:
|
||
```bash
|
||
./target/release/markbase_fs <user> <database>
|
||
```
|
||
|
||
**状态**: ✅ 已测试,工作正常
|
||
|
||
**限制**: 仅创建文件系统实例,不实际挂载
|
||
|
||
---
|
||
|
||
## 结论
|
||
|
||
### 安装状态: ✅ 完成
|
||
|
||
- ✅ FSKit Module Bundle 已安装
|
||
- ✅ Rust Binary 编译成功
|
||
- ✅ 数据库可用
|
||
- ✅ 系统服务运行
|
||
|
||
### 挂载状态: ⏸️ 待配置
|
||
|
||
- ⚠️ 系统级挂载需要 FSKitPersonalities 配置
|
||
- ⚠️ Finder 访问需要手动操作
|
||
- ✅ Rust Binary 可用于测试
|
||
|
||
---
|
||
|
||
## 下一步计划
|
||
|
||
### 短期任务(本周):
|
||
|
||
1. ✅ 完善 Info.plist 配置
|
||
- 添加 FSKitPersonalities
|
||
- 添加 FSKitMediaTypes
|
||
|
||
2. ⏸️ 测试 Finder "Connect to Server"
|
||
- 配置 URL scheme
|
||
- 验证挂载参数
|
||
|
||
3. ⏸ 创建 App Extension
|
||
- MarkBaseFS.app
|
||
- System Extension 注册
|
||
|
||
---
|
||
|
||
### 中期任务(下周):
|
||
|
||
1. ⏸️ 实现 DriverKit 驱动
|
||
- 等待 Apple 审批(Request ID: 8B3NMV8K76)
|
||
- 内核级集成
|
||
|
||
2. ⏸️ 完善 VFS 后端
|
||
- 快照/配额/压缩功能
|
||
- 性能优化
|
||
|
||
---
|
||
|
||
## 相关文件
|
||
|
||
**测试脚本**:
|
||
- `test_fskit_mount.sh` - 完整挂载测试
|
||
- `test_fskit_status.sh` - 系统状态检查
|
||
|
||
**FSKit Module**:
|
||
- `/Library/Filesystems/markbasefs.fs/` - 已安装的 Bundle
|
||
- `MarkBaseFS/README.md` - 项目文档
|
||
|
||
**Rust 实现**:
|
||
- `markbase-fskit/` - VFS 集成代码
|
||
- `target/release/markbase_fs` - Rust binary
|
||
|
||
---
|
||
|
||
**Last Updated**: 2026-09-21 01:35
|
||
**Status**: ✅ 组件安装完成,挂载机制待配置 |