[lxc-devel] [PATCH 2/2] templates: use hardlink detection in rsync
Dwight Engen
dwight.engen at oracle.com
Mon Dec 3 16:26:40 UTC 2012
On Mon, 3 Dec 2012 10:04:13 -0600
Serge Hallyn <serge.hallyn at canonical.com> wrote:
> However one question is: is -H ubiquitous?
I'm wondering why we don't just use the cp -a? It seems like cp is far
more likely to be installed than rsync? rootfs_path probably doesn't
already exist so it not like rsync is going to be faster?
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
> ---
> templates/lxc-altlinux.in | 2 +-
> templates/lxc-debian.in | 2 +-
> templates/lxc-fedora.in | 2 +-
> templates/lxc-opensuse.in | 2 +-
> templates/lxc-ubuntu | 2 +-
> 5 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/templates/lxc-altlinux.in b/templates/lxc-altlinux.in
> index 0bf9735..abdd3d1 100644
> --- a/templates/lxc-altlinux.in
> +++ b/templates/lxc-altlinux.in
> @@ -184,7 +184,7 @@ copy_altlinux()
> #cp -a $cache/rootfs-$arch $rootfs_path || return 1
> # i prefer rsync (no reason really)
> mkdir -p $rootfs_path
> - rsync -a $cache/rootfs/ $rootfs_path/
> + rsync -Ha $cache/rootfs/ $rootfs_path/
> return 0
> }
>
> diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in
> index 494e837..889852f 100644
> --- a/templates/lxc-debian.in
> +++ b/templates/lxc-debian.in
> @@ -156,7 +156,7 @@ copy_debian()
> # make a local copy of the minidebian
> echo -n "Copying rootfs to $rootfs..."
> mkdir -p $rootfs
> - rsync -a "$cache/rootfs-$SUITE-$arch"/ $rootfs/ || return 1
> + rsync -Ha "$cache/rootfs-$SUITE-$arch"/ $rootfs/ || return 1
> return 0
> }
>
> diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in
> index edd4b9d..fe013c5 100644
> --- a/templates/lxc-fedora.in
> +++ b/templates/lxc-fedora.in
> @@ -188,7 +188,7 @@ copy_fedora()
> #cp -a $cache/rootfs-$arch $rootfs_path || return 1
> # i prefer rsync (no reason really)
> mkdir -p $rootfs_path
> - rsync -a $cache/rootfs/ $rootfs_path/
> + rsync -Ha $cache/rootfs/ $rootfs_path/
> return 0
> }
>
> diff --git a/templates/lxc-opensuse.in b/templates/lxc-opensuse.in
> index 3242451..a7b8465 100644
> --- a/templates/lxc-opensuse.in
> +++ b/templates/lxc-opensuse.in
> @@ -207,7 +207,7 @@ copy_opensuse()
> # make a local copy of the mini opensuse
> echo -n "Copying rootfs to $rootfs ..."
> mkdir -p $rootfs
> - rsync -a $cache/rootfs-$arch/ $rootfs/ || return 1
> + rsync -Ha $cache/rootfs-$arch/ $rootfs/ || return 1
> return 0
> }
>
> diff --git a/templates/lxc-ubuntu b/templates/lxc-ubuntu
> index 1e1d77c..0b55c03 100644
> --- a/templates/lxc-ubuntu
> +++ b/templates/lxc-ubuntu
> @@ -249,7 +249,7 @@ copy_ubuntu()
> # make a local copy of the miniubuntu
> echo "Copying rootfs to $rootfs ..."
> mkdir -p $rootfs
> - rsync -a $cache/rootfs-$arch/ $rootfs/ || return 1
> + rsync -Ha $cache/rootfs-$arch/ $rootfs/ || return 1
> return 0
> }
>
More information about the lxc-devel
mailing list