1. When is hostapd downloaded?
The hostapd source code is downloaded during the make process if it is required for the selected configuration. This typically happens during the make download or the make package/hostapd/download phase.
The source is downloaded to the dl/ directory from its upstream source as specified in the Makefile for the hostapd package located in package/network/services/hostapd/.
2. When is hostapd patched?
After downloading, the source code is unpacked, and any OpenWrt-specific patches are applied during the make package/hostapd/prepare step. This involves:
- Extracting the source archive to the
build_dir/target-*/hostapd-*directory. - Applying patches found in
package/network/services/hostapd/patches/.
The patching process modifies the source code to include fixes, adjustments, or enhancements specific to OpenWrt.
3. How to view the patched source code?
After the source has been patched, it resides in the build_dir directory. You can explore and modify it as follows:
- Prepare the source:
make package/hostapd/{clean,prepare} V=sThis will unpack the source code and apply the patches. - Locate the patched source: Navigate to the directory:
build_dir/target-*/hostapd-*/ - Inspect or modify the source code: You can browse and edit the files in this directory.
4. How to add your own patches?
If you want to add custom patches to hostapd, follow these steps:
- Create your patch: Modify the source code in
build_dir/target-*/hostapd-*/as needed and then create a patch:cd build_dir/target-*/hostapd-*/ git diff > my_custom_patch.patch - Save the patch in OpenWrt’s patch directory: Place the patch file in the
package/network/services/hostapd/patches/directory. Ensure it follows the naming convention (xxx-patch-description.patch), wherexxxis a numerical prefix determining the order of patch application. - Rebuild the package: Run:
make package/hostapd/{clean,prepare,compile} V=sYour patch will be applied alongside the existing patches. - Test your changes: Deploy the updated
hostapdpackage to your OpenWrt device and verify functionality.
5. Additional Debugging Tips
- Use the verbose mode (
V=s) during the build process to see detailed logs, including patch application steps. - Check the
Makefileinpackage/network/services/hostapd/for specific details on how patches are applied and the build process is configured. - Clean the package if necessary to force reapplication of patches:
make package/hostapd/clean
This process lets you inspect and customize the patched hostapd source code effectively. Let me know if you need help with a specific patch!
