azldev-mock
できること
このスキルは、azldevを使ってmockのchroot内でパッケージを実行し、RPMファイルを確認する方法を説明します。出荷の前に、ビルド済みのパッケージを安全に確かめたい開発者が対象です。
使う場面
- ✓RPMをビルドしたが、自分のコンピューターにインストールせずにテストしたいとき。
- ✓RPMがインストールできず、エラーの詳細を確認したいとき。
- ✓ビルド済みパッケージのファイル一覧や依存関係を確認する必要があるとき。
スキルのリンク
https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-mock/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“パッケージ用のRPMをビルドしました。mockのchrootでテストして、ファイル一覧と依存関係を確認してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、非対話形式の入力を使ってmockのシェルでコマンドを実行し、パッケージ情報を読み取り、隔離された環境の中でインストールを再試行します。ホストには何もインストールされません。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Test and inspect packages in a mock chroot
Never install built RPMs on the host. They target the distro you are building, not your dev machine. Use a mock chroot instead.
azldev tests and inspects packages inside mock build roots via mock shell,
which lives under the hidden advanced group (azldev adv is an alias for
azldev advanced; it does not appear in azldev --help).
Non-interactive chroot (preferred for agents)
Pipe commands in via a heredoc — fully autonomous, no user interaction needed:
azldev adv mock shell --add-package /path/to/package.rpm <<'CMDS'
<command> --version
echo "exit code: $?"
exit
CMDS
Use this for automated checks: running binaries, querying installed packages, inspecting paths.
Inspect an RPM without installing it
When --add-package fails to install, or you just want to look at an RPM's
contents, get the file inside the chroot and inspect it there rather than
installing on the host. If the RPM is not already reachable inside the build
root, copy it in first with mock --copyin <rpm> /tmp/ (using the project's
distro mock config), then:
azldev adv mock shell <<'CMDS'
rpm -qip /tmp/<name>*.rpm # package info
rpm -qlp /tmp/<name>*.rpm # file list
rpm -qRp /tmp/<name>*.rpm # dependencies
dnf install /tmp/<name>*.rpm # retry the install to see the error details
exit
CMDS
This gives you the full distro environment for debugging dependency issues, file conflicts, and failed installs, without touching the host.
Interactive chroot
Use when you need to explore interactively or react to output between commands:
azldev adv mock shell --add-package /path/to/package.rpm --enable-network
When driving an interactive shell as an agent:
- Run a simple command (e.g.
echo ready) in a foreground terminal to establish a shared shell. - Ask the user to run the
azldev adv mock shellcommand in that same terminal. - Wait for confirmation that they are inside the mock shell.
- Run diagnostic commands in the same foreground terminal — they execute inside the chroot.
- Run
exitto leave the chroot.
Prefer the non-interactive heredoc approach; use interactive only when you must react to output between commands.
Key flags
| Flag | Purpose |
|---|---|
-p, --add-package <path> |
Install a package into the chroot before entering. Accepts an RPM file path or a package name. May be repeated. |
--enable-network |
Allow network access (dependency resolution, downloads). |
-pmeans--add-package, not a component name. Unlikeazldev comp build -p <name>,mock shellhas no component selector.-p <name>installs a package by name from the configured repos — it does not set up a chroot with that component's build dependencies.
Gotchas
- Don't mix
-p <name>with--add-package /path/to/<name>.rpmfor the same package — that installs both the repo build and your local build, which conflict. Use one or the other. - The mock chroot is persistent across
azldev adv mock shellsessions — installed packages and created files survive. Handy (install once, re-enter later), but stale state can confuse. azldev has no built-in reset; clear it withmockdirectly (--scrub=chroot, or--scrub=allto also drop the bootstrap), pointing at the project's distro mock config. - One mock session per terminal. Running
azldev adv mock shellwhile a terminal is already inside a mock shell fails — runexitfirst.
Generated by azldev docs agent; do not hand-edit.
よくある質問
なぜRPMを自分のコンピューターにインストールしないのですか?
スキルによると、ビルド済みのパッケージは、お使いのマシンではなく、ビルド対象のディストリビューションを対象とするためです。
手作業なしで実行できますか?
はい。スキルは、コマンドをシェルへ流し込む非対話形式の方法を説明しています。
特別なコマンドが必要ですか?
標準のヘルプには表示されない、上級者向けのmockシェルコマンドを使います。
詳細
作者による元の説明
Read this before testing or inspecting a built RPM; do not drive mock by hand from memory. Explains how to test and inspect built packages in a mock chroot with 'azldev adv mock shell', covering non-interactive (heredoc) and interactive chroot workflows, the -p/--add-package flag, and resetting stale chroot state. Triggers include test package, mock shell, inspect rpm, smoke test, chroot, verify build output.
repo: microsoft/azurelinux
人気
- GitHubのスター
- 5.4k
- ランキング
- #14964
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
azldev-add-component
5.4kエージェントが、azldevのLinuxディストリビューションのビルドに新しいソフトウェアコンポーネントを追加し、上流のspec確認から結果の検証まで進められるよう支援します。
azldev-build-component
5.4kエージェントが、azldevのパッケージのビルドとデバッグを行えるよう支援します。render、build、テストの繰り返しと、失敗したビルドチェックの修正を含みます。
azldev-comp-toml
5.4kエージェントが、azldevで各パッケージのビルド方法を定めるコンポーネント定義ファイルを、作成、編集、確認できるよう支援します。
azldev-image
5.4kエージェントが、azldevのイメージコマンドを使い、コンテナや仮想マシンのLinuxイメージをビルド、起動、テストできるよう支援します。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。