Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:guide-developer:helloworld:chapter7 [2018/06/01 08:38] – LEDE -> OpenWrt tmomasdocs:guide-developer:helloworld:chapter7 [2024/03/29 14:42] (current) – [Including the first patch into the package] jiashuo_lin
Line 24: Line 24:
 During the life cycle of an application, from the initial design until the application is decommissioned, it often requires changes or fixes to the original source code or associated files in order to operate correctly. Changing the application source code is especially common when using when porting software to run on a different computer architecture. In the OpenWrt build system, this change management is accomplished with a tool called Quilt. During the life cycle of an application, from the initial design until the application is decommissioned, it often requires changes or fixes to the original source code or associated files in order to operate correctly. Changing the application source code is especially common when using when porting software to run on a different computer architecture. In the OpenWrt build system, this change management is accomplished with a tool called Quilt.
  
-There is an [[docs:guide-developer:build-system:use-patches-with-buildsystem|existing page]] in the OpenWrt wiki describing the tool in more detail. **Please review at least the first section in this page**, as there is crucial information on how the create a ''.quiltrc'' file, which ensures that the patches you create follow the established standards of the OpenWrt build system.+There is an [[docs:guide-developer:toolchain:use-patches-with-buildsystem|existing page]] in the OpenWrt wiki describing the tool in more detail. **Please review at least the first section in this page**, as there is crucial information on how the create a ''.quiltrc'' file, which ensures that the patches you create follow the established standards of the OpenWrt build system.
  
 At this point it is a good idea to ensure that Quilt can be found from the PATH environment variable. The OpenWrt build system installs the 'quilt' tool into the 'bin' directory under the target-independent tools' folder. We added this directory to our path in the [[docs:guide-developer:helloworld:chapter1#adjusting_the_path_variable|first chapter]]. To ensure that you can invoke the tool, you can simply issue: At this point it is a good idea to ensure that Quilt can be found from the PATH environment variable. The OpenWrt build system installs the 'quilt' tool into the 'bin' directory under the target-independent tools' folder. We added this directory to our path in the [[docs:guide-developer:helloworld:chapter1#adjusting_the_path_variable|first chapter]]. To ensure that you can invoke the tool, you can simply issue:
Line 110: Line 110:
  
 As we can see, the OpenWrt build system migrated our newly-created patch file into the folder where the package manifest is. The original source code folder remains completely unaware of our changes. As we can see, the OpenWrt build system migrated our newly-created patch file into the folder where the package manifest is. The original source code folder remains completely unaware of our changes.
 +
 +Now, we need to modify ''mypackages/examples/helloworld/Makefile'' to copy the patch to the build directory. The earlier version used the ''cp'' command without the ''-r'' option. We need to add the ''-r'' option to copy directories.
 +<code>
 +define Build/Prepare
 + mkdir -p $(PKG_BUILD_DIR)
 + cp $(SOURCE_DIR)/* $(PKG_BUILD_DIR) -r
 + $(Build/Patch)
 +endef
 +</code>
  
 We can ensure that our new patch is applied correctly during the build process: We can ensure that our new patch is applied correctly during the build process:
  • Last modified: 2018/06/01 08:38
  • by tmomas