How to create patches using quilt for LuCI files?

Hello, please can somebody enlighten me how I can add patches to the OpenWrt build system for LuCI? I have read the developer WiKi multiple times and searched the forum already, but couldn't find out how to create patches using quilt to incorporate changes in LuCI files.

There must be a way to download and unpack the files so that it's possible to patch them using quilt, right? I want to test patches for new board-specific functions and some small fixes to the status page first before sending them to the upstream package maintainers in quilt format.

Thanks in advance!

Here you go: https://openwrt.org/docs/guide-developer/build-system/use-patches-with-buildsystem

I tried this already, doesn't work for LuCI files. That's why I asked how I can unpack the files (then it can work the way described in the developer's guide):

$ make feeds/luci/modules/luci-mod-admin-full/{clean,prepare} V=s QUILT=1
make[1]: Entering directory '/home/r1d2/OpenWRT/19.07.2'
make[1]: *** No rule to make target 'feeds/luci/modules/luci-mod-admin-full/clean'. Stop.
make[1]: Leaving directory '/home/r1d2/OpenWRT/19.07.2'
/home/r1d2/OpenWRT/19.07.2/include/toplevel.mk:225: recipe for target 'feeds/luci/modules/luci-mod-admin-full/clean' failed
make: *** [feeds/luci/modules/luci-mod-admin-full/clean] Error 2
$

make package/luci-mod-admin-full/{clean,prepare} V=s QUILT=1

1 Like

Ahh, thanks very much, this worked!

This is a helpful quick reference to bookmark: https://openwrt.org/docs/guide-developer/single.package

Wait a moment - where do I find the files? build_dir/target-x86_64/luci-admin-full/ just contains the quilt files, but no sources. I managed for LEDE 17.01.4 to extract the files into feeds/luci/modules/luci-mod-admin-full, where I placed the patches back then, but can't remember how I did extract the files there.

I just remember that I read the developer's Wiki about patching 200 times and spend days until I could manage to patch the file in question. :smiley:

Should I go the hard way and just extract the downloaded TAR file into the feeds directory? IIRC the patch should be created in the feeds directory, not in the build_dir (unlike for other packages which I can easily patch if following the instructions in the developer's guide)?

I suggest to work with a proper clone of the LuCI repo as feed, which also makes upstreaming your patches way easier later.

  1. Clone LuCI: git clone https://github.com/openwrt/luci /some/where/luci
    1a) When not building for master, checkout the appropriate branch, e.g. cd /some/where/luci; git checkout openwrt-19.07
  2. Change to buildroot, copy the feed config: cp feeds.conf.default feeds.conf
  3. Edit feeds.conf, replace src-git luci https://git.openwrt.org/project/luci.git with src-link luci /some/where/luci
  4. Update the LuCI feed: ./scripts/feeds update luci

Your LuCI packages will now be built from /some/where/luci instead of the online Github sources.

1 Like

Hello jow, yes, I will work on a clone. Thanks very much for your help!

I have just some small enhancements such as a shutdown button on the reboot page for APU2 and EdgeRouter-X and a GUI for a dual-image boot package for APU2.

BTW, the new version of LuCI is really great, a big thank you to you and all developers for those enhancements!

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