How to mirror Android repository on my private server?

605 views
Skip to first unread message

surai

unread,
Jun 6, 2009, 9:33:52 PM6/6/09
to Repo and Gerrit Discussion
Hi.

I'm searching and following another discussions on this issue but I
couldn't succeed.

Here is what I did, and please let me know if there is something
wrong.

[on server's side]
1. repo init -u git://android.git.kernel.org/platform/manifest.git --
mirror

2. repo sync
: now I can see kernel, platform, .repo, tools

3. git clone platform/manifest.git
: now I can see kernel, platform, .repo, tools and manifest

4. vi manifest/default.xml
: edit like below, here 192.168.0.75 is url of my internal server.

<manifest>
<remote name="korg"
fetch="git://192.168.0.75/"
review="review.source.android.com" />
<default revision="cupcake"
remote="korg" />

5. git daemon
: is the necessary?


[on client's side]
1. repo init -u git://192.168.0.75/platform/manifest.git


then the result is below

[on server's side]
maggy@nogari:~/mydroid$ git daemon
[24915] '/platform/manifest.git': unable to chdir or not a git archive


[on client's side]
...
* [new tag] v1.6.7.5 -> v1.6.7.5
* [new tag] v1.6.8 -> v1.6.8
Getting manifest ...
from git://192.168.0.75/platform/manifest.git
fatal: The remote end hung up unexpectedly
fatal: cannot obtain manifest git://192.168.0.75/platform/manifest.git
surai@client:~/mydroid$


Some discussion says after modifying default.xml, I have to push this
change back to the repository on the server. But I couldn't understand
this step, and it might be a clue.

Thanks in advance,
surai

Shawn Pearce

unread,
Jun 7, 2009, 2:55:24 PM6/7/09
to repo-d...@googlegroups.com
Yes, you need to configure the git daemon.  It looks like its already running on your server.  You need to reconfigure it to pass --base-path=/path/to/your/mirror.  Probably by editing /etc/sv/git-daemon/run, but it varies by Linux distribution.

To push the manifest back after modifying it:

  git push ../platform/manifest.git master

surai

unread,
Jun 7, 2009, 8:09:22 PM6/7/09
to Repo and Gerrit Discussion
Thank you for your reply.

I cound't find /etc/sv directory so I tried to find git-daemon but I
found only following file.
/usr/lib/git-core/git-daemon

And it is just a executable file.


I'm using Ubuntu 9.04 which is latest version of Ubuntu now.
Can you please check which file do I need to edit.

And if there is a guide for setting up a mirroring server, please let
me know.
I tried to find it every web-site, but I couldn't find it.

Thanks in advance.
> > surai- Hide quoted text -
>
> - Show quoted text -

Shawn Pearce

unread,
Jun 7, 2009, 8:17:17 PM6/7/09
to repo-d...@googlegroups.com
apt-get install git-daemon-run

That will create /etc/sv/ directory with the mentioned file.

Gergely Kis

unread,
Jun 8, 2009, 4:36:26 AM6/8/09
to repo-d...@googlegroups.com
Also, if you get a problem when trying to start git-daemon, check this
for a workaround:
https://bugs.launchpad.net/ubuntu/+source/git-core/+bug/153048

Best Regards,
Gergely


On Mon, Jun 8, 2009 at 2:17 AM, Shawn Pearce<s...@google.com> wrote:
> apt-get install git-daemon-run
> That will create /etc/sv/ directory with the mentioned file.
>

surai

unread,
Jun 8, 2009, 11:26:38 AM6/8/09
to Repo and Gerrit Discussion
Thank you Shawn.
As you said, I installed git-daemon-run and I editted /etc/sv/git-
daemon/run file like below.

--base-path=/home/maggy/mydroid /var/cache/git

and I commited and pushed default.xml also.

but still client reports below error.
---------------------------------------------------------------------------------------------
...
* [new tag] v1.6.7.5 -> v1.6.7.5
* [new tag] v1.6.8 -> v1.6.8
Getting manifest ...
from git://192.168.0.75/platform/manifest.git
fatal: The remote end hung up unexpectedly
fatal: cannot obtain manifest git://192.168.0.75/platform/manifest.git
---------------------------------------------------------------------------------------------

I think the client computer can't access internal server with git://
protocol.
Is there another program to install to do this? or What kind of file
do I have to check to setup this.

Thank you.
> > > - Show quoted text -- 원본 텍스트 숨기기 -
>
> - 원본 텍스트 보기 -

Shawn Pearce

unread,
Jun 8, 2009, 11:41:44 AM6/8/09
to repo-d...@googlegroups.com
2009/6/8 surai <surai.kr@gmail.com>

Thank you Shawn.
As you said, I installed git-daemon-run and I editted /etc/sv/git-
daemon/run file like below.

--base-path=/home/maggy/mydroid /var/cache/git

Actually, you need to also permit that path to export.  So really:

  --base-path=/home/maggy/mydroid /home/maggy/mydroid 

And you'll either need to create a git-daemon-export-ok in every project.git directory, *or* you need to add --export-all to the daemon's run script.

Is there another program to install to do this?

Try `git ls-remote git://server.ip.address/platform/manifest.git`.

When that works (lists a bunch of SHA-1s and refs), then clients can access that project.

surai

unread,
Jun 9, 2009, 2:30:35 AM6/9/09
to Repo and Gerrit Discussion
I can solve this problem, after editing daemon/run file as you said.

Thank you very much.

Best Regards,
Surai.

On Jun 9, 12:41 am, Shawn Pearce <s...@google.com> wrote:
> 2009/6/8 surai <surai...@gmail.com>
Reply all
Reply to author
Forward
0 new messages