Zum Inhalt springen
Skillpedia
Deployment & Cloud (DevOps)5.4k · #14964

azldev-mock

Was er macht

Dieser Skill zeigt, wie man Pakete ausführt und RPM-Dateien in einem Mock-Chroot mit azldev untersucht. Er ist für Entwickler gedacht, die gebaute Pakete vor der Auslieferung sicher prüfen wollen.

Wann du ihn nutzt

  • ✓Wenn du ein RPM gebaut hast und es testen willst, ohne es auf deinem Computer zu installieren.
  • ✓Wenn sich ein RPM nicht installieren lässt und du die Fehlerdetails sehen willst.
  • ✓Wenn du die Dateiliste oder Abhängigkeiten eines gebauten Pakets prüfen musst.

Link zum Skill

https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-mock/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-mock/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Ich habe ein RPM für mein Paket gebaut. Kannst du es in einem Mock-Chroot testen und seine Dateiliste und Abhängigkeiten prüfen?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Agent führt Befehle in einer Mock-Shell über nicht-interaktive Eingabe aus, liest Paketinformationen und versucht die Installation erneut in der isolierten Umgebung. Auf dem Host wird nichts installiert.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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:

  1. Run a simple command (e.g. echo ready) in a foreground terminal to establish a shared shell.
  2. Ask the user to run the azldev adv mock shell command in that same terminal.
  3. Wait for confirmation that they are inside the mock shell.
  4. Run diagnostic commands in the same foreground terminal — they execute inside the chroot.
  5. Run exit to 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).

-p means --add-package, not a component name. Unlike azldev comp build -p <name>, mock shell has 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>.rpm for 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 shell sessions — 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 with mock directly (--scrub=chroot, or --scrub=all to also drop the bootstrap), pointing at the project's distro mock config.
  • One mock session per terminal. Running azldev adv mock shell while a terminal is already inside a mock shell fails — run exit first.

Generated by azldev docs agent; do not hand-edit.

Häufige Fragen

Warum keine RPMs auf dem eigenen Computer installieren?

Der Skill sagt, gebaute Pakete zielen auf die Distribution, die gebaut wird, nicht auf den eigenen Rechner.

Kann es ohne manuelle Schritte laufen?

Ja. Der Skill beschreibt eine nicht-interaktive Weise, Befehle in die Shell zu leiten.

Braucht es einen Spezialbefehl?

Er nutzt den erweiterten Mock-Shell-Befehl, der in der Standard-Hilfeausgabe nicht erscheint.

Details

Originalbeschreibung des Autors

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

Beliebtheit

GitHub-Sterne
5.4k
Platz im Ranking
#14964
Lizenz
MIT
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills