github.com/hashicorp/packer@v1.14.3/examples/_common/parallels.sh (about)

     1  #!/bin/sh -eux
     2  
     3  # set a default HOME_DIR environment variable if not set
     4  HOME_DIR="${HOME_DIR:-/home/vagrant}";
     5  
     6  case "$PACKER_BUILDER_TYPE" in
     7  parallels-iso|parallels-pvm)
     8      mkdir -p /tmp/parallels;
     9      mount -o loop $HOME_DIR/prl-tools-lin.iso /tmp/parallels;
    10      VER="`cat /tmp/parallels/version`";
    11  
    12      echo "Parallels Tools Version: $VER";
    13  
    14      /tmp/parallels/install --install-unattended-with-deps \
    15        || (code="$?"; \
    16            echo "Parallels tools installation exited $code, attempting" \
    17            "to output /var/log/parallels-tools-install.log"; \
    18            cat /var/log/parallels-tools-install.log; \
    19            exit $code);
    20      umount /tmp/parallels;
    21      rm -rf /tmp/parallels;
    22      rm -f $HOME_DIR/*.iso;
    23  
    24      # Parallels Tools for Linux includes native auto-mount script,
    25      # which causes losing some of Vagrant-relative shared folders.
    26      # So, we should disable this behavior.
    27      # https://github.com/Parallels/vagrant-parallels/issues/325#issuecomment-418727113
    28      auto_mount_script='/usr/bin/prlfsmountd'
    29      if [ -f "${auto_mount_script}" ]; then
    30          echo -e '#!/bin/sh\n'\
    31          '# Shared folders auto-mount is disabled by Vagrant ' \
    32          > "${auto_mount_script}"
    33      fi
    34      ;;
    35  esac