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( ...@@ -8,11 +8,3 @@ DIR_SOURCE_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'fuchsia-sdk', 'sdk') 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 @@ ...@@ -5,6 +5,7 @@
"""Implements commands for running and interacting with Fuchsia on devices.""" """Implements commands for running and interacting with Fuchsia on devices."""
import boot_data import boot_data
import common
import logging import logging
import os import os
import subprocess import subprocess
...@@ -12,8 +13,6 @@ import target ...@@ -12,8 +13,6 @@ import target
import time import time
import uuid import uuid
from common import SDK_ROOT, EnsurePathExists
CONNECT_RETRY_COUNT = 20 CONNECT_RETRY_COUNT = 20
CONNECT_RETRY_WAIT_SECS = 1 CONNECT_RETRY_WAIT_SECS = 1
...@@ -35,8 +34,7 @@ class DeviceTarget(target.Target): ...@@ -35,8 +34,7 @@ class DeviceTarget(target.Target):
self._new_instance = True self._new_instance = True
if self._auto: if self._auto:
self._ssh_config_path = EnsurePathExists( self._ssh_config_path = boot_data.GetSSHConfigPath(output_dir)
boot_data.GetSSHConfigPath(output_dir))
else: else:
self._ssh_config_path = os.path.expanduser(ssh_config) self._ssh_config_path = os.path.expanduser(ssh_config)
self._host = host self._host = host
...@@ -48,7 +46,7 @@ class DeviceTarget(target.Target): ...@@ -48,7 +46,7 @@ class DeviceTarget(target.Target):
"""Returns the IP address and port of a Fuchsia instance discovered on """Returns the IP address and port of a Fuchsia instance discovered on
the local area network.""" 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] command = [netaddr_path, '--fuchsia', '--nowait', node_name]
logging.debug(' '.join(command)) logging.debug(' '.join(command))
proc = subprocess.Popen(command, proc = subprocess.Popen(command,
...@@ -71,25 +69,25 @@ class DeviceTarget(target.Target): ...@@ -71,25 +69,25 @@ class DeviceTarget(target.Target):
logging.info('Netbooting Fuchsia. ' + logging.info('Netbooting Fuchsia. ' +
'Please ensure that your device is in bootloader mode.') 'Please ensure that your device is in bootloader mode.')
bootserver_path = os.path.join(SDK_ROOT, 'tools', 'bootserver') bootserver_path = os.path.join(common.SDK_ROOT, 'tools', 'bootserver')
bootserver_command = [ data_fvm_path = boot_data.ConfigureDataFVM(self._output_dir,
bootserver_path, boot_data.FVM_TYPE_SPARSE)
bootserver_command = [bootserver_path,
'-1', '-1',
'--efi', '--efi',
EnsurePathExists(boot_data.GetTargetFile(self._GetTargetSdkArch(), boot_data.GetTargetFile(self._GetTargetSdkArch(),
'local.esp.blk')), 'local.esp.blk'),
'--fvm', '--fvm',
EnsurePathExists(boot_data.GetTargetFile(self._GetTargetSdkArch(), boot_data.GetTargetFile(self._GetTargetSdkArch(),
'fvm.sparse.blk')), 'fvm.sparse.blk'),
'--fvm', '--fvm',
EnsurePathExists( data_fvm_path,
boot_data.ConfigureDataFVM(self._output_dir, boot_data.GetTargetFile(self._GetTargetSdkArch(),
boot_data.FVM_TYPE_SPARSE)), 'zircon.bin'),
EnsurePathExists(boot_data.GetTargetFile(self._GetTargetSdkArch(), boot_data.GetTargetFile(self._GetTargetSdkArch(),
'zircon.bin')), 'bootdata-blob.bin'),
EnsurePathExists(boot_data.GetTargetFile(self._GetTargetSdkArch(), '--'] + \
'bootdata-blob.bin')), boot_data.GetKernelArgs(self._output_dir)
'--'] + boot_data.GetKernelArgs(self._output_dir)
logging.debug(' '.join(bootserver_command)) logging.debug(' '.join(bootserver_command))
subprocess.check_call(bootserver_command) subprocess.check_call(bootserver_command)
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"""Implements commands for running and interacting with Fuchsia on QEMU.""" """Implements commands for running and interacting with Fuchsia on QEMU."""
import boot_data import boot_data
import common
import logging import logging
import target import target
import os import os
...@@ -13,8 +14,6 @@ import socket ...@@ -13,8 +14,6 @@ import socket
import subprocess import subprocess
import time import time
from common import SDK_ROOT, EnsurePathExists
# Virtual networking configuration data for QEMU. # Virtual networking configuration data for QEMU.
GUEST_NET = '192.168.3.0/24' GUEST_NET = '192.168.3.0/24'
...@@ -52,7 +51,8 @@ class QemuTarget(target.Target): ...@@ -52,7 +51,8 @@ class QemuTarget(target.Target):
self.Shutdown() self.Shutdown()
def Start(self): def Start(self):
qemu_path = os.path.join(SDK_ROOT, 'qemu', 'bin', qemu_path = os.path.join(
common.SDK_ROOT, 'qemu', 'bin',
'qemu-system-' + self._GetTargetSdkArch()) 'qemu-system-' + self._GetTargetSdkArch())
kernel_args = boot_data.GetKernelArgs(self._output_dir) kernel_args = boot_data.GetKernelArgs(self._output_dir)
...@@ -67,24 +67,20 @@ class QemuTarget(target.Target): ...@@ -67,24 +67,20 @@ class QemuTarget(target.Target):
qemu_command = [qemu_path, qemu_command = [qemu_path,
'-m', str(self._ram_size_mb), '-m', str(self._ram_size_mb),
'-nographic', '-nographic',
'-kernel', EnsurePathExists( '-kernel', boot_data.GetTargetFile(self._GetTargetSdkArch(),
boot_data.GetTargetFile(self._GetTargetSdkArch(), 'zircon.bin'),
'zircon.bin')), '-initrd', boot_data.GetTargetFile(self._GetTargetSdkArch(),
'-initrd', EnsurePathExists( 'bootdata-blob.bin'),
boot_data.GetTargetFile(self._GetTargetSdkArch(),
'bootdata-blob.bin')),
'-smp', '4', '-smp', '4',
# Attach the blobstore and data volumes. Use snapshot mode to discard # Attach the blobstore and data volumes. Use snapshot mode to discard
# any changes. # any changes.
'-snapshot', '-snapshot',
'-drive', 'file=%s,format=qcow2,if=none,id=data,snapshot=on' % '-drive', 'file=%s,format=qcow2,if=none,id=data,snapshot=on' %
EnsurePathExists(os.path.join(self._output_dir, os.path.join(self._output_dir, 'fvm.blk.qcow2'),
'fvm.blk.qcow2')),
'-drive', 'file=%s,format=qcow2,if=none,id=blobstore,snapshot=on' % '-drive', 'file=%s,format=qcow2,if=none,id=blobstore,snapshot=on' %
EnsurePathExists(
boot_data.ConfigureDataFVM(self._output_dir, boot_data.ConfigureDataFVM(self._output_dir,
boot_data.FVM_TYPE_QCOW)), boot_data.FVM_TYPE_QCOW),
'-device', 'virtio-blk-pci,drive=data', '-device', 'virtio-blk-pci,drive=data',
'-device', 'virtio-blk-pci,drive=blobstore', '-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