]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/scripts/vagrant/update.sh
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / scripts / vagrant / update.sh
index 681fd9dc57b05df559106c801bb8b0e4ce4d399d..87bb21c9d291353575c008c7bec17da759d22913 100755 (executable)
@@ -9,8 +9,8 @@ fi
 
 set -e
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-SPDK_DIR="$( cd "${DIR}/../../" && pwd )"
+DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+SPDK_DIR="$(cd "${DIR}/../../" && pwd)"
 echo "SPDK_DIR = $SPDK_DIR"
 
 # Bug fix for vagrant rsync problem
@@ -28,12 +28,12 @@ if [ ! -f /home/vagrant/autorun-spdk.conf ]; then
        chgrp vagrant /home/vagrant/autorun-spdk.conf
 fi
 
-SYSTEM=`uname -s`
+SYSTEM=$(uname -s)
 
 if [ "$SYSTEM" = "FreeBSD" ]; then
        # Do initial setup for the system
        pkg upgrade -f
-       ${SPDK_DIR}/scripts/pkgdep.sh
+       ${SPDK_DIR}/scripts/pkgdep.sh --all
        if [ -d /usr/src/.git ]; then
                echo
                echo "/usr/src/ is a git repository"
@@ -50,7 +50,7 @@ else
        #       get the requested number of hugepages without rebooting.
        #       So do it here just in case
        sysctl -w vm.nr_hugepages=1024
-       HUGEPAGES=`sysctl -n  vm.nr_hugepages`
+       HUGEPAGES=$(sysctl -n vm.nr_hugepages)
        if [ $HUGEPAGES != 1024 ]; then
                echo "Warning: Unable to get 1024 hugepages, only got $HUGEPAGES"
                echo "Warning: Adjusting HUGEMEM in /home/vagrant/autorun-spdk.conf"
@@ -59,15 +59,15 @@ else
        fi
 
        # Figure out what system we are running on
-       if [ -f /etc/lsb-release ];then
+       if [ -f /etc/lsb-release ]; then
                . /etc/lsb-release
-       elif [ -f /etc/redhat-release ];then
+       elif [ -f /etc/redhat-release ]; then
                yum update -y
                yum install -y redhat-lsb
-               DISTRIB_ID=`lsb_release -si`
-               DISTRIB_RELEASE=`lsb_release -sr`
-               DISTRIB_CODENAME=`lsb_release -sc`
-               DISTRIB_DESCRIPTION=`lsb_release -sd`
+               DISTRIB_ID=$(lsb_release -si)
+               DISTRIB_RELEASE=$(lsb_release -sr)
+               DISTRIB_CODENAME=$(lsb_release -sc)
+               DISTRIB_DESCRIPTION=$(lsb_release -sd)
        fi
 
        # Do initial setup for the system
@@ -79,21 +79,20 @@ else
                # Standard update + upgrade dance
                apt-get update --assume-yes --no-install-suggests --no-install-recommends -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
                apt-get upgrade --assume-yes --no-install-suggests --no-install-recommends -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
-               ${SPDK_DIR}/scripts/pkgdep.sh
+               ${SPDK_DIR}/scripts/pkgdep.sh --all
+               apt-get clean
        elif [ "$DISTRIB_ID" == "CentOS" ]; then
                # Standard update + upgrade dance
                yum check-update
                yum update -y
-               ${SPDK_DIR}/scripts/pkgdep.sh
+               ${SPDK_DIR}/scripts/pkgdep.sh --all
+               yum clean all
        elif [ "$DISTRIB_ID" == "Fedora" ]; then
-               if [ "$DISTRIB_RELEASE" = "26" ]; then
-                       echo
-                       echo "  Run \"${SPDK_DIR}/test/common/config/vm_setup.sh\" to complete setup of Fedora 26"
-                       echo
-               else
-                       yum check-update
-                       yum update -y
-                       ${SPDK_DIR}/scripts/pkgdep.sh
-               fi
+               yum check-update
+               yum update -y
+               "$SPDK_DIR"/scripts/pkgdep.sh --all
+               sudo -u vagrant "$SPDK_DIR"/test/common/config/vm_setup.sh -i
+               yum clean all
        fi
+       cat /dev/null > ~/.bash_history && history -c
 fi