Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37428759
en ru br
ALT Linux repos
S:7.0.10-alt2
5.0: 3.0.4-alt0.M50.1
4.1: 2.1.4-alt0.M41.5
4.0:
+backports:1.6.6-alt0.M40.2

Group :: Emulators
RPM: virtualbox

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: virtualbox-3.0.4-alt0.M50.1.patch
Download


 Config.kmk                                         |   14 +-
 configure                                          |    9 +-
 include/VBox/ostypes.h                             |    2 +
 .../Additions/linux/installer/vboxadd-service.sh   |  258 ++--------------
 src/VBox/Additions/linux/installer/vboxadd.sh      |  344 ++++----------------
 src/VBox/Devices/Makefile.kmk                      |    6 +-
 src/VBox/Devices/Storage/testcase/Makefile.kmk     |    1 +
 src/VBox/Devices/testcase/Makefile.kmk             |    4 +
 src/VBox/Frontends/VBoxBFE/Makefile.kmk            |    1 +
 src/VBox/Frontends/VBoxFB/Makefile.kmk             |    1 +
 src/VBox/Frontends/VBoxManage/Makefile.kmk         |    1 +
 src/VBox/Frontends/VBoxSDL/Makefile.kmk            |    1 +
 src/VBox/Frontends/VirtualBox/Makefile.kmk         |    1 +
 src/VBox/Frontends/VirtualBox/VirtualBox.qrc       |    2 +
 src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp   |    2 +
 .../VirtualBox/src/VBoxOSTypeSelectorWidget.cpp    |    4 +-
 src/VBox/Main/Global.cpp                           |    4 +
 src/VBox/Main/Makefile.kmk                         |    5 +
 src/VBox/Main/VMMDevInterface.cpp                  |    1 +
 src/VBox/Main/xml/SettingsConverter.xsl            |    1 +
 src/VBox/Main/xml/VirtualBox-settings-common.xsd   |    2 +
 src/VBox/Runtime/Makefile.kmk                      |   10 +-
 src/VBox/Runtime/r0drv/linux/the-linux-kernel.h    |   16 +-
 src/VBox/Runtime/r3/linux/semevent-linux.cpp       |    2 +-
 src/VBox/VMM/Makefile.kmk                          |    2 +-
 src/VBox/VMM/testcase/Makefile.kmk                 |    7 +-
 src/libs/xpcom18a4/Makefile.kmk                    |    6 +-
 src/libs/xpcom18a4/python/__init__.py              |    2 +-
 src/libs/xpcom18a4/python/components.py            |    2 +-
 src/recompiler/Makefile.kmk                        |    2 +-
 30 files changed, 172 insertions(+), 541 deletions(-)
diff --git a/Config.kmk b/Config.kmk
index 8ca2034..9341d9e 100644
--- a/Config.kmk
+++ b/Config.kmk
@@ -62,6 +62,9 @@ PROPS_DLLS_ACCUMULATE_L      += INTERMEDIATES
 PROPS_SYSMODS_ACCUMULATE_L   += INTERMEDIATES
 PROPS_MISCBINS_ACCUMULATE_L  += INTERMEDIATES
 
+# path to the units
+KBUILD_UNIT_PATHS = $(PWD)/kBuild/units
+
 # Install paths.
 PATH_INS              = $(PATH_OUT)
 ifeq ($(KBUILD_TARGET),darwin)
@@ -1358,7 +1361,7 @@ VBOX_PATH_MAKECAB   ?= $(VBOX_PATH_CABSDK)/BIN/MAKECAB.EXE
 
 # We need to export YASM for OSE, but since it was converted to .zip we need to
 # allow for the location used by the zip to be properly cleaned up first.
-if1of ($(KBUILD_HOST).$(KBUILD_HOST_ARCH),  win.x86 linux.x86 solaris.x86)
+if1of ($(KBUILD_HOST).$(KBUILD_HOST_ARCH),  win.x86 linux.x86 linux.amd64 solaris.x86)
  PATH_TOOL_YASM ?= $(PATH_DEVTOOLS_BLD)/bin
 endif
 
@@ -1929,7 +1932,14 @@ if1of ($(KBUILD_TARGET), linux)
    ifneq ($(kernelpath),)
     VBOX_LINUX_INCS                 += $(VBOX_LINUX_SRC)/include2 $(kernelpath)/include
    else
-    kernelpath := $(VBOX_LINUX_SRC)
+    # 2.6.25 format for splitted sources
+    kernelsrc := $(shell $(SED_EXT) -ne 's+^MAKEARGS := -C++p' $(VBOX_LINUX_SRC)/Makefile)
+    ifneq ($(kernelsrc),)
+     kernelpath := $(realpath $(VBOX_LINUX_SRC)/$(kernelsrc))
+     VBOX_LINUX_INCS                 += $(VBOX_LINUX_SRC)/include2 $(kernelpath)/include
+    else
+     kernelpath := $(VBOX_LINUX_SRC)
+    endif
    endif
    VBOX_LINUX_INCS                  += $(kernelpath)/include/asm-i386/mach-default \
                                        $(kernelpath)/include/asm-x86/mach-default \
diff --git a/configure b/configure
index 420e4b2..1250cfc 100755
--- a/configure
+++ b/configure
@@ -1658,12 +1658,11 @@ EOF
   echo "$CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
   $CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
   if [ $? -ne 0 ]; then
-    echo
-    echo "  Cannot compile 32-bit applications (missing headers and/or libraries)!"
-    echo "  Check the file $LOG for detailed error information."
-    fail
+    cnf_append "VBOX_WITHOUT_BIARCH" "1"
+    log_success "no"
+  else
+    log_success "yes"
   fi
-  log_success ""
 }
 
 
diff --git a/include/VBox/ostypes.h b/include/VBox/ostypes.h
index ff6b720..1d86e2f 100644
--- a/include/VBox/ostypes.h
+++ b/include/VBox/ostypes.h
@@ -97,6 +97,8 @@ typedef enum VBOXOSTYPE
     VBOXOSTYPE_Ubuntu_x64       = 0x5C100,
     VBOXOSTYPE_Xandros          = 0x5D000,
     VBOXOSTYPE_Xandros_x64      = 0x5D100,
+    VBOXOSTYPE_ALTLinux         = 0x5E000,
+    VBOXOSTYPE_ALTLinux_x64     = 0x5E100,
     VBOXOSTYPE_FreeBSD          = 0x60000,
     VBOXOSTYPE_FreeBSD_x64      = 0x60100,
     VBOXOSTYPE_OpenBSD          = 0x61000,
