From a058c452957138b5c75bfccc4eb0dc203c08a558 Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Wed, 04 Jul 2012 22:55:21 +0000 Subject: Tweak ubuntu X configuration in check-system And remove the instructions from README --- diff --git a/README b/README index 63357e2..9964c8c 100644 --- a/README +++ b/README @@ -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 = diff --git a/TODO b/TODO index 1efd2b7..94356b1 100644 --- a/TODO +++ b/TODO @@ -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 -- cgit v0.9.1