cli: add initrd info to kata-env

Show the configured hypervisor initrd setting.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
This commit is contained in:
Peng Tao 2018-03-23 09:21:20 +08:00
parent 19c3555412
commit 21343d7d71

View File

@ -30,7 +30,7 @@ import (
// //
// XXX: Increment for every change to the output format // XXX: Increment for every change to the output format
// (meaning any change to the EnvInfo type). // (meaning any change to the EnvInfo type).
const formatVersion = "1.0.9" const formatVersion = "1.0.10"
// MetaInfo stores information on the format of the output itself // MetaInfo stores information on the format of the output itself
type MetaInfo struct { type MetaInfo struct {
@ -44,6 +44,11 @@ type KernelInfo struct {
Parameters string Parameters string
} }
// InitrdInfo stores initrd image details
type InitrdInfo struct {
Path string
}
// ImageInfo stores root filesystem image details // ImageInfo stores root filesystem image details
type ImageInfo struct { type ImageInfo struct {
Path string Path string
@ -130,6 +135,7 @@ type EnvInfo struct {
Hypervisor HypervisorInfo Hypervisor HypervisorInfo
Image ImageInfo Image ImageInfo
Kernel KernelInfo Kernel KernelInfo
Initrd InitrdInfo
Proxy ProxyInfo Proxy ProxyInfo
Shim ShimInfo Shim ShimInfo
Agent AgentInfo Agent AgentInfo
@ -307,12 +313,17 @@ func getEnvInfo(configFile string, config oci.RuntimeConfig) (env EnvInfo, err e
Parameters: strings.Join(vc.SerializeParams(config.HypervisorConfig.KernelParams, "="), " "), Parameters: strings.Join(vc.SerializeParams(config.HypervisorConfig.KernelParams, "="), " "),
} }
initrd := InitrdInfo{
Path: config.HypervisorConfig.InitrdPath,
}
env = EnvInfo{ env = EnvInfo{
Meta: meta, Meta: meta,
Runtime: runtime, Runtime: runtime,
Hypervisor: hypervisor, Hypervisor: hypervisor,
Image: image, Image: image,
Kernel: kernel, Kernel: kernel,
Initrd: initrd,
Proxy: proxy, Proxy: proxy,
Shim: shim, Shim: shim,
Agent: agent, Agent: agent,