Changeset 43796 in vbox for trunk/src/VBox/Installer
- Timestamp:
- Nov 2, 2012 11:39:25 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 81781
- Location:
- trunk/src/VBox/Installer/linux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/VBoxHeadlessXOrg.sh
r43704 r43796 81 81 The optional configuration file should contain a series of lines of the form 82 82 "KEY=value". It will be read in as a command shell sub-script. Here is the 83 current list of possible key settings with a short explanation. 83 current list of possible key settings with a short explanation. Usually it 84 should be sufficient to change the value of \${HEADLESS_X_ORG_USERS} and to 85 leave all other settings unchanged. 84 86 85 87 HEADLESS_X_ORG_CONFIGURATION_FOLDER … … 100 102 repeated at regular intervals until it returns successfully, so a command 101 103 which can be executed internally be the shell (like "[") is preferable. 104 The default command waits until the udev event queue has settled. 105 106 HEADLESS_X_ORG_USERS 107 List of users who will have access to the X servers started and for whom we 108 will provide the configuration details via VirtualBox extra data. This 109 variable is only used by the commands in the default configuration 110 (\${HEADLESS_X_ORG_SERVER_PRE_COMMAND} and 111 \${HEADLESS_X_ORG_SERVER_POST_COMMAND}), and not by the service itself. 102 112 103 113 HEADLESS_X_ORG_SERVER_PRE_COMMAND 104 114 Command to execute once to perform any set-up needed before starting the 105 X servers, such as setting up the X server authentication. 115 X servers, such as setting up the X server authentication. The default 116 command creates an authority file for each of the users in the list 117 \${HEADLESS_X_ORG_USERS}. 106 118 107 119 HEADLESS_X_ORG_SERVER_COMMAND … … 112 124 HEADLESS_X_ORG_SERVER_COMMAND="Xorg :\${screen} [...] > \"\${log_file}\" 113 125 126 HEADLESS_X_ORG_SERVER_POST_COMMAND 127 Command to execute once the X servers have been successfully started. By 128 default this stores the service configuration information to VirtualBox 129 extra data for each of the users in the list \${HEADLESS_X_ORG_USERS}. 130 114 131 HEADLESS_X_ORG_SERVER_LOG_FILE_TEMPLATE 115 The default X server log file name, containing the variable " ${screen}" for132 The default X server log file name, containing the variable "\${screen}" for 116 133 the screen number. The variable must be quoted for expansion at evaluation 117 134 time, e.g. … … 125 142 HEADLESS_X_ORG_LOG_FILE="${SERVICE_NAME}.log" 126 143 HEADLESS_X_ORG_RUN_FOLDER="/var/run/${SERVICE_NAME}" 127 HEADLESS_X_ORG_CHECK_PREREQUISITES=" [ -e /dev/dri/card0 ]"144 HEADLESS_X_ORG_CHECK_PREREQUISITES="udevadm settle || ! udevadm -V" 128 145 X_AUTH_FILE="${HEADLESS_X_ORG_RUN_FOLDER}/xauth" 129 HEADLESS_X_ORG_SERVER_PRE_COMMAND="echo > \"${X_AUTH_FILE}\"; xauth -f \"${X_AUTH_FILE}\" add :0 . \"\$(dd if=/dev/urandom count=1 bs=16 2>/dev/null | od -An -x)\" "146 HEADLESS_X_ORG_SERVER_PRE_COMMAND="echo > \"${X_AUTH_FILE}\"; xauth -f \"${X_AUTH_FILE}\" add :0 . \"\$(dd if=/dev/urandom count=1 bs=16 2>/dev/null | od -An -x)\"; for i in ${HEADLESS_X_ORG_USERS}; do cp \"${X_AUTH_FILE}\" \"${X_AUTH_FILE}.${i}\"; chown \"${i}\" \"${X_AUTH_FILE}.${i}\"; done" 130 147 HEADLESS_X_ORG_SERVER_COMMAND="Xorg :\${screen} -auth \"${HEADLESS_X_ORG_RUN_FOLDER}/xauth\" -config \"\${conf_file}\" -logverbose 0 -logfile /dev/null -verbose 7 > \"\${log_file}\" 2>&1" 131 148 HEADLESS_X_ORG_SERVER_LOG_FILE_TEMPLATE="Xorg.\${screen}.log" … … 245 262 space=" " 246 263 done 264 265 # Do any post-start work. 266 eval "${HEADLESS_X_ORG_SERVER_POST_COMMAND}" 267 247 268 wait -
trunk/src/VBox/Installer/linux/testcase/tstHeadlessXOrg.sh
r43795 r43796 264 264 expect_exit "${PID}" 5 test_pre_command 265 265 rm -f "${XORG_FOLDER}"/xorg.conf.* "${TEST_FOLDER}"/run/pre* 266 267 # Set up our post-command test configuration file. 268 create_basic_configuration_file "${TEST_FOLDER}/conf" "${TEST_FOLDER}" 269 cat >> "${TEST_FOLDER}/conf" << EOF 270 HEADLESS_X_ORG_SERVER_COMMAND="rm -f \"${TEST_FOLDER}/run/post\"" 271 HEADLESS_X_ORG_SERVER_POST_COMMAND="touch \"${TEST_FOLDER}/run/post\"" 272 EOF 273 274 # Post-command test. 275 print_line "post-command test" 276 touch "${XORG_FOLDER}/xorg.conf.2" 277 touch "${XORG_FOLDER}/xorg.conf.4" 278 279 test_post_command() 280 { 281 STATUS="$1" 282 case "${STATUS}" in 283 0) 284 LOG_FOLDER="${TEST_FOLDER}/log" 285 LOG="${LOG_FOLDER}/log" 286 if [ -e "${TEST_FOLDER}/run/post" ]; then 287 printf "SUCCESS.\n" 288 else 289 printf "\nFAILED: post-command not executed.\n" 290 fi 291 ;; 292 *) 293 printf "\nFAILED: exit status ${STATUS}.\n" 294 esac 295 } 296 297 rm -f "${TEST_FOLDER}/run/post" 298 ./VBoxHeadlessXOrg.sh -c "${TEST_FOLDER}/conf" & 299 PID=$! 300 expect_exit "${PID}" 5 test_post_command 301 rm -f "${XORG_FOLDER}"/xorg.conf.* "${TEST_FOLDER}/run/post"
Note:
See TracChangeset
for help on using the changeset viewer.