qemu-image
Inspect or package QEMU disk, SD, eMMC, flash, pflash, firmware, raw, and qcow2 images. Use for read-only image format, partition, region, offset, sector-size, and hash analysis, or for explicitly authorized image creation, conversion, partitioning, filesystem population, and fixed-offset writes with readback and rollback evidence.
processmission · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add processmission/oh-my-qemu --skill qemu-image技能说明
SPDX-FileCopyrightText: Copyright (c) 2026 Process Mission
SPDX-License-Identifier: MIT
name: qemu-image description: Inspect or package QEMU disk, SD, eMMC, flash, pflash, firmware, raw, and qcow2 images. Use for read-only image format, partition, region, offset, sector-size, and hash analysis, or for explicitly authorized image creation, conversion, partitioning, filesystem population, and fixed-offset writes with readback and rollback evidence.
QEMU Image
Audit workflow
For non-trivial tasks, use a stable .oh-my-qemu/<task-slug>/ directory and
create only needed entries:
.oh-my-qemu/<task-slug>/
├── audit.md # Baseline, mode, authorization, decisions, evidence, and gaps
├── commands.md # Redacted commands, working directories, and results
├── logs/ # Decisive inspection, packaging, and verification output
├── scripts/ # Task-specific helper scripts and intermediate documents
└── output/ # Working copies, backups, readbacks, and generated images
Before writing task artifacts or configuring QEMU in a Git worktree, add
.agents/, .oh-my-qemu/, and builds/ to the repository-local file from
git rev-parse --git-path info/exclude; preserve existing entries and avoid
duplicates. Keep QEMU builds under source-root builds/build-<target>/; never
use build/. Never stage or commit while using this skill.
Record baseline and handoff git status --short --untracked-files=all,
distinguish pre-existing changes, and verify no excluded path is tracked or
staged. Log redacted commands, working directories, and results in
commands.md; keep helpers in scripts/, decisive output in logs/, and
generated images, third-party dependencies, and non-QEMU binaries in
output/. Report the audit directory and unresolved gaps at handoff.
Select the mode
- Use inspect by default, including for ambiguous requests. Keep the target image or device read-only and limit actions to identification, measurement, hashing, and verification. Do not mount read-write, repair a filesystem or image, convert, resize, rebase, amend, repartition, or write raw bytes.
- Use package only when the user explicitly requests creation, conversion, population, or mutation and the exact output path or device and allowed changes are clear. Authorization to inspect is not authorization to write.
- If a command's write behavior is uncertain, stop and resolve it before use. Prefer a task-local working copy for experiments and never mutate an input artifact by default.
Record the selected mode, target, authorization boundary, and intended outputs
in audit.md before taking an action that can write.
Inspect an image
- Resolve the exact path without following an ambiguous glob. Record whether it is a regular file, block device, symlink, or backing-chain member.
- Identify the container format independently from its contents. Record raw, qcow2, or other format; virtual and allocated size; backing files; and any format features that affect mutation. Do not infer format from the suffix.
- Record the partition-table type and the logical sector size reported by the relevant tool. List partition and fixed-region start, end, size, type or GUID, filesystem, purpose, and alignment. Include boot data outside a partition table.
- Express every address with an explicit unit and base. Derive a byte offset
as
start_sector * logical_sector_size; never assume 512-byte sectors. Distinguish image-relative, partition-relative, and nested-container offsets. - Compute SHA-256 for the inspected image and important inputs when practical. Record the exact hashing command and identify any unhashable or changing target as a gap.
Prefer read-only forms of locally available tools such as file, qemu-img info, fdisk -l, sfdisk --dump, and sha256sum or shasum -a 256. Treat
tool absence or an unsupported format as an unresolved gap, not as permission
to mutate the image.
Plan a package operation
Before writing, record this contract in audit.md:
| Output | Format | Virtual size | Existing target? | Mutation policy |
| --- | --- | --- | --- | --- |
| Region | Start byte | Start sector | Sector size | Size | Type/filesystem | Source |
| --- | --- | --- | --- | --- | --- | --- |
| Order | Operation | Input | Output region | Offset/seek | Block size | Bounds | Readback |
| --- | --- | --- | --- | --- | --- | --- | --- |
- Resolve every input and output path, record available space, and hash each input. Separate firmware, bootloader, kernel, DTB, initrd, root filesystem, and modules even when the final output combines them.
- Record the image format, partition table, logical sector size, alignment, fixed regions, filesystem choices, write order, and expected final size.
- For each write, state whether the offset is in bytes or sectors and which
base it is relative to. When using
dd, recordbs,seek,skip,count, and truncation behavior. Prove thatoffset + payload_sizestays within its assigned region and the image, and reject unintended overlaps. - Classify the target as immutable input, working copy, disposable output, or reusable mutable media. Account for later guest, firmware, pflash, qcow2, or filesystem writes; use a clean copy or overlay when repeatability matters.
Package and verify
- Create a new output under
output/unless the user authorized another exact path. For an existing target, require explicit overwrite or in-place authorization and first prepare a verified backup or another documented, reversible strategy. - Create or convert the container, partition it, create filesystems, copy files, and perform fixed-offset writes in the recorded order. Preserve sparse allocation when required and do not let a raw write truncate the output unintentionally.
- Flush pending writes before verification. Re-inspect format, virtual a