diff --git a/src/VBox/Additions/linux/installer/vboxadd-service.sh b/src/VBox/Additions/linux/installer/vboxadd-service.sh
index 2872d4d..aa81d0b 100755
--- a/src/VBox/Additions/linux/installer/vboxadd-service.sh
+++ b/src/VBox/Additions/linux/installer/vboxadd-service.sh
@@ -30,250 +30,41 @@
 # Description:    VirtualBox Additions Service
 ### END INIT INFO
 
-PATH=$PATH:/bin:/sbin:/usr/sbin
+# Do not load RH compatibility interface.
+WITHOUT_RC_COMPAT=1
 
-system=unknown
-if [ -f /etc/redhat-release ]; then
-    system=redhat
-    PIDFILE="/var/lock/subsys/vboxadd-service"
-elif [ -f /etc/SuSE-release ]; then
-    system=suse
-    PIDFILE="/var/lock/subsys/vboxadd-service"
-elif [ -f /etc/debian_version ]; then
-    system=debian
-    PIDFILE="/var/run/vboxadd-service"
-elif [ -f /etc/gentoo-release ]; then
-    system=gentoo
-    PIDFILE="/var/run/vboxadd-service"
-elif [ -f /etc/arch-release ]; then
-     system=arch
-     PIDFILE="/var/run/vboxadd-service"
-elif [ -f /etc/slackware-version ]; then
-    system=slackware
-    PIDFILE="/var/run/vboxadd-service"
-elif [ -f /etc/lfs-release ]; then
-    system=lfs
-    PIDFILE="/var/run/vboxadd-service.pid"
-else
-    system=other
-    if [ -d /var/run -a -w /var/run ]; then
-        PIDFILE="/var/run/vboxadd-service"
-    fi
-fi
-
-if [ "$system" = "redhat" ]; then
-    . /etc/init.d/functions
-    fail_msg() {
-        echo_failure
-        echo
-    }
-
-    succ_msg() {
-        echo_success
-        echo
-    }
-
-    begin() {
-        echo -n "$1"
-    }
-fi
-
-if [ "$system" = "suse" ]; then
-    . /etc/rc.status
-    daemon() {
-        startproc ${1+"$@"}
-    }
-
-    fail_msg() {
-        rc_failed 1
-        rc_status -v
-    }
-
-    succ_msg() {
-        rc_reset
-        rc_status -v
-    }
-
-    begin() {
-        echo -n "$1"
-    }
-fi
-
-if [ "$system" = "debian" ]; then
-    daemon() {
-        start-stop-daemon --start --exec $1 -- $2
-    }
-
-    killproc() {
-        start-stop-daemon --stop --exec $@
-    }
-
-    fail_msg() {
-        echo " ...fail!"
-    }
-
-    succ_msg() {
-        echo " ...done."
-    }
-
-    begin() {
-        echo -n "$1"
-    }
-fi
-
-if [ "$system" = "gentoo" ]; then
-    . /sbin/functions.sh
-    daemon() {
-        start-stop-daemon --start --exec $1 -- $2
-    }
-
-    killproc() {
-        start-stop-daemon --stop --exec $@
-    }
-
-    fail_msg() {
-        echo " ...fail!"
-    }
-
-    succ_msg() {
-        echo " ...done."
-    }
-
-    begin() {
-        echo -n "$1"
-    }
-
-    if [ "`which $0`" = "/sbin/rc" ]; then
-        shift
-    fi
-fi
-
-if [ "$system" = "arch" ]; then
-    USECOLOR=yes
-    . /etc/rc.d/functions
-    daemon() {
-        $@
-        test $? -eq 0 && add_daemon rc.`basename $1`
-    }
-
-    killproc() {
-        killall $@
-        rm_daemon `basename $@`
-    }
+# Source function library.
+. /etc/init.d/functions
 
-    fail_msg() {
-        stat_fail
-    }
+LOCKFILE="/var/lock/subsys/vboxadd-service"
+PIDFILE="/var/run/vboxadd-service"
+RETVAL=0
 
-    succ_msg() {
-        stat_done
-    }
+# Source ntpd configuration.
+VBOXADD_SERVICE_ARGS=""
+SourceIfNotEmpty /etc/sysconfig/vboxadd-service
 
-    begin() {
-        stat_busy "$1"
-    }
-
-fi
-
-if [ "$system" = "slackware" ]; then
-    daemon() {
-        $1 $2
-    }
-
-    killproc() {
-        killall $1
-        rm -f $PIDFILE
-    }
-
-    fail_msg() {
-        echo " ...fail!"
-    }
-
-    succ_msg() {
-        echo " ...done."
-    }
-
-    begin() {
-        echo -n "$1"
-    }
-
-fi
-
-if [ "$system" = "lfs" ]; then
-    . /etc/rc.d/init.d/functions
-    daemon() {
-        loadproc $1 $2
-    }
-
-    fail_msg() {
-        echo_failure
-    }
-
-    succ_msg() {
-        echo_ok
-    }
-
-    begin() {
-        echo $1
-    }
-
-    status() {
-        statusproc $1
-    }
-fi
-
-if [ "$system" = "other" ]; then
-    fail_msg() {
-        echo " ...fail!"
-    }
-
-    succ_msg() {
-        echo " ...done."
-    }
-
-    begin() {
-        echo -n "$1"
-    }
-fi
-
-binary=/usr/sbin/vboxadd-service
-
-test -x "$binary" || {
-    echo "Cannot run $binary"
-    exit 1
-}
+binary=vboxadd-service
 
 vboxaddrunning() {
     lsmod | grep -q "vboxadd[^_-]"
 }
 
 start() {
-    if ! test -f $PIDFILE; then
-        begin "Starting VirtualBox Guest Addition service ";
-        vboxaddrunning || {
-            echo "VirtualBox Additions module not loaded!"
-            exit 1
-        }
-        daemon $binary
+    if vboxaddrunning; then
+        start_daemon --displayname "VirtualBox Guest Addition service" \
+            --make-pidfile --pidfile "$PIDFILE" --lockfile "$LOCKFILE" -- $binary -f $VBOXADD_SERVICE_ARGS
         RETVAL=$?
-        test $RETVAL -eq 0 && echo `pidof vboxadd-service` > $PIDFILE
-        succ_msg
+    else
+        echo "VirtualBox Additions module not loaded!"
+        RETVAL=2
     fi
     return $RETVAL
 }
 
 stop() {
-    if test -f $PIDFILE; then
-        begin "Stopping VirtualBox Guest Addition service ";
-        vboxaddrunning || {
-            echo "VirtualBox Additions module not loaded!"
-            exit 1
-        }
-        killproc $binary
-        RETVAL=$?
-        test $RETVAL -eq 0 && rm -f $PIDFILE
-        succ_msg
-    fi
+    stop_daemon --displayname "VirtualBox Guest Addition service" --pidfile "$PIDFILE" --lockfile "$LOCKFILE" -- $binary
+    RETVAL=$?
     return $RETVAL
 }
 
