# Life Cycle Management with Software Module Daemon
Life Cycle Management of an application is important aspect of firmware development. It provides a dynamic plug and play experience for the application developers.
Software module deamon designed with adherence to the requirements of TR-369( Appendix I) and TR-069 (Appendix VI), it also provides the TR-181 - (v2.16) datamodel support for 'Device.SoftwareModules.' by using bbfdm micro-service model.
## Responsibilities
Software Module Daemon(sw-mod-d aka swmodd) offers life cycle management of the [OCI images](https://github.com/opencontainers/image-spec/blob/main/spec.md).
It provides the isolation between host and guest services using linux namespaces with [cgroups](https://docs.kernel.org/admin-guide/cgroup-v1/index.html).
It can provides an isolated Execution Environment(ExecEnv) based on configuration with the support of [overlayfs](https://docs.kernel.org/filesystems/overlayfs.html).
TR-181 - v2.16+ for [usp](https://usp-data-models.broadband-forum.org/tr-181-2-16-0-usp.html) and [cwmp](https://cwmp-data-models.broadband-forum.org/tr-181-2-16-0-cwmp.html) brings new possibilities into LCM, which provides clean and clear mappings for application container deployments.
### System capabilities
The first object which defines/list the capabilities of the current system is 'ExecEnvClass'
| Device.SoftwareModules.ExecEnvClass.{i}. | List the runtime capabilities of the system, When an EE gets added it inherits the runtime from that instances |
| Device.SoftwareModules.ExecEnvClass.{i}.DeploymentUnitRef | Reference of DU which result into existence of this EEClass, this shall be empty. |
| Device.SoftwareModules.ExecEnvClass.{i}.Name | CRUN or LXC |
| Device.SoftwareModules.ExecEnvClass.{i}.Capability.{i}.SpecificationURI |https://github.com/containers/crun/blob/main/crun.1.md OR https://linuxcontainers.org/lxc/|
| Device.SoftwareModules.ExecEnvClass.{i}.Capability.{i}.SpecificationVersion | 1.0.0 OR lxc-config version|
When `swmodd` starts, it checks the runtime dependencies and based of runtime availability, it populates the EEClass table. One EEClass instance shall maps to each supported runtime tools availability in the system.
If `skopeo` and `umoci` present in the system, it adds an additional Capability of oci image spec to denote that pulling oci images from container registries are also supported.
ex:
-`swmodd` detects if system has crun and lxc tools available
- It adds CRUN as one EEClass instance
- It further add LXC as next EEClass instance
- It further add below as SpecificationURI
- (CRUN tar bundle support) https://github.com/containers/crun/blob/main/crun.1.md
- (LXC tar bundle support) https://linuxcontainers.org/lxc/
- (Pull from Registry Support if `spokeo` and `umoci` present) https://github.com/opencontainers/image-spec/blob/main/spec.md
#### Create execution environment
Execution environment has closed resemblance with a storage which can be used to keep oci images and further can be used in runtime engines.