VirtualBox

Changeset 12283 in vbox


Ignore:
Timestamp:
Sep 9, 2008 10:19:10 AM (16 years ago)
Author:
vboxsync
Message:

Additions/linux: changed the installer to support Fedora 9

Location:
trunk/src/VBox/Additions
Files:
1 added
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/Makefile.kmk

    r12170 r12283  
    7777                $(VBOX_PATH_X11_ADDITION_INSTALLER)/vboxvideo.ids \
    7878                $(VBOX_PATH_X11_ADDITION_INSTALLER)/x11config.pl \
     79                $(VBOX_PATH_X11_ADDITION_INSTALLER)/x11config15.pl \
    7980                $(VBOX_PATH_LINUX_ADDITION_INSTALLER)/Makefile.test \
    8081                $(VBOX_PATH_LINUX_ADDITION_INSTALLER)/test.c \
     
    8384                $(PATH_BIN)/additions/vboxmouse_drv_71.so \
    8485                $(PATH_BIN)/additions/vboxmouse_drv_14.so \
     86                $(PATH_BIN)/additions/vboxmouse_drv_15.so \
    8587                $(PATH_BIN)/additions/vboxvideo_drv.o \
    8688                $(PATH_BIN)/additions/vboxvideo_drv_70.so \
     
    123125        $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_X11_ADDITION_INSTALLER)/vboxvideo.ids         $(PATH_TARGET)/install
    124126        $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_X11_ADDITION_INSTALLER)/x11config.pl          $(PATH_TARGET)/install
     127        $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_X11_ADDITION_INSTALLER)/x11config15.pl        $(PATH_TARGET)/install
     128        $(QUIET)$(INSTALL) -m 0644 $(VBOX_PATH_LINUX_ADDITION_INSTALLER)/90-vboxguest.fdi    $(PATH_TARGET)/install
    125129        $(QUIET)$(BIN_COPY_SYMBOLS) $(PATH_BIN)/additions/vboxmouse_drv.o        $(PATH_TARGET)/install/vboxmouse_drv.o
    126130        $(QUIET)$(BIN_COPY) $(PATH_BIN)/additions/vboxmouse_drv_70.so    $(PATH_TARGET)/install/vboxmouse_drv_70.so
    127131        $(QUIET)$(BIN_COPY) $(PATH_BIN)/additions/vboxmouse_drv_71.so    $(PATH_TARGET)/install/vboxmouse_drv_71.so
    128132        $(QUIET)$(BIN_COPY) $(PATH_BIN)/additions/vboxmouse_drv_14.so    $(PATH_TARGET)/install/vboxmouse_drv_14.so
     133        $(QUIET)$(BIN_COPY) $(PATH_BIN)/additions/vboxmouse_drv_15.so    $(PATH_TARGET)/install/vboxmouse_drv_15.so
    129134        $(QUIET)$(BIN_COPY_SYMBOLS) $(PATH_BIN)/additions/vboxvideo_drv.o        $(PATH_TARGET)/install/vboxvideo_drv.o
    130135        $(QUIET)$(BIN_COPY) $(PATH_BIN)/additions/vboxvideo_drv_70.so    $(PATH_TARGET)/install/vboxvideo_drv_70.so
  • trunk/src/VBox/Additions/x11/installer/x11config15.pl

    r12275 r12283  
    33# Sun xVM VirtualBox
    44#
    5 # Guest Additions X11 config update script
     5# Guest Additions X11 config update script for X.org 1.5
    66#
    77# Copyright (C) 2006-2008 Sun Microsystems, Inc.
     
    2020#
    2121
     22# What this script does: X.org 1.5 introduces full hardware autodetection
     23# and no longer requires the user to provide an X.org configuration file.
     24# However, if such a file is provided, it will override autodetection of
     25# the graphics card (not of vboxmouse as far as I can see).  Although this
     26# would normally be the user's business, at least Fedora 9 still generates
     27# a configuration file by default, so we have to rewrite it if we want
     28# the additions to work on a default guest installation.  So we simply go
     29# through any configuration files we may find on the system and replace
     30# references to VESA or framebuffer drivers (which might be autodetected
     31# for use on a VirtualBox guest) and replace them with vboxvideo.
     32
     33use File::Copy;
     34
    2235my $temp="/tmp/xorg.conf";
    23 my $os_type=`uname -s`;
     36# The list of possible names of X.org configuration files
    2437my @cfg_files = ("/etc/X11/xorg.conf-4", "/etc/X11/xorg.conf", "/etc/X11/.xorg.conf", "/etc/xorg.conf",
    2538                 "/usr/etc/X11/xorg.conf-4", "/usr/etc/X11/xorg.conf", "/usr/lib/X11/xorg.conf-4",
    26                  "/usr/lib/X11/xorg.conf", "/etc/X11/XF86Config-4", "/etc/X11/XF86Config",
    27                  "/etc/XF86Config", "/usr/X11R6/etc/X11/XF86Config-4", "/usr/X11R6/etc/X11/XF86Config",
    28                  "/usr/X11R6/lib/X11/XF86Config-4", "/usr/X11R6/lib/X11/XF86Config");
     39                 "/usr/lib/X11/xorg.conf");
    2940my $CFG;
    3041my $TMP;
    3142
    32 my $config_count = 0;
     43# Subroutine to roll back after a partial installation
     44sub do_fail {
     45    foreach $cfg (@cfg_files) {
     46        move $cfg.".vbox", $cfg;
     47        unlink $cfg.".vbox";
     48    }
     49    die $1;
     50}
    3351
    34 foreach $cfg (@cfg_files)
    35 {
     52# Perform the substitution on any configuration file we may find.
     53foreach $cfg (@cfg_files) {
    3654
    37     if (open(CFG, $cfg))
    38     {
    39         open(TMP, ">$temp") or die "Can't create $TMP: $!\n";
     55    if (open(CFG, $cfg)) {
     56        open(TMP, ">$temp")
     57            or &do_fail("Can't create $TMP: $!\n");
    4058
    41         my $have_mouse = 0;
    42         my $in_section = 0;
    43 
    44         while (defined ($line = <CFG>))
    45         {
    46             if ($line =~ /^\s*Section\s*"([a-zA-Z]+)"/i)
    47             {
     59        while (defined ($line = <CFG>)) {
     60            if ($line =~ /^\s*Section\s*"([a-zA-Z]+)"/i) {
    4861                my $section = lc($1);
    49                 if (($section eq "inputdevice") || ($section eq "device"))
    50                 {
     62                if ($section eq "device") {
    5163                    $in_section = 1;
    5264                }
    53                 if ($section eq "serverlayout")
    54                 {
    55                     $in_layout = 1;
    56                 }
    5765            } else {
    58                 if ($line =~ /^\s*EndSection/i)
    59                 {
     66                if ($line =~ /^\s*EndSection/i) {
    6067                    $in_section = 0;
    61                     $in_layout = 0;
    6268                }
    6369            }
    6470
    65             if ($in_section)
    66             {
    67                 if ($line =~ /^\s*driver\s+\"(?:mouse|vboxmouse)\"/i)
    68                 {
    69                     $line = "    Driver      \"vboxmouse\"\n    Option      \"CorePointer\"\n";
    70                     $have_mouse = 1
    71                 }
    72 
    73                 # Other drivers sending events interfere badly with pointer integration
    74                 if ($line =~ /^\s*option\s+\"(?:alwayscore|sendcoreevents|corepointer)\"/i)
    75                 {
    76                     $line = "";
    77                 }
    78 
    79                 # Solaris specific: /dev/kdmouse for PS/2 and not /dev/mouse
    80                 if ($os_type =~ 'SunOS')
    81                 {
    82                     if ($line =~ /^\s*option\s+\"(?:device)\"\s+\"(?:\/dev\/mouse)\"/i)
    83                     {
    84                         $line = "    Option      \"Device\" \"\/dev\/kdmouse\"\n"
    85                     }
    86                 }
    87 
    88                 if ($line =~ /^\s*driver\s+\"(?:fbdev|vga|vesa|vboxvideo|ChangeMe)\"/i)
    89                 {
    90                     $line = "    Driver      \"vboxvideo\"\n";
    91                 }
    92             }
    93             if ($in_layout)
    94             {
    95                 # Other drivers sending events interfere badly with pointer integration
    96                 if (   $line =~ /^\s*inputdevice.*\"(?:alwayscore|sendcoreevents)\"/i)
    97                 {
    98                     $line = "";
     71            if ($in_section) {
     72                if ($line =~ /^\s*driver\s+\"(fbdev|vga|vesa|vboxvideo|ChangeMe)\"/i) {
     73                    $line =~ s/(fbdev|vga|vesa|vboxvideo|ChangeMe)/vboxvideo/i;
    9974                }
    10075            }
    10176            print TMP $line;
    10277        }
    103 
    104         if (!$have_mouse) {
    105             print TMP "\n";
    106             print TMP "Section \"InputDevice\"\n";
    107             print TMP "        Identifier  \"VBoxMouse\"\n";
    108             print TMP "        Driver      \"vboxmouse\"\n";
    109             if ($os_type eq 'SunOS')
    110             {
    111                 print TMP "        Option      \"Device\"     \"\/dev\/kdmouse\"\n";
    112             }
    113             print TMP "        Option      \"CorePointer\"\n";
    114             print TMP "EndSection\n";
    115         }
    11678        close(TMP);
    11779
    118         rename $cfg, $cfg.".bak";
    119         system("cp $temp $cfg");
     80        # We do not overwrite existing $cfg.".vbox" files because that will
     81        # likely ruin any future attempts to uninstall the additions
     82        copy $cfg, $cfg.".bak";
     83        if (! -e $cfg.".vbox") {
     84            rename $cfg, $cfg.".vbox";
     85        }
     86        copy $temp, $cfg
     87            or &do_fail("Could not overwrite configuration file $cfg!  Exiting...");
    12088        unlink $temp;
    121 
    122         # Solaris specific: Rename our modified .xorg.conf to xorg.conf for it to be used
    123         if (($os_type =~ 'SunOS') && ($cfg =~ '/etc/X11/.xorg.conf'))
    124         {
    125             system("mv -f $cfg /etc/X11/xorg.conf");
    126         }
    127 
    128         $config_count++;
    12989    }
    13090}
    131 
    132 $config_count != 0 or die "Could not find any X11 configuration files";
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