Re: Howto look outside chroot for local git tree?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Thu, Mar 1, 2012 at 2:07 AM, Damien Churchill <damoxc@xxxxxxxxx> wrote:
>
> You could mount --bind the location of your local git repositories to
> a point inside your chroot, that's probably the quickest and simplest
> way of doing it, although it offers no protection of your git
> repositories from being wiped out from within the chroot.

you can readonly --bind mount at the VFS level:

mount --bind /a /b
mount -oremount,bind,ro /b

... i have an AUR package that does exactly this:

(the for loop after "# Allow env passthru ...")
http://aur.archlinux.org/packages/py/pyjamas-engine-pythonwebkit/PKGBUILD

... this block allows variables to be set from the ENV, but more
related is the excerpt later on in build():

    if [[ ! -e ${g}/objects ]]; then
        msg "[git] Creating NEW repository ... "
        git --git-dir="${g}" --work-tree="${w}" init
    elif [[ ! -w ${g}/objects ]]; then
        warning "[git] Repository read-only, setting up proxy ... "
        git --git-dir="${_gitrepo_proxy}" --work-tree="${w}" init
        echo "${g}/objects" > "${_gitrepo_proxy}/objects/info/alternates"
        cp -r "${g}/refs" "${_gitrepo_proxy}"
        g="${_gitrepo_proxy}"
    fi

... this block check for an objects directory: if missing clone new,
if readonly create proxy.  the proxy works by creating a new git repo,
and assigning the original as an alternate object store ... this
allows the build to not only reuse the existing repo but *also*
download/use/change within it's own repo.

i use this for webkit because it's a 1GiB+ repository.

-- 

C Anthony


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux