You're looking at the wrong part of the documentation. The bit you linked to ("Install required dependencies") is for the build host, not the output image.
The document goes into detail on how to include extra packages and even custom files, at the bottom:
You can include custom files in your image by placing them in <buildroot>/files
, e.g. if you want to have my_config
included in your image in the directory /etc/config/
⇒ <buildroot>/files/etc/config/my_config
. If the files
directory doesn't exist on your buildsystem, then create it.
I'd also recommend for such changes to use the Image Builder instead of building from source. Much easier to automate, takes less time to build, and you won't end up with a broken install (most likely).
Adding custom files on an ImageBuilder build is also simple. Just follow the guide and take a look at the "Usage" section.
E.g. if you wanted to build for the RAVPower RP-WD009 like I do, and add, say, LuCI and Wireguard, you'd do the following:
make PROFILE="ravpower_rp-wd009" PACKAGES="+luci +luci-app-wireguard" FILES="./files"
This command would make the base image for the WD009, add the luci
and luci-app-wireguard
packages (these are composite packages, so e.g. luci
includes the necessary network admin, etc. interfaces, luci-app-wireguard
includes wireguard
and wireguard-tools
and the kernel module), and include everything in the files
folder.
Then you can use the uci-defaults
approach to add your own configurations that will only be executed on a first fresh boot: https://openwrt.org/docs/guide-developer/uci-defaults
Basically you can collate the network settings into a single file, as if you were executing it in terminal, and when the system detects a clean boot, the script will be executed, setting it up for first use. I'm already doing this to enable WiFi on my WD009's for an easier setup, especially on the go.