Commit fecf101c by Stéphane Graber

download: Don't use an hardcoded exclude list

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: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 33aa351a
...@@ -341,14 +341,20 @@ fi ...@@ -341,14 +341,20 @@ fi
# Unpack the rootfs # Unpack the rootfs
echo "Unpacking the rootfs" echo "Unpacking the rootfs"
if [ "$DOWNLOAD_MODE" = "system" ]; then
tar --numeric-owner -xpJf ${LXC_CACHE_PATH}/rootfs.tar.xz -C ${LXC_ROOTFS} EXCLUDES=""
else excludelist=$(relevant_file excludes)
tar --anchored --exclude="./dev/*" --numeric-owner -xpJf \ if [ -f "${excludelist}" ]; then
${LXC_CACHE_PATH}/rootfs.tar.xz -C ${LXC_ROOTFS} while read line; do
mkdir -p ${LXC_ROOTFS}/dev/pts/ EXCLUDES="$EXCLUDES --exclude=$line"
done < $excludelist
fi 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 # Setup the configuration
configfile=$(relevant_file config) configfile=$(relevant_file config)
fstab=$(relevant_file fstab) fstab=$(relevant_file fstab)
......
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