Skip to content

chore: 移除网络性能测试工具和脚本,并将 ext4 镜像大小从 4GB 减小到 512MB - #13

Open
ZIYAN137 wants to merge 3 commits into
mainfrom
feat/os-comp-support
Open

chore: 移除网络性能测试工具和脚本,并将 ext4 镜像大小从 4GB 减小到 512MB#13
ZIYAN137 wants to merge 3 commits into
mainfrom
feat/os-comp-support

Conversation

@ZIYAN137

Copy link
Copy Markdown
Owner

🛠️ Chore / 项目维护

📋 描述 (Description)

本次 PR 主要解决测评机编译时磁盘空间不足的问题,通过以下两项改动:

  1. 缩减镜像大小:将 ext4 rootfs 镜像大小从 4GB 减小到 512MB

    • 修改 os/build.rs 中的 IMG_SIZE_MB 常量从 4096 改为 512
    • 构建时生成的两个镜像(RISC-V 和 LoongArch)总大小从 8GB 降至 1GB
    • 512MB 足够容纳当前 data/ 目录的所有用户程序(约 13MB)
  2. 移除网络性能测试工具:删除不必要的网络测试工具和脚本

    • 删除 iperf3 和 netperf 二进制文件
    • 删除相关测试脚本

🎯 改动类型 (Change Type)

  • 构建系统 (Build System)
  • CI/CD 配置 (CI/CD Configuration)
  • 开发工具/脚本 (Development Tools/Scripts)
  • 依赖更新 (Dependency Updates)
  • 文档重构 (Documentation Refactoring)
  • 代码格式化 (Code Formatting)
  • 其他 (Other): ___________

🔗 关联 Issue

解决测评机编译时因磁盘空间不足导致的克隆失败问题(repository is too large to clone: 1817 MB)

✅ 验证清单 (Validation Checklist)

  • 本地构建成功,生成 512MB 的镜像文件
  • RISC-V 架构内核正常启动和运行
  • LoongArch 架构内核正常启动和运行
  • 用户程序能够正常加载和执行
  • 测评机能够成功克隆和编译项目

📸 截图/输出 (Screenshots/Output)

构建输出示例:

[build.rs] Creating 512MB full ext4 image at os/fs-riscv.img
[build.rs] Full ext4 image created successfully (512MB).

改动统计:

 data/iperf_testcode_comix.sh       | 100 -------------------------------------
 data/netperf_testcode.sh           |  30 -----------
 data/risc-v_musl/bin/iperf3        | Bin 826400 -> 0 bytes
 data/risc-v_musl/bin/netperf       | Bin 232720 -> 0 bytes
 data/risc-v_musl/bin/netserver     | Bin 242568 -> 0 bytes
 data/risc-v_musl/iperf_testcode.sh |  42 ----------------
 data/tmp/.gitkeep                  |   0
 os/build.rs                        |   6 +--
 8 files changed, 3 insertions(+), 175 deletions(-)

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @ZIYAN137, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

本次拉取请求旨在解决测评机在编译过程中遇到的磁盘空间不足问题。通过将构建的 ext4 镜像大小从 4GB 减少到 512MB,并移除不再需要的网络性能测试工具和脚本,显著降低了项目的整体存储需求,从而避免了因仓库过大导致的克隆失败。

Highlights

  • 镜像大小缩减: 将 os/build.rs 中 ext4 根文件系统镜像的大小从 4GB 显著缩减至 512MB,以优化存储占用。
  • 网络测试工具移除: 删除了 iperf3netperf 等网络性能测试工具及其相关的脚本和二进制文件,以减少项目体积。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

本次 PR 旨在通过移除不再需要的网络性能测试工具和脚本,以及将 ext4 镜像大小从 4GB 减小到 512MB,来解决测评机磁盘空间不足的问题。这些改动目标明确,实现清晰,值得肯定。

os/build.rs 中的改动不仅更新了镜像大小,还改进了日志输出,使用常量替代了硬编码的尺寸,提高了代码的一致性和可维护性。

另外,注意到随着 netperf 工具的移除,项目中的 docs/net/netperf.md 文件已变得过时。建议在后续的提交中将其一并移除,以保持文档的整洁和准确性。

Comment thread os/build.rs
/// 创建完整的 ext4 镜像 (包含 data/)
fn create_full_ext4_image(path: &PathBuf, data_dir: &Path, _project_root: &Path) {
const IMG_SIZE_MB: usize = 4096; // 4GB
const IMG_SIZE_MB: usize = 512; // 512MB

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

为了提高代码的可维护性和一致性,建议将 IMG_SIZE_MB 常量移至模块级别(例如,在 main 函数之前)。

当前,该常量仅在 create_full_ext4_image 函数内部可见。但在 main 函数的第 101 行,有一个硬编码的日志消息 Creating full ext4 runtime image (4GB) at fs.img...,它与镜像大小的实际变化(512MB)不一致。

将此常量提升到模块作用域,可以让调用方(main 函数)也使用它,从而确保日志信息与实际配置同步,避免将来出现类似的不一致问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant