RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
Sometimes while applying patches, it may face offsets mismatch and results in failure. This makes your build verification also to fail.
You can get similar error in console logs for patch failures.
ERROR: Command Error: exit status: 1 Output:
Applying patch index.patch
patching file source/Styles/xb3/code/index.php
Hunk #1 succeeded at 22 (offset 21 lines).
Hunk #2 succeeded at 32 (offset 21 lines).
Hunk #3 succeeded at 73 (offset 21 lines).
Hunk #4 succeeded at 183 (offset 27 lines).
Hunk #5 succeeded at 195 (offset 27 lines).
Hunk #6 succeeded at 245 (offset 37 lines).
Hunk #7 succeeded at 307 (offset 37 lines).
Hunk #8 succeeded at 460 (offset 52 lines).
Hunk #9 succeeded at 469 (offset 52 lines).
Hunk #10 FAILED at 431.
Hunk #11 FAILED at 445.
Hunk #12 FAILED at 455.
3 out of 12 hunks FAILED -- rejects in file source/Styles/xb3/code/index.php
Patch index.patch does not apply (enforce with -f)
From the logs, you can find out that patch is not applied to the source file properly. In such scenarios you will have to update or refersh the patch.
4. Find the location of the patch file in the repo.
5. After cherry-picking you can verify the changes in the source file.
cmpnt_build_custom_pre_arm.mkCONTRIBUTING.md debug_scripts LICENSE NOTICE scripts
cmpnt_build_custom_pre_pc.mk COPYING index.patch Makefile.orig README sourc
4. Apply the patch to the source file/files.
patching file source/Styles/xb3/code/index.php
Hunk #1 succeeded at 22 (offset 21 lines).
Hunk #2 succeeded at 32 (offset 21 lines).
Hunk #3 succeeded at 73 (offset 21 lines).
Hunk #4 succeeded at 183 (offset 27 lines).
Hunk #5 succeeded at 195 (offset 27 lines).
Hunk #6 succeeded at 245 (offset 37 lines).
Hunk #7 succeeded at 307 (offset 37 lines).
Hunk #8 succeeded at 445 (offset 37 lines).
Hunk #9 succeeded at 454 (offset 37 lines).
Hunk #10 succeeded at 468 (offset 37 lines).
Hunk #11 succeeded at 482 (offset 37 lines).
Hunk #12 succeeded at 492 (offset 37 lines).
5. It should be applied successfully. In case of observing any failure when apply the patch to the source file/files then skip this step. If no failures observed then take a backup for the file/files got patched. For ex :
6. In case of observing any failure when apply the patch to the source file/files, then this may expects some other patch to be applied first. In such case,
a. Go to the full console log and then search for "Repo Init".
Example:
Repo Init for - Project: ssh://gerrit.teamccp.com:29418/rdk/yocto_oe/manifests/cisco-intel-manifest Branch: 2003_sprint Manifest: ciscoxb3-3939B
b. Create another directory
$ mkdir cisco_intel_repo
$ cd cisco_intel_repo
c. Append .xml with manifest filename in repo init command and Clone the repo
$ repo init -u ssh://gerrit.teamccp.com:29418/rdk/yocto_oe/manifests/cisco-intel-manifest -m ciscoxb3-3939B.xml -b 2003_sprint
$ repo sync -j4 --no-clone-bundle
d. grep with file name( in which patch applied failure observed) in meta-* layers, So that will find the other patch file which creates this file.
$ grep -irn "Filename" meta-*
e. Analyse and apply the patch file first, and then on top of that apply the second patch file, If no failures observed then take a backup for the file/files got patched. For ex :
$ cp source/Styles/xb3/code/index.php source/Styles/xb3/code/index_bk.php
--- git/source/Styles/xb3/code/index.php 2019-05-20 05:56:54.047078876 +0000
+++ git.1/source/Styles/xb3/code/index.php 2019-05-20 06:26:56.000000000 +0000