From b0c99338a1321381b431fd7dcb633f2036f6f32f Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Wed, 31 May 2017 19:27:47 -0700 Subject: [PATCH] [Aboot]: Add '--numeric-owner' when untarring docker filesystem to preserve original owners (#653) --- files/Aboot/boot0.j2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index eca3db743131..7c2d202012fc 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -67,8 +67,12 @@ extract_image() { if [ -n "$sonic_upgrade" ] || [ "$rootfs_type" != "vfat" ]; then mkdir -p "$image_path/{{ DOCKERFS_DIR }}" + if [ -n "$sonic_upgrade" ]; then + TAR_EXTRA_OPTION="--numeric-owner" + fi + ## extract docker archive - tar xf "$image_path/{{ FILESYSTEM_DOCKERFS }}" -C "$image_path/{{ DOCKERFS_DIR }}" + tar xf "$image_path/{{ FILESYSTEM_DOCKERFS }}" -C "$image_path/{{ DOCKERFS_DIR }}" $TAR_EXTRA_OPTION ## clean up docker archive rm -f "$image_path/{{ FILESYSTEM_DOCKERFS }}"