VirtualBox

Ignore:
Timestamp:
Jun 15, 2013 3:34:01 PM (12 years ago)
Author:
vboxsync
Message:

Additions/linux: make XFree86 configuration file generation work without a template too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/installer/vboxadd-x11.sh

    r46563 r46574  
    302302    # The driver extension
    303303    driver_ext=".so"
     304    # The configuration file we generate if no original was found but we need
     305    # one.
     306    main_cfg="/etc/X11/xorg.conf"
    304307
    305308    modules_dir=`X -showDefaultModulePath 2>&1` || modules_dir=
     
    404407            ;;
    405408        6.7* | 6.8.* | 4.2.* | 4.3.* )
    406             # Assume X.Org post-fork or XFree86
     409            # As the module binaries are the same we use one text for these
     410            # four server versions.
    407411            xserver_version="XFree86 4.2/4.3 and X.Org 6.7/6.8"
    408412            driver_ext=.o
     
    410414            vboxmouse_src=vboxmouse_drv.o
    411415            automouse=""
    412             autokeyboard=""  # Actually not true for 6.8, but it doesn't matter.
     416            autokeyboard=""
     417            case $x_version in
     418                6.8.* )
     419                    autokeyboard="true"
     420                    ;;
     421                4.2.* | 4.3.* )
     422                    main_cfg="/etc/X11/XF86Config"
     423                    ;;
     424            esac
    413425            ;;
    414426        * )
     
    470482            # X.Org Server 1.5 and 1.6 can detect hardware they know, but they
    471483            # need a configuration file for VBoxVideo.
    472             main_cfg="/etc/X11/xorg.conf"
    473             nobak="/etc/X11/xorg.vbox.nobak"
     484            nobak_cfg="`expr "${main_cfg}" : '\([^.]*\)'`.vbox.nobak"
    474485            if test -z "$configured"; then
    475486                touch "$main_cfg"
    476487                "$lib_dir/x11config.sh" $autokeyboard $automouse $nopsaux --noBak "$main_cfg"
    477                 touch "$nobak"
     488                touch "${nobak_cfg}"
    478489            fi
    479490        fi
     
    542553{
    543554    # Restore xorg.conf files as far as possible
    544     ## List of generated files which have been changed since we generated them
     555    # List of generated files which have been changed since we generated them
    545556    newer=""
    546     ## Are we dealing with a legacy information which didn't support
     557    # Are we dealing with a legacy information which didn't support
    547558    # uninstallation?
    548559    legacy=""
    549     ## Do any of the restored configuration files still reference our drivers?
     560    # Do any of the restored configuration files still reference our drivers?
    550561    failed=""
     562    # Have we encountered a "nobak" configuration file which means that there
     563    # is no original file to restore?
     564    nobak=""
    551565    test -r "$CONFIG_DIR/$CONFIG" || legacy="true"
    552     main_cfg="/etc/X11/xorg.conf"
    553     nobak="/etc/X11/xorg.vbox.nobak"
    554     if test -r "$nobak"; then
    555         test -r "$main_cfg" &&
    556             if test -n "$legacy" -o ! "$nobak" -ot "$main_cfg"; then
    557                 rm -f "$nobak" "$main_cfg"
     566    for main_cfg in "/etc/X11/xorg.conf" "/etc/X11/XF86Config"; do
     567        nobak_cfg="`expr "${main_cfg}" : '\([^.]*\)'`.vbox.nobak"
     568        if test -r "${nobak_cfg}"; then
     569            test -r "${main_cfg}" &&
     570            if test -n "${legacy}" -o ! "${nobak_cfg}" -ot "${main_cfg}"; then
     571                rm -f "${nobak_cfg}" "${main_cfg}"
    558572            else
    559                 newer="$newer`printf "  $main_cfg (no original)\n"`"
     573                newer="${newer}`printf "  ${main_cfg} (no original)\n"`"
    560574            fi
    561     else
     575            nobak="true"
     576        fi
     577    done
     578    if test -n "${nobak}"; then
    562579        for i in $x11conf_files; do
    563580            if test -r "$i.vbox"; then
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