[Mellanox]WA to avoid fsroot being corrupted by "dpkg --extract"

This commit is contained in:
Stephen 2020-03-15 07:31:45 +00:00 committed by Guohan Lu
parent ec85c2e159
commit e95504fe72

View File

@ -344,7 +344,14 @@ sudo chmod a+x $FILESYSTEM_ROOT/usr/sbin/policy-rc.d
{% if installer_debs.strip() -%}
{% for deb in installer_debs.strip().split(' ') -%}
{% if sonic_asic_platform == "mellanox" %}
sudo dpkg --extract {{deb}} $FILESYSTEM_ROOT
if [ -e tmpdir ] ;
then
rm -rf tmpdir;
fi
sudo mkdir tmpdir
sudo dpkg --extract {{deb}} tmpdir
for subdir in $(ls tmpdir) ; do sudo cp -R tmpdir/$subdir/* $FILESYSTEM_ROOT/$subdir; done
sudo rm -rf tmpdir
{% else %}
sudo dpkg --root=$FILESYSTEM_ROOT -i {{deb}} || sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
{% endif %}