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

Side by Side Diff: fixup_image_for_qemu.py

Issue 2973005: fixed vm scripts (Closed) Base URL: ssh://gitrw.chromium.org/crosutils.git
Patch Set: fixes Created 10 years, 5 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
« 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
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Makes changes to mounted Chromium OS image to allow it to run with VMs 7 """Makes changes to mounted Chromium OS image to allow it to run with VMs
8 8
9 This script changes two files within the Chromium OS image to let the image 9 This script changes two files within the Chromium OS image to let the image
10 work with VMs, particularly QEMU 10 work with VMs, particularly QEMU
(...skipping 17 matching lines...) Expand all
28 import sys 28 import sys
29 29
30 USAGE = "usage: %prog --mounted_dir=directory --for_qemu=[true]" 30 USAGE = "usage: %prog --mounted_dir=directory --for_qemu=[true]"
31 31
32 POST_INST_IN_FILENAME = 'usr/sbin/chromeos-postinst' 32 POST_INST_IN_FILENAME = 'usr/sbin/chromeos-postinst'
33 POST_INST_OUT_FILENAME = 'postinst_vm' 33 POST_INST_OUT_FILENAME = 'postinst_vm'
34 XORG_CONF_FILENAME = os.path.join('etc', 'X11', 'xorg.conf') 34 XORG_CONF_FILENAME = os.path.join('etc', 'X11', 'xorg.conf')
35 35
36 EFI_CODE_MARKER_START = r'echo "Updating grub target for EFI BIOS"' 36 EFI_CODE_MARKER_START = r'echo "Updating grub target for EFI BIOS"'
37 EFI_CODE_MARKER_END = \ 37 EFI_CODE_MARKER_END = \
38 r"""gpt -S boot -i $NEW_PART_NUM -b /tmp/oldpmbr.bin ${ROOT_DEV} 2>&1 38 r"""sh "${INSTALL_ROOT}"/usr/sbin/chromeos-firmwareupdate
39 fi 39 fi
40 else""" 40 else"""
41 41
42 INPUT_SECTION_MARKER = r'Section "InputDevice"' 42 INPUT_SECTION_MARKER = r'Section "InputDevice"'
43 SECTION_END_MARKER = r'EndSection' 43 SECTION_END_MARKER = r'EndSection'
44 44
45 MOUSE_SECTION_IDENTIFIERS = [] 45 MOUSE_SECTION_IDENTIFIERS = []
46 MOUSE_SECTION_IDENTIFIERS += ['Identifier "Mouse'] 46 MOUSE_SECTION_IDENTIFIERS += ['Identifier "Mouse']
47 MOUSE_SECTION_IDENTIFIERS += ['Identifier "USBMouse'] 47 MOUSE_SECTION_IDENTIFIERS += ['Identifier "USBMouse']
48 48
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 if options.for_qemu not in ('true', 'false'): 139 if options.for_qemu not in ('true', 'false'):
140 parser.error("Please specify either true or false for --for_qemu") 140 parser.error("Please specify either true or false for --for_qemu")
141 141
142 FixPostInst(options.mounted_dir) 142 FixPostInst(options.mounted_dir)
143 if (options.for_qemu == 'true'): 143 if (options.for_qemu == 'true'):
144 FixXorgConf(options.mounted_dir) 144 FixXorgConf(options.mounted_dir)
145 145
146 146
147 if __name__ == '__main__': 147 if __name__ == '__main__':
148 main() 148 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