diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-07-04 22:55:21 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-07-04 22:56:06 (GMT) |
commit | a058c452957138b5c75bfccc4eb0dc203c08a558 (patch) | |
tree | e7b0f3f1e7eb82677bb97b95213504e50540db9e | |
parent | d1bf08573a4e49b1db2c8f2abef528fddd7f025e (diff) |
Tweak ubuntu X configuration in check-system
And remove the instructions from README
-rw-r--r-- | README | 13 | ||||
-rw-r--r-- | TODO | 1 | ||||
-rwxr-xr-x | scripts/check-system | 17 | ||||
-rwxr-xr-x | scripts/ubuntu-tweaks | 6 |
4 files changed, 25 insertions, 12 deletions
@@ -2,17 +2,8 @@ For all the distributions your user need admin rights (i.e. it should be able to run the su command). -== Fedora 17 (32-bit and 64-bit) == - -Works out of the box! - -== Ubuntu 12.04 (32-bit and 64-bit) == - -By default only root can start the X server. You need to change that with - - sudo dpkg-reconfigure x11-common - -I'm hoping we can get rid of this step in the next Ubuntu version when a working nested X server implementation should become available. +Fedora 17 (32-bit and 64-bit) +Ubuntu 12.04 (32-bit and 64-bit) = Getting started = @@ -1,3 +1,2 @@ -* Add x11-common reconfig to check system and remove from README * Figure out what to do with shutdown * Allow to configure resolution (sugarbuildrc?) diff --git a/scripts/check-system b/scripts/check-system index 75498b2..17eda54 100755 --- a/scripts/check-system +++ b/scripts/check-system @@ -4,6 +4,7 @@ import os import subprocess import sys +scriptdir = os.path.dirname(__file__) devnull = open("/dev/null", "w") xvfb_display = ":100" @@ -386,6 +387,21 @@ def check_distro(): return distro +def apply_ubuntu_tweaks(): + wrapper_config = open("/etc/X11/Xwrapper.config").read() + if "allowed_users=anybody" not in wrapper_config: + if "SUGAR_BUILDBOT" in os.environ: + print "\nPlease allow anybody to run the X server with \n" \ + " sudo dpkg-reconfigure x11-common" + else: + print "\nWe are going to allow anybody to run the X server" + ubuntu_tweaks = os.path.join(scriptdir, "ubuntu-tweaks") + subprocess.call(["sudo", ubuntu_tweaks]) + +def apply_distro_tweaks(distro): + if distro == "fedora": + apply_ubuntu_tweaks() + def warn_if_unsupported(distro): if distro == "unsupported": print "*********************************************************\n" \ @@ -405,5 +421,6 @@ xvfb_proc, orig_display = start_xvfb() run_checks(distro, checks) warn_if_unsupported(distro) +apply_distro_tweaks(distro) stop_xvfb(xvfb_proc, orig_display) diff --git a/scripts/ubuntu-tweaks b/scripts/ubuntu-tweaks new file mode 100755 index 0000000..be5ebf2 --- /dev/null +++ b/scripts/ubuntu-tweaks @@ -0,0 +1,6 @@ +#!/bin/sh + +XWRAPPERCONFIG=/etc/X11/Xwrapper.config + +sed -i '/^allowed_users.*/d' $XWRAPPERCONFIG +echo "allowed_users=anybody" >> $XWRAPPERCONFIG |