Commit 6273aef1 by Harald Dunkel Committed by Serge Hallyn

Use "rsync -SHaAX" to copy the cached rootfs into place

(updated by Serge to also handle hte new lxc-fedora{-legacy{.in templates) Signed-off-by: 's avatarHarald Dunkel <harri@afaics.de> Signed-off-by: 's avatarSerge Hallyn <serge@hallyn.com> Acked-by: 's avatarSerge Hallyn <serge@hallyn.com>
parent f1401c06
...@@ -221,7 +221,7 @@ copy_altlinux() ...@@ -221,7 +221,7 @@ copy_altlinux()
#cp -a $cache/rootfs-$arch $rootfs_path || return 1 #cp -a $cache/rootfs-$arch $rootfs_path || return 1
# i prefer rsync (no reason really) # i prefer rsync (no reason really)
mkdir -p $rootfs_path mkdir -p $rootfs_path
rsync -Ha $cache/rootfs/ $rootfs_path/ rsync -SHaAX $cache/rootfs/ $rootfs_path/
return 0 return 0
} }
......
...@@ -533,7 +533,7 @@ copy_centos() ...@@ -533,7 +533,7 @@ copy_centos()
#cp -a $cache/rootfs-$arch $rootfs_path || return 1 #cp -a $cache/rootfs-$arch $rootfs_path || return 1
# i prefer rsync (no reason really) # i prefer rsync (no reason really)
mkdir -p $rootfs_path mkdir -p $rootfs_path
rsync -a $cache/rootfs/ $rootfs_path/ rsync -SHaAX $cache/rootfs/ $rootfs_path/
echo echo
return 0 return 0
} }
......
...@@ -433,7 +433,7 @@ copy_debian() ...@@ -433,7 +433,7 @@ copy_debian()
btrfs subvolume snapshot "$cache/rootfs-$release-$arch" "$realrootfs" || return 1 btrfs subvolume snapshot "$cache/rootfs-$release-$arch" "$realrootfs" || return 1
[ "$rootfs" = "$realrootfs" ] || mount --bind "$realrootfs" "$rootfs" || return 1 [ "$rootfs" = "$realrootfs" ] || mount --bind "$realrootfs" "$rootfs" || return 1
else else
rsync -Ha "$cache/rootfs-$release-$arch"/ "$rootfs"/ || return 1 rsync -SHaAX "$cache/rootfs-$release-$arch"/ $rootfs/ || return 1
fi fi
return 0 return 0
} }
......
...@@ -1015,7 +1015,7 @@ copy_fedora() ...@@ -1015,7 +1015,7 @@ copy_fedora()
#cp -a $cache/rootfs-$basearch $rootfs_path || return 1 #cp -a $cache/rootfs-$basearch $rootfs_path || return 1
# i prefer rsync (no reason really) # i prefer rsync (no reason really)
mkdir -p $rootfs_path mkdir -p $rootfs_path
rsync -Ha $cache/rootfs/ $rootfs_path/ rsync -SHaAX $cache/rootfs/ $rootfs_path/
echo echo
return 0 return 0
} }
......
...@@ -520,7 +520,7 @@ copy_fedora() ...@@ -520,7 +520,7 @@ copy_fedora()
echo -n "Copying ${cache} to ${rootfs} ... " echo -n "Copying ${cache} to ${rootfs} ... "
mkdir -p "${rootfs}" && mkdir -p "${rootfs}" &&
rsync --archive --hard-links --sparse "${cache}/" "${rootfs}/" && rsync --archive --hard-links --sparse --acls --xattrs "${cache}/" "${rootfs}/" &&
echo || return 1 echo || return 1
return 0 return 0
......
...@@ -155,7 +155,7 @@ copy_openmandriva() ...@@ -155,7 +155,7 @@ copy_openmandriva()
echo -n "Copying rootfs to $rootfs_path ..." echo -n "Copying rootfs to $rootfs_path ..."
mkdir -p $rootfs_path mkdir -p $rootfs_path
rsync -Ha $cache/rootfs/ $rootfs_path/ rsync -SHaAX $cache/rootfs/ $rootfs_path/
return 0 return 0
} }
......
...@@ -251,7 +251,7 @@ copy_opensuse() ...@@ -251,7 +251,7 @@ copy_opensuse()
# make a local copy of the mini opensuse # make a local copy of the mini opensuse
echo "Copying rootfs to $rootfs ..." echo "Copying rootfs to $rootfs ..."
mkdir -p $rootfs mkdir -p $rootfs
rsync -Ha $cache/rootfs-$arch/ $rootfs/ || return 1 rsync -SHaAX $cache/rootfs-$arch/ $rootfs/ || return 1
return 0 return 0
} }
......
...@@ -439,7 +439,7 @@ copy_ubuntu() ...@@ -439,7 +439,7 @@ copy_ubuntu()
btrfs subvolume snapshot $cache/rootfs-$arch $realrootfs || return 1 btrfs subvolume snapshot $cache/rootfs-$arch $realrootfs || return 1
[ "$rootfs" = "$realrootfs" ] || mount --bind $realrootfs $rootfs || return 1 [ "$rootfs" = "$realrootfs" ] || mount --bind $realrootfs $rootfs || return 1
else else
rsync -Ha $cache/rootfs-$arch/ $rootfs/ || return 1 rsync -SHaAX $cache/rootfs-$arch/ $rootfs/ || return 1
fi fi
return 0 return 0
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment