I have to modify the /drivers/bus/mhi/pci_generic.c file. I am building my own image for an x86/64 target. I read the guide about using quilt to create and apply .patch file, but I don't know what I have to write in the file.
I need to change two lines of code:
from:
- err = mhi_sync_power_up(mhi_cntrl);
to:
+ err = mhi_async_power_up(mhi_cntrl);
Can someone help me and explain me how to do it? In the meantime, I decided to modify the pci_generic.c file in build_dir directory using an editor, and then:
make target/linux/compile
make target/linux/install
make
Is this correct? Are the modifications I made in the text editor applied to the openwrt .img file?
I have tried creating the patch with quilt. These are the commands I used:
make target/linux/{clean,prepare} V=s QUILT=1
cd build_dir/target-x86_64_musl/linux-x86_64/linux-6.1.82
quilt new generic/010-main_code_fix.patch
quilt edit drivers/bus/mhi/host/pci_generic.c
quilt diff
quilt refresh
cd /home/lele/openwrt
make target/linux/update package/index V=s
I can see the patch here build_dir/target-x86_64_musl/linux-x86_64/linux-6.1.82/patches/generic and with quilt series
But I can't see the patch in target/linux/x86/patches-6.1/
What do I need to do? How can be sure the patch is applied at image building?
the patch won't go magically in the target/generic directory... you need to move it from your linux/generic to target/linux/generic patches directory... maybe in hack directory.
also remember that anything in build_dir might be wiped and recompiled again
I have moved to target/linux/x86/patches-*, but how can I be sure that the patch have been applied to the image?
If I try: quilt series. It doesn't list the patch. Why?
If a patch is applied or not you would recognize only if there is an error and it does not build because of this. You could enable logging (V=sc) also. As described in the wiki. Another option would be flashing your image and look if it works as intended (with proper tools if available/needed).
Then check the log (for the patch filename) either during build time or writing it into a file and check after build. Patches are applied very early in build process.