VirtualBox

Ignore:
Timestamp:
Jan 7, 2010 2:07:29 PM (15 years ago)
Author:
vboxsync
Message:

Solaris/Additions: Fix snv_130 breakage with change in Xorg dir layout.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/solaris/Installer/postinstall.sh

    r24977 r25681  
    112112    # create the device link
    113113    /usr/sbin/devfsadm -i vboxguest
    114     sync
    115 fi
    116 
    117 
    118 # check if X.Org exists
    119 if test -f "/usr/X11/bin/Xorg"; then
     114fi
     115
     116
     117# check if X.Org exists (snv_130 and higher have /usr/X11/* as /usr/*)
     118if test -f "/usr/bin/Xorg"; then
     119    xorgbin="/usr/bin/Xorg"
     120elif test -f "/usr/X11/bin/Xorg"; then
    120121    xorgbin="/usr/X11/bin/Xorg"
    121122else
     
    140141# Install Xorg components to the required places
    141142if test ! -z "$xorgbin"; then
    142     xorgversion_long=`/usr/X11/bin/Xorg -version 2>&1 | grep "X Window System Version"`
     143    xorgversion_long=`$xorgbin -version 2>&1 | grep "X Window System Version"`
    143144    xorgversion=`/usr/bin/expr "${xorgversion_long}" : 'X Window System Version \([^ ]*\)'`
    144145    if test -z "$xorgversion_long"; then
    145         xorgversion_long=`/usr/X11/bin/Xorg -version 2>&1 | grep "X.Org X Server"`
     146        xorgversion_long=`$xorgbin -version 2>&1 | grep "X.Org X Server"`
    146147        xorgversion=`/usr/bin/expr "${xorgversion_long}" : 'X.Org X Server \([^ ]*\)'`
    147148    fi
     
    189190        retval=2
    190191    else
    191         echo "Configuring X.Org..."
    192 
    193         # 32-bit x11 drivers
    194         if test -f "$vboxadditions_path/$vboxmouse_src"; then
    195             vboxmouse_dest="/usr/X11/lib/modules/input/vboxmouse_drv.so"
    196             vboxvideo_dest="/usr/X11/lib/modules/drivers/vboxvideo_drv.so"
    197             /usr/sbin/installf -c none $PKGINST "$vboxmouse_dest" f
    198             /usr/sbin/installf -c none $PKGINST "$vboxvideo_dest" f
    199             cp "$vboxadditions_path/$vboxmouse_src" "$vboxmouse_dest"
    200             cp "$vboxadditions_path/$vboxvideo_src" "$vboxvideo_dest"
    201 
    202             # Removing redundent names from pkg and files from disk
    203             /usr/sbin/removef $PKGINST $vboxadditions_path/vboxmouse_drv_* 1>/dev/null
    204             /usr/sbin/removef $PKGINST $vboxadditions_path/vboxvideo_drv_* 1>/dev/null
    205             rm -f $vboxadditions_path/vboxmouse_drv_*
    206             rm -f $vboxadditions_path/vboxvideo_drv_*
     192        echo "Installing mouse and video drivers for X.Org $xorgversion..."
     193
     194        # Determine destination paths (snv_130 and above use "/usr/lib/xorg", older use "/usr/X11/lib"
     195        vboxmouse_dest_base="/usr/lib/xorg/modules/input"
     196        if test ! -d $vboxmouse_dest_base; then
     197            vboxmouse_dest_base="/usr/X11/lib/modules/input"
    207198        fi
    208 
    209         # 64-bit x11 drivers
    210         if test -f "$vboxadditions64_path/$vboxmouse_src"; then
    211             vboxmouse_dest="/usr/X11/lib/modules/input/$solaris64dir/vboxmouse_drv.so"
    212             vboxvideo_dest="/usr/X11/lib/modules/drivers/$solaris64dir/vboxvideo_drv.so"
    213             /usr/sbin/installf -c none $PKGINST "$vboxmouse_dest" f
    214             /usr/sbin/installf -c none $PKGINST "$vboxvideo_dest" f
    215             cp "$vboxadditions64_path/$vboxmouse_src" "$vboxmouse_dest"
    216             cp "$vboxadditions64_path/$vboxvideo_src" "$vboxvideo_dest"
    217 
    218             # Removing redundent names from pkg and files from disk
    219             /usr/sbin/removef $PKGINST $vboxadditions64_path/vboxmouse_drv_* 1>/dev/null
    220             /usr/sbin/removef $PKGINST $vboxadditions64_path/vboxvideo_drv_* 1>/dev/null
    221             rm -f $vboxadditions64_path/vboxmouse_drv_*
    222             rm -f $vboxadditions64_path/vboxvideo_drv_*
     199        vboxvideo_dest_base="/usr/lib/xorg/modules/drivers"
     200        if test ! -d $vboxvideo_dest_base; then
     201            vboxvideo_dest_base="/usr/X11/lib/modules/drivers"
    223202        fi
    224203
    225         # Some distros like Indiana have no xorg.conf, deal with this
    226         if test ! -f '/etc/X11/xorg.conf' && test ! -f '/etc/X11/.xorg.conf'; then
    227 
    228             # Xorg 1.3.x+ should use the modeline less Xorg confs while older should
    229             # use ones with all the video modelines in place. Argh.
    230             xorgconf_file="solaris_xorg_modeless.conf"
    231             xorgconf_unfit="solaris_xorg.conf"
     204        vboxmouse64_dest_base=$vboxmouse_dest_base/$solaris64dir
     205        vboxvideo64_dest_base=$vboxvideo_dest_base/$solaris64dir
     206
     207        # Make sure destination path exists
     208        if test ! -d $vboxmouse_dest_base || test ! -d $vboxvideo_dest_base || test ! -d $vboxmouse64_dest_base || test ! -d $vboxvideo64_dest_base; then
     209            echo "*** Missing destination paths for mouse or video modules. Aborting."
     210            echo "*** Failed to install the VirtualBox X Window System drivers."
     211
     212            # Exit as partially failed installation
     213            retval=2
     214        else
     215            # 32-bit x11 drivers
     216            if test -f "$vboxadditions_path/$vboxmouse_src"; then
     217                vboxmouse_dest="$vboxmouse_dest_base/vboxmouse_drv.so"
     218                vboxvideo_dest="$vboxvideo_dest_base/vboxvideo_drv.so"
     219                /usr/sbin/installf -c none $PKGINST "$vboxmouse_dest" f
     220                /usr/sbin/installf -c none $PKGINST "$vboxvideo_dest" f
     221                cp "$vboxadditions_path/$vboxmouse_src" "$vboxmouse_dest"
     222                cp "$vboxadditions_path/$vboxvideo_src" "$vboxvideo_dest"
     223
     224                # Removing redundent names from pkg and files from disk
     225                /usr/sbin/removef $PKGINST $vboxadditions_path/vboxmouse_drv_* 1>/dev/null
     226                /usr/sbin/removef $PKGINST $vboxadditions_path/vboxvideo_drv_* 1>/dev/null
     227                rm -f $vboxadditions_path/vboxmouse_drv_*
     228                rm -f $vboxadditions_path/vboxvideo_drv_*
     229            fi
     230
     231            # 64-bit x11 drivers
     232            if test -f "$vboxadditions64_path/$vboxmouse_src"; then
     233                vboxmouse_dest="$vboxmouse64_dest_base/vboxmouse_drv.so"
     234                vboxvideo_dest="$vboxvideo64_dest_base/vboxvideo_drv.so"
     235                /usr/sbin/installf -c none $PKGINST "$vboxmouse_dest" f
     236                /usr/sbin/installf -c none $PKGINST "$vboxvideo_dest" f
     237                cp "$vboxadditions64_path/$vboxmouse_src" "$vboxmouse_dest"
     238                cp "$vboxadditions64_path/$vboxvideo_src" "$vboxvideo_dest"
     239
     240                # Removing redundent names from pkg and files from disk
     241                /usr/sbin/removef $PKGINST $vboxadditions64_path/vboxmouse_drv_* 1>/dev/null
     242                /usr/sbin/removef $PKGINST $vboxadditions64_path/vboxvideo_drv_* 1>/dev/null
     243                rm -f $vboxadditions64_path/vboxmouse_drv_*
     244                rm -f $vboxadditions64_path/vboxvideo_drv_*
     245            fi
     246
     247            # Some distros like Indiana have no xorg.conf, deal with this
     248            if test ! -f '/etc/X11/xorg.conf' && test ! -f '/etc/X11/.xorg.conf'; then
     249
     250                # Xorg 1.3.x+ should use the modeline less Xorg confs while older should
     251                # use ones with all the video modelines in place. Argh.
     252                xorgconf_file="solaris_xorg_modeless.conf"
     253                xorgconf_unfit="solaris_xorg.conf"
     254                case "$xorgversion" in
     255                    7.1.* | 7.2.* | 6.9.* | 7.0.* )
     256                        xorgconf_file="solaris_xorg.conf"
     257                        xorgconf_unfit="solaris_xorg_modeless.conf"
     258                        ;;
     259                esac
     260
     261                /usr/sbin/removef $PKGINST $vboxadditions_path/$xorgconf_file 1>/dev/null
     262                mv -f $vboxadditions_path/$xorgconf_file /etc/X11/.xorg.conf
     263
     264                /usr/sbin/removef $PKGINST $vboxadditions_path/$xorgconf_unfit 1>/dev/null
     265                rm -f $vboxadditions_path/$xorgconf_unfit
     266            fi
    232267            case "$xorgversion" in
    233                 7.1.* | 7.2.* | 6.9.* | 7.0.* )
    234                     xorgconf_file="solaris_xorg.conf"
    235                     xorgconf_unfit="solaris_xorg_modeless.conf"
     268                7.1.* | 7.2.* | 6.9.* | 7.0.* | 1.3.* )
     269                    $vboxadditions_path/x11config.pl
     270                    ;;
     271                1.5.* | 1.6.* | 1.7.* )
     272                    $vboxadditions_path/x11config15sol.pl
    236273                    ;;
    237274            esac
    238 
    239             /usr/sbin/removef $PKGINST $vboxadditions_path/$xorgconf_file 1>/dev/null
    240             mv -f $vboxadditions_path/$xorgconf_file /etc/X11/.xorg.conf
    241 
    242             /usr/sbin/removef $PKGINST $vboxadditions_path/$xorgconf_unfit 1>/dev/null
    243             rm -f $vboxadditions_path/$xorgconf_unfit
    244275        fi
    245         case "$xorgversion" in
    246             7.1.* | 7.2.* | 6.9.* | 7.0.* | 1.3.* )
    247                 $vboxadditions_path/x11config.pl
    248                 ;;
    249             1.5.* | 1.6.* | 1.7.* )
    250                 $vboxadditions_path/x11config15sol.pl
    251                 ;;
    252         esac
    253276    fi
    254277
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