VirtualBox

Changeset 58324 in vbox


Ignore:
Timestamp:
Oct 20, 2015 8:39:37 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103523
Message:

Installers/linux: cleaner script for getting shell script location folders.

Location:
trunk/src/VBox
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/export_modules

    r57316 r58324  
    1616#
    1717
     18# The below is GNU-specific.  See VBox.sh for the longer Solaris/OS X version.
     19TARGET=`readlink -e -- "${0}"` || exit 1
     20MY_DIR="${TARGET%/[!/]*}"
     21
    1822if [ -z "$1" ]; then
    1923    echo "Usage: $0 <filename.tar.gz>"
     
    2529PATH_OUT=$PATH_TMP
    2630FILE_OUT="`cd \`dirname $1\`; pwd`/`basename $1`"
    27 PATH_ROOT="`cd \`dirname $0\`/../../../..; pwd`"
     31PATH_ROOT="${MY_DIR}/../../../..; pwd`"
    2832PATH_LINUX="$PATH_ROOT/src/VBox/Additions/linux"
    2933PATH_VBOXGUEST="$PATH_ROOT/src/VBox/Additions/common/VBoxGuest"
  • trunk/src/VBox/Additions/linux/installer/autorun.sh

    r36759 r58324  
    2727fi
    2828
     29# The below is GNU-specific.  See VBox.sh for the longer Solaris/OS X version.
     30TARGET=`readlink -e -- "${0}"` || exit 1
     31path="${TARGET%/[!/]*}"
    2932# 32-bit or 64-bit?
    30 path=`dirname $0`
    3133case `uname -m` in
    3234  i[3456789]86|x86|i86pc)
  • trunk/src/VBox/HostDrivers/linux/export_modules

    r57327 r58324  
    1515#
    1616
     17# The below is GNU-specific.  See VBox.sh for the longer Solaris/OS X version.
     18TARGET=`readlink -e -- "${0}"` || exit 1
     19MY_DIR="${TARGET%/[!/]*}"
     20
    1721if [ -z "$1" ]; then
    1822    echo "Usage: $0 <filename.tar.gz> [--without-hardening]"
     
    2933PATH_OUT=$PATH_TMP
    3034FILE_OUT="`cd \`dirname $1\`; pwd`/`basename $1`"
    31 PATH_ROOT="`cd \`dirname $0\`/../../../..; pwd`"
     35PATH_ROOT="${MY_DIR}/../../../..; pwd`"
    3236PATH_LINUX="$PATH_ROOT/src/VBox/HostDrivers/linux"
    3337PATH_VBOXDRV="$PATH_ROOT/src/VBox/HostDrivers/Support"
  • trunk/src/VBox/HostDrivers/linux/load.sh

    r58264 r58324  
    1616#
    1717
    18 MY_DIR=`dirname "$0"`
    19 MY_DIR=`cd "${MY_DIR}" && pwd`
    20 if [ ! -d "${MY_DIR}" ]; then
    21     echo "Cannot find ${MY_DIR} or it's not a directory..."
    22     exit 1;
    23 fi
     18# The below is GNU-specific.  See VBox.sh for the longer Solaris/OS X version.
     19TARGET=`readlink -e -- "${0}"` || exit 1
     20MY_DIR="${TARGET%/[!/]*}"
    2421
    2522set -e
  • trunk/src/VBox/HostDrivers/linux/loadall.sh

    r58264 r58324  
    1616#
    1717
    18 MY_DIR=`dirname "$0"`
    19 MY_DIR=`cd "${MY_DIR}" && pwd`
    20 if [ ! -d "${MY_DIR}" ]; then
    21     echo "Cannot find ${MY_DIR} or it's not a directory..."
    22     exit 1;
    23 fi
     18# The below is GNU-specific.  See VBox.sh for the longer Solaris/OS X version.
     19TARGET=`readlink -e -- "${0}"` || exit 1
     20MY_DIR="${TARGET%/[!/]*}"
    2421
    2522if test ${#} -eq 0; then
  • trunk/src/VBox/Installer/linux/postinst-common.sh

    r58214 r58324  
    2323# (e.g. /opt/VirtualBox, /usr/lib/VirtualBox, the build output directory).
    2424
    25 # This is GNU-specific, sorry Solaris.  It fails on directories ending in '\n'.
    26 MY_PATH="$(dirname $(readlink -f -- "${0}"))"
     25# The below is GNU-specific.  See VBox.sh for the longer Solaris/OS X version.
     26TARGET=`readlink -e -- "${0}"` || exit 1
     27MY_PATH="${TARGET%/[!/]*}"
    2728cd "${MY_PATH}"
    2829. "./routines.sh"
    2930
    3031START=true
    31 TARGET="${MY_PATH}"
    3232while test -n "${1}"; do
    3333    case "${1}" in
     
    4949
    5050# Install runlevel scripts and systemd unit files
    51 install_init_script "${TARGET}/vboxdrv.sh" vboxdrv
    52 install_init_script "${TARGET}/vboxballoonctrl-service.sh" vboxballoonctrl-service
    53 install_init_script "${TARGET}/vboxautostart-service.sh" vboxautostart-service
    54 install_init_script "${TARGET}/vboxweb-service.sh" vboxweb-service
     51install_init_script "${MY_PATH}/vboxdrv.sh" vboxdrv
     52install_init_script "${MY_PATH}/vboxballoonctrl-service.sh" vboxballoonctrl-service
     53install_init_script "${MY_PATH}/vboxautostart-service.sh" vboxautostart-service
     54install_init_script "${MY_PATH}/vboxweb-service.sh" vboxweb-service
    5555
    5656delrunlevel vboxdrv
  • trunk/src/VBox/Installer/linux/prerm-common.sh

    r58241 r58324  
    2727# error).
    2828
    29 # This is GNU-specific, sorry Solaris.
    30 MY_PATH="$(dirname $(readlink -f -- "${0}"))/"
     29# The below is GNU-specific.  See VBox.sh for the longer Solaris/OS X version.
     30TARGET=`readlink -e -- "${0}"` || exit 1
     31MY_PATH="${TARGET%/[!/]*}"
    3132cd "${MY_PATH}"
    3233. "./routines.sh"
  • trunk/src/VBox/Installer/linux/uninstall.sh

    r58186 r58324  
    1616#
    1717
    18 . `dirname $0`/routines.sh
     18# The below is GNU-specific.  See VBox.sh for the longer Solaris/OS X version.
     19TARGET=`readlink -e -- "${0}"` || exit 1
     20MY_PATH="${TARGET%/[!/]*}"
     21. "${MY_PATH}/routines.sh"
    1922
    2023if [ -z "$ro_LOG_FILE" ]; then
     
    4952# Do pre-removal common to all installer types, currently service script
    5053# clean-up.
    51 `dirname $0`/prerm-common.sh || exit 1  # Arguments intentionally not quoted.
     54"${MY_PATH}/prerm-common.sh" || exit 1
    5255
    5356# Remove kernel module installed
  • trunk/src/VBox/Installer/linux/vboxdrv.sh

    r58271 r58324  
    3232MODPROBE=/sbin/modprobe
    3333SCRIPTNAME=vboxdrv
    34 # This is GNU-specific, sorry Solaris.  It fails on directories ending in '\n'.
    35 SCRIPT_DIR="$(dirname $(readlink -f -- "${0}"))"
     34
     35# The below is GNU-specific.  See VBox.sh for the longer Solaris/OS X version.
     36TARGET=`readlink -e -- "${0}"` || exit 1
     37SCRIPT_DIR="${TARGET%/[!/]*}"
    3638
    3739if $MODPROBE -c | grep -q '^allow_unsupported_modules  *0'; then
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette