Error of hunk while building make file of yocto

Hi everyone,

I am adding driver of RTL8192CU to the kernel recipe by using patch
I am referring one document Legato - How to add a WiFi USB dongle v001.pdf (823.1 KB)

As per document I have generated patch and added in .bb file
After that I have given “make” command to build the yocto image
But It gave me error as below:

ERROR: Command Error: exit status: 1 Output:
Applying patch r8192cu_remove_debug.patch
patching file include/autoconf.h
Hunk #1 FAILED at 296.
1 out of 1 hunk FAILED – rejects in file include/autoconf.h
Patch r8192cu_remove_debug.patch does not apply (enforce with -f)
ERROR: Function failed: patch_do_patch
ERROR: Logfile of failure stored in: /home/ram/yocto_build/yocto/build_bin/tmp/work/swi_mdm9x15-poky-linux-gnueabi/rtl8192cu/4.0.2-r1/temp/log.do_patch.23474
ERROR: Task 391 (/home/ram/yocto_build/yocto/meta-swi/meta-swi-mdm9x15/recipes-connectivity/realtek/rtl8192cu_4.0.2_9000.bb, do_patch) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 1215 tasks of which 1211 didn’t need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:

Summary: 1 task failed:
  /home/ram/yocto_build/yocto/meta-swi/meta-swi-mdm9x15/recipes-connectivity/realtek/rtl8192cu_4.0.2_9000.bb, do_patch
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
make: *** [image_bin] Error 1

I have followed rules of patch file i.e added ‘space’ before “@”, “+” and “-”
and also done “ctrlF” after editing it

How to remove this Hunk error at 296 ?

Hi rups,

I was trying to reproduce your result, but it seems that the drivers for the realtek 8192CU aren’t even posted on the realtek site anymore. Where did you get them from? Also, do you know where the PDF you linked to came from? Pasting patches from PDFs seems like a very unreliable way to distribute a patch.

Hi @dfrey,

The driver for RTL8192CU is not available on realtek site.
So, I have taken it from site :

is there any problem with Driver files which is to be patch ? or
procedure is incorrect.

Kindly tell me the reason of this issue and how can i recover it.

I’m guessing that the drivers that the patch was based on differ from the package that you found. You could try to resolve the conflicts and see if it works.