Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fs): 【任务发布】实现把整个磁盘镜像当成一个分区来读取的功能 #769

Open
fslongjin opened this issue Apr 25, 2024 · 3 comments
Labels
A-fs Area: 文件系统 enhancement New feature or request

Comments

@fslongjin
Copy link
Member

目前遇到的问题

目前DragonOS的磁盘镜像是创建完整的MBR分区表,然后在第1个分区内格式化文件系统。并且在系统启动时,也是解析MBR,然后加载第1个分区的文件系统作为根文件系统。

但是,上述“创建完整的MBR分区表,然后在第1个分区内格式化文件系统”的操作需要privileged权限或者SYS_ADMIN的权限。由于CI/CD的安全性需求,我们不能给容器这些权限。因此需要直接把磁盘镜像mkfs,然后启动。因此我们的内核也需要支持这样的“没有分区表”的磁盘镜像。

需求

本任务需要让内核支持“没有分区表”的磁盘镜像,让内核正常启动。

相关代码

目前这里的代码写的比较丑: https://code.dragonos.org.cn/xref/DragonOS/kernel/src/filesystem/vfs/core.rs?r=731bc2b32d7b37298883d7a15b6dca659b436ee4&mo=4086&fi=143#145

如果能进一步增加相关检测机制,封装起来,那就更好了。

@fslongjin fslongjin added enhancement New feature or request A-fs Area: 文件系统 labels Apr 25, 2024
@dragonosbot dragonosbot added the needs-triage 这个问题可能需要分类处理。如果已经完成分类,请移除它。 label Apr 25, 2024
@fslongjin fslongjin removed the needs-triage 这个问题可能需要分类处理。如果已经完成分类,请移除它。 label Apr 25, 2024
@fslongjin fslongjin added this to the DragonOS 0.2.0 milestone May 13, 2024
@guojidan
Copy link

guojidan commented Jun 6, 2024

我尝试实现下 😃

@fslongjin
Copy link
Member Author

我的方案 https://bbs.dragonos.org.cn/t/topic/332

@fslongjin
Copy link
Member Author

已完成该需求: #903

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-fs Area: 文件系统 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants