Setup account
1. Create account
If you are using VMware, you might need to add a new account. DO NOT use the “mine” account, and it is suggested to use your Domain_ID.
sudo useradd -d /home/[Domain_ID] -m -g [group] [Domain_ID] sudo passwd [Domain_ID]
Example:
sudo useradd –d /home/yanglin3 –m –g adm yanglin3 sudo passwd yanglin3
2. Generate ssh-key
Login the new account to generate the ssh key:
ssh-keygen -t rsa cat ~/.ssh/id_rsa.pub
3. Register gerrit
Refer to Gerrit manual: gerrit_manual.pptx
4. Apply permission (VMware user only)
If you are not working on Nanjing Site, you might need to apply the permission to access Qualcomm Baseline code. Send the content of your id_rsa.pub to huangrongfu@yulong.com.
Example:
This is XXX from shenzhen site, who is working on 8860U product BSP team. Can you help to add me permission to access Baseline code, my ssh-key is: #ssh-rsa .....
5. Install git and Setup .gitconfig
Git: already installed by default in linux
Run the following commands to config the .gitconfig (you can find the file under ~/.gitconfig)
(Replace the <Name>, <Email>, <Domain_ID> to your own information)
git config --global color.ui auto git config --global core.editor vim git config --global --add user.name <Name> git config --global --add user.email <Email>
Example
git config --global color.ui auto git config --global core.editor vim git config --global --add user.name "Tiger Huang" git config --global --add user.email huangrongfu@yulong.com
(Optinal) For Nanjing guys who uses the linux machine, and has skipped Setup account 4. Apply permission (VMware user only), run one more command:
git config --global --add url.file:///njyjs.insteadof ssh://njyjs@10.5.41.69/njyjs
(Optinal) If you are not using the Domain_ID as your linux accout, you might need to run
git config --global --add url.ssh://<Domain_ID>@10.1.11.21:29418.insteadof ssh://10.1.11.21:29418 Example: your account is /home/yl20186, but Domain_ID is huangrongfu git config --global --add url.ssh://huangrongfu@10.1.11.21:29418.insteadof ssh://10.1.11.21:29418
6. Install repo
Download the repo tool, run
git clone ssh://njyjs@10.5.41.69/njyjs/qualcomm/repo -b yl20186 ~/bin/repo
add the repo into you PATH:
Example:
add "export PATH=~/bin/repo:$PATH" into you ~/.bashrc (add to last line)
yanglin3@git-server:~/bin<203>$ bash yanglin3@git-server:~/bin<1>$ which repo /home/yanglin3/bin/repo/repo
For the repo/git usage, the details refer to http://source.android.com/source/developing.html
Download code
1. repo init
Download the manifests according to your working group
-
8930
repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8930_yl20186 -m BSP.xml (driver) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8930_yl20186 -m SYS.xml (system) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8930_yl20186 -m RADIO.xml (wireless) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8930_yl20186 -m MM.xml (multimedia) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8930_yl20186 (Qualcomm Base)
-
8210
repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8210_yl20186 -m BSP.xml (driver) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8210_yl20186 -m SYS.xml (system) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8210_yl20186 -m RADIO.xml (wireless) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8210_yl20186 -m MM.xml (media) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8210_yl20186 -m MODEM.xml (radio) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8210_yl20186 (Qualcomm Base) for shenzhen user: repo init -u ssh://10.1.11.21:29418/qualcomm/manifests --no-repo-verify -b yl_8210_4.4 -m BSP.xml (driver) *8926
repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8926_yl20186 -m BSP.xml (driver) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8926_yl20186 -m SYS.xml (system) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8926_yl20186 -m RADIO.xml (wireless) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8926_yl20186 -m MM.xml (media) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8926_yl20186 -m MODEM.xml (radio) repo init -u ssh://njyjs@10.5.41.69/njyjs/qualcomm/manifests --no-repo-verify -b qcom8926_yl20186 (Qualcomm Base) repo init -u ssh://10.1.11.28:29418/QC8926/.repo/manifests --no-repo-verify -b QC8926 -m QC8926_Verify_BSP.xml (shenzhen driver)
2. repo sync
Download the source code
repo sync -j4
3. Create debug remote (Optional)
If you need to push code to debug branches and haven't run this command before:
repo forall -c 'git remote rm yl.dbg; git remote add yl.dbg apksync@10.1.11.21:qcom/$REPO_PATH'
This command will create remote yl.dbg for each repo.
4. Doanload modem code (staled, unused now)
If you are working on modem team, you can try the following command to download the source code:
git clone ssh://apksync@10.1.11.21:29418/qcom8930_BP/qcom8930_modem -b yulong8930
Build commands
THE FOLLOWING CMDS ARE JUST EXAMPLES
-
CP7576U
./build.sh cp7576u -v eng -b P1 ./build.sh cp7576u -v eng -b P1 -i bootimg
-
CP8860U
./build.sh cp8860u -r vf_it -b T3 -v user -u ./build.sh cp8860u -b T3 -i bootimg ./build.sh cp8860u -b T3 -i aboot
-
CP8861U
./build.sh cp8861u -b T3 -v user -u
-
CP8870U
./build.sh cp8870u -b P1 -v user -u
Modify code
-
create your local branch and jump to it
git checkout -b <local_branch>
-
modify your code (Remember not enable encryption software)
-
add your changes to index
git add .
-
commit the changes
git commit -s
If this commit is for submitting to gerrit, you need to make sure you commit message following the gerrit rules.
ActivityID:Sumitter Title <blank line> Detail description about why you add this commit <blank line> Signed-off
Example:
AndDB00655899:huangrongfu Fix hotplug attribute during the suspend failure If the system suspend fails, the hotplug_disable attribute remains set. This prevents any change to core status from mpdecision. Reset the value of this attribute if the module receives PM_POST_RESTORE notification. Signed-off-by: Tiger Huang <huangrongfu@yulong.com>
Submit code
Submit to Gerrit
After you have completed your coding, you need to submit it to gerrit for review.
-
8930
git push yl.sz <local_branch>:refs/for/yl_8930_4.2
-
8210
git push yl.sz <local_branch>:refs/for/yl_8210_4.4
Resubmit to Gerrit
Most time, the reviewer would have comments on your code, then you might need to modify your code (git commit -s –amend)and resubmit the change.
git push yl.sz <local_branch>:refs/changes/<gerrit_number>
Example
http://10.1.11.21:8081/#/c/131/ git push yl.sz <local_branch>:refs/changes/131
Push to Debug branch
There are some branches which can be used for test/debug.
yl_8860u_apk (app team) yl_8860u_debug (system team) yl_8860u_driver (driver team) yl_8860u_plt yl_8860u_radio
Let me take the yl_8860u_driver branch for example to explain how to push to it.
1, Fetch and rebase to the debug branch > git fetch yl.dbg > git checkout remotes/yl.dbg/yl_8860u_driver 2, Apply your changes 3, Push to debug branch > git push yl.dbg <local_branch>:yl_8860u_driver