From 939bcf3e7bf9854a09df1487e7f0b335c779e57b Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Thu, 1 Jun 2017 01:42:34 +0000 Subject: [PATCH] [Aboot]: Add '--numeric-owner' when untarring docker filesystem to preserve original owners --- 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 }}"