hyderhusainarastu/hardware-mod-toolkit/stock-updater-packaging

Claude Code and agent skill by hyderhusainarastu/hardware-mod-toolkit

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Install custom firmware through a vendor updater (SD card, USB mass storage or OTA archive) instead of a programmer: derive acceptance rules, build a conforming package, rehearse against stock, stage the first install. Use to run your own build on a device or reinstall stock.

Install

npx vskill@latest install hyderhusainarastu/hardware-mod-toolkit/stock-updater-packaging

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as hyderhusainarastu/hardware-mod-toolkit/stock-updater-packaging.

Stock updater packaging

Most consumer devices ship an updater that will install any image satisfying its acceptance rules -- it does not know or care whether the bytes came from the vendor. If you can derive those rules, you can run custom firmware with no programmer, no soldering, and no chip-erase write, and the same path reinstalls stock, which makes it a recovery mechanism too. This is usually the single highest-leverage move available on a device with a stock update mechanism -- try it before reaching for a hardware programmer.

The catch: the rules that make it work are never documented and are rarely intuitive. They come from reading the updater's own code (disassembly, decompiled firmware, or a leaked/OSS SDK) -- not from guessing at a plausible container format. This skill is the checklist for deriving those rules safely, the staging discipline for a first install, and the rehearsal that proves your packaging pipeline before it is ever trusted with a non-stock image.

Prerequisite mindset: everything in this skill is a host-side, read-only activity until an explicit, separately-gated "stage this on the device" step. Follow whatever hardware safety process this project uses (see the hardware-recon and moderator-operating-model skills) for gating the actual on-device step -- this skill only covers getting a correct package built and verified.

1. Derive the acceptance rules before building anything

Do not start writing a packaging script until you can answer every question below from the updater's own code, not from an error-message's wording, a forum post, or what seems reasonable. Vendor error strings routinely describe a check inconsistently with what the code actually does -- the worked example below found a "file size mismatch" error whose two operands were both stat() of the same file, taken microseconds apart, i.e. a tautology that can never fire on a legitimately-written file. Trusting the string instead of the disassembly would have produced a totally unnecessary manifest field.

The fill-in questionnaire is references/updater-acceptance-worksheet.md (linked at the end of this file) -- use it to record your answers and their evidence grade as you go. The categories:

#QuestionWhy it matters
Q1Trigger — what makes the updater run at all? File existence at a fixed path, a button held at boot, a menu selection, a magic value in NVS/EEPROM?Determines the minimum condition for an accidental install, and thus a safety rule ("never leave the trigger artifact staged").
Q2Path and filename — exact, case-sensitive location and name(s) the updater looks for.Get this byte-exact. A vendor image that ships a member under one case (Foo.bin) while every lookup in the code uses another (FOO.BIN) works only because the filesystem matches case-insensitively — match the vendor's on-disk casing in a hand-built package, don't "fix" it.
Q3Container format — tar, zip, a custom framed blob, a directory of loose files? Which exact library/parser reads it (stock tar? a minimal third-party parser embedded in firmware, e.g. microtar-class code)?The specific parser's quirks (see Q7) are what actually constrains you, not the nominal format's spec.
Q4Member set — which files/segments are required, which are optional, and does the parser look them up by name or by position?If lookup is by name, member order in your archive is free even if it differs from the vendor's own layout — confirm this with the parser code, don't assume.
Q5Per-member validation — checksum, magic bytes, signature, size field? At what layer (container header vs. payload image header)?A tar-level header checksum and an application-image's own magic+checksum are usually two independent checks; get both right.
Q6Size / version checks — read the actual operands. What are the two things being compared, concretely (a stated length vs. bytes actually present; a stat() result vs. a stored value; two stat() calls on the same path)?This is the check most likely to be a red herring. Never write a manifest field or declare a size just because an error message implies one is checked — verify what is actually compared before adding anything to satisfy it.
Q7Container-parser quirks — regular-files-only? No subdirectories (does it call mkdir, or open output paths with a flat-file API that fails on /)? Extended/long-name headers (PAX, GNU longname) supported or silently skipped? Nested archives expanded, and to what depth?These come only from reading the specific parser. A minimal embedded tar/zip reader is usually a small, faithful compile of a well-known minimal library — once you identify which one, its source (if available) tells you the exact constraints.
Q8Write destination and commit point — where does each member land (which partition/slot), and in what order are members installed? Specifically: at what point is the new boot selection committed, relative to any other steps that could still fail?The most dangerous shape is "commit before the last step" — an installer that switches the active boot partition for member A, then processes member B, and reports overall failure if B fails while A is already live and bootable. A failure log after this point does not mean nothing was written.
Q9Malformed-input behavior — does a corrupt/truncated member fail the whole install loudly, or does the parser silently exit via its own "success" path on truncation?The single most load-bearing failure mode to characterize. A parser whose main loop treats "no more valid headers" and "hit corruption" identically will report a clean install after a partial one — see §6 and §7.
Q10Which write, if any, is unrecoverable from software — a companion MCU flashed over a simple serial protocol with no readback/verify, an EEPROM with no backup partition, anything with no re-flash path if it goes wrong mid-write?Defines the Stage A / Stage B split in §3. Everything else on the device may have some recovery route (a debug/download interface, a second boot slot); design around the one thing that provably does not.
Q11Rollback / fallback behavior — does the bootloader auto-revert a bad image? Under what exact condition (only while a boot-selection record is blank/invalid, or something broader)?If rollback exists only for the pre-any-install state, then "the bootloader will save us" stops being true the moment your first install completes, even if that first install was of pristine stock content. Write this down explicitly.
Q12Version/downgrade gate — does one exist, and where?Don't assume either way; a missing gate means arbitrary re-installs (including of your own build, repeatedly) are accepted, which is useful for iteration but also means nothing stops an accidental downgrade.
Q13State written after a successful install — any flag, counter, or key in persistent settings storage that your own image should account for (or avoid depending on) on its next boot?Determines whether your firmware has any implicit "I was just installed" contract to honor.

Grade every answer CONFIRMED / STRONGLY INDICATED / POSSIBLE / UNKNOWN (or this project's equivalent evidence standard) and cite the exact evidence — a disassembly address, a decompiled function name, a byte-level scan result. A linear disassembly listing can mis-tile itself around variable-length instructions and silently render a wrong answer that still looks plausible — for any answer that changes what you build, re-derive it by realigning at the actual branch target, or by an independent byte-level scan for the exact encoding you expect, not by trusting one linear read-through.

2. Hard requirements vs. explicit non-requirements

Once Q1–Q13 are answered, write down two lists, not one. The second list is just as important as the first:

Hard requirements — the literal set of things your package must satisfy, each traced to the question above that established it (exact path, exact member names, exact typeflags/headers, checksum validity, size ceiling, chip/architecture match for any binary image).

Explicit non-requirements — things a cautious builder is tempted to add that the updater provably does not check: a manifest/index file it never parses, a size or version declaration when the real check is a same-file tautology (Q6), a signature beyond whatever the payload image's own bootloader-level validation already does, a specific member order when lookup is by-name, a companion-image write when your first goal is only the main SoC. Every item on this list should cite the specific evidence that it is unneeded — "no code path reads this file" or "the only consumer of this format is a code path this install method never reaches" are the kind of claims that belong here. Skipping this list is how a project ends up shipping a synthetic manifest that accomplishes nothing and, worse, invites a code path (e.g. a network-based updater variant) that was never meant to be reachable this way.

3. Staged install — omit the unrecoverable member first

However Q10 answered "which write has no software recovery path," Stage A ships everything except that member. Concretely:

  • Stage A package = every required member except the one identified in Q10, if the format and

parser allow a member to be omitted cleanly (confirm this too — some parsers require a placeholder even for an "optional" step; know the difference between "member absent" and "member present but empty" before relying on either).

  • Only after Stage A is built, rehearsed (§4), and verified on the actual device does anything

involving the unrecoverable member get considered at all — as an explicit Stage B, with its own separate go-ahead.

  • If the format has no way to omit that member and get a clean partial install, Stage A instead

means shipping that member byte-identical to the current stock content — a write that is a functional no-op even though bytes do cross the wire, which is the next-safest thing to omitting it outright.

This staging discipline is the single biggest lever for keeping a first attempt low-stakes: it turns "does this whole pipeline work at all, on this exact device" into a question you can answer without ever touching the one component you cannot get back if it goes wrong.

4. The rehearsal — prove the pipeline before it packages anything new

Before a hand-built package ever contains non-stock content, run your packaging tool in a stock-only mode: feed it a genuine vendor release archive, have it re-extract that archive's own members, restage them, and re-container them through the exact same code path your tool uses for a real build — then assert the result is member-identical (same bytes, per member, not per-archive) to the original.

<packaging-tool> --stock-only --stock-from <vendor-release-archive> --out <scratch-dir>
# tool re-extracts <vendor-release-archive>'s own members, restages them, rebuilds the
# container, and must report all members MATCH (byte-identical) against the source archive.

If this does not come out byte-identical, the pipeline is not trustworthy for anything else — stop and fix the packaging code, don't proceed to build a non-stock package with it. Two gotchas found the hard way that are worth checking for specifically:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
3

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/hyderhusainarastu/hardware-mod-toolkit/stock-updater-packaging/badge)](https://verified-skill.com/skills/hyderhusainarastu/hardware-mod-toolkit/stock-updater-packaging)

Something wrong with this skill or its page? Tell us.