New Revision: https://blackfin.cosmocode.de/doku.php?id=version_control_
systems
Old Revision: https://blackfin.cosmocode.de/doku.php?id=version_control_
systems&rev=1358434104
Edit Summary: Remove obsolete document
@@ -1,7 +1,24 @@
====== Version Control Systems ======
- The Blackfin open source project keeps its main project in Subversion (S
VN). Some older projects may use CVS instead.
+ The ADI specific GNU toolchain, u-boot and buildroot Lniux distribution
projects keep their source code in GIT. While the ADI specific Linux libra
ries, applications and test suites are kept in Subversion (SVN).
+
+
+ ===== git =====
+
+ [[http://git.or.cz/|git]] is a fast distributed scm that is used in many
open source projects but most notably, the Linux kernel. Unlike SVN/CVS,
it has no centralized repository.
+
+ All of the blackfin Linux projects except for the obsolete uClinux-dist
switched to the new GIT repositories at [[http://blackfin.uclinux.org/]] f
rom the SVN repositories.
+
+ ==== Check out the ADI Linux projects ====
+
+ The sub directory will be called "u-boot":
+
+ <xterm>$ **git clone git:%%//%%git.code.sf.net/p/adi-toolchain/blackfin
toolchain**</xterm>
+ <xterm>$ **git clone git:%%//%%git.code.sf.net/p/adi-u-boot/code u-boot*
*</xterm>
+ <xterm>$ **git clone git:%%//%%git.code.sf.net/p/adi-buildroot/code buil
droot**</xterm>
+
+
===== Subversion =====
Subversion is touted as a replacement for **CVS**.
@@ -15,50 +32,8 @@
* True version History
An online book is available [[http://svnbook.red-bean.com]].
- ==== Firewalls ====
-
- If you are behind a firewall, and can not access the subversion port, yo
u can replace all the below instructions with a different machine name/por
t. To test if this will be in the situation you are in - this is a direct
connection to the internet (no firewall):
-
- <xterm>$ **telnet sources.blackfin.uclinux.org 3690**
- Trying 204.50.165.247...
- Connected to sources.blackfin.uclinux.org.
- Escape character is '^]'.
- ( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline svndiff1 absent-entries )
) ) Connection closed by foreign host.</xterm>
-
- This is the same with a firewall:
- <xterm>$ **telnet sources.blackfin.uclinux.org 3690**
- Trying 204.50.165.247...</xterm>
-
- By replacing the ''sources.blackfin.uclinux.org'' with ''firewall-source
s.blackfin.uclinux.org:80'' the following command should work:
-
- <xterm>$ **svn checkout svn:%%//%%firewall-sources.blackfin.uclinux.org:
80/svn/u-boot/trunk u-boot**</xterm>
-
- And here is telnet with the proper firewall address (behind the firewall
):
- <xterm>$ **telnet firewall-sources.blackfin.uclinux.org 80**
- Trying 204.50.165.246...
- Connected to firewall-sources.blackfin.uclinux.org.
- Escape character is '^]'.
- ( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline svndiff1 absent-entries )
) ) Connection closed by foreign host.</xterm>
-
- Some firewalls do content checking rather than simple port filtering. I
f that's the case, then attempts to do svn over port 80 will probably fail
. The firewall may let through encrypted traffic on port 443 though.
- <xterm>$ **telnet firewall-sources.blackfin.uclinux.org 443**
- Trying 204.50.165.246...
- Connected to firewall-sources.blackfin.uclinux.org.
- Escape character is '^]'.
- SSH-2.0-OpenSSH_3.9p1</xterm>
-
- If you see the SSH version string (exact version information may differ)
, then you can probably access via the anonymous user (password is ''anony
mous'') and SSH. You will need to create an entry in your ~/.ssh/config f
ile so it knows to go to port 443.
- <xterm>$ **svn checkout svn+ssh:%%//%%anonymous@firewall-sources.blackfi
n.uclinux.org/svn/u-boot/trunk u-boot**</xterm>
-
- Example ''~/.ssh/config'' entry:
- <code>
- Host firewall-sources.blackfin.uclinux.org
- Port 443
- </code>
-
- If all of these methods fail, then sorry, there isn't anything we can do
to help you. Complain to your IT department.
==== Packages ====
The source code for subversion itself is found at its homepage [[http://
subversion.tigris.org]].
@@ -66,23 +41,18 @@
Most popular distributions already have packages available for you.
==== Quick Start ====
- === Check out a Project ===
+ === Check out the ADI open application project ===
- The sub directory will be called "u-boot":
-
- <xterm>$ **svn checkout svn:%%//%%firewall-sources.blackfin.uclinux.org:
80/svn/u-boot/trunk u-boot**</xterm>
-
- or
+ <xterm>$ **svn checkout svn:%%//%%svn.code.sf.net/p/adi-openapp/code/tru
nk adi-open-app**</xterm>
- <xterm>$ **svn checkout svn:%%//%%sources.blackfin.uclinux.org/svn/u-boo
t/trunk u-boot**</xterm>
=== Initial actions ===
* find out what version you have checked out:<xterm>$ **svn info**</xt
erm>
- * find out what version upstream is at:<xterm>$ **svn info svn:%%//%%f
irewall-sources.blackfin.uclinux.org:80/svn/linux-kernel/branches/2008R1**
</xterm>
- * look at the files that were updated upstream:<xterm>$ **svn log -v s
vn:%%//%%firewall-sources.blackfin.uclinux.org:80/svn/linux-kernel/branche
s/2008R1 | less**</xterm>
+ * find out what version upstream is at:<xterm>$ **svn info svn:%%//%%s
vn.code.sf.net/p/adi-openapp/code/branch/2008R1**</xterm>
+ * look at the files that were updated upstream:<xterm>$ **svn log -v s
vn:%%//%%svn.code.sf.net/p/adi-openapp/code/branches/2008R1 | less**</xter
m>
* bring your working copy up-to-date with the repository<xterm>$ **svn
update**</xterm>
* bring your working copy up-to-date with a specific revision in the r
epository (this can upgrade or downgrade, depending on the revision you gi
ve):<xterm>$ **svn update -r 5316**</xterm>
* check the status of your local copy:<xterm>$ **svn st**
'A' Added
@@ -114,170 +84,19 @@
While CVS requires you to use magic commands to create tags and branches
, SVN has actual directories in the top level.
So to create a branch in svn, you would:
<code>
- $ svn cp trunk branch/branch_R07R1
- $ svn commit -m 'add new 2007R1 branch' branch/branch_R07R1
+ $ svn cp trunk branch/2013R1
+ $ svn commit -m 'add new 2013R1 branch' branch/2013R1
</code>
And to tag a release:
<code>
- $ svn cp branch/branch_R07R1 tags/R07R1-RC1
- $ svn commit -m 'tag new R07R1-RC1 release' tags/R07R1-RC1
+ $ svn cp branch/2013R1 tags/2013R1-RC1
+ $ svn commit -m 'tag new 2013R1-RC1 release' tags/2013R1-RC1
</code>
- ==== Mirroring ====
-
- Since the svn connection from ''blackfin.uclinux.org'' can be slow at ti
mes, the best way of speeding this connection up, is to use a local mirror
. To set up a local mirror, you can use [[http://rsync.samba.org/|rsync]].
This will provide you a local copy of the entire repository, which you ca
n access much faster than ''blackfin.uclinux.org''. This is the recommende
d way of doing things, as it puts less stress on the server, and will decr
ease the overall bandwidth requirements.
-
- <note warning> The following instructions set up what some would call no
t very secure - and it is not. These instructions are best suited for some
thing that is not sitting on the internet, and only allow people that you
are know and trust access.</note>
-
- To set up a local repository, do the following:
- - Check to ensure you can talk to the rsync server on blackfin.uclinux
.org<code>
- $ rsync blackfin.uclinux.org::
- toolchain
- jtag
- ltp
- multimedia
- u-boot
- uclinux-dist
- linux-kernel
- xmame
- dokuwiki
- </code>If port 873 is blocked on your firewall, there is no way to conne
ct to the rsync server.
- - Do an initial rsync the projects you are going to create local repos
itories of -- remember that you only need to mirror the projects you actua
lly care about. The first time that this is done, it can take a over two h
ours per repository.<code>
- /usr/bin/rsync -azv --delete --force blackfin.uclinux.org::u-boot /svnro
ot/u-boot
- /usr/bin/rsync -azv --delete --force blackfin.uclinux.org::toolchain /sv
nroot/toolchain
- /usr/bin/rsync -azv --delete --force blackfin.uclinux.org::jtag /svnroot
/jtag
- /usr/bin/rsync -azv --delete --force blackfin.uclinux.org::ltp /svnroot/
ltp
- /usr/bin/rsync -azv --delete --force blackfin.uclinux.org::multimedia /s
vnroot/multimedia
- /usr/bin/rsync -azv --delete --force blackfin.uclinux.org::u-boot /svnro
ot/u-boot
- /usr/bin/rsync -azv --delete --force blackfin.uclinux.org::uclinux-dist
/svnroot/uclinux-dist
- /usr/bin/rsync -azv --delete --force blackfin.uclinux.org::linux-kernel
/svnroot/linux-kernel
- /usr/bin/rsync -azv --delete --force blackfin.uclinux.org::xmame /svnroo
t/xmame
- /usr/bin/rsync -azv --delete --force blackfin.uclinux.org::dokuwiki /svn
root/dokuwiki
- </code>
- - after this is complete, you can check out code on the local machine
with<code>
- svn -q checkout file:///svnroot/toolchain/trunk toolchain
- </code>Doing this will take less than 3 minutes, 38 seconds (on my machi
ne, which uses RAID0), but it is **much** faster than downloading over the
network.
- <note tip>
- This will only work if you use the same version of SVN as the server. C
urrent version is 1.4.3
- </note>
- - If you want to set svn up to give people local access to the reposit
ory via a ''svn:'' protocol you must set up svn as a deamon to listen on y
our network.<code>
- svnserve -d -r /svnroot/ -R
- </code> This causes ''svnserve'' to run in daemon (''-d'') mode (in the
background) this will accept TCP/IP connections on the svn port (3690, by
default - since 3690 is not a secure port, it does not need to be started
as root) with the virtual root (''-r /svnroot/'') for repositories served
by svnserve to be set to ''/svnroot'' (pathnames in URLs provided by the
client will be interpreted relative to this root, and will not be allowed
to escape this root), and to be read-only (''-R'') forcing all write opera
tions to be forbidden (afterall it is a mirror).
- - This allows checkouts to be done with <code>
- svn -q checkout svn://192.168.0.4/toolchain/trunk toolchain
- </code>Doing this will take less than 3 minutes, 25 seconds, showing the
re is no appreciable difference between network, and local file access. If
it is possible to check out a local mirror, please do so.
-
- - To keep rsync up to date, you can run this script. \\ Because rysnc
can sometimes take over 60 minutes to complete, and we don't want to be ru
nning more than one rsync at a time, this small shell script will make sur
e that this is the only rsync connecting to a site with "blackfin" in the
name (to make sure that the network does not become congested) before star
ting the network transfer. It times out in 59 minutes, as we will be start
ing it every 60 minutes with a cron job. Make a new file ''/usr/local/bin/
blackfin_rsync''<code>
- #!/bin/sh
- # This needs 1 argument
- if [ $# -ne 1 ]; then
- echo 1>&2 Usage: $0 repository_name
- exit
- fi
-
- # Set initial variables to zero
- I=0
-
- # This checks to see if rsync is running.
- # $RUN will be set to 0 if it is not running
- #
- RUN=`/bin/ps -C rsync | grep -v PID | wc -l`
- while [ "$RUN" -gt 0 ]
- do
- # This will put all the rsync process ID into a tmp file
- # This assumes that the first parameter from ps is the PID
- #
- /bin/ps -C rsync | grep -v PID | awk '{print $1}' > /tmp/tmp_file
-
- # This will read the file into the pid[] array
- typeset -i cnt=0
- while read line
- do
- pid[$cnt]=$line
- ((cnt = cnt + 1 ))
- done < /tmp/tmp_file
-
- typeset -i temp=0
-
- # This checks to see if the rsync is running is going to a site
- # with 'blackfin' in the address. If so, wait. Otherwise, skip it.
- while [ "$temp" -ne "$cnt" ]
- do
- RUN=`ps ${pid[$temp]} | grep -v PID | grep blackfin | wc -l`
- if [ "$RUN" -gt 0 ] ; then
- break
- fi
- ((temp = temp + 1))
- done
-
- # Wait 1 minute
- sleep 60
- I=$[I+1]
- if [ "$I" -gt 59 ] ; then
- # If waiting 59 minutes stop
- rm /tmp/tmp_file
- exit
- fi
- done
-
- rsync -az --delete --force blackfin.uclinux.org::$1 /svnroot/$1
- # rsync options are:
- # -a archive mode, equivalent to -rlptgoD
- # -r recurse into directories
- # -l copy symlinks as symlinks
- # -p preserve permissions
- # -t preserve times
- # -g preserve group
- # -o preserve owner
- # -D preserve devices
- # -z compress file data
- # --delete delete files that don't exist on sender
- # --force force deletion of dirs even if not empty
- </code>Ensure that this file has execute permissions with ''chmod +x /us
r/local/bin/blackfin_rsync''
- - Add to the crontab, with ''crontab -e''. The following lines should
be in your crontab file:<code>
- #min hour day month dayofweek command
- #0-59 0-23 1-32 1-12 0-7
- 0 * * * * /usr/local/bin/blackfin_rsync jtag
- 10 * * * * /usr/local/bin/blackfin_rsync jtagto
ols
- 20 * * * * /usr/local/bin/blackfin_rsync uboot5
33
- 30 * * * * /usr/local/bin/blackfin_rsync uclinu
x533
- 45 * * * * /usr/local/bin/blackfin_rsync gcc3
- </code>To reduce load on the server - use different times than this. If
everyone uses the same times, it will have periods of intense activity (an
d be slow for everyone), and then periods where it is sitting idle.
- - Now your localhost mirror should be set up, so you can replace ''bla
ckfin.uclinux.org'' with ''localhost''. Not only can this be used for a lo
cal mirror, but you now can tell other people on the same subnet as you, t
hat they can use your server to pull from. This will increase their bandwi
dth, and reduce the overall load on the main server.
- - You should use this script to checkout from your local lan:<code>
- #!/bin/sh
-
- #Home
- CVSSERVER=192.168.0.4
-
- CHECKOUT=~/blackfin/trunk
- mkdir -p $CHECKOUT
-
- DIST=uClinux-dist
- KERNEL=$DIST/linux-2.6.x
- UBOOT=u-boot
- TOOLCHAIN=toolchain
-
- cd $CHECKOUT
-
- rm -rf $CHECKOUT/$DIST $CHECKOUT/$UBOOT $CHECKOUT/$TOOLCHAIN
-
- svn checkout --ignore-externals svn://$CVSSERVER/uclinux-dist/trunk $CHE
CKOUT/$DIST
- svn checkout svn://$CVSSERVER/linux-kernel/trunk $CHECKOUT/$KERNEL
- svn checkout svn://$CVSSERVER/toolchain/trunk $CHECKOUT/$TOOLCHAIN
- svn checkout svn://$CVSSERVER/u-boot/trunk $CHECKOUT/$UBOOT
-
- $CHECKOUT/$TOOLCHAIN/buildscript/BuildToolChain -s $CHECKOUT/$TOOLCHAIN
-k $CHECKOUT/$KERNEL -u $CHECKOUT/$UBOOT/u-boot-1.1.6 -o $CHECKOUT/gcc4 -b
$CHECKOUT/gcc-build -c 4.1
- </code>The ''--ignore-externals'' flag will ensure that the kernel repos
itory at ''http://blackfin.uclinux.org'' will not used, but the local vers
ion will be checked out, and put in the proper place.
-
- ===== git =====
-
- [[http://git.or.cz/|git]] is a fast distributed scm that is used in many
open source projects but most notably, the Linux kernel. Unlike SVN/CVS,
it has no centralized repository.
- All of the blackfin projects except for the uClinux-dist have switched t
o GIT repository from the SVN repository at [[https://blackfin.uclinux.org
/git/]].
===== Quick References =====
Here's a quick reference for common commands and their counterparts in C
VS, SVN, and git. Most commands are (purposefully) pretty much the same,
but the little details are what nag you.
|