Software: Settings: add setting to Software interface

Added the xyz.openbmc_project.Software.Settings interface to provide
the user with some control over the Software it manages.

Currently, it only has `WriteProtected` that indicate if the software is
writeable or not.

The settings are enforced by the service that manage the property.

Change-Id: I726c247428b4e1c8b1fe9cf66554ef272bbcd231
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/gen/xyz/openbmc_project/Software/Settings/meson.build b/gen/xyz/openbmc_project/Software/Settings/meson.build
new file mode 100644
index 0000000..0652d1a
--- /dev/null
+++ b/gen/xyz/openbmc_project/Software/Settings/meson.build
@@ -0,0 +1,14 @@
+# Generated file; do not modify.
+generated_sources += custom_target(
+    'xyz/openbmc_project/Software/Settings__cpp'.underscorify(),
+    input: [ '../../../../../yaml/xyz/openbmc_project/Software/Settings.interface.yaml',  ],
+    output: [ 'server.cpp', 'server.hpp', 'client.hpp',  ],
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'cpp',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.current_source_dir() / '../../../../../yaml',
+        'xyz/openbmc_project/Software/Settings',
+    ],
+)
+
diff --git a/gen/xyz/openbmc_project/Software/meson.build b/gen/xyz/openbmc_project/Software/meson.build
index da2e83b..29089c9 100644
--- a/gen/xyz/openbmc_project/Software/meson.build
+++ b/gen/xyz/openbmc_project/Software/meson.build
@@ -111,6 +111,20 @@
     ],
 )
 
+subdir('Settings')
+generated_others += custom_target(
+    'xyz/openbmc_project/Software/Settings__markdown'.underscorify(),
+    input: [ '../../../../yaml/xyz/openbmc_project/Software/Settings.interface.yaml',  ],
+    output: [ 'Settings.md' ],
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'markdown',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.current_source_dir() / '../../../../yaml',
+        'xyz/openbmc_project/Software/Settings',
+    ],
+)
+
 subdir('Version')
 generated_others += custom_target(
     'xyz/openbmc_project/Software/Version__markdown'.underscorify(),
diff --git a/yaml/xyz/openbmc_project/Software/README.md b/yaml/xyz/openbmc_project/Software/README.md
index f13d04c..e686076 100644
--- a/yaml/xyz/openbmc_project/Software/README.md
+++ b/yaml/xyz/openbmc_project/Software/README.md
@@ -159,6 +159,27 @@
 `ActivationState = Failed` or an `ActivateState = Active`` with a
 `RedundancyPriority = 0 (High)`.
 
+### Software Settings
+
+The `xyz.openbmc_project.Software.Settings` interface is provided
+to show the settings of the given software. The `Software.Settings`
+should be added to along side `Software.Version` to represent
+its state from the same service.
+
+```
+busctl introspect $SERVICE /xyz/openbmc_project/software/software_0
+...
+xyz.openbmc_project.Software.Version   interface   -
+.Purpose                               property    s
+.Version                               property    s
+xyz.openbmc_project.Software.Settings  interface   -
+.WriteProtected                        property    b
+...
+```
+
+The *ItemUpdater* manages the fields such as `WriteProtected` to help provide
+information on how the software is managed.
+
 ## REST use-cases
 
 ### Find all software versions on the system, either active or available.
diff --git a/yaml/xyz/openbmc_project/Software/Settings.interface.yaml b/yaml/xyz/openbmc_project/Software/Settings.interface.yaml
new file mode 100644
index 0000000..52771df
--- /dev/null
+++ b/yaml/xyz/openbmc_project/Software/Settings.interface.yaml
@@ -0,0 +1,11 @@
+description: >
+  Implement to provide software settings management.
+
+properties:
+  - name: WriteProtected
+    type: boolean
+    default: false
+    description: >
+      This property shall indicate whether the software image can be
+      overwritten, where a value `true` shall indicate that the software cannot
+      be altered or overwritten.