@@ -281,15 +72,6 @@ restart() {
     stop && start
 }
 
-    status() {
-        echo -n "Checking for vboxadd-service"
-        if [ -f $PIDFILE ]; then
-            echo " ...running"
-        else
-            echo " ...not running"
-        fi
-    }
-
 case "$1" in
 start)
     start
@@ -301,7 +83,7 @@ restart)
     restart
     ;;
 status)
-    status
+    status --displayname "VirtualBox Guest Addition service" --pidfile "$PIDFILE" -- $binary
     ;;
 *)
     echo "Usage: $0 {start|stop|restart|status}"
diff --git a/src/VBox/Additions/linux/installer/vboxadd.sh b/src/VBox/Additions/linux/installer/vboxadd.sh
index e54d7ed..b4fa45b 100755
--- a/src/VBox/Additions/linux/installer/vboxadd.sh
+++ b/src/VBox/Additions/linux/installer/vboxadd.sh
@@ -30,132 +30,14 @@
 # Description:    VirtualBox Linux Additions kernel modules
 ### END INIT INFO
 
-PATH=$PATH:/bin:/sbin:/usr/sbin
-BUILDVBOXADD=`/bin/ls /usr/src/vboxadd*/build_in_tmp 2>/dev/null|cut -d' ' -f1`
-BUILDVBOXVFS=`/bin/ls /usr/src/vboxvfs*/build_in_tmp 2>/dev/null|cut -d' ' -f1`
-BUILDVBOXVIDEO=`/bin/ls /usr/src/vboxvideo*/build_in_tmp 2>/dev/null|cut -d' ' -f1`
-LOG="/var/log/vboxadd-install.log"
+# Do not load RH compatibility interface.
+WITHOUT_RC_COMPAT=1
 
-if [ -f /etc/arch-release ]; then
-    system=arch
-elif [ -f /etc/redhat-release ]; then
-    system=redhat
-elif [ -f /etc/SuSE-release ]; then
-    system=suse
-elif [ -f /etc/gentoo-release ]; then
-    system=gentoo
-elif [ -f /etc/lfs-release -a -d /etc/rc.d/init.d ]; then
-    system=lfs
-else
-    system=other
-fi
+# Source function library.
+. /etc/init.d/functions
 
-if [ "$system" = "arch" ]; then
-    USECOLOR=yes
-    . /etc/rc.d/functions
-    fail_msg() {
-        stat_fail
-    }
-
-    succ_msg() {
-        stat_done
-    }
-
-    begin() {
-        stat_busy "$1"
-    }
-fi
-
-if [ "$system" = "redhat" ]; then
-    . /etc/init.d/functions
-    fail_msg() {
-        echo_failure
-        echo
-    }
-    succ_msg() {
-        echo_success
-        echo
-    }
-    begin() {
-        echo -n "$1"
-    }
-fi
-
-if [ "$system" = "suse" ]; then
-    . /etc/rc.status
-    fail_msg() {
-        rc_failed 1
-        rc_status -v
-    }
-    succ_msg() {
-        rc_reset
-        rc_status -v
-    }
-    begin() {
-        echo -n "$1"
-    }
-fi
-
-if [ "$system" = "gentoo" ]; then
-    if [ -f /sbin/functions.sh ]; then
-        . /sbin/functions.sh
-    elif [ -f /etc/init.d/functions.sh ]; then
-        . /etc/init.d/functions.sh
-    fi
-    fail_msg() {
-        eend 1
-    }
-    succ_msg() {
-        eend $?
-    }
-    begin() {
-        ebegin $1
-    }
-    if [ "`which $0`" = "/sbin/rc" ]; then
-        shift
-    fi
-fi
-
-if [ "$system" = "lfs" ]; then
-    . /etc/rc.d/init.d/functions
-    fail_msg() {
-        echo_failure
-    }
-    succ_msg() {
-        echo_ok
-    }
-    begin() {
-        echo $1
-    }
-fi
-
-if [ "$system" = "other" ]; then
-    fail_msg() {
-        echo " ...fail!"
-    }
-    succ_msg() {
-        echo " ...done."
-    }
-    begin() {
-        echo -n $1
-    }
-fi
-
-dev=/dev/vboxadd
-userdev=/dev/vboxuser
-owner=vboxadd
-group=1
-
-fail()
-{
-    if [ "$system" = "gentoo" ]; then
-        eerror $1
-        exit 1
-    fi
-    fail_msg
-    echo "($1)"
-    exit 1
-}
+LOCKFILE=/var/lock/subsys/virtualbox-addition
+RETVAL=0
 
 running_vboxadd()
 {
@@ -167,183 +49,87 @@ running_vboxvfs()
     lsmod | grep -q "vboxvfs[^_-]"
 }
 
-start()
+running_vboxvideo()
 {
-    begin "Starting VirtualBox Additions ";
-    running_vboxadd || {
-        rm -f $dev || {
-            fail "Cannot remove $dev"
-        }
-
-        rm -f $userdev || {
-            fail "Cannot remove $userdev"
-        }
-
-        modprobe vboxadd >/dev/null 2>&1 || {
-            fail "modprobe vboxadd failed"
-        }
-        sleep .5
-    }
-    if [ ! -c $dev ]; then
-        maj=`sed -n 's;\([0-9]\+\) vboxadd;\1;p' /proc/devices`
-        if [ ! -z "$maj" ]; then
-            min=0
-        else
-            min=`sed -n 's;\([0-9]\+\) vboxadd;\1;p' /proc/misc`
-            if [ ! -z "$min" ]; then
-                maj=10
-            fi
-        fi
-        test -z "$maj" && {
-            rmmod vboxadd 2>/dev/null
-            fail "Cannot locate the VirtualBox device"
-        }
-
-        mknod -m 0664 $dev c $maj $min || {
-            rmmod vboxadd 2>/dev/null
-            fail "Cannot create device $dev with major $maj and minor $min"
-        }
-    fi
-    chown $owner:$group $dev 2>/dev/null || {
-        rm -f $dev 2>/dev/null
-        rm -f $userdev 2>/dev/null
-        rmmod vboxadd 2>/dev/null
-        fail "Cannot change owner $owner:$group for device $dev"
-    }
+    lsmod | grep -q "vboxvideo[^_-]"
+}
 
