[unification] Move //zircon/system/uapp/usb-fwloader to the GN build

Generated with: //scripts/unification/move_zn_element.py

scripts/unification/verify_element_move.py --reference local/initial.json:

Warning   image   size change for bin/usb-fwloader: -7% (57.9K)

Bug: 36139
Change-Id: I3f06e3ab51c4e3da8d5eb0e35d5548fe911cb714
diff --git a/build/unification/images/BUILD.gn b/build/unification/images/BUILD.gn
index 667ccdd..9532f61 100644
--- a/build/unification/images/BUILD.gn
+++ b/build/unification/images/BUILD.gn
@@ -81,7 +81,6 @@
     ":bin.sysinfo",
     ":bin.threads",
     ":bin.top",
-    ":bin.usb-fwloader",
     ":bin.vmaps",
     ":bin.vmos",
     ":bin.xdc-test",
@@ -1131,7 +1130,7 @@
     "//zircon/system/uapp/trace-example:trace-example-manifest",
     "//zircon/system/uapp/fs-umount:umount-manifest",
     "//zircon/system/uapp/unbind:unbind-manifest",
-    #":bin.usb-fwloader",
+    "//zircon/system/uapp/usb-fwloader:usb-fwloader-manifest",
     "//zircon/system/uapp/usbctl:usbctl-manifest",
     #":bin.vmaps",
     #":bin.vmos",
diff --git a/zircon/system/uapp/BUILD.gn b/zircon/system/uapp/BUILD.gn
index 3f51f1b..e803f0d 100644
--- a/zircon/system/uapp/BUILD.gn
+++ b/zircon/system/uapp/BUILD.gn
@@ -25,7 +25,6 @@
     "psutils",
     "spiutil",
     "syscall-check",
-    "usb-fwloader",
     "xdc-test",
   ]
 }
diff --git a/zircon/system/uapp/usb-fwloader/BUILD.gn b/zircon/system/uapp/usb-fwloader/BUILD.gn
index 38dbbe7..fd9f84d 100644
--- a/zircon/system/uapp/usb-fwloader/BUILD.gn
+++ b/zircon/system/uapp/usb-fwloader/BUILD.gn
@@ -2,19 +2,37 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-zx_executable("usb-fwloader") {
-  testonly = true
+##########################################
+# Though under //zircon, this build file #
+# is meant to be used in the Fuchsia GN  #
+# build.                                 #
+# See fxb/36139.                         #
+##########################################
+
+assert(!defined(zx) || zx != "/",
+       "This file can only be used in the Fuchsia GN build.")
+
+import("//build/unification/images/migrated_manifest.gni")
+
+executable("usb-fwloader") {
+  configs += [ "//build/unification/config:zircon-migrated" ]
+  # Dependent manifests unfortunately cannot be marked as `testonly`.
+  # TODO(44278): Remove when converting this file to proper GN build idioms.
+  testonly = false
   sources = [ "usb-fwloader.cc" ]
   deps = [
-    "$zx/system/fidl/fuchsia-device:c",
-    "$zx/system/fidl/fuchsia-device:llcpp",
-    "$zx/system/fidl/fuchsia-hardware-usb-fwloader:c",
-    "$zx/system/fidl/fuchsia-hardware-usb-tester:c",
-    "$zx/system/fidl/fuchsia-mem:c",
-    "$zx/system/ulib/fbl",
-    "$zx/system/ulib/fdio",
-    "$zx/system/ulib/fzl",
-    "$zx/system/ulib/zircon",
-    "$zx/system/ulib/zx",
+    "//zircon/public/lib/fbl",
+    "//zircon/public/lib/fdio",
+    "//zircon/public/lib/fzl",
+    "//zircon/public/lib/zx",
+    "//zircon/system/fidl/fuchsia-device:c",
+    "//zircon/system/fidl/fuchsia-device:llcpp",
+    "//zircon/system/fidl/fuchsia-hardware-usb-fwloader:c",
+    "//zircon/system/fidl/fuchsia-hardware-usb-tester:c",
+    "//zircon/system/fidl/fuchsia-mem:c",
   ]
 }
+
+migrated_manifest("usb-fwloader-manifest") {
+  deps = [ ":usb-fwloader" ]
+}