Restructure fwu-app deployment

Change fwu-app deployment to be more consistent to existing
deployments:
  - change fwu-app to be a dedicated deployment instead of a
    configuration of an SP.  Change the name to "fwu-tool".
	Change the name of the executable to the same.
  - delete posix environment and:
      - move posix trace implementation to linux-pc environment
	  - move deployment specific files to the deployment directory
  - move fwu-app common files from components/service/fwu/app to
    the new deployment, under src/app

Change-Id: Icf68d39bda34092807f33256f540389cd82d0a46
Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
diff --git a/deployments/fwu-tool/file-block-store.cmake b/deployments/fwu-tool/file-block-store.cmake
new file mode 100644
index 0000000..ea1590b
--- /dev/null
+++ b/deployments/fwu-tool/file-block-store.cmake
@@ -0,0 +1,33 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Lists components that provide an infrastructure layer for the block-storage
+# service provider that uses a ram-backed block store, partitioned by default
+# using the 'ref' configuration. This infrastructure is intended for test
+# purposes.
+#-------------------------------------------------------------------------------
+if (NOT DEFINED TGT)
+	message(FATAL_ERROR "Mandatory parameter TGT is not defined.")
+endif()
+
+#-------------------------------------------------------------------------------
+# Infrastructure components
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET ${TGT}
+	BASE_DIR ${TS_ROOT}
+	COMPONENTS
+		"components/media/disk"
+		"components/media/volume"
+		"components/media/volume/base_io_dev"
+		"components/media/volume/block_volume"
+		"components/media/volume/factory/single_flash"
+		"components/service/block_storage/block_store"
+		"components/service/block_storage/block_store/device"
+		"components/service/block_storage/block_store/device/file"
+		"components/service/block_storage/block_store/partitioned"
+		"components/service/block_storage/factory/file"
+		"components/service/block_storage/config/gpt"
+)
\ No newline at end of file
diff --git a/deployments/fwu-tool/fwu.cmake b/deployments/fwu-tool/fwu.cmake
new file mode 100644
index 0000000..d9cac39
--- /dev/null
+++ b/deployments/fwu-tool/fwu.cmake
@@ -0,0 +1,55 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Common components used for any deployment of the fwu service provider.
+#-------------------------------------------------------------------------------
+
+if (NOT DEFINED TGT)
+	message(FATAL_ERROR "Mandatory parameter TGT is not defined.")
+endif()
+
+#-------------------------------------------------------------------------------
+#  Components common to all deployments
+#
+#-------------------------------------------------------------------------------
+add_components(TARGET ${TGT}
+	BASE_DIR ${TS_ROOT}
+	COMPONENTS
+		"components/app/fwu-tool"
+		"components/common/uuid"
+		"components/common/endian"
+		"components/media/disk/gpt_iterator"
+		"components/media/volume/index"
+		"components/service/common/include"
+		"components/service/fwu/agent"
+		"components/service/fwu/config"
+		"components/service/fwu/config/gpt"
+		"components/service/fwu/fw_store/banked"
+		"components/service/fwu/fw_store/banked/metadata_serializer/v1"
+		"components/service/fwu/fw_store/banked/metadata_serializer/v2"
+		"components/service/fwu/installer"
+		"components/service/fwu/installer/raw"
+		"components/service/fwu/installer/copy"
+		"components/service/fwu/installer/factory/default"
+		"components/service/fwu/inspector/direct"
+)
+
+#################################################################
+
+target_include_directories(${TGT} PRIVATE
+	${TS_ROOT}
+	${TS_ROOT}/components
+)
+
+#-------------------------------------------------------------------------------
+#  Define install content.
+#
+#-------------------------------------------------------------------------------
+if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+	set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
+endif()
+install(TARGETS ${TGT}
+		RUNTIME DESTINATION ${TS_ENV}/bin
+		PUBLIC_HEADER DESTINATION ${TS_ENV}/include)
diff --git a/deployments/fwu-tool/linux-pc/CMakeLists.txt b/deployments/fwu-tool/linux-pc/CMakeLists.txt
new file mode 100644
index 0000000..e0948c0
--- /dev/null
+++ b/deployments/fwu-tool/linux-pc/CMakeLists.txt
@@ -0,0 +1,59 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
+include(../../deployment.cmake REQUIRED)
+
+#-------------------------------------------------------------------------------
+# The CMakeLists.txt for building the fwu-tool deployment for linux-pc
+#
+# This configuration builds the FWU update agent into a command-line app
+# that can be used to apply updates to disk image files.
+#-------------------------------------------------------------------------------
+project(trusted-services LANGUAGES CXX C)
+add_executable(fwu-tool)
+set(TGT "fwu-tool")
+target_include_directories(fwu-tool PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
+
+#-------------------------------------------------------------------------------
+#  Configure trace output for command-line app
+#
+#-------------------------------------------------------------------------------
+set(TRACE_PREFIX "fwu-tool" CACHE STRING "Trace prefix")
+set(TRACE_LEVEL "TRACE_LEVEL_DEBUG" CACHE STRING "Trace level")
+
+#-------------------------------------------------------------------------------
+#  Deployment specific build configuration
+#
+#-------------------------------------------------------------------------------
+
+# Scale number of partitions for pretty complicated fw images
+target_compile_definitions(${TGT} PRIVATE
+    PARTITIONED_BLOCK_STORE_MAX_PARTITIONS=24)
+
+#-------------------------------------------------------------------------------
+# This configuration builds for linux-pc
+#
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/environments/linux-pc/env.cmake)
+add_components(TARGET ${TGT}
+	BASE_DIR ${TS_ROOT}
+	COMPONENTS "environments/linux-pc"
+)
+
+#-------------------------------------------------------------------------------
+#  External project source-level dependencies
+#
+#-------------------------------------------------------------------------------
+include(${TS_ROOT}/external/tf_a/tf-a.cmake)
+add_tfa_dependency(TARGET ${TGT})
+
+#-------------------------------------------------------------------------------
+#  Deployment specific components
+#
+#-------------------------------------------------------------------------------
+include(../fwu.cmake REQUIRED)
+include(../file-block-store.cmake REQUIRED)