-    if [ ! -c $userdev ]; then
-        maj=10
-        min=`sed -n 's;\([0-9]\+\) vboxuser;\1;p' /proc/misc`
-        if [ ! -z "$min" ]; then
-            mknod -m 0666 $userdev c $maj $min || {
-                rm -f $dev 2>/dev/null
-                rmmod vboxadd 2>/dev/null
-                fail "Cannot create device $userdev with major $maj and minor $min"
-            }
-            chown $owner:$group $userdev 2>/dev/null || {
-                rm -f $dev 2>/dev/null
-                rm -f $userdev 2>/dev/null
-                rmmod vboxadd 2>/dev/null
-                fail "Cannot change owner $owner:$group for device $userdev"
-            }
+start()
+{
+    action "Loading VirtualBox module (vboxadd):" modprobe vboxadd 
+    RETVAL=$?
+    if [ $RETVAL = 0 ]; then
+        action "Loading VirtualBox module (vboxvfs):" modprobe vboxvfs
+        RETVAL=$?
+        if [ $RETVAL = 0 ]; then
+            action "Mount VirtualBox Share Folders:" mount -a -t vboxsf
+            action "Loading VirtualBox module (vboxvideo):" modprobe vboxvideo
+            RETVAL=$?
         fi
     fi
-
-    if [ -n "$BUILDVBOXVFS" ]; then
-        running_vboxvfs || {
-            modprobe vboxvfs > /dev/null 2>&1 || {
-                if dmesg | grep "vboxConnect failed" > /dev/null 2>&1; then
-                    fail_msg
-                    echo "Unable to start shared folders support.  Make sure that your VirtualBox build"
-                    echo "supports this feature."
-                    exit 1
-                fi
-                fail "modprobe vboxvfs failed"
-            }
-        }
-    fi
-
-    # Mount all shared folders from /etc/fstab. Normally this is done by some
-    # other startup script but this requires the vboxdrv kernel module loaded.
-    mount -a -t vboxsf
-
-    succ_msg
-    return 0
+    [ $RETVAL = 0 ] && touch "$LOCKFILE" ||:
+    return $RETVAL
 }
 
 stop()
 {
-    begin "Stopping VirtualBox Additions ";
-    if !umount -a -t vboxsf 2>/dev/null; then
-        fail "Cannot unmount vboxsf folders"
-    fi
-    if [ -n "$BUILDVBOXVFS" ]; then
-        if running_vboxvfs; then
-            rmmod vboxvfs 2>/dev/null || fail "Cannot unload module vboxvfs"
-        fi
-    fi
-    if running_vboxadd; then
-        rmmod vboxadd 2>/dev/null || fail "Cannot unload module vboxadd"
-        rm -f $userdev || fail "Cannot unlink $userdev"
-        rm -f $dev || fail "Cannot unlink $dev"
-    fi
-    succ_msg
-    return 0
+    local RETVAL1 RETVAL2 RETVAL3
+    action "Unmount VirtualBox Share Folders:" umount -a -t vboxsf
+    action "Unloading VirtualBox module (vboxvideo):" modprobe -r vboxvideo || RETVAL3=$?
+    action "Unloading VirtualBox module (vboxvfs):" modprobe -r vboxvfs || RETVAL2=$?
+    action "Unloading VirtualBox module (vboxadd):" modprobe -r vboxadd || RETVAL1=$?
+    [ $RETVAL3 = 0 ] || RETVAL=$RETVAL3
+    [ $RETVAL2 = 0 ] || RETVAL=$RETVAL2
+    [ $RETVAL1 = 0 ] || RETVAL=$RETVAL1
+    [ $RETVAL = 0 ] && rm -f "$LOCKFILE" ||:
+    return $RETVAL
 }
 
 restart()
 {
     stop && start
-    return 0
 }
 
-setup()
-{
-    # don't stop the old modules here -- they might be in use
-    if find /lib/modules/`uname -r` -name "vboxvfs\.*" 2>/dev/null|grep -q vboxvfs; then
-        begin "Removing old VirtualBox vboxvfs kernel module"
-        find /lib/modules/`uname -r` -name "vboxvfs\.*" 2>/dev/null|xargs rm -f 2>/dev/null
-        succ_msg
-    fi
-    if find /lib/modules/`uname -r` -name "vboxadd\.*" 2>/dev/null|grep -q vboxadd; then
-        begin "Removing old VirtualBox vboxadd kernel module"
-        find /lib/modules/`uname -r` -name "vboxadd\.*" 2>/dev/null|xargs rm -f 2>/dev/null
-        succ_msg
-    fi
-    begin "Recompiling VirtualBox kernel modules"
-    if ! $BUILDVBOXADD \
-        --save-module-symvers /tmp/vboxadd-Module.symvers \
-        --no-print-directory install > $LOG 2>&1; then
-        fail "Look at $LOG to find out what went wrong"
-    fi
-    if [ -n "$BUILDVBOXVFS" ]; then
-        if ! $BUILDVBOXVFS \
-            --use-module-symvers /tmp/vboxadd-Module.symvers \
-            --no-print-directory install >> $LOG 2>&1; then
-            fail "Look at $LOG to find out what went wrong"
-        fi
-    fi
-    if [ -n "$BUILDVBOXVIDEO" ]; then
-        if ! $BUILDVBOXVIDEO \
-            --use-module-symvers /tmp/vboxadd-Module.symvers \
-            --no-print-directory install >> $LOG 2>&1; then
-            fail "Look at $LOG to find out what went wrong"
-        fi
-    fi
-    succ_msg
-    start
-    echo
-    echo "You should reboot your guest to make sure the new modules are actually used"
-}
-
-dmnstatus()
+status()
 {
     if running_vboxadd; then
+        echo "vboxadd module is loaded"
+        running_vboxvfs && echo "vboxvfs module is loaded"
+        running_vboxvideo && echo "vboxvideo module is loaded"
         echo "The VirtualBox Additions are currently running."
+    elif [ -f "$LOCKFILE" ]; then
+        echo "The VirtualBox Additions module is not loaded, but subsystem is locked"
+        RETVAL=2
     else
-        echo "The VirtualBox Additions are not currently running."
+        echo "The VirtualBox Additions are not currently running"
     fi
 }
 
+# See how we were called.
 case "$1" in
-start)
-    start
-    ;;
-stop)
-    stop
-    ;;
-restart)
-    restart
-    ;;
-setup)
-    setup
-    ;;
-status)
-    dmnstatus
-    ;;
-*)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
+    start)
+        start
+        ;;
+    stop)
+        stop
+        ;;
+    restart)
+        restart
+        ;;
+    condstop)
+        if [ -e "$LOCKFILE" ]; then
+            stop
+        fi
+        ;;
+    condrestart)
+        # Do nothing on package upgrade
+        ;;
+    status)
+        status
+        ;;
+    *)
+        msg_usage "${0##*/} {start|stop|restart|condstop|condrestart|status}"
+        RETVAL=1
 esac
 
