VirtualBox

Changeset 76610 in vbox for trunk


Ignore:
Timestamp:
Jan 2, 2019 1:27:51 PM (6 years ago)
Author:
vboxsync
Message:

Linux installer: Various path quoting fixes / simplifications.

Location:
trunk/src/VBox/Installer/linux
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/check_module_dependencies.sh

    r76553 r76610  
    7474UNIT_TEST=
    7575
    76 case "${1}" in
     76case "$1" in
    7777"")
    7878    # Return immediately successfully if everything is installed
    7979    type ${TOOLS} >/dev/null 2>&1 && HAVE_TOOLS=yes
    8080    test -d "/lib/modules/`uname -r`/build/include" && HAVE_HEADERS=yes
    81     test -n "${HAVE_TOOLS}" && test -n "${HAVE_HEADERS}" && exit 0
     81    test -n "$HAVE_TOOLS" && test -n "$HAVE_HEADERS" && exit 0
    8282    UNAME=`uname -r`
    8383    for i in rpm dpkg; do
    8484        for j in /var/lib/${i}/*; do
    8585            test -e "${j}" || break
    86             if test -z "${PACKAGE_TYPE}"; then
     86            if test -z "$PACKAGE_TYPE"; then
    8787                PACKAGE_TYPE="${i}"
    8888            else
     
    9494    ;;
    9595-h|--help)
    96     echo "${USAGE_MESSAGE}"
     96    echo "$USAGE_MESSAGE"
    9797    exit 0 ;;
    9898*)
    9999    ERROR=""
    100     UNAME="${2}"
    101     PACKAGE_TYPE="${3}"
    102     BASE_EXPECTED="${4}"
    103     VERSIONED_EXPECTED="${5}"
     100    UNAME="$2"
     101    PACKAGE_TYPE="$3"
     102    BASE_EXPECTED="$4"
     103    VERSIONED_EXPECTED="$5"
    104104    test "${1}" = --test || ERROR=yes
    105     test -n "${UNAME}" && test -n "${PACKAGE_TYPE}" || test -z "${UNAME}" ||
     105    test -n "$UNAME" && test -n "${PACKAGE_TYPE}" || test -z "$UNAME" ||
    106106        ERROR=yes
    107     test -n "${BASE_EXPECTED}" && test -n "${VERSIONED_EXPECTED}" ||
    108         test -z "${BASE_EXPECTED}" || ERROR=yes
    109     case "${ERROR}" in ?*)
    110         echo "${USAGE_MESSAGE}" >&2
     107    test -n "$BASE_EXPECTED" && test -n "$VERSIONED_EXPECTED" ||
     108        test -z "$BASE_EXPECTED" || ERROR=yes
     109    case "$ERROR" in ?*)
     110        echo "$USAGE_MESSAGE" >&2
    111111        exit 1
    112112    esac
    113113    TEST=yes
    114114    TEST_PARAMS="${2} ${3} ${4} ${5}"
    115     test -z "${UNAME}" && UNIT_TEST=yes
     115    test -z "$UNAME" && UNIT_TEST=yes
    116116    ;;
    117117esac
    118118
    119 case "${PACKAGE_TYPE}" in
     119case "$PACKAGE_TYPE" in
    120120rpm)
    121121    for i in ${SUSE_FLAVOURS}; do
    122         case "${UNAME}" in *-"${i}")
     122        case "$UNAME" in *-"${i}")
    123123            BASE_PACKAGE="kernel-${i}-devel"
    124             VERSIONED_PACKAGE="kernel-${i}-devel-${UNAME%-${i}}"
     124            VERSIONED_PACKAGE="kernel-${i}-devel-$UNAME%-${i}"
    125125            break
    126126        esac
    127127    done
    128128    for i in ${EL_FLAVOURS} ""; do
    129         case "${UNAME}" in *.el5"${i}"|*.el*"${i}".i686|*.el*"${i}".x86_64)
     129        case "$UNAME" in *.el5"${i}"|*.el*"${i}".i686|*.el*"${i}".x86_64)
    130130            test -n "${i}" && i="${i}-"  # Hack to handle empty flavour.
    131131            BASE_PACKAGE="kernel-${i}devel"
    132             VERSIONED_PACKAGE="kernel-${i}devel-${UNAME}"
    133             break
    134         esac
    135     done
    136     case "${UNAME}" in *.fc*.i686|*.fc*.x86_64)  # Fedora
     132            VERSIONED_PACKAGE="kernel-${i}devel-$UNAME"
     133            break
     134        esac
     135    done
     136    case "$UNAME" in *.fc*.i686|*.fc*.x86_64)  # Fedora
    137137        BASE_PACKAGE="kernel-devel"
    138         VERSIONED_PACKAGE="kernel-devel-${UNAME}"
     138        VERSIONED_PACKAGE="kernel-devel-$UNAME"
    139139    esac
    140140    for i in ${MAGEIA_FLAVOURS} ""; do  # Mageia
    141         case "${UNAME}" in *-"${i}"*.mga*)
     141        case "$UNAME" in *-"${i}"*.mga*)
    142142            if test -z "${i}"; then
    143143                BASE_PACKAGE="kernel-linus-devel"
    144                 VERSIONED_PACKAGE="kernel-linus-devel-${UNAME}"
     144                VERSIONED_PACKAGE="kernel-linus-devel-$UNAME"
    145145            else
    146146                BASE_PACKAGE="kernel-${i}-devel"
    147                 VERSIONED_PACKAGE="kernel-${i}-devel-${UNAME%-${i}*}${UNAME#*${i}}"
     147                VERSIONED_PACKAGE="kernel-${i}-devel-$UNAME%-${i}*$UNAME#*${i}"
    148148            fi
    149149            break
     
    153153dpkg)
    154154    for i in ${DEBIAN_FLAVOURS}; do  # Debian/Ubuntu
    155         case "${UNAME}" in *-${i})
     155        case "$UNAME" in *-${i})
    156156            BASE_PACKAGE="linux-headers-${i}"
    157             VERSIONED_PACKAGE="linux-headers-${UNAME}"
    158             break
    159         esac
    160     done
    161     case "${UNAME}" in *-pclos*)  # PCLinuxOS
     157            VERSIONED_PACKAGE="linux-headers-$UNAME"
     158            break
     159        esac
     160    done
     161    case "$UNAME" in *-pclos*)  # PCLinuxOS
    162162        BASE_PACKAGE="kernel-devel"
    163         VERSIONED_PACKAGE="kernel-devel-${UNAME}"
    164     esac
    165 esac
    166 
    167 case "${UNIT_TEST}${BASE_EXPECTED}" in "")
     163        VERSIONED_PACKAGE="kernel-devel-$UNAME"
     164    esac
     165esac
     166
     167case "$UNIT_TEST$BASE_EXPECTED" in "")
    168168    echo "This system is currently not set up to build kernel modules." >&2
    169     test -n "${HAVE_TOOLS}" ||
    170         echo "Please install the ${TOOLS} packages from your distribution." >&2
    171     test -n "${HAVE_HEADERS}" && exit 1
     169    test -n "$HAVE_TOOLS" ||
     170        echo "Please install the $TOOLS packages from your distribution." >&2
     171    test -n "$HAVE_HEADERS" && exit 1
    172172    echo "Please install the Linux kernel \"header\" files matching the current kernel" >&2
    173173    echo "for adding new hardware support to the system." >&2
    174     if test -n "${BASE_PACKAGE}${VERSIONED_PACKAGE}"; then
     174    if test -n "$BASE_PACKAGE$VERSIONED_PACKAGE"; then
    175175        echo "The distribution packages containing the headers are probably:" >&2
    176         echo "    ${BASE_PACKAGE} ${VERSIONED_PACKAGE}" >&2
     176        echo "    $BASE_PACKAGE $VERSIONED_PACKAGE" >&2
    177177    fi
    178     test -z "${TEST}" && exit 1
     178    test -z "$TEST" && exit 1
    179179    exit 0
    180180esac
    181181
    182 case "${BASE_EXPECTED}" in ?*)
    183     case "${BASE_EXPECTED} ${VERSIONED_EXPECTED}" in
    184         "${BASE_PACKAGE} ${VERSIONED_PACKAGE}")
     182case "$BASE_EXPECTED" in ?*)
     183    case "$BASE_EXPECTED $VERSIONED_EXPECTED" in
     184        "$BASE_PACKAGE $VERSIONED_PACKAGE")
    185185        exit 0
    186186    esac
    187     echo "Test: ${TEST_PARAMS}" >&2
    188     echo "Result: ${BASE_PACKAGE} ${VERSIONED_PACKAGE}"
     187    echo "Test: $TEST_PARAMS" >&2
     188    echo "Result: $BASE_PACKAGE $VERSIONED_PACKAGE"
    189189    exit 1
    190190esac
  • trunk/src/VBox/Installer/linux/install.sh

    r76609 r76610  
    202202    # Find previous installation
    203203    if test -r "$CONFIG_DIR/$CONFIG"; then
    204         . $CONFIG_DIR/$CONFIG
     204        . ${CONFIG_DIR}/$CONFIG
    205205        PREV_INSTALLATION=$INSTALL_DIR
    206206    fi
     
    228228
    229229    # Remove previous installation
    230     test "${BUILD_MODULE}" = true || VBOX_DONT_REMOVE_OLD_MODULES=1
     230    test "$BUILD_MODULE" = true || VBOX_DONT_REMOVE_OLD_MODULES=1
    231231
    232232    if [ -n "$PREV_INSTALLATION" ]; then
     
    241241    fi
    242242
    243     mkdir -p -m 755 $CONFIG_DIR
    244     touch $CONFIG_DIR/$CONFIG
     243    mkdir -p -m 755 ${CONFIG_DIR}
     244    touch ${CONFIG_DIR}/$CONFIG
    245245
    246246    info "Installing VirtualBox to $INSTALLATION_DIR"
     
    249249
    250250    # Verify the archive
    251     mkdir -p -m 755 $INSTALLATION_DIR
     251    mkdir -p -m 755 ${INSTALLATION_DIR}
    252252    bzip2 -d -c VirtualBox.tar.bz2 > VirtualBox.tar
    253     if ! tar -tf VirtualBox.tar > $CONFIG_DIR/$CONFIG_FILES; then
    254         rmdir $INSTALLATION_DIR 2> /dev/null
    255         rm -f $CONFIG_DIR/$CONFIG 2> /dev/null
    256         rm -f $CONFIG_DIR/$CONFIG_FILES 2> /dev/null
     253    if ! tar -tf VirtualBox.tar > ${CONFIG_DIR}/$CONFIG_FILES; then
     254        rmdir ${INSTALLATION_DIR} 2> /dev/null
     255        rm -f ${CONFIG_DIR}/$CONFIG 2> /dev/null
     256        rm -f ${CONFIG_DIR}/$CONFIG_FILES 2> /dev/null
    257257        log 'Error running "bzip2 -d -c VirtualBox.tar.bz2" or "tar -tf VirtualBox.tar".'
    258258        abort "Error installing VirtualBox.  Installation aborted"
     
    260260
    261261    # Create installation directory and install
    262     if ! tar -xf VirtualBox.tar -C $INSTALLATION_DIR; then
     262    if ! tar -xf VirtualBox.tar -C ${INSTALLATION_DIR}; then
    263263        cwd=`pwd`
    264         cd $INSTALLATION_DIR
    265         rm -f `cat $CONFIG_DIR/$CONFIG_FILES` 2> /dev/null
     264        cd ${INSTALLATION_DIR}
     265        rm -f `cat ${CONFIG_DIR}/$CONFIG_FILES` 2> /dev/null
    266266        cd $pwd
    267         rmdir $INSTALLATION_DIR 2> /dev/null
    268         rm -f $CONFIG_DIR/$CONFIG 2> /dev/null
     267        rmdir ${INSTALLATION_DIR} 2> /dev/null
     268        rm -f ${CONFIG_DIR}/$CONFIG 2> /dev/null
    269269        log 'Error running "tar -xf VirtualBox.tar -C '"$INSTALLATION_DIR"'".'
    270270        abort "Error installing VirtualBox.  Installation aborted"
    271271    fi
    272272
    273     cp uninstall.sh $INSTALLATION_DIR
    274     echo "uninstall.sh" >> $CONFIG_DIR/$CONFIG_FILES
     273    cp uninstall.sh ${INSTALLATION_DIR}
     274    echo "uninstall.sh" >> ${CONFIG_DIR}/$CONFIG_FILES
    275275
    276276    # Hardened build: Mark selected binaries set-user-ID-on-execution,
     
    278278    #                 and finally make sure the directory is only writable by the user (paranoid).
    279279    if [ -n "$HARDENED" ]; then
    280         if [ -f $INSTALLATION_DIR/VirtualBoxVM ]; then
    281             test -e $INSTALLATION_DIR/VirtualBoxVM   && chmod 4511 $INSTALLATION_DIR/VirtualBoxVM
     280        if [ -f "$INSTALLATION_DIR/VirtualBoxVM" ]; then
     281            test -e ${INSTALLATION_DIR}/VirtualBoxVM   && chmod 4511 ${INSTALLATION_DIR}/VirtualBoxVM
    282282        else
    283             test -e $INSTALLATION_DIR/VirtualBox     && chmod 4511 $INSTALLATION_DIR/VirtualBox
     283            test -e ${INSTALLATION_DIR}/VirtualBox     && chmod 4511 ${INSTALLATION_DIR}/VirtualBox
    284284        fi
    285         test -e $INSTALLATION_DIR/VBoxSDL        && chmod 4511 $INSTALLATION_DIR/VBoxSDL
    286         test -e $INSTALLATION_DIR/VBoxHeadless   && chmod 4511 $INSTALLATION_DIR/VBoxHeadless
    287         test -e $INSTALLATION_DIR/VBoxNetDHCP    && chmod 4511 $INSTALLATION_DIR/VBoxNetDHCP
    288         test -e $INSTALLATION_DIR/VBoxNetNAT     && chmod 4511 $INSTALLATION_DIR/VBoxNetNAT
    289 
    290         ln -sf $INSTALLATION_DIR/VBoxVMM.so   $INSTALLATION_DIR/components/VBoxVMM.so
    291         ln -sf $INSTALLATION_DIR/VBoxRT.so    $INSTALLATION_DIR/components/VBoxRT.so
    292 
    293         chmod go-w $INSTALLATION_DIR
     285        test -e ${INSTALLATION_DIR}/VBoxSDL        && chmod 4511 ${INSTALLATION_DIR}/VBoxSDL
     286        test -e ${INSTALLATION_DIR}/VBoxHeadless   && chmod 4511 ${INSTALLATION_DIR}/VBoxHeadless
     287        test -e ${INSTALLATION_DIR}/VBoxNetDHCP    && chmod 4511 ${INSTALLATION_DIR}/VBoxNetDHCP
     288        test -e ${INSTALLATION_DIR}/VBoxNetNAT     && chmod 4511 ${INSTALLATION_DIR}/VBoxNetNAT
     289
     290        ln -sf ${INSTALLATION_DIR}/VBoxVMM.so   ${INSTALLATION_DIR}/components/VBoxVMM.so
     291        ln -sf ${INSTALLATION_DIR}/VBoxRT.so    ${INSTALLATION_DIR}/components/VBoxRT.so
     292
     293        chmod go-w ${INSTALLATION_DIR}
    294294    fi
    295295
    296296    # This binaries need to be suid root in any case, even if not hardened
    297     test -e $INSTALLATION_DIR/VBoxNetAdpCtl && chmod 4511 $INSTALLATION_DIR/VBoxNetAdpCtl
    298     test -e $INSTALLATION_DIR/VBoxVolInfo && chmod 4511 $INSTALLATION_DIR/VBoxVolInfo
     297    test -e ${INSTALLATION_DIR}/VBoxNetAdpCtl && chmod 4511 ${INSTALLATION_DIR}/VBoxNetAdpCtl
     298    test -e ${INSTALLATION_DIR}/VBoxVolInfo && chmod 4511 ${INSTALLATION_DIR}/VBoxVolInfo
    299299
    300300    # Write the configuration.  Needs to be done before the vboxdrv service is
    301301    # started.
    302     echo "# VirtualBox installation directory" > $CONFIG_DIR/$CONFIG
    303     echo "INSTALL_DIR='$INSTALLATION_DIR'" >> $CONFIG_DIR/$CONFIG
    304     echo "# VirtualBox version" >> $CONFIG_DIR/$CONFIG
    305     echo "INSTALL_VER='$VERSION'" >> $CONFIG_DIR/$CONFIG
    306     echo "INSTALL_REV='$SVNREV'" >> $CONFIG_DIR/$CONFIG
    307     echo "# Build type and user name for logging purposes" >> $CONFIG_DIR/$CONFIG
    308     echo "BUILD_TYPE='$BUILD_BUILDTYPE'" >> $CONFIG_DIR/$CONFIG
    309     echo "USERNAME='$BUILD_USERNAME'" >> $CONFIG_DIR/$CONFIG
     302    echo "# VirtualBox installation directory" > ${CONFIG_DIR}/$CONFIG
     303    echo "INSTALL_DIR='${INSTALLATION_DIR}'" >> ${CONFIG_DIR}/$CONFIG
     304    echo "# VirtualBox version" >> ${CONFIG_DIR}/$CONFIG
     305    echo "INSTALL_VER='$VERSION'" >> ${CONFIG_DIR}/$CONFIG
     306    echo "INSTALL_REV='$SVNREV'" >> ${CONFIG_DIR}/$CONFIG
     307    echo "# Build type and user name for logging purposes" >> ${CONFIG_DIR}/$CONFIG
     308    echo "BUILD_TYPE='$BUILD_BUILDTYPE'" >> ${CONFIG_DIR}/$CONFIG
     309    echo "USERNAME='$BUILD_USERNAME'" >> ${CONFIG_DIR}/$CONFIG
    310310
    311311    # Create users group
     
    313313
    314314    # Create symlinks to start binaries
    315     ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VirtualBox
    316     if [ -f $INSTALLATION_DIR/VirtualBoxVM ]; then
    317         ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VirtualBoxVM
    318     fi
    319     ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxManage
    320     ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxSDL
    321     ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxVRDP
    322     ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxHeadless
    323     ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxBalloonCtrl
    324     ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxBugReport
    325     ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxAutostart
    326     ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/vboxwebsrv
    327     ln -sf $INSTALLATION_DIR/vbox-img /usr/bin/vbox-img
    328     ln -sf $INSTALLATION_DIR/VBox.png /usr/share/pixmaps/VBox.png
    329     if [ -f $INSTALLATION_DIR/VBoxDTrace ]; then
    330         ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxDTrace
     315    ln -sf ${INSTALLATION_DIR}/VBox.sh /usr/bin/VirtualBox
     316    if [ -f "$INSTALLATION_DIR/VirtualBoxVM" ]; then
     317        ln -sf ${INSTALLATION_DIR}/VBox.sh /usr/bin/VirtualBoxVM
     318    fi
     319    ln -sf ${INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxManage
     320    ln -sf ${INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxSDL
     321    ln -sf ${INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxVRDP
     322    ln -sf ${INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxHeadless
     323    ln -sf ${INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxBalloonCtrl
     324    ln -sf ${INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxBugReport
     325    ln -sf ${INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxAutostart
     326    ln -sf ${INSTALLATION_DIR}/VBox.sh /usr/bin/vboxwebsrv
     327    ln -sf ${INSTALLATION_DIR}/vbox-img /usr/bin/vbox-img
     328    ln -sf ${INSTALLATION_DIR}/VBox.png /usr/share/pixmaps/VBox.png
     329    if [ -f "$INSTALLATION_DIR/VBoxDTrace" ]; then
     330        ln -sf ${INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxDTrace
    331331    fi
    332332    # Unity and Nautilus seem to look here for their icons
    333     ln -sf $INSTALLATION_DIR/icons/128x128/virtualbox.png /usr/share/pixmaps/virtualbox.png
    334     ln -sf $INSTALLATION_DIR/virtualbox.desktop /usr/share/applications/virtualbox.desktop
    335     ln -sf $INSTALLATION_DIR/virtualbox.xml /usr/share/mime/packages/virtualbox.xml
    336     ln -sf $INSTALLATION_DIR/rdesktop-vrdp /usr/bin/rdesktop-vrdp
    337     ln -sf $INSTALLATION_DIR/src/vboxhost /usr/src/vboxhost-_VERSION_
     333    ln -sf ${INSTALLATION_DIR}/icons/128x128/virtualbox.png /usr/share/pixmaps/virtualbox.png
     334    ln -sf ${INSTALLATION_DIR}/virtualbox.desktop /usr/share/applications/virtualbox.desktop
     335    ln -sf ${INSTALLATION_DIR}/virtualbox.xml /usr/share/mime/packages/virtualbox.xml
     336    ln -sf ${INSTALLATION_DIR}/rdesktop-vrdp /usr/bin/rdesktop-vrdp
     337    ln -sf ${INSTALLATION_DIR}/src/vboxhost /usr/src/vboxhost-_VERSION_
    338338
    339339    # Convenience symlinks. The creation fails if the FS is not case sensitive
    340340    ln -sf VirtualBox /usr/bin/virtualbox > /dev/null 2>&1
    341     if [ -f $INSTALLATION_DIR/VirtualBoxVM ]; then
     341    if [ -f "$INSTALLATION_DIR/VirtualBoxVM" ]; then
    342342        ln -sf VirtualBoxVM /usr/bin/virtualboxvm > /dev/null 2>&1
    343343    fi
     
    346346    ln -sf VBoxHeadless /usr/bin/vboxheadless > /dev/null 2>&1
    347347    ln -sf VBoxBugReport /usr/bin/vboxbugreport > /dev/null 2>&1
    348     if [ -f $INSTALLATION_DIR/VBoxDTrace ]; then
     348    if [ -f "$INSTALLATION_DIR/VBoxDTrace" ]; then
    349349        ln -sf VBoxDTrace /usr/bin/vboxdtrace > /dev/null 2>&1
    350350    fi
    351351
    352352    # Create legacy symlinks if necesary for Qt5/xcb stuff.
    353     if [ -d $INSTALLATION_DIR/legacy ]; then
     353    if [ -d "$INSTALLATION_DIR/legacy" ]; then
    354354        if ! /sbin/ldconfig -p | grep -q "\<libxcb\.so\.1\>"; then
    355             for f in `ls -1 $INSTALLATION_DIR/legacy/`; do
    356                 ln -s $INSTALLATION_DIR/legacy/$f $INSTALLATION_DIR/$f
    357                 echo $INSTALLATION_DIR/$f >> $CONFIG_DIR/$CONFIG_FILES
     355            for f in `ls -1 ${INSTALLATION_DIR}/legacy/`; do
     356                ln -s ${INSTALLATION_DIR}/legacy/$f ${INSTALLATION_DIR}/$f
     357                echo ${INSTALLATION_DIR}/$f >> ${CONFIG_DIR}/$CONFIG_FILES
    358358            done
    359359        fi
     
    362362    # Icons
    363363    cur=`pwd`
    364     cd $INSTALLATION_DIR/icons
     364    cd ${INSTALLATION_DIR}/icons
    365365    for i in *; do
    366366        cd $i
     
    373373                fi
    374374                if [ -d /usr/share/icons/hicolor/$i/$dst ]; then
    375                     ln -s $INSTALLATION_DIR/icons/$i/$j /usr/share/icons/hicolor/$i/$dst/$j
    376                     echo /usr/share/icons/hicolor/$i/$dst/$j >> $CONFIG_DIR/$CONFIG_FILES
     375                    ln -s ${INSTALLATION_DIR}/icons/$i/$j /usr/share/icons/hicolor/$i/$dst/$j
     376                    echo /usr/share/icons/hicolor/$i/$dst/$j >> ${CONFIG_DIR}/$CONFIG_FILES
    377377                fi
    378378            done
     
    390390    # If Python is available, install Python bindings
    391391    if [ -n "$PYTHON" ]; then
    392       maybe_run_python_bindings_installer $INSTALLATION_DIR $CONFIG_DIR $CONFIG_FILES
     392      maybe_run_python_bindings_installer ${INSTALLATION_DIR} ${CONFIG_DIR} $CONFIG_FILES
    393393    fi
    394394
    395395    # Do post-installation common to all installer types, currently service
    396396    # script set-up.
    397     if test "${BUILD_MODULE}" = "true"; then
     397    if test "$BUILD_MODULE" = "true"; then
    398398      START_SERVICES=
    399399    else
    400400      START_SERVICES="--nostart"
    401401    fi
    402     "${INSTALLATION_DIR}/prerm-common.sh" >> "${LOG}"
     402    "$INSTALLATION_DIR/prerm-common.sh" >> "$LOG"
    403403
    404404    # Now check whether the kernel modules were stopped.
    405405    lsmod | grep -q vboxdrv && MODULES_STOPPED=
    406406
    407     "${INSTALLATION_DIR}/postinst-common.sh" ${START_SERVICES} >> "${LOG}"
     407    "$INSTALLATION_DIR/postinst-common.sh" ${START_SERVICES} >> "$LOG"
    408408
    409409    info ""
     
    420420    # And do a final test as to whether the kernel modules were properly created
    421421    # and loaded.  Return 0 if both are true, 1 if not.
    422     test -n "${MODULES_STOPPED}" &&
     422    test -n "$MODULES_STOPPED" &&
    423423        modinfo vboxdrv >/dev/null 2>&1 &&
    424424        lsmod | grep -q vboxdrv ||
  • trunk/src/VBox/Installer/linux/postinst-common.sh

    r76553 r76610  
    3030TARGET=`readlink -e -- "${0}"` || exit 1
    3131MY_PATH="${TARGET%/[!/]*}"
    32 cd "${MY_PATH}"
     32cd "$MY_PATH"
    3333. "./routines.sh"
    3434
     
    5353
    5454# Install runlevel scripts and systemd unit files
    55 install_init_script "${MY_PATH}/vboxdrv.sh" vboxdrv
    56 install_init_script "${MY_PATH}/vboxballoonctrl-service.sh" vboxballoonctrl-service
    57 install_init_script "${MY_PATH}/vboxautostart-service.sh" vboxautostart-service
    58 install_init_script "${MY_PATH}/vboxweb-service.sh" vboxweb-service
     55install_init_script "$MY_PATH/vboxdrv.sh" vboxdrv
     56install_init_script "$MY_PATH/vboxballoonctrl-service.sh" vboxballoonctrl-service
     57install_init_script "$MY_PATH/vboxautostart-service.sh" vboxautostart-service
     58install_init_script "$MY_PATH/vboxweb-service.sh" vboxweb-service
    5959finish_init_script_install
    6060
     
    6868addrunlevel vboxweb-service
    6969
    70 ln -sf "${MY_PATH}/postinst-common.sh" /sbin/vboxconfig
     70ln -sf "$MY_PATH/postinst-common.sh" /sbin/vboxconfig
    7171
    7272# Set SELinux permissions
    7373# XXX SELinux: allow text relocation entries
    7474if [ -x /usr/bin/chcon ]; then
    75     chcon -t texrel_shlib_t "${MY_PATH}"/*VBox* > /dev/null 2>&1
    76     chcon -t texrel_shlib_t "${MY_PATH}"/VBoxAuth.so \
     75    chcon -t texrel_shlib_t ${MY_PATH}/*VBox* > /dev/null 2>&1
     76    chcon -t texrel_shlib_t ${MY_PATH}/VBoxAuth.so \
    7777        > /dev/null 2>&1
    78     chcon -t texrel_shlib_t "${MY_PATH}"/VirtualBox.so \
     78    chcon -t texrel_shlib_t ${MY_PATH}/VirtualBox.so \
    7979        > /dev/null 2>&1
    80     chcon -t texrel_shlib_t "${MY_PATH}"/components/VBox*.so \
     80    chcon -t texrel_shlib_t ${MY_PATH}/components/VBox*.so \
    8181        > /dev/null 2>&1
    82     chcon -t java_exec_t    "${MY_PATH}"/VirtualBox > /dev/null 2>&1
    83     chcon -t java_exec_t    "${MY_PATH}"/VBoxSDL > /dev/null 2>&1
    84     chcon -t java_exec_t    "${MY_PATH}"/VBoxHeadless \
     82    chcon -t java_exec_t    ${MY_PATH}/VirtualBox > /dev/null 2>&1
     83    chcon -t java_exec_t    ${MY_PATH}/VBoxSDL > /dev/null 2>&1
     84    chcon -t java_exec_t    ${MY_PATH}/VBoxHeadless \
    8585        > /dev/null 2>&1
    86     chcon -t java_exec_t    "${MY_PATH}"/VBoxNetDHCP \
     86    chcon -t java_exec_t    ${MY_PATH}/VBoxNetDHCP \
    8787        > /dev/null 2>&1
    88     chcon -t java_exec_t    "${MY_PATH}"/VBoxNetNAT \
     88    chcon -t java_exec_t    ${MY_PATH}/VBoxNetNAT \
    8989        > /dev/null 2>&1
    90     chcon -t java_exec_t    "${MY_PATH}"/VBoxExtPackHelperApp \
     90    chcon -t java_exec_t    ${MY_PATH}/VBoxExtPackHelperApp \
    9191        > /dev/null 2>&1
    92     chcon -t java_exec_t    "${MY_PATH}"/vboxwebsrv > /dev/null 2>&1
    93     chcon -t bin_t          "${MY_PATH}"/src/vboxhost/build_in_tmp \
     92    chcon -t java_exec_t    ${MY_PATH}/vboxwebsrv > /dev/null 2>&1
     93    chcon -t bin_t          ${MY_PATH}/src/vboxhost/build_in_tmp \
    9494         > /dev/null 2>&1
    9595    chcon -t bin_t          /usr/share/virtualbox/src/vboxhost/build_in_tmp \
     
    9797fi
    9898
    99 test -n "${START}" &&
     99test -n "$START" &&
    100100{
    101     if ! "${MY_PATH}/vboxdrv.sh" setup; then
    102         "${MY_PATH}/check_module_dependencies.sh" >&2
     101    if ! "$MY_PATH/vboxdrv.sh" setup; then
     102        "$MY_PATH/check_module_dependencies.sh" >&2
    103103        echo >&2
    104104        echo "There were problems setting up VirtualBox.  To re-start the set-up process, run" >&2
  • trunk/src/VBox/Installer/linux/uninstall.sh

    r76553 r76610  
    3939
    4040# Find previous installation
    41 if [ -r $CONFIG_DIR/$CONFIG ]; then
    42     . $CONFIG_DIR/$CONFIG
    43     PREV_INSTALLATION=$INSTALL_DIR
     41if [ -r "$CONFIG_DIR/$CONFIG" ]; then
     42    . ${CONFIG_DIR}/$CONFIG
     43    PREV_INSTALLATION=${INSTALL_DIR}
    4444fi
    4545
     
    9393  /usr/bin/vboxdtrace \
    9494  /usr/bin/vboxbugreport \
    95   $PREV_INSTALLATION/components/VBoxVMM.so \
    96   $PREV_INSTALLATION/components/VBoxREM.so \
    97   $PREV_INSTALLATION/components/VBoxRT.so \
    98   $PREV_INSTALLATION/components/VBoxDDU.so \
    99   $PREV_INSTALLATION/components/VBoxXPCOM.so \
     95  ${PREV_INSTALLATION}/components/VBoxVMM.so \
     96  ${PREV_INSTALLATION}/components/VBoxREM.so \
     97  ${PREV_INSTALLATION}/components/VBoxRT.so \
     98  ${PREV_INSTALLATION}/components/VBoxDDU.so \
     99  ${PREV_INSTALLATION}/components/VBoxXPCOM.so \
    100100  2> /dev/null
    101101
    102102cwd=`pwd`
    103 if [ -f $PREV_INSTALLATION/src/Makefile ]; then
    104     cd $PREV_INSTALLATION/src
     103if [ -f ${PREV_INSTALLATION}/src/Makefile ]; then
     104    cd ${PREV_INSTALLATION}/src
    105105    make clean > /dev/null 2>&1
    106106fi
    107 if [ -f $PREV_INSTALLATION/src/vboxdrv/Makefile ]; then
    108     cd $PREV_INSTALLATION/src/vboxdrv
     107if [ -f ${PREV_INSTALLATION}/src/vboxdrv/Makefile ]; then
     108    cd ${PREV_INSTALLATION}/src/vboxdrv
    109109    make clean > /dev/null 2>&1
    110110fi
    111 if [ -f $PREV_INSTALLATION/src/vboxnetflt/Makefile ]; then
    112     cd $PREV_INSTALLATION/src/vboxnetflt
     111if [ -f ${PREV_INSTALLATION}/src/vboxnetflt/Makefile ]; then
     112    cd ${PREV_INSTALLATION}/src/vboxnetflt
    113113    make clean > /dev/null 2>&1
    114114fi
    115 if [ -f $PREV_INSTALLATION/src/vboxnetadp/Makefile ]; then
    116     cd $PREV_INSTALLATION/src/vboxnetadp
     115if [ -f ${PREV_INSTALLATION}/src/vboxnetadp/Makefile ]; then
     116    cd ${PREV_INSTALLATION}/src/vboxnetadp
    117117    make clean > /dev/null 2>&1
    118118fi
    119 if [ -f $PREV_INSTALLATION/src/vboxpci/Makefile ]; then
    120     cd $PREV_INSTALLATION/src/vboxpci
     119if [ -f ${PREV_INSTALLATION}/src/vboxpci/Makefile ]; then
     120    cd ${PREV_INSTALLATION}/src/vboxpci
    121121    make clean > /dev/null 2>&1
    122122fi
    123 cd $PREV_INSTALLATION
    124 if [ -r $CONFIG_DIR/$CONFIG_FILES ]; then
    125     rm -f `cat $CONFIG_DIR/$CONFIG_FILES` 2> /dev/null
     123cd ${PREV_INSTALLATION}
     124if [ -r "$CONFIG_DIR/$CONFIG_FILES" ]; then
     125    rm -f `cat ${CONFIG_DIR}/$CONFIG_FILES` 2> /dev/null
    126126elif [ -n "$DEFAULT_FILES" -a -r "$DEFAULT_FILES" ]; then
    127127    DEFAULT_FILE_NAMES=""
     
    131131    done
    132132fi
    133 for file in `find $PREV_INSTALLATION 2> /dev/null`; do
     133for file in `find ${PREV_INSTALLATION} 2> /dev/null`; do
    134134    rmdir -p $file 2> /dev/null
    135135done
    136136cd $cwd
    137 mkdir -p $PREV_INSTALLATION 2> /dev/null # The above actually removes the current directory and parents!
    138 rmdir $PREV_INSTALLATION 2> /dev/null
    139 rm -r $CONFIG_DIR/$CONFIG 2> /dev/null
     137mkdir -p ${PREV_INSTALLATION} 2> /dev/null # The above actually removes the current directory and parents!
     138rmdir ${PREV_INSTALLATION} 2> /dev/null
     139rm -r ${CONFIG_DIR}/$CONFIG 2> /dev/null
    140140
    141141if [ -z "$VBOX_NO_UNINSTALL_MESSAGE" ]; then
    142     rm -r $CONFIG_DIR/$CONFIG_FILES 2> /dev/null
    143     rmdir $CONFIG_DIR 2> /dev/null
     142    rm -r ${CONFIG_DIR}/$CONFIG_FILES 2> /dev/null
     143    rmdir ${CONFIG_DIR} 2> /dev/null
    144144    [ -n "$INSTALL_REV" ] && INSTALL_REV=" r$INSTALL_REV"
    145145    info "VirtualBox $INSTALL_VER$INSTALL_REV has been removed successfully."
Note: See TracChangeset for help on using the changeset viewer.

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