Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: fixup_image_for_qemu.py

Issue 6768009: Use 1280x1024 resolution when running ChromeOS under qemu. (Closed) Base URL: ssh://gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | image_to_vm.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
rkc 2011/03/29 01:57:30 Nit: 2011 now
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 """Makes changes to mounted Chromium OS image to allow it to run with VMs
8
9 This script changes two files within the Chromium OS image to let the image
10 work with VMs, particularly QEMU
11
12 Currently this script does the following,
13 1.) Modify xorg.conf to advertize a screen which can do 1280x1024
14 """
15
16 from optparse import OptionParser
17 import os
18 import stat
19 import sys
20
21 USAGE = "usage: %prog --mounted_dir=directory"
22
23 REPLACE_SCREEN_PAIR = ('Identifier "DefaultMonitor"',
24 'Identifier "DefaultMonitor"\n HorizSync 28-51\n VertRefresh 43-60')
25 XORG_CONF_FILENAME = os.path.join('etc', 'X11', 'xorg.conf')
26
27
28 # Modify the xorg.conf file to change all screen sections
29 def FixXorgConf(mount_point):
30 xorg_conf_filename = os.path.join(mount_point, XORG_CONF_FILENAME)
31 f = open(xorg_conf_filename, 'r')
32 xorg_conf = f.read()
33 f.close()
34
35 # Add refresh rates for the screen
36 xorg_conf = xorg_conf.replace(REPLACE_SCREEN_PAIR[0],
37 REPLACE_SCREEN_PAIR[1])
38
39 # Write the file back out.
40 f = open(xorg_conf_filename, 'w')
41 f.write(xorg_conf)
42 f.close()
43
44 def main():
45 parser = OptionParser(USAGE)
46 parser.add_option('--mounted_dir', dest='mounted_dir',
47 help='directory where the Chromium OS image is mounted')
48 (options, args) = parser.parse_args()
49
50 if not options.mounted_dir:
51 parser.error("Please specify the mount point for the Chromium OS image");
52
53 FixXorgConf(options.mounted_dir)
54
55
56 if __name__ == '__main__':
57 main()
OLDNEW
« no previous file with comments | « no previous file | image_to_vm.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698