Commit 195beedf authored by Wez's avatar Wez Committed by Commit Bot

Revert "Fuchsia: extend the size of the blobstore FVM at build time."

This reverts commit 2a112566.

Reason for revert: Unfortunately the SDK this CL rolled us to is subtley but badly broken. The CL fell narrowly short of Breaking All The Things, because some of the Things just don't touch the broken bits. :(

Original change's description:
> Fuchsia: extend the size of the blobstore FVM at build time.
> 
> This CL grows Fuchsia blobstore by a specified amount, large enough to
> accommodate packaged executables installed at machine (QEMU) runtime.
> 
> Roll SDK from 32a56ad5 to de50ae25 for "fvm extend" and the inclusion
> of fvm.blk.
> 
> Bug: 798851, 707030
> Change-Id: I5a6b6be21cc443e6ad46271918a2f40e191a26f6
> Reviewed-on: https://chromium-review.googlesource.com/987012
> Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
> Reviewed-by: Wez <wez@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#547568}

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

Bug: 828232, 828229, 798851, 707030
Change-Id: I3ac0d1586c1a70700fbbd88d9f5762728bedc868
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/991672Reviewed-by: default avatarWez <wez@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547618}
parent eb800e13
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/fuchsia/config.gni") import("//build/config/fuchsia/config.gni")
import("//build/config/fuchsia/rules.gni")
import("//build/config/sysroot.gni") import("//build/config/sysroot.gni")
assert(is_fuchsia) assert(is_fuchsia)
...@@ -62,72 +61,3 @@ config("compiler") { ...@@ -62,72 +61,3 @@ config("compiler") {
libs = [ "zircon" ] libs = [ "zircon" ]
} }
# Writes an extended version of fvm.blk to fvm.extended.blk.
blobstore_extended_path = "$root_out_dir/fvm.extended.blk"
action("blobstore_extended_fvm") {
# The file is grown by 500MB, which should be large enough to hold packaged
# binaries and assets. The value should be increased if the size becomes a
# limitation in the future.
_extend_size = "524288000" # 500MB = 500 * 1024 * 1024
script = "//build/config/fuchsia/extend_fvm.py"
if (current_cpu == "arm64") {
_blobstore_src_path = "//third_party/fuchsia-sdk/sdk/target/aarch64/fvm.blk"
} else if (current_cpu == "x64") {
_blobstore_src_path = "//third_party/fuchsia-sdk/sdk/target/x86_64/fvm.blk"
}
inputs = [
_blobstore_src_path,
]
outputs = [
blobstore_extended_path,
]
args = [
rebase_path("${fuchsia_sdk}/tools/fvm"),
rebase_path(_blobstore_src_path),
rebase_path(blobstore_extended_path),
_extend_size,
]
}
# _________________________________________
# / Create a compressed copy-on-write (COW) \
# \ image based on fvm.blk. /
# -----------------------------------------
# \ ^__^
# \ (oo)\_______
# (__)\ )\/\
# ||----w |
# || ||
action("blobstore_extended_qcow2") {
script = "//build/gn_run_binary.py"
deps = [
":blobstore_extended_fvm",
]
inputs = [
blobstore_extended_path,
]
outputs = [
blobstore_qcow_path,
]
data = [
blobstore_qcow_path,
]
args = [
rebase_path("//third_party/fuchsia-sdk/sdk/qemu/bin/qemu-img",
root_build_dir),
"convert",
"-f",
"raw",
"-O",
"qcow2",
"-c",
rebase_path(blobstore_extended_path),
rebase_path(blobstore_qcow_path),
]
}
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Copies a FVM file and extends it by a specified amount.
Arg #1: path to 'fvm'.
#2: the path to the source fvm.blk.
#3: the path that the extended FVM file will be written to.
#4: the additional number of bytes to grow fvm.blk by."""
import os
import shutil
import subprocess
import sys
def ExtendFVM(fvm_tool_path, src_path, dest_path, delta):
old_size = os.path.getsize(src_path)
new_size = old_size + int(delta)
shutil.copyfile(src_path, dest_path)
subprocess.check_call([fvm_tool_path, dest_path, 'extend', '--length',
str(new_size)])
return 0
if __name__ == '__main__':
sys.exit(ExtendFVM(*sys.argv[1:]))
...@@ -7,9 +7,6 @@ assert(is_fuchsia) ...@@ -7,9 +7,6 @@ assert(is_fuchsia)
import("//build/config/chromecast_build.gni") import("//build/config/chromecast_build.gni")
import("//build/config/fuchsia/config.gni") import("//build/config/fuchsia/config.gni")
import("//build/config/fuchsia/package.gni") import("//build/config/fuchsia/package.gni")
import("//build/config/sysroot.gni")
blobstore_qcow_path = "$root_out_dir/fvm.blk.qcow2"
template("generate_runner_script") { template("generate_runner_script") {
# This runtime_deps file is used at runtime and thus cannot go in # This runtime_deps file is used at runtime and thus cannot go in
...@@ -22,8 +19,8 @@ template("generate_runner_script") { ...@@ -22,8 +19,8 @@ template("generate_runner_script") {
_pkg_dir = "$root_out_dir/gen/" + get_label_info(invoker.package_name, "dir") _pkg_dir = "$root_out_dir/gen/" + get_label_info(invoker.package_name, "dir")
_manifest_path = "$_pkg_dir/${invoker.package_name}.archive_manifest" _manifest_path = "$_pkg_dir/${invoker.package_name}.archive_manifest"
_package_path = "$_pkg_dir/${invoker.package_name}.far" _package_path = "$_pkg_dir/${invoker.package_name}.far"
_runner_target = "${target_name}_script" _runner_target = "${target_name}_runner"
_legacy_runner_target = "${target_name}_legacy_script" _legacy_runner_target = "${target_name}_legacy_runner"
group(_runtime_deps_target) { group(_runtime_deps_target) {
forward_variables_from(invoker, forward_variables_from(invoker,
...@@ -107,7 +104,6 @@ template("generate_runner_script") { ...@@ -107,7 +104,6 @@ template("generate_runner_script") {
]) ])
deps = [ deps = [
"//build/config/fuchsia:blobstore_extended_qcow2",
"//testing/buildbot/filters:fuchsia_filters", "//testing/buildbot/filters:fuchsia_filters",
] ]
......
...@@ -69,7 +69,8 @@ class QemuTarget(target.Target): ...@@ -69,7 +69,8 @@ class QemuTarget(target.Target):
# 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' %
os.path.join(self._output_dir, 'fvm.blk.qcow2'), boot_data.GetTargetFile(self._GetTargetSdkArch(),
'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' %
self._MakeQcowDisk(boot_data.ConfigureDataFVM(self._output_dir, self._MakeQcowDisk(boot_data.ConfigureDataFVM(self._output_dir,
False)), False)),
......
de50ae25fe0912099c47d7e303f167c95b555e19 32a56ad54471732034ba802cbfc3c9ff277b9d1c
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