Changeset 12283 in vbox
- Timestamp:
- Sep 9, 2008 10:19:10 AM (16 years ago)
- 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 77 77 $(VBOX_PATH_X11_ADDITION_INSTALLER)/vboxvideo.ids \ 78 78 $(VBOX_PATH_X11_ADDITION_INSTALLER)/x11config.pl \ 79 $(VBOX_PATH_X11_ADDITION_INSTALLER)/x11config15.pl \ 79 80 $(VBOX_PATH_LINUX_ADDITION_INSTALLER)/Makefile.test \ 80 81 $(VBOX_PATH_LINUX_ADDITION_INSTALLER)/test.c \ … … 83 84 $(PATH_BIN)/additions/vboxmouse_drv_71.so \ 84 85 $(PATH_BIN)/additions/vboxmouse_drv_14.so \ 86 $(PATH_BIN)/additions/vboxmouse_drv_15.so \ 85 87 $(PATH_BIN)/additions/vboxvideo_drv.o \ 86 88 $(PATH_BIN)/additions/vboxvideo_drv_70.so \ … … 123 125 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_X11_ADDITION_INSTALLER)/vboxvideo.ids $(PATH_TARGET)/install 124 126 $(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 125 129 $(QUIET)$(BIN_COPY_SYMBOLS) $(PATH_BIN)/additions/vboxmouse_drv.o $(PATH_TARGET)/install/vboxmouse_drv.o 126 130 $(QUIET)$(BIN_COPY) $(PATH_BIN)/additions/vboxmouse_drv_70.so $(PATH_TARGET)/install/vboxmouse_drv_70.so 127 131 $(QUIET)$(BIN_COPY) $(PATH_BIN)/additions/vboxmouse_drv_71.so $(PATH_TARGET)/install/vboxmouse_drv_71.so 128 132 $(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 129 134 $(QUIET)$(BIN_COPY_SYMBOLS) $(PATH_BIN)/additions/vboxvideo_drv.o $(PATH_TARGET)/install/vboxvideo_drv.o 130 135 $(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 3 3 # Sun xVM VirtualBox 4 4 # 5 # Guest Additions X11 config update script 5 # Guest Additions X11 config update script for X.org 1.5 6 6 # 7 7 # Copyright (C) 2006-2008 Sun Microsystems, Inc. … … 20 20 # 21 21 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 33 use File::Copy; 34 22 35 my $temp="/tmp/xorg.conf"; 23 my $os_type=`uname -s`; 36 # The list of possible names of X.org configuration files 24 37 my @cfg_files = ("/etc/X11/xorg.conf-4", "/etc/X11/xorg.conf", "/etc/X11/.xorg.conf", "/etc/xorg.conf", 25 38 "/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"); 29 40 my $CFG; 30 41 my $TMP; 31 42 32 my $config_count = 0; 43 # Subroutine to roll back after a partial installation 44 sub do_fail { 45 foreach $cfg (@cfg_files) { 46 move $cfg.".vbox", $cfg; 47 unlink $cfg.".vbox"; 48 } 49 die $1; 50 } 33 51 34 foreach $cfg (@cfg_files) 35 {52 # Perform the substitution on any configuration file we may find. 53 foreach $cfg (@cfg_files) { 36 54 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"); 40 58 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) { 48 61 my $section = lc($1); 49 if (($section eq "inputdevice") || ($section eq "device")) 50 { 62 if ($section eq "device") { 51 63 $in_section = 1; 52 64 } 53 if ($section eq "serverlayout")54 {55 $in_layout = 1;56 }57 65 } else { 58 if ($line =~ /^\s*EndSection/i) 59 { 66 if ($line =~ /^\s*EndSection/i) { 60 67 $in_section = 0; 61 $in_layout = 0;62 68 } 63 69 } 64 70 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; 99 74 } 100 75 } 101 76 print TMP $line; 102 77 } 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 }116 78 close(TMP); 117 79 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..."); 120 88 unlink $temp; 121 122 # Solaris specific: Rename our modified .xorg.conf to xorg.conf for it to be used123 if (($os_type =~ 'SunOS') && ($cfg =~ '/etc/X11/.xorg.conf'))124 {125 system("mv -f $cfg /etc/X11/xorg.conf");126 }127 128 $config_count++;129 89 } 130 90 } 131 132 $config_count != 0 or die "Could not find any X11 configuration files";
Note:
See TracChangeset
for help on using the changeset viewer.