I'll assume two things for the following:
- You've got a working buildroot set up to create your own images;
- You have a local copy of your odhcpd repo on the same machine.
This is all from memory as I can never find the docs for it, but it's in there somewhere (not sure if the docs describe it better, but here goes)...
First thing to do is create a symbolic link in the buildroot package directory, named git-src
and linked to the .git
directory in your local odhcp repo.
$ cd ~/openwrt
$ ln -s ~/local-repos/odhcpd/.git package/network/services/odhcp/git-src
Now you need to point the makefile to your changes, which must be committed in your local repo:
$ vi package/network/services/odhcpd/Makefile
change two things in that file, reset these two to match the commit over in your local repo
PKG_SOURCE_DATE:=2024-05-08
PKG_SOURCE_VERSION:=a29882318a4ccb3ae26f7cc0145e06ad4ead224b
Then run two commands to include your code into the build
$ make package/odhcpd/download
$ make package/odhcpd/check V=s FIXUP=1
Now if you git diff
, you should see that the PKG_MIRROR_HASH:=
line has also been updated to correspond to your code.
Your next make world
or make package/odhcpd/compile
will now pick up your modified repo as the source, and the result should land in the bin dir:
$ find bin/packages/ -name 'odhcp*apk'
bin/packages/x86_64/base/odhcp6c-2025.02.06~8aa8b706-r1.apk
bin/packages/x86_64/base/odhcpd-ipv6only-2024.05.08~a2988231-r1.apk
And the resulting images will also include your new package, if that's more convenient.