-exit
+exit $RETVAL
diff --git a/src/VBox/Devices/Makefile.kmk b/src/VBox/Devices/Makefile.kmk
index 49495a4..334875a 100644
--- a/src/VBox/Devices/Makefile.kmk
+++ b/src/VBox/Devices/Makefile.kmk
@@ -104,7 +104,7 @@ ifdef VBOX_WITH_USB
  endif
 endif
 
-VBoxDDU_LDFLAGS.linux    = -Wl,--no-undefined
+VBoxDDU_LDFLAGS.linux    = -Wl,-rpath,$(VBOXDIR)
 VBoxDDU_LDFLAGS.l4       = -Wl,--no-undefined
 
 #
@@ -223,7 +223,7 @@ VBoxDD_LDFLAGS.darwin   = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxDD.dyli
 	-framework IOKit \
 	-framework Carbon \
 	-framework DiskArbitration
-VBoxDD_LDFLAGS.linux    = -Wl,--no-undefined
+VBoxDD_LDFLAGS.linux    = -Wl,-rpath,$(VBOXDIR)
 VBoxDD_LDFLAGS.l4       = -Wl,--no-undefined
 
 #
@@ -250,7 +250,7 @@ VBoxDD2_LIBS           += \
 endif
 VBoxDD2_LIBS.darwin    += $(LIB_REM)
 VBoxDD2_LDFLAGS.darwin  = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxDD2.dylib
-VBoxDD2_LDFLAGS.linux   = -Wl,--no-undefined
+VBoxDD2_LDFLAGS.linux   = -Wl,-rpath,$(VBOXDIR)
 VBoxDD2_LDFLAGS.l4      = -Wl,--no-undefined
 
 
diff --git a/src/VBox/Devices/Storage/testcase/Makefile.kmk b/src/VBox/Devices/Storage/testcase/Makefile.kmk
index 833de97..c579a0b 100644
--- a/src/VBox/Devices/Storage/testcase/Makefile.kmk
+++ b/src/VBox/Devices/Storage/testcase/Makefile.kmk
@@ -34,6 +34,7 @@ ifdef VBOX_WITH_TESTCASES
    vditool_SOURCES  = vditool.cpp
  endif
 endif
+# vditool_LDFLAGS.linux  = -Wl,-rpath,$(VBOXDIR)
 
 
 #
diff --git a/src/VBox/Devices/testcase/Makefile.kmk b/src/VBox/Devices/testcase/Makefile.kmk
index b75545b..9ae1182 100644
--- a/src/VBox/Devices/testcase/Makefile.kmk
+++ b/src/VBox/Devices/testcase/Makefile.kmk
@@ -48,7 +48,9 @@ TESTING += \
 #
 # The testcase generator.
 #
+ifndef VBOX_WITHOUT_BIARCH
 PROGRAMS += tstDeviceStructSizeGC
+endif
 tstDeviceStructSizeGC_TEMPLATE  = VBOXGCEXE
 tstDeviceStructSizeGC_DEFS      =
 ifdef VBOX_WITH_USB
@@ -81,7 +83,9 @@ tstDeviceStructSizeGC_INCS      = \
 #
 # The testcase it self.
 #
+ifndef VBOX_WITHOUT_BIARCH
 PROGRAMS += tstDeviceStructSize
+endif
 tstDeviceStructSize_TEMPLATE = VBOXR3AUTOTST
 tstDeviceStructSize_DEFS     =
 ifdef VBOX_WITH_USB
diff --git a/src/VBox/Frontends/VBoxBFE/Makefile.kmk b/src/VBox/Frontends/VBoxBFE/Makefile.kmk
index 84dff48..2351c07 100644
--- a/src/VBox/Frontends/VBoxBFE/Makefile.kmk
+++ b/src/VBox/Frontends/VBoxBFE/Makefile.kmk
@@ -150,6 +150,7 @@ VBoxBFE_LIBS.l4 = \
 VBoxBFE_LIBS.darwin = \
 	$(LIB_SDK_LIBSDL_SDLMAIN)
 VBoxBFE_LDFLAGS.darwin = -framework Foundation -framework AppKit
+VBoxBFE_LDFLAGS.linux  = -Wl,-rpath,$(VBOXDIR)
 
 VBoxBFE_CXXFLAGS.l4 += -fno-rtti -nostdinc -Wno-non-virtual-dtor \
 	$(addprefix -I,$(VBOX_L4_GCC3_INCS) $(L4_INCDIR))
diff --git a/src/VBox/Frontends/VBoxFB/Makefile.kmk b/src/VBox/Frontends/VBoxFB/Makefile.kmk
index caa94c9..75fbd26 100644
--- a/src/VBox/Frontends/VBoxFB/Makefile.kmk
+++ b/src/VBox/Frontends/VBoxFB/Makefile.kmk
@@ -52,6 +52,7 @@ VBoxFB_LIBPATH    = \
 VBoxFB_CXXFLAGS   =  \
 	-DNDEBUG -DTRIMMED -O -Wall -fno-rtti -fno-exceptions \
 	-Wno-non-virtual-dtor -Wno-long-long -fshort-wchar -pthread -pipe
+VBoxFB_LDFLAGS.linux = -Wl,-rpath,$(VBOXDIR)
 
 include $(KBUILD_PATH)/subfooter.kmk
 
diff --git a/src/VBox/Frontends/VBoxManage/Makefile.kmk b/src/VBox/Frontends/VBoxManage/Makefile.kmk
index bfc1102..4e9f51c 100644
--- a/src/VBox/Frontends/VBoxManage/Makefile.kmk
+++ b/src/VBox/Frontends/VBoxManage/Makefile.kmk
@@ -82,6 +82,7 @@ endif
 ifndef VBOX_ONLY_DOCS
  VBoxManage_LIBS      += $(LIB_DDU)
 endif # !VBOX_ONLY_DOCS
+VBoxManage_LDFLAGS.linux = -Wl,-rpath,$(VBOXDIR)
 
 # VBoxManageSVN.cpp uses VBOX_SVN_REV.
 VBoxManageSVN.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
diff --git a/src/VBox/Frontends/VBoxSDL/Makefile.kmk b/src/VBox/Frontends/VBoxSDL/Makefile.kmk
index 937d52a..26e4ce1 100644
--- a/src/VBox/Frontends/VBoxSDL/Makefile.kmk
+++ b/src/VBox/Frontends/VBoxSDL/Makefile.kmk
@@ -112,6 +112,7 @@ endif
 
 VBoxSDL_LDFLAGS.darwin = \
 	-framework Foundation -framework AppKit
