From b7fa3aaef2173d5f4b43fca0f77584b7dc62c944 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Wed, 24 May 2017 05:16:59 +0000 Subject: [PATCH 1/2] [image]: add --numeric_owner to perserve the original owner of the for docker filesystem --- installer/x86_64/install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installer/x86_64/install.sh b/installer/x86_64/install.sh index 451edbe3f37..927dc0effba 100755 --- a/installer/x86_64/install.sh +++ b/installer/x86_64/install.sh @@ -385,6 +385,7 @@ if [ "$install_env" != "sonic" ]; then } else demo_mnt="/host" + TAR_EXTRA_OPTION="--numeric-owner" running_sonic_revision=$(cat /etc/sonic/sonic_version.yml | grep build_version | cut -f2 -d" ") # Prevent installing existing SONiC if it is running if [ "$image_dir" = "image-$running_sonic_revision" ]; then @@ -417,7 +418,7 @@ fi unzip $ONIE_INSTALLER_PAYLOAD -d $demo_mnt/$image_dir if [ -f $demo_mnt/$image_dir/$FILESYSTEM_DOCKERFS ]; then - cd $demo_mnt/$image_dir && mkdir -p $DOCKERFS_DIR && tar xf $FILESYSTEM_DOCKERFS -C $DOCKERFS_DIR && rm -f $FILESYSTEM_DOCKERFS; cd $OLDPWD + cd $demo_mnt/$image_dir && mkdir -p $DOCKERFS_DIR && tar x $TAR_EXTRA_OPTION -f $FILESYSTEM_DOCKERFS -C $DOCKERFS_DIR && rm -f $FILESYSTEM_DOCKERFS; cd $OLDPWD fi # Create loop device for /var/log to limit its size to $VAR_LOG_SIZE MB From 24758477bf18414b91dfcab252e00fee5a351a86 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Wed, 24 May 2017 17:59:30 +0000 Subject: [PATCH 2/2] add --numeric-owner option onie installation --- installer/x86_64/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/x86_64/install.sh b/installer/x86_64/install.sh index 927dc0effba..18669893bcb 100755 --- a/installer/x86_64/install.sh +++ b/installer/x86_64/install.sh @@ -385,7 +385,6 @@ if [ "$install_env" != "sonic" ]; then } else demo_mnt="/host" - TAR_EXTRA_OPTION="--numeric-owner" running_sonic_revision=$(cat /etc/sonic/sonic_version.yml | grep build_version | cut -f2 -d" ") # Prevent installing existing SONiC if it is running if [ "$image_dir" = "image-$running_sonic_revision" ]; then @@ -418,6 +417,7 @@ fi unzip $ONIE_INSTALLER_PAYLOAD -d $demo_mnt/$image_dir if [ -f $demo_mnt/$image_dir/$FILESYSTEM_DOCKERFS ]; then + TAR_EXTRA_OPTION="--numeric-owner" cd $demo_mnt/$image_dir && mkdir -p $DOCKERFS_DIR && tar x $TAR_EXTRA_OPTION -f $FILESYSTEM_DOCKERFS -C $DOCKERFS_DIR && rm -f $FILESYSTEM_DOCKERFS; cd $OLDPWD fi