Quoting Stéphane Graber (stgra...@ubuntu.com):
> Instead of hardcoding --exclude=./dev/*, use a new metadata file
> "excludes" which lists all the paths or patterns to exclude during
> extraction (one per line).
> 
> Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>

Acked-by: Serge E. Hallyn <serge.hal...@ubuntu.com>

> ---
>  templates/lxc-download.in | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/templates/lxc-download.in b/templates/lxc-download.in
> index 4f28d0c..2298a9b 100644
> --- a/templates/lxc-download.in
> +++ b/templates/lxc-download.in
> @@ -341,14 +341,20 @@ fi
>  
>  # Unpack the rootfs
>  echo "Unpacking the rootfs"
> -if [ "$DOWNLOAD_MODE" = "system" ]; then
> -    tar --numeric-owner -xpJf ${LXC_CACHE_PATH}/rootfs.tar.xz -C 
> ${LXC_ROOTFS}
> -else
> -    tar  --anchored --exclude="./dev/*" --numeric-owner -xpJf \
> -        ${LXC_CACHE_PATH}/rootfs.tar.xz -C ${LXC_ROOTFS}
> -    mkdir -p ${LXC_ROOTFS}/dev/pts/
> +
> +EXCLUDES=""
> +excludelist=$(relevant_file excludes)
> +if [ -f "${excludelist}" ]; then
> +    while read line; do
> +        EXCLUDES="$EXCLUDES --exclude=$line"
> +    done < $excludelist
>  fi
>  
> +tar  --anchored ${EXCLUDES} --numeric-owner -xpJf \
> +    ${LXC_CACHE_PATH}/rootfs.tar.xz -C ${LXC_ROOTFS}
> +
> +mkdir -p ${LXC_ROOTFS}/dev/pts/
> +
>  # Setup the configuration
>  configfile=$(relevant_file config)
>  fstab=$(relevant_file fstab)
> -- 
> 1.8.5.2
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel@lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to