Cloning Tizen Source

1 Introduction

This document provides information about how to clone Tizen source, including the following:

  • Cloning over SSH
  • Cloning over HTTPS

This document assumes that the instructions in the following documents have been read, well understood, and correctly followed:

2 Cloning over SSH

This section describes how to clone Tizen source over SSH, including the following:

  • Cloning specific project over SSH
  • Cloning all projects over SSH

2.1 Cloning Specific Project over SSH

This section describes how to clone specific project over SSH.

To clone specific project over SSH, perform the following procedure:

  1. Confirm the package name by checking it on Tizen Project List or by running the following command:

    $ ssh review.tizen.org gerrit ls-projects
    
  2. Clone the required package by executing the following command:

    $ git clone [-b <Branch>] ssh://<Username>@review.tizen.org:29418/<Gerrit_Project> [<Local_Project>]
    

    An example is shown below:

    $ git clone ssh://<Username>@review.tizen.org:29418/pkgs/a/avsystem
    

2.2 Cloning All Projects over SSH

This section describes how to clone source of all projects over SSH, including the following:

  • Cloning the latest source of all projects over SSH

  • Cloning the snapshot source of all projects over SSH

    Note: The following two methods can be used to guarantee the synchronization process go on smoothly.

    • Method 1

      Make sure the SSH configuration file is correctly configured according to Setting up Development Environment, otherwise, the synchronization can not be performed successfully and the error message is like the following:

      ...
      nc: connection failed, SOCKS error 1
      ssh_exchange_identification: Connection closed by remote host
      nc: connection failed, SOCKS error 1
      ...
      fatal: Could not read from remote repository.
       
      Please make sure you have the correct access rights
      and the repository exists.
      ssh_exchange_identification: Connection closed by remote host
      fatal: Could not read from remote repository.
       
      ...
      
    • Method 2

      For those who have trouble modifying the SSH configuration file, an alternative is to make the following change in <Tizen_project>/.repo/manifests/_remote.xml:

      Change

      fetch="ssh://review.tizen.org/"
      

      to

      fetch="ssh://review.tizen.org:29418/"
      

    Between the two methods, we recommend Method 1, that is, Setting up Development Environment must be strictly followed to guarantee usability.

To prepare for cloning, perform the following procedure:

  1. Create ~/bin/ subdirectory, include it in PATH, and then switch to it by executing the following commands:

    $ mkdir ~/bin/
    $ PATH=~/bin:$PATH
    
  2. Download the repo script by executing the following command:

    $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    

    Note: To find solutions for the issues encountered during obtaining the repo tool, refer to Tips and Heads-up.

  3. Change the attribute of repo to make it executable by executing the command:

    $ sudo chmod a+x ~/bin/repo
    
  4. Create a new directory for Tizen and then switch to it by executing the following commands:

    $ mkdir ~/<Tizen_Project>
    $ cd ~/<Tizen_Project>
    

2.2.1 Cloning the Latest Source of All Projects over SSH

To clone the latest source of all projects over SSH, perform the following procedure:

  1. Initialize the repository by executing one of the following commands, as appropriate:

    • Tizen 2.2

      $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen_2.2
      
    • Tizen 3.0

      • Common

        $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen -m common.xml
        
      • IVI

        $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen -m ivi.xml
        
      • Mobile

        $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen -m mobile.xml
        
  2. Synchronize the repository by executing the following command:

    $ repo sync
    

2.2.2 Cloning the Snapshot Source of All Projects over SSH

Tizen IVI is taken as example in this section.

To clone the snapshot source of all projects over SSH, perform the following procedure:

  1. Initialize the original repository by executing the following command:

    $ repo init -u ssh://<Username>@review.tizen.org:29418/scm/manifest -b tizen -m ivi.xml
    

    Upon successful initialization, the ~/<Tizen_Project>/.repo/manifests/ directory is available and ready for use.

  2. Replace latest manifest with snapshot manifest and make proper modification by executing one of the following two sets of commands, as appropriate:

    • Tizen Common

      $ wget <Snapshot_Manifest_URL> -O .repo/manifests/common/projects.xml
      $ sed -i '3,4d' .repo/manifests/common/projects.xml
      
    • Tizen IVI

      $ wget <Snapshot_Manifest_URL> -O .repo/manifests/ivi/projects.xml
      $ sed -i '3,4d' .repo/manifests/ivi/projects.xml
      

    An example for Tizen IVI is shown below:

    $ wget http://download.tizen.org/snapshots/tizen/ivi/ivi/tizen_20140703.2/builddata/manifest/tizen_20140703.2_atom.xml -O .repo/manifests/ivi/projects.xml
    $ sed -i '3,4d' .repo/manifests/ivi/projects.xml
    
  3. Synchronize the repository by executing the following command:

    $ repo sync
    

3 Cloning over HTTPS

This section describes how to clone Tizen source over HTTPS, including the following:

  • Cloning specific project over HTTPS
  • Cloning all projects over HTTPS

3.1 Cloning Specific Project over HTTPS

This section describes how to clone specific project over HTTPS.

To clone specific project over HTTPS, perform the following procedure:

  1. Confirm the package name by checking it on Tizen Project List.

  2. Generate HTTPS password on Gerrit setting page: HTTPS Password.

  3. Clone the required package by executing the following command:

    $ git clone [-b <Branch>] https://<Username>:<HTTPS_Password>@review.tizen.org/gerrit/p/<Gerrit_Project> [<Local_Project>]
    

    An example is shown below:

    $ git clone https://JohnDoe:ABCDEFG@review.tizen.org/gerrit/p/a/avsystem
    

3.2 Cloning All projects over HTTPS

This section describes how to clone source of all projects over HTTPS, including the following:

  • Cloning the latest source of all projects over HTTPS

  • Cloning the snapshot source of all projects over HTTPS

    Note: When using HTTPS protocol, fetch attribute in .repo/manifests/_remote.xml must be configured as follows after successful repo initialization:

    fetch="https://<Username>:<HTTPS_Password>@review.tizen.org/gerrit/p"
    

To prepare for cloning, perform the following procedure:

  1. Create ~/bin/ subdirectory, include it in PATH, and then switch to it by executing the following commands:

    $ mkdir ~/bin/
    $ PATH=~/bin:$PATH
    
  2. Download the repo script by executing the following command:

    $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    
  3. Change the attribute of repo to make it executable by executing the command:

    $ sudo chmod a+x ~/bin/repo
    
  4. Create a new directory for Tizen and then switch to it by executing the following commands:

    $ mkdir ~/<Tizen_Project>
    $ cd ~/<Tizen_Project>
    
  5. Generate HTTPS password on Gerrit setting page: HTTPS Password.

3.2.1 Cloning the Latest Source of All Projects over HTTPS

To clone the latest source of all projects over HTTPS, perform the following procedure:

  1. Initialize the repository by executing one of the following commands, as appropriate:

    • Tizen 2.2

      $ repo init -u https://<Username>:<HTTPS_Password>@review.tizen.org/gerrit/p/scm/manifest -b tizen_2.2
      
    • Tizen 3.0

      • Common

        $ repo init -u https://<Username>:<HTTPS_Password>@review.tizen.org/gerrit/p/scm/manifest -b tizen -m common.xml
        
      • IVI

        $ repo init -u https://<Username>:<HTTPS_Password>@review.tizen.org/gerrit/p/scm/manifest -b tizen -m ivi.xml
        
      • Mobile

        $ repo init -u https://<Username>:<HTTPS_Password>@review.tizen.org/gerrit/p/scm/manifest -b tizen -m mobile.xml
        
  2. Configure "fetch" attribute in .repo/manifests/_remote.xml as follows after repo initialization:

fetch="https://<Username>:<HTTPS_Password>@review.tizen.org/gerrit/p"
  1. Synchronize the repository by executing the following command:

    $ repo sync
    

3.2.2 Cloning the Snapshot Source of All Projects over HTTPS

Tizen IVI is taken as example in this section.

To clone the snapshot source of all projects over HTTPS, perform the following procedure:

  1. Initialize the original repository by executing the following command:

    $ repo init -u https://<Username>:<HTTPS_Password>@review.tizen.org/gerrit/p/scm/manifest -b tizen -m ivi.xml
    

    Upon successful initialization, the ~/<Tizen_Project>/.repo/manifests/ directory is available and ready for use.

  2. Configure "fetch" attribute in .repo/manifests/_remote.xml as follows after repo initialization:

fetch="https://<Username>:<HTTPS_Password>@review.tizen.org/gerrit/p"
  1. Replace latest manifest with snapshot manifest and make proper modification by executing one of the following two sets of commands, as appropriate:

    • Tizen Common

      $ wget <Snapshot_Manifest_URL> -O .repo/manifests/common/projects.xml
      $ sed -i '3,4d' .repo/manifests/common/projects.xml
      
    • Tizen IVI

      $ wget <Snapshot_Manifest_URL> -O .repo/manifests/ivi/projects.xml
      $ sed -i '3,4d' .repo/manifests/ivi/projects.xml
      

    An example for Tizen IVI is shown below:

    $ wget http://download.tizen.org/snapshots/tizen/ivi/ivi/tizen_20140703.2/builddata/manifest/tizen_20140703.2_atom.xml -O .repo/manifests/ivi/projects.xml
    $ sed -i '3,4d' .repo/manifests/ivi/projects.xml
    
  2. Synchronize the repository by executing the following command:

    $ repo sync