Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
devel:import-k-module [2012/02/18 04:59] 109.230.216.60 DzfAZcsYtFrX |
devel:import-k-module [2012/11/11 16:59] (current) oej old revision restored |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Following your incsruttions I could get the uImage. Can you please let me know how to load this custom uImage onto the SD card so that I can see the changes running | + | ====== Import Kamailio Module ====== |
+ | |||
+ | Here is how you can import a Kamailio module with full history (that means all previous commits done on the svn will also be visible in git) into the sip-router git repository. | ||
+ | |||
+ | First off, make sure you have a local copy of the sip-router git repository with Kamailio history merged into it. You can find a step-by-step guide at [[git: | ||
+ | |||
+ | It is supposed that the module you want to import into the git repository will be based on the sources present in the kamailio svn trunk, so as the next step create a new branch based on the Kamailio trunk: | ||
+ | |||
+ | < | ||
+ | git co -b sqlops_filtered km/trunk | ||
+ | </ | ||
+ | |||
+ | The name of the new branch is sqlops_filtered because it is imported Kamailio sqlops module, " | ||
+ | |||
+ | Like revision numbers in svn (and unlike versions in cvs), git commits, identified by those cryptic sha1 hashes, record | ||
+ | because we only one to import the files in modules/ | ||
+ | |||
+ | But there is a solution: git-filter-branch. This is a handy git command which (among other things) can walk through all commits in the history of the current branch and transform the commits into new commits with selected files only. To include only files in modules/ | ||
+ | |||
+ | < | ||
+ | git-filter-branch --subdirectory-filter modules/ | ||
+ | </ | ||
+ | |||
+ | The command rewrite the history of the current branch, your current branch should be sqlops_filtered if you followed this guide from the beginning. If you investigate the history of the branch with git log, you should see only commits that are related to files in modules/ | ||
+ | |||
+ | If you examine your current working directory now, you'll notice | ||
+ | |||
+ | < | ||
+ | rm -rf .git/ | ||
+ | </ | ||
+ | |||
+ | And the following command will move all the files back to modules/ | ||
+ | |||
+ | < | ||
+ | git-filter-branch --index-filter 'git ls-files -s | | ||
+ | sed " | ||
+ | | ||
+ | mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' | ||
+ | </ | ||
+ | |||
+ | The previous command might look a little scary, but it is documented in man git-filter-branch if you are interested in details. | ||
+ | |||
+ | If you examine your current working directory now, it should contain modules directory with sqlops subdirectory and all the module files there. This branch is now ready to be merged into the sip-router tree, so create a new branch, for example sqlops, based on the sip-router master branch: | ||
+ | |||
+ | < | ||
+ | git co -b sqlops sr/master | ||
+ | </ | ||
+ | |||
+ | And now you can merge branch sqlops_filtered into the newly created branch: | ||
+ | |||
+ | < | ||
+ | git merge sqlops_filtered | ||
+ | </ | ||
+ | |||
+ | And if everything went well, congratulations, |