+VBoxSDL_LDFLAGS.linux  = -Wl,-rpath,$(VBOXDIR)
 
 VBoxSDL_CLEAN = $(PATH_VBoxSDL)/Ico64x01.h
 VBoxSDL_INTERMEDIATES = $(PATH_VBoxSDL)/Ico64x01.h
diff --git a/src/VBox/Frontends/VirtualBox/Makefile.kmk b/src/VBox/Frontends/VirtualBox/Makefile.kmk
index 4ab60e2..56f474c 100644
--- a/src/VBox/Frontends/VirtualBox/Makefile.kmk
+++ b/src/VBox/Frontends/VirtualBox/Makefile.kmk
@@ -465,6 +465,7 @@ endif
 # Import QDesigner UI sources and translations from VBoxUI.pro.
 ifndef VBOX_WITH_REGISTRATION
  FORMS := $(filter-out ui/VBoxRegistrationDlg.ui,$(FORMS))
+VirtualBox_LDFLAGS.linux  = -Wl,-rpath,$(VBOXDIR)
 endif
 $(eval VirtualBox_SOURCES += $(FORMS))
 
diff --git a/src/VBox/Frontends/VirtualBox/VirtualBox.qrc b/src/VBox/Frontends/VirtualBox/VirtualBox.qrc
index 9b565bd..a9ed379 100644
--- a/src/VBox/Frontends/VirtualBox/VirtualBox.qrc
+++ b/src/VBox/Frontends/VirtualBox/VirtualBox.qrc
@@ -16,6 +16,8 @@
     <file alias="vm_show_logs_disabled_32px.png">images/vm_show_logs_disabled_32px.png</file>
     <file alias="vm_start_32px.png">images/vm_start_32px.png</file>
     <file alias="vm_start_disabled_32px.png">images/vm_start_disabled_32px.png</file>
+    <file alias="os_altlinux.png">images/os_altlinux.png</file>
+    <file alias="os_altlinux_64.png">images/os_altlinux_64.png</file>
     <file alias="os_archlinux.png">images/os_archlinux.png</file>
     <file alias="os_archlinux_64.png">images/os_archlinux_64.png</file>
     <file alias="os_debian.png">images/os_debian.png</file>
diff --git a/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp b/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
index 771a43f..4106f55 100644
--- a/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
@@ -4563,6 +4563,8 @@ void VBoxGlobal::init()
         {"Linux24_64",      ":/os_linux24_64.png"},
         {"Linux26",         ":/os_linux26.png"},
         {"Linux26_64",      ":/os_linux26_64.png"},
+        {"ALTLinux",        ":/os_altlinux.png"},
+        {"ALTLinux_64",     ":/os_altlinux_64.png"},
         {"ArchLinux",       ":/os_archlinux.png"},
         {"ArchLinux_64",    ":/os_archlinux_64.png"},
         {"Debian",          ":/os_debian.png"},
diff --git a/src/VBox/Frontends/VirtualBox/src/VBoxOSTypeSelectorWidget.cpp b/src/VBox/Frontends/VirtualBox/src/VBoxOSTypeSelectorWidget.cpp
index 881d7a9..c732d8a 100644
--- a/src/VBox/Frontends/VirtualBox/src/VBoxOSTypeSelectorWidget.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/VBoxOSTypeSelectorWidget.cpp
@@ -195,10 +195,10 @@ void VBoxOSTypeSelectorWidget::onFamilyChanged (int aIndex)
         if (xpIndex != -1)
             mCbType->setCurrentIndex (xpIndex);
     }
-    /* Or select Ubuntu item for Linux family as default */
+    /* Or select AltLinux item for Linux family as default */
     else if (familyId == "Linux")
     {
-        int ubIndex = mCbType->findData ("Ubuntu", RoleTypeID);
+        int ubIndex = mCbType->findData ("ALTLinux", RoleTypeID);
         if (ubIndex != -1)
             mCbType->setCurrentIndex (ubIndex);
     }
diff --git a/src/VBox/Main/Global.cpp b/src/VBox/Main/Global.cpp
index ce1a9b0..de0f52e 100644
--- a/src/VBox/Main/Global.cpp
+++ b/src/VBox/Main/Global.cpp
@@ -79,6 +79,10 @@ const Global::OSType Global::sOSTypes[SchemaDefs::OSTypeId_COUNT] =
       VBOXOSTYPE_Linux26,         VBOXOSHINT_NONE, 256,   4,  8 * _1K, NetworkAdapterType_Am79C973 },
     { "Linux",   "Linux",             SchemaDefs_OSTypeId_Linux26_64,      "Linux 2.6 (64 bit)",
       VBOXOSTYPE_Linux26_x64,     VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC,  256,   4,  8 * _1K, NetworkAdapterType_I82540EM },
