How to patch fstools?

I wish to patch fstools. I saw there's a mirror on github.
Is it possible to use a local clone of that when building custom OpenWrt images? How?

Thanks.

Maybe this is what you are looking for:

If you build with the full toolchain, you can just add a patch to your local repository to the fstools's "patches" directory. (You might actually need to create the dir.)

you can

  • first "prepare" the package to populate the source build directory, then
  • copy the unchanged file to a safe renamed file,
  • edit the correct file,
  • use diff output (unchanged vs. edited) as the draft for the patch,
  • edit that to be a/src/xxxx b/src/xxxx etc., and
  • then place to to the correct patches directory of fstools.

There are lots of patch examples in the source repos. e.g.

Once you have tested that, you could send the patch to the developer mailing list or the fstools github repo.

I remember that kernel patches were managed with quilt and then added to OpenWrt's local git and that packages have their own git for the feed. Your procedure seems ... odd by comparison. I don't understand in what repository it will finally be saved to. OpenWrt's? Or a feed? Or is there a separate git for fstools hidden in some subdir that I don't know about?

I don't know where is that. Please provide the path.

As a more general question:
Why is fstools saved separately from the rest of OpenWrt? Shouldn't it be in a feed or in OpenWrt's git?

package/system/fstools/patches

You first test it it your own local source repo (via local patch to be applied to the downloaded fstools sources).
And later, via a PR, propose it to the external fstools source repo. (So that you could drop the local patch).

Well, it is handled quite similarly as any external package, like busybox, procd, ucode, haveged, irqbalance, whatever... OpenWrt main repo contains just the Makefile, init scripts etc, while the actual upstream package sources are downloaded for patching and compilation. Core package definitions are in the main repo, while most non-important packages are in the feeds.

(The only difference is that fstools is not really a third-party program, but authored and hosted by the OpenWrt team.)

You don't really need quilt for handling patches. It helps in handling patch series containing lots of patches, but is not mandatory. Drafting a single patch is quite easy without it.)

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.