xenpac Posted December 12, 2016 Posted December 12, 2016 Hi, my name is Tom and i am an embedded developer. I am aiming to dig into the CSI0 camera interface for the bananapi. Admittedly, i am new to the linux way of coding and compilation. Thus far for armbian, i realized,... ....compilation by script "compile.sh"...which checks all needed tools, code, updates...downloads everything...runs a config screen to select target, platform, ...and yeah..it works. When i run the script two times ...it keeps compiling again. hmm+ My experience is, that i do have the sourcecode, a compiler script/makefile....and it will just update the changes i did on the source. (old scool:-) so if i have the source in a directory local on the computer (after a one time compile with compile.sh), .. then modifying the code..if i run compile.sh again, will it overwrite my changes by downloading again? Also i do see "patches". So patches (diff files to the original source files) are ?? uploaded to the git...and ?? will be applied during the compilation?? As you can tell, linux devel-newbi:-) So..how do i work on the sourcecode locally on my computer...ie. run the compiler, and finally supply "patches" then when i found a solution? Please give me a little guideline on local development the armbian source. (quick and easy...not long) regards Tom
Igor Posted December 13, 2016 Posted December 13, 2016 The tool helps you a lot in compassion to classic way. You just need a little playing around to get used to. Default cache settings are: - make ccache, root filesystem cache - delete debs, make clean on sources So each time you run, kernel is recompiled, but you have ccache which makes this recompilation way way faster. so if i have the source in a directory local on the computer (after a one time compile with compile.sh), .. then modifying the code..if i run compile.sh again, will it overwrite my changes by downloading again? Yes, it drop your changes unless you start compilation with: CREATE_PATCHES="no" which will create a patch out of changes you made to: u-boot and/or kernel source code. Then proceed for example this way: when you are satisfied with the patch and patch is beneficiary to community, you prepare a pull request with a patch placed in a proper directory of the main script eg. lib/patches/kernel/sunxi-next (allwinner mainline), not the userpatches where it's created and where you can add your local patches ...
xenpac Posted December 30, 2016 Author Posted December 30, 2016 happy new year :-) almost actually i just want to work on a driver code and just compile that to get a .ko file. Using the script "compile.sh" AND CREATE_PATCHES="no" will create a patch from my changes....and will apply it? but i already changed the source code? sounds complicated.
Igor Posted December 31, 2016 Posted December 31, 2016 will create a patch from my changes....and will apply it? but i already changed the source code? Changes to sources are dropped when you start compilation. If you want to create and use patch, you need to alter your code when you are prompted. This is possible in "developer mode" -> running the script with CREATE_PATCHES="yes". When this is enabled, patch to your changes is created (in userpatches/patch/) and those changes are included.
xenpac Posted December 31, 2016 Author Posted December 31, 2016 Is there a way to just compile the modified driver resulting in a .ko file, so i can substitute it on the target? with make? this is just for testing...
Recommended Posts