1
0

Auto-generate rootfs image name

This commit is contained in:
dump_stack() 2018-11-29 00:01:14 +00:00
parent fdb08ecf62
commit f81a4e38a1
2 changed files with 11 additions and 1 deletions

View File

@ -27,6 +27,12 @@ func (km KernelMask) DockerName() string {
return fmt.Sprintf("out_of_tree_%s_%s", distro, release)
}
func (km KernelMask) ImageName() string {
distro := strings.ToLower(km.DistroType.String())
release := strings.Replace(km.DistroRelease, ".", "", -1)
return fmt.Sprintf("%s_%s.img", distro, release)
}
type ArtifactType int
const (

View File

@ -247,7 +247,11 @@ func genInitrdPath(files []os.FileInfo, kname string) string {
}
func genRootfsImage(km config.KernelMask) string {
return "does not implemented yet, you need to set it byself"
usr, err := user.Current()
if err != nil {
return fmt.Sprintln(err)
}
return usr.HomeDir + "/.out-of-tree/images/" + km.ImageName()
}
func genKernels(km config.KernelMask, newkcfg *config.KernelConfig) (