VirtualBox

Changeset 46352 in vbox for trunk/src/VBox/Installer/linux


Ignore:
Timestamp:
May 31, 2013 9:07:53 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
86145
Message:

Installer/linux/headlessxorg: a number of updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/scripts/VBoxHeadlessXOrg.sh

    r44529 r46352  
    152152HEADLESS_X_ORG_RUN_FOLDER="/var/run/${SERVICE_NAME}"
    153153HEADLESS_X_ORG_USERS=""
    154 HEADLESS_X_ORG_FIRST_DISPLAY=10
     154HEADLESS_X_ORG_FIRST_DISPLAY=40
    155155X_AUTH_FILE="${HEADLESS_X_ORG_RUN_FOLDER}/xauth"
    156156
    157157default_wait_for_prerequisites()
    158158{
    159     udevadm settle # Fails if no udevadm.
     159    udevadm settle || udevsettle # Fails if no udevadm.
    160160}
    161161HEADLESS_X_ORG_WAIT_FOR_PREREQUISITES="default_wait_for_prerequisites"
     
    163163default_pre_command()
    164164{
    165   # Create and duplicate the authority file.
     165  # Create new authority file.
    166166  echo > "${X_AUTH_FILE}"
    167   key="$(dd if=/dev/urandom count=1 bs=16 2>/dev/null | od -An -x)"
    168   xauth -f "${X_AUTH_FILE}" add :0 . "${key}"
    169   for i in ${HEADLESS_X_ORG_USERS}; do
    170     cp "${X_AUTH_FILE}" "${X_AUTH_FILE}.${i}"
    171     chown "${i}" "${X_AUTH_FILE}.${i}"
    172   done
    173167  # Create the xorg.conf files.
    174168  mkdir -p "${HEADLESS_X_ORG_CONFIGURATION_FOLDER}" || return 1
     
    176170  for i in /sys/bus/pci/devices/*; do
    177171    read class < "${i}/class"
    178     case ${class} in *03????)
     172    case "${class}" in *03????)
    179173      address="${i##*/}"
    180174      address="${address%%:*}${address#*:}"
    181175      address="PCI:${address%%.*}:${address#*.}"
    182       cat > "${HEADLESS_X_ORG_CONFIGURATION_FOLDER}/xorg.conf.${display}" << EOF
     176      read vendor < "${i}/vendor"
     177      case "${vendor}" in *10de|*10DE)  # NVIDIA
     178        cat > "${HEADLESS_X_ORG_CONFIGURATION_FOLDER}/xorg.conf.${display}" << EOF
     179Section "Module"
     180    Load       "glx"
     181EndSection
     182Section "Device"
     183    Identifier "Device${display}"
     184    Driver     "nvidia"
     185    Option     "UseDisplayDevice" "none"
     186EndSection
    183187Section "Screen"
    184188    Identifier "Screen${display}"
     189    Device     "Device${display}"
    185190EndSection
    186191Section "ServerLayout"
     
    194199EndSection
    195200EOF
    196     display=`expr ${display} + 1`
     201      esac
     202      # Add key to the authority file.
     203      key="$(dd if=/dev/urandom count=1 bs=16 2>/dev/null | od -An -x)"
     204      xauth -f "${X_AUTH_FILE}" add :${display} . "${key}"
     205      display=`expr ${display} + 1`
    197206    esac
     207  done
     208  # Duplicate the authority file.
     209  for i in ${HEADLESS_X_ORG_USERS}; do
     210    cp "${X_AUTH_FILE}" "${X_AUTH_FILE}.${i}"
     211    chown "${i}" "${X_AUTH_FILE}.${i}"
    198212  done
    199213}
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