+    { "Linux",   "Linux",             SchemaDefs_OSTypeId_ALTLinux,        "ALT Linux",
+      VBOXOSTYPE_ALTLinux,        VBOXOSHINT_NONE, 256,  12,  8 * _1K, NetworkAdapterType_Am79C973 },
+    { "Linux",   "Linux",             SchemaDefs_OSTypeId_ALTLinux_64,     "ALT Linux (64 bit)",
+      VBOXOSTYPE_ALTLinux_x64,    VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC,  256,  12,  8 * _1K, NetworkAdapterType_I82540EM },
     { "Linux",   "Linux",             SchemaDefs_OSTypeId_ArchLinux,       "Arch Linux",
       VBOXOSTYPE_ArchLinux,       VBOXOSHINT_NONE, 256,  12,  8 * _1K, NetworkAdapterType_Am79C973 },
     { "Linux",   "Linux",             SchemaDefs_OSTypeId_ArchLinux_64,    "Arch Linux (64 bit)",
diff --git a/src/VBox/Main/Makefile.kmk b/src/VBox/Main/Makefile.kmk
index 6e0ee89..7fe7e17 100644
--- a/src/VBox/Main/Makefile.kmk
+++ b/src/VBox/Main/Makefile.kmk
@@ -249,6 +249,7 @@ ifdef VBOX_WITH_USB
 endif
 
 VBoxSVC_LIBS += \
+	$(LIB_RUNTIME) \
 	$(LIB_DDU) \
 	$(LIB_SETTINGS)
 VBoxSVC_LIBS.darwin = \
@@ -373,6 +374,7 @@ ifdef VBOX_WITH_NETFLT
  endif
 endif
 VBoxSVC_LDFLAGS.darwin    = -framework IOKit -framework SystemConfiguration
+VBoxSVC_LDFLAGS.linux     = -Wl,-rpath,$(VBOXDIR)
 
 ifdef VBOX_WITH_CROGL
  VBoxSVC_LDFLAGS.darwin += -framework OpenGL
@@ -498,6 +500,7 @@ VBoxSVCM_SOURCES        = \
 VBoxSVCM_LDFLAGS.darwin = \
 	-install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
 	-exported_symbols_list $(PATH_VBoxSVCM)/VBoxSVCM.def
+VBoxSVCM_LDFLAGS.linux  = -Wl,-rpath,$(VBOXDIR)
  ifeq ($(KBUILD_TARGET),darwin)
 VBoxSVCM_ORDERDEPS     += $(PATH_VBoxSVCM)/VBoxSVCM.def
 VBoxSVCM_CLEAN         += $(PATH_VBoxSVCM)/VBoxSVCM.def
@@ -642,6 +645,8 @@ VBoxC_SOURCES += \
 	RemoteUSBBackend.cpp
 endif
 
+VBoxC_LDFLAGS.linux = -Wl,-rpath,$(VBOXDIR)
+
 ifeq ($(KBUILD_TARGET),darwin)
 VBoxC_ORDERDEPS += $(PATH_VBoxC)/VBoxC.def
 VBoxC_CLEAN     += $(PATH_VBoxC)/VBoxC.def
diff --git a/src/VBox/Main/VMMDevInterface.cpp b/src/VBox/Main/VMMDevInterface.cpp
index 99eb6ce..04e7d71 100644
--- a/src/VBox/Main/VMMDevInterface.cpp
+++ b/src/VBox/Main/VMMDevInterface.cpp
@@ -31,6 +31,7 @@
 #include <VBox/VBoxGuest.h>
 #include <VBox/shflsvc.h>
 #include <iprt/asm.h>
+#include <stdlib.h>
 
 #ifdef VBOX_WITH_HGCM
 #include "hgcm/HGCM.h"
diff --git a/src/VBox/Main/xml/SettingsConverter.xsl b/src/VBox/Main/xml/SettingsConverter.xsl
index e6a137c..e1fc71e 100644
--- a/src/VBox/Main/xml/SettingsConverter.xsl
+++ b/src/VBox/Main/xml/SettingsConverter.xsl
@@ -743,6 +743,7 @@ Value '<xsl:value-of select="@type"/>' of 'HardDisk::type' attribute is invalid.
         <xsl:when test="@OSType='linux22'">Linux22</xsl:when>
         <xsl:when test="@OSType='linux24'">Linux24</xsl:when>
         <xsl:when test="@OSType='linux26'">Linux26</xsl:when>
+        <xsl:when test="@OSType='altlinux'">ALTLinux</xsl:when>
         <xsl:when test="@OSType='archlinux'">ArchLinux</xsl:when>
         <xsl:when test="@OSType='debian'">Debian</xsl:when>
         <xsl:when test="@OSType='opensuse'">OpenSUSE</xsl:when>
diff --git a/src/VBox/Main/xml/VirtualBox-settings-common.xsd b/src/VBox/Main/xml/VirtualBox-settings-common.xsd
index 7d3ede9..13f7563 100644
--- a/src/VBox/Main/xml/VirtualBox-settings-common.xsd
+++ b/src/VBox/Main/xml/VirtualBox-settings-common.xsd
@@ -165,6 +165,8 @@
     <xsd:enumeration value="Linux24_64"/>
     <xsd:enumeration value="Linux26"/>
     <xsd:enumeration value="Linux26_64"/>
+    <xsd:enumeration value="ALTLinux"/>
+    <xsd:enumeration value="ALTLinux_64"/>
     <xsd:enumeration value="ArchLinux"/>
     <xsd:enumeration value="ArchLinux_64"/>
     <xsd:enumeration value="Debian"/>
diff --git a/src/VBox/Runtime/Makefile.kmk b/src/VBox/Runtime/Makefile.kmk
index 727138b..2b59d26 100644
--- a/src/VBox/Runtime/Makefile.kmk
+++ b/src/VBox/Runtime/Makefile.kmk
@@ -1523,8 +1523,7 @@ ifeq ($(VBOX_LDR_FMT32),lx)
  RuntimeGC_SOURCES += os2/sys0.asm
 endif
 
-if1of ($(KBUILD_TARGET), darwin solaris freebsd)
-RuntimeGC_SOURCES += \
+LIBGCC_MATH_SOURCES := \
 	common/math/gcc/adddi3.c \
 	common/math/gcc/anddi3.c \
 	common/math/gcc/ashldi3.c \
@@ -1544,6 +1543,13 @@ RuntimeGC_SOURCES += \
 	common/math/gcc/udivdi3.c \
 	common/math/gcc/umoddi3.c \
 	common/math/gcc/xordi3.c
+
+if1of ($(KBUILD_TARGET), darwin solaris freebsd)
+RuntimeGC_SOURCES += $(LIBGCC_MATH_SOURCES)
+else
+ifdef VBOX_WITHOUT_BIARCH
+RuntimeGC_SOURCES += $(LIBGCC_MATH_SOURCES)
+endif
 endif
 
 
diff --git a/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h b/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
index 8d15808..1fc3781 100644
--- a/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
+++ b/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
@@ -286,11 +286,21 @@ DECLINLINE(unsigned long) msecs_to_jiffies(unsigned int cMillies)
 #undef bool
 
 /*
- * There are post-2.6.24 kernels (confusingly with unchanged version number)
- * which eliminate macros which were marked as deprecated.
+ * The 2.6.25 kernel eliminates macros that were marked as deprecated and eliminates
+ * routine change_page_attr() in favor of the set_pages_* API.
  */
-#ifndef __attribute_used__
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
 #define __attribute_used__ __used
+
+static inline int my_change_page_attr(struct page *page, int numpages, pgprot_t prot)
+{
+	/* use the set_pages_* API */
+	if (pgprot_val(prot) & _PAGE_NX)
+		set_pages_nx(page, numpages);
+	set_pages_uc(page, numpages);
+	return 0;
+}
+#define change_page_attr(a,b,c) my_change_page_attr((a), (b), (c))
 #endif
 
 /**
diff --git a/src/VBox/Runtime/r3/linux/semevent-linux.cpp b/src/VBox/Runtime/r3/linux/semevent-linux.cpp
index f1595c4..9f5ea66 100644
--- a/src/VBox/Runtime/r3/linux/semevent-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/semevent-linux.cpp
@@ -95,7 +95,7 @@ struct RTSEMEVENTINTERNAL
 static long sys_futex(int32_t volatile *uaddr, int op, int val, struct timespec *utime, int32_t *uaddr2, int val3)
 {
     errno = 0;
-    long rc = syscall(__NR_futex, uaddr, op, val, utime, uaddr2, val3);
+    long rc = syscall(SYS_futex, uaddr, op, val, utime, uaddr2, val3);
     if (rc < 0)
     {
         Assert(rc == -1);
diff --git a/src/VBox/VMM/Makefile.kmk b/src/VBox/VMM/Makefile.kmk
index 2fcdee5..0f3dc73 100644
--- a/src/VBox/VMM/Makefile.kmk
+++ b/src/VBox/VMM/Makefile.kmk
@@ -205,7 +205,7 @@ VBoxVMM_LIBS += \
 
 VBoxVMM_LIBS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
 VBoxVMM_LDFLAGS.win = /DELAYLOAD:dbghelp.dll
-VBoxVMM_LDFLAGS.linux = -Wl,--no-undefined
+VBoxVMM_LDFLAGS.linux = -Wl,-rpath,$(VBOXDIR)
 VBoxVMM_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxVMM.dylib
 VBoxVMM_LDFLAGS.solaris = -mimpure-text
 #ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
diff --git a/src/VBox/VMM/testcase/Makefile.kmk b/src/VBox/VMM/testcase/Makefile.kmk
index 2ee2b97..07a1d60 100644
--- a/src/VBox/VMM/testcase/Makefile.kmk
+++ b/src/VBox/VMM/testcase/Makefile.kmk
@@ -25,7 +25,10 @@ include	$(KBUILD_PATH)/subheader.kmk
 #
 # Target lists.
 #
-PROGRAMS   += tstVMStructSize tstVMStructGC tstAsmStructs tstAsmStructsGC tstVMM tstVMM-HwAccm tstGlobalConfig tstInstrEmul
+PROGRAMS   += tstVMM tstVMM-HwAccm tstGlobalConfig tstInstrEmul
+ifndef VBOX_WITHOUT_BIARCH
+PROGRAMS   += tstVMStructSize tstVMStructGC tstAsmStructs tstAsmStructsGC
+endif
 ifneq ($(KBUILD_TARGET),win)
 PROGRAMS   += tstVMMFork
 endif
@@ -51,9 +54,11 @@ BLDDIRS += $(VBOX_VMM_TESTCASE_OUT_DIR)
 #
 ifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
  ifeq ($(filter-out x86.x86 amd64.amd64 x86.amd64, $(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH)),)
+  ifndef VBOX_WITHOUT_BIARCH
   OTHERS += \
 	$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
 	$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
+  endif
  endif
 endif
 
diff --git a/src/libs/xpcom18a4/Makefile.kmk b/src/libs/xpcom18a4/Makefile.kmk
index 14c361b..e1a5183 100644
--- a/src/libs/xpcom18a4/Makefile.kmk
+++ b/src/libs/xpcom18a4/Makefile.kmk
@@ -682,7 +682,7 @@ else
  xpidl_CFLAGS = \
 	$(libIDL_config_cflags)
  xpidl_LDFLAGS = \
-	$(libIDL_config_libs)
+	-Wl,--no-as-needed $(libIDL_config_libs)
 endif
 
 #
@@ -1234,6 +1234,7 @@ VBoxXPCOM_LDFLAGS.solaris += -Wl,-z,allextract \
 #VBoxXPCOM_LIBS += $(LIB_RUNTIME_EF)
 #VBoxXPCOM_LDFLAGS = -Wl,--whole-archive $(VBoxXPCOM_LIBS) -Wl,--no-whole-archive $(LIB_RUNTIME)
 VBoxXPCOM_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxXPCOM.dylib
+VBoxXPCOM_LDFLAGS.linux  = -Wl,-rpath,$(VBOXDIR)
 
 ifdef VBOX_IPC_RELEASE_LOG
 IPC_LOGGING = 1
@@ -1314,7 +1315,9 @@ VBoxXPCOMIPCC_SOURCES += \
 	ipc/ipcd/client/src/ipcConnectionUnix.cpp
 endif
 VBoxXPCOMIPCC_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxXPCOMIPCC.dylib
+VBoxXPCOMIPCC_LDFLAGS.linux  = -Wl,-rpath,$(VBOXDIR)
 VBoxXPCOMIPCC_LIBS = \
+	$(TARGET_VBoxXPCOM) \
 	$(TARGET_VBox-xpcom-ipcutils) \
 	$(TARGET_VBox-xpcom-ipcshared) \
 	$(TARGET_VBox-xpcom-ipcdlock) \
@@ -1340,6 +1343,7 @@ else
  VBoxXPCOMIPCD_SOURCES += \
 	ipc/ipcd/daemon/src/ipcdUnix.cpp
 endif
+VBoxXPCOMIPCD_LDFLAGS.linux = -Wl,-rpath,$(VBOXDIR)
 
 
 #
diff --git a/src/libs/xpcom18a4/python/__init__.py b/src/libs/xpcom18a4/python/__init__.py
index 6d03b9c..f6cf204 100644
--- a/src/libs/xpcom18a4/python/__init__.py
+++ b/src/libs/xpcom18a4/python/__init__.py
@@ -97,7 +97,7 @@ class ConsoleServiceStream:
     def flush(self):
         pass
     def write(self, msg):
-        import _xpcom
+        from xpcom import _xpcom
         _xpcom.LogConsoleMessage(msg)
     def close(self):
         pass
diff --git a/src/libs/xpcom18a4/python/components.py b/src/libs/xpcom18a4/python/components.py
index 9ea64fc..f6ddd87 100644
--- a/src/libs/xpcom18a4/python/components.py
+++ b/src/libs/xpcom18a4/python/components.py
@@ -37,7 +37,7 @@
 
 # This module provides the JavaScript "components" interface
 import xpt
-import xpcom, _xpcom
+import xpcom, xpcom._xpcom as _xpcom
 import xpcom.client
 import xpcom.server
 import types
diff --git a/src/recompiler/Makefile.kmk b/src/recompiler/Makefile.kmk
index 989de60..8337d37 100644
--- a/src/recompiler/Makefile.kmk
+++ b/src/recompiler/Makefile.kmk
@@ -190,7 +190,7 @@ endif
 ## @todo clean up this, there are some duplicates with the template here I think.
 $(REM_MOD)_LDFLAGS.darwin  = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(REM_MOD).dylib
 $(REM_MOD)_LDFLAGS.l4      = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib -Wl,--no-undefined
-$(REM_MOD)_LDFLAGS.linux   = $(VBOX_LD_as_needed)
+$(REM_MOD)_LDFLAGS.linux   = $(VBOX_LD_as_needed) -Wl,-rpath,$(VBOXDIR)
 $(REM_MOD)_LDFLAGS.os2     = -Zomf
 $(REM_MOD)_LDFLAGS.debug   = -g
 $(REM_MOD)_LDFLAGS.solaris = -mimpure-text
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin