1
0

feat: add kernels list to distro interface

This commit is contained in:
2023-05-23 22:00:20 +00:00
parent c1ec4add81
commit daaef89050
9 changed files with 103 additions and 99 deletions

View File

@ -147,6 +147,10 @@ func NewFromKernelInfo(ki distro.KernelInfo) (
return
}
func (c Container) Name() string {
return c.name
}
func (c Container) Exist() (yes bool) {
cmd := exec.Command(Runtime, "images", "-q", c.name)
@ -329,6 +333,10 @@ func (c Container) Run(workdir string, cmds []string) (out string, err error) {
}
func (c Container) Kernels() (kernels []distro.KernelInfo, err error) {
if !c.Exist() {
return
}
var libmodules, boot string
for _, volume := range c.Volumes {
switch volume.Dest {