diff options
author | Radostin Stoyanov <rstoyanov1@gmail.com> | 2018-04-10 17:10:14 +0100 |
---|---|---|
committer | Radostin Stoyanov <rstoyanov1@gmail.com> | 2018-04-10 17:27:02 +0100 |
commit | 20c0c7607ee11ef24e7453df2311d83e98af83a3 (patch) | |
tree | 749ca247b0fe0aca3dc17b7924f173e64107d5a2 | |
parent | ba2b756350ff2cd45af156ac3952d126348722f1 (diff) | |
download | virt-bootstrap.git-20c0c7607ee11ef24e7453df2311d83e98af83a3.tar.gz virt-bootstrap.git-20c0c7607ee11ef24e7453df2311d83e98af83a3.tar.xz virt-bootstrap.git-20c0c7607ee11ef24e7453df2311d83e98af83a3.zip |
docker-source: Preserve extended file attributes
Preserve extended file attributes of extracted rootfs as described in
https://github.com/opencontainers/image-spec/blob/master/layer.md
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
-rw-r--r-- | src/virtBootstrap/utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/virtBootstrap/utils.py b/src/virtBootstrap/utils.py index ec6a96e..94b3ccb 100644 --- a/src/virtBootstrap/utils.py +++ b/src/virtBootstrap/utils.py @@ -278,8 +278,12 @@ def safe_untar(src, dest): # Note: Here we use --absolute-names flag to get around the error message # "Cannot open: Permission denied" when symlynks are extracted, with the # qemu:/// driver. This flag must not be used outside virt-sandbox. + # + # Preserve file attributes following the specification in + # https://github.com/opencontainers/image-spec/blob/master/layer.md params = ['--', '/bin/tar', 'xf', src, '-C', '/mnt', '--exclude', 'dev/*', - '--overwrite', '--absolute-names'] + '--overwrite', '--absolute-names', + '--acls', '--xattrs', '--selinux'] execute(virt_sandbox + params) |