Commit 46266c4c authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Revert "Fuchsia: Explicitly check that all file dependencies exist."

This reverts commit 7891d057.

Reason for revert: See last comment, broke webkit_lint on the win tryservers.

Original change's description:
> Fuchsia: Explicitly check that all file dependencies exist.
> 
> Wrap file path references with "EnsureFileExists()" which acts as a
> simple identity function, except for invalid paths for which it
> raises IOErrors.
> 
> Bug: 837200
> Change-Id: Ie718cd5517415b375ed3bf5d5112d59b32074c04
> Reviewed-on: https://chromium-review.googlesource.com/1037778
> Reviewed-by: Scott Graham <scottmg@chromium.org>
> Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#555137}

TBR=wez@chromium.org,kmarshall@chromium.org,scottmg@chromium.org

Change-Id: Ic53f3c5b7bc2a6177166a8564584999dd2477454
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 837200
Reviewed-on: https://chromium-review.googlesource.com/1038444Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555183}
parent 5b4d9b94
......@@ -8,11 +8,3 @@ DIR_SOURCE_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'fuchsia-sdk', 'sdk')
def EnsurePathExists(path):
"""Checks that the file |path| exists on the filesystem and returns the path
if it does, raising an exception otherwise."""
if not os.path.exists(path):
raise IOError('Missing file: ' + path)
return path
......@@ -5,6 +5,7 @@
"""Implements commands for running and interacting with Fuchsia on devices."""
import boot_data
import common
import logging
import os
import subprocess
......@@ -12,8 +13,6 @@ import target
import time
import uuid
from common import SDK_ROOT, EnsurePathExists
CONNECT_RETRY_COUNT = 20
CONNECT_RETRY_WAIT_SECS = 1
......@@ -35,8 +34,7 @@ class DeviceTarget(target.Target):
self._new_instance = True
if self._auto:
self._ssh_config_path = EnsurePathExists(
boot_data.GetSSHConfigPath(output_dir))
self._ssh_config_path = boot_data.GetSSHConfigPath(output_dir)
else:
self._ssh_config_path = os.path.expanduser(ssh_config)
self._host = host
......@@ -48,7 +46,7 @@ class DeviceTarget(target.Target):
"""Returns the IP address and port of a Fuchsia instance discovered on
the local area network."""
netaddr_path = os.path.join(SDK_ROOT, 'tools', 'netaddr')
netaddr_path = os.path.join(common.SDK_ROOT, 'tools', 'netaddr')
command = [netaddr_path, '--fuchsia', '--nowait', node_name]
logging.debug(' '.join(command))
proc = subprocess.Popen(command,
......@@ -71,25 +69,25 @@ class DeviceTarget(target.Target):
logging.info('Netbooting Fuchsia. ' +
'Please ensure that your device is in bootloader mode.')
bootserver_path = os.path.join(SDK_ROOT, 'tools', 'bootserver')
bootserver_command = [
bootserver_path,
'-1',
'--efi',
EnsurePathExists(boot_data.GetTargetFile(self._GetTargetSdkArch(),
'local.esp.blk')),
'--fvm',
EnsurePathExists(boot_data.GetTargetFile(self._GetTargetSdkArch(),
'fvm.sparse.blk')),
'--fvm',
EnsurePathExists(
boot_data.ConfigureDataFVM(self._output_dir,
boot_data.FVM_TYPE_SPARSE)),
EnsurePathExists(boot_data.GetTargetFile(self._GetTargetSdkArch(),
'zircon.bin')),
EnsurePathExists(boot_data.GetTargetFile(self._GetTargetSdkArch(),
'bootdata-blob.bin')),
'--'] + boot_data.GetKernelArgs(self._output_dir)
bootserver_path = os.path.join(common.SDK_ROOT, 'tools', 'bootserver')
data_fvm_path = boot_data.ConfigureDataFVM(self._output_dir,
boot_data.FVM_TYPE_SPARSE)
bootserver_command = [bootserver_path,
'-1',
'--efi',
boot_data.GetTargetFile(self._GetTargetSdkArch(),
'local.esp.blk'),
'--fvm',
boot_data.GetTargetFile(self._GetTargetSdkArch(),
'fvm.sparse.blk'),
'--fvm',
data_fvm_path,
boot_data.GetTargetFile(self._GetTargetSdkArch(),
'zircon.bin'),
boot_data.GetTargetFile(self._GetTargetSdkArch(),
'bootdata-blob.bin'),
'--'] + \
boot_data.GetKernelArgs(self._output_dir)
logging.debug(' '.join(bootserver_command))
subprocess.check_call(bootserver_command)
......
......@@ -5,6 +5,7 @@
"""Implements commands for running and interacting with Fuchsia on QEMU."""
import boot_data
import common
import logging
import target
import os
......@@ -13,8 +14,6 @@ import socket
import subprocess
import time
from common import SDK_ROOT, EnsurePathExists
# Virtual networking configuration data for QEMU.
GUEST_NET = '192.168.3.0/24'
......@@ -52,8 +51,9 @@ class QemuTarget(target.Target):
self.Shutdown()
def Start(self):
qemu_path = os.path.join(SDK_ROOT, 'qemu', 'bin',
'qemu-system-' + self._GetTargetSdkArch())
qemu_path = os.path.join(
common.SDK_ROOT, 'qemu', 'bin',
'qemu-system-' + self._GetTargetSdkArch())
kernel_args = boot_data.GetKernelArgs(self._output_dir)
# TERM=dumb tells the guest OS to not emit ANSI commands that trigger
......@@ -67,24 +67,20 @@ class QemuTarget(target.Target):
qemu_command = [qemu_path,
'-m', str(self._ram_size_mb),
'-nographic',
'-kernel', EnsurePathExists(
boot_data.GetTargetFile(self._GetTargetSdkArch(),
'zircon.bin')),
'-initrd', EnsurePathExists(
boot_data.GetTargetFile(self._GetTargetSdkArch(),
'bootdata-blob.bin')),
'-kernel', boot_data.GetTargetFile(self._GetTargetSdkArch(),
'zircon.bin'),
'-initrd', boot_data.GetTargetFile(self._GetTargetSdkArch(),
'bootdata-blob.bin'),
'-smp', '4',
# Attach the blobstore and data volumes. Use snapshot mode to discard
# any changes.
'-snapshot',
'-drive', 'file=%s,format=qcow2,if=none,id=data,snapshot=on' %
EnsurePathExists(os.path.join(self._output_dir,
'fvm.blk.qcow2')),
os.path.join(self._output_dir, 'fvm.blk.qcow2'),
'-drive', 'file=%s,format=qcow2,if=none,id=blobstore,snapshot=on' %
EnsurePathExists(
boot_data.ConfigureDataFVM(self._output_dir,
boot_data.FVM_TYPE_QCOW)),
boot_data.ConfigureDataFVM(self._output_dir,
boot_data.FVM_TYPE_QCOW),
'-device', 'virtio-blk-pci,drive=data',
'-device', 'virtio-blk-pci,drive=blobstore',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment