Skip to content

fix(gvisor): 修复自动化开启/关闭 gvisor 集成的问题#1405

Merged
fslongjin merged 5 commits intoDragonOS-Community:masterfrom
mistcoversmyeyes:bugfix/gvisor
Nov 25, 2025
Merged

fix(gvisor): 修复自动化开启/关闭 gvisor 集成的问题#1405
fslongjin merged 5 commits intoDragonOS-Community:masterfrom
mistcoversmyeyes:bugfix/gvisor

Conversation

@mistcoversmyeyes
Copy link
Contributor

@mistcoversmyeyes mistcoversmyeyes commented Nov 24, 2025

  • write_disk_image.sh :创建系统镜像的时候主动创建 /tmp 路径,以提供给 gvisor 后续使用
  • enable_comile_gvisor.sh:修改匹配 gvisor 集成配置代码块的逻辑,支持位置无关的 gvisor 代码块的注释。
  • disable_compile_gvisor.sh:修改匹配 gvisor 集成配置代码块的逻辑,支持位置无关的 gvisor 代码块的接触注释

Note

Replace per-action scripts with a single toggle script for gVisor tests, update Makefile/docs to use it, convert blocklist to array form, and create /tmp in the disk image.

  • Testing/Build:
    • Make test-syscall use user/apps/tests/syscall/gvisor/toggle_compile_gvisor.sh for enable/disable and ensure cleanup runs while preserving test exit status.
  • Scripts:
    • Add user/apps/tests/syscall/gvisor/toggle_compile_gvisor.sh (idempotent comment/uncomment by matching name = "gvisor syscall tests").
    • Remove enable_compile_gvisor.sh and disable_compile_gvisor.sh.
  • Config:
    • Convert gVisor blocklist to array syntax in config/app-blocklist.toml via blocked_apps = [ ... ].
  • Docs:
    • Update docs/kernel/ktest/gvisor_syscall_test.rst to reference the new toggle script and revised workflow.
  • Image build:
    • tools/write_disk_image.sh: create /tmp in rootfs.

Written by Cursor Bugbot for commit 24c5e88. This will update automatically on new commits. Configure here.

@github-actions github-actions bot added the Bug fix A bug is fixed in this pull request label Nov 24, 2025
@mistcoversmyeyes mistcoversmyeyes force-pushed the bugfix/gvisor branch 3 times, most recently from ea74a98 to 766c212 Compare November 25, 2025 05:46
- 在 `write_disk_image.sh` 中添加创建 /tmp 目录的命令。

Signed-off-by: yuming <mingjiangyu1@qq.com>
@mistcoversmyeyes mistcoversmyeyes marked this pull request as ready for review November 25, 2025 08:32
Copilot AI review requested due to automatic review settings November 25, 2025 08:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the automation scripts for enabling/disabling gvisor integration in the system. It improves the robustness of the configuration block matching logic to support position-independent gvisor code blocks, and ensures the /tmp directory exists in the system image with proper permissions for gvisor usage.

Key Changes:

  • Rewrote enable_compile_gvisor.sh and disable_compile_gvisor.sh with more robust AWK-based parsing that handles commented and uncommented blocks flexibly
  • Added /tmp directory creation with sticky bit permissions (1777) in the disk image creation process

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
user/apps/tests/syscall/gvisor/enable_compile_gvisor.sh Complete rewrite from simple sed/awk to comprehensive AWK script with block detection, error handling, backup creation, and support for partially commented gvisor configuration blocks
user/apps/tests/syscall/gvisor/disable_compile_gvisor.sh Complete rewrite from simple sed to comprehensive AWK script with block detection, uncommenting logic, error handling, and backup creation
tools/write_disk_image.sh Added /tmp directory creation with standard multi-user sticky bit permissions (1777) for gvisor runtime requirements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@fslongjin
Copy link
Member

这个也太复杂了

Signed-off-by: longjin <longjin@DragonOS.org>
@github-actions github-actions bot added documentation Improvements or additions to documentation test Unitest/User space test labels Nov 25, 2025
@fslongjin fslongjin merged commit 9420fe0 into DragonOS-Community:master Nov 25, 2025
12 of 13 checks passed
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Nov 25, 2025
@mistcoversmyeyes mistcoversmyeyes deleted the bugfix/gvisor branch December 2, 2025 07:57
@mistcoversmyeyes mistcoversmyeyes restored the bugfix/gvisor branch December 2, 2025 07:57
@mistcoversmyeyes mistcoversmyeyes deleted the bugfix/gvisor branch December 2, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug fix A bug is fixed in this pull request test Unitest/User space test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants