Skip to content

flashprog: add new package - #30228

Open
connollydavid wants to merge 1 commit into
openwrt:masterfrom
connollydavid:flashprog
Open

flashprog: add new package#30228
connollydavid wants to merge 1 commit into
openwrt:masterfrom
connollydavid:flashprog

Conversation

@connollydavid

@connollydavid connollydavid commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

📦 Package Details

Maintainer: @connollydavid

Description:
Adds flashprog 1.5 in four variants, splitting the programmers by the libraries
they need.


🧪 Run Testing Details

  • OpenWrt Version: main and 25.12
  • OpenWrt Target/Subtarget: x86/64
  • OpenWrt Device: Intel N150

Closes #29591


✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

This PR contains no patches.

@openwrt openwrt Bot added the Add package label Aug 9, 2026

@BKPepe BKPepe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The split into four variants makes sense if it provides a meaningful reduction in package size and/or dependencies, but the PR currently doesn't show that. Could you provide the package/installed sizes of the four variants (ideally including their dependencies) and briefly explain the intended use case for each variant?

Also, since flashprog is already provided as the full variant and the other variants all have the same description, it would be useful to clarify when a user should choose flashprog-spi, flashprog-pci, or flashprog-external instead of the default full package.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fresh review of the single commit c84a34c. The commit message matches what the diff does (four variants, the programmer split, and the deliberate per-variant binary names), and the packaging basics look right: PKG_MAINTAINER is set, the define indentation follows the metadata/recipe convention, BuildPackage is called with literal package names, and test.sh avoids grep -q.

Two inline comments, both about the variant layout rather than about correctness — neither blocks a merge as far as I can tell.


Generated by Claude Code

Comment thread utils/flashprog/Makefile Outdated
Comment thread utils/flashprog/Makefile
@connollydavid

connollydavid commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Hi Josef, thanks for taking a look. I was skeptical of needing variants
myself, but the dependencies changed my mind. The sizes below are from this
branch built for x86/64, in bytes. installed is apk's own
installed-size. The +deps columns add the dependency closure, counting
libatomic1 because libusb pulls it, and excluding libc, libpthread and librt.

package programmers .apk installed .apk +deps installed +deps
flashprog-spi 4 99,575 684,818 99,575 684,818
flashprog-pci 21 174,863 873,731 203,837 935,964
flashprog-external 20 144,122 783,543 243,708 1,027,401
flashprog 37 217,439 968,351 345,999 1,274,442

Dependencies counted: flashprog-pci libpci; flashprog-external libftdi1,
libgpiod, libjaylink, libusb-1.0, libatomic1; flashprog those six together.
So flashprog-spi lands 589,624 bytes lighter than flashprog and pulls in
nothing.

Every variant carries dummy, linux_mtd, linux_spi and mstarddc_spi,
which reach a flash chip through the kernel. That is all flashprog-spi
carries, so it suits a device programming a chip it already talks to.

flashprog-pci adds the internal and PCI device programmers, which reach a
flash chip through the mainboard chipset or a card on the bus. It suits a
device programming its own board.

flashprog-external adds the programmers that attach over USB, a serial port
or GPIO lines. It suits a device used as the flashing host for a chip on
another board.

flashprog carries all of them.

I have given each variant its own description saying which programmers it
carries and which libraries it needs, so the package list answers this too,
and dropped DEFAULT_VARIANT since the four names are distinct and share no
PROVIDES.

p.s. sorry for not including initially. I was desperately trying not to
waffle :)

-dc

connollydavid added a commit to connollydavid/agentic-UDPspeeder-simd that referenced this pull request Aug 10, 2026
flashprog carries the four-variant package now on openwrt/packages#30228,
with the per-variant descriptions the review asked for; ci-flashprog
carries the apk-only check that verifies each variant's programmer set.
@connollydavid
connollydavid requested a review from BKPepe August 10, 2026 14:55
@efahl

efahl commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

You ought to stick that table into the commit message, so non-github users can see it, too.

@connollydavid

Copy link
Copy Markdown
Contributor Author

thanks @efahl, done, I edited commit message for terseness too (and put closes tag in the right place!).

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-review of the force-pushed f176d9f (replaces c84a34c). The branch was also rebased onto current master, so the only change to this PR's own files is in utils/flashprog/Makefile.

DEFAULT_VARIANT:=1 is gone, which resolves my earlier comment — with four distinct package names and no shared PROVIDES, it had no effect. The four per-variant descriptions are the standard $(call Package/<pkg>/Default/description) idiom used by ~100 other Makefiles in the feed, and the library lists match each variant's DEPENDS exactly. The commit message now carries the size table, its programmer counts are self-consistent (4 base + 17 pci + 16 external = 37 full) and match the numbers you posted in the thread, and the subject scope matches the files touched. All 14 checks are green on this head.

Two nits inline, neither blocking.

One earlier thread is still open and unanswered: the per-variant binary renaming on lines 124/129/134 means the command a user types depends on which variant they installed, so upstream docs and any script calling flashprog only work with the full variant. Your comment explains what each variant is for, which is useful, but doesn't say whether installing two of them side by side is an actual use case — that's the part that would justify renaming over CONFLICTS/ALTERNATIVES. Worth a line either way so the thread can be closed.


Generated by Claude Code

Comment thread utils/flashprog/Makefile Outdated
Comment thread utils/flashprog/Makefile Outdated
Detects, reads, writes, verifies and erases flash chips over SPI, LPC,
FWH and parallel buses. Four variants split the programmers by the
libraries they need; each installs the same binary under its own name,
so any combination can be installed together.

Installed size with dependency closure, x86/64, in bytes (libc,
libpthread and librt excluded):

| package            | programmers | installed +deps |
|--------------------|-------------|-----------------|
| flashprog-spi      | 4           | 684,818         |
| flashprog-pci      | 21          | 935,964         |
| flashprog-external | 20          | 1,027,401       |
| flashprog          | 37          | 1,274,442       |

Signed-off-by: David Connolly <david@connol.ly>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flashprog: add the additional project after flashrom developer split in 2023

4 participants