feat: implement openSUSE 42+ support
This commit is contained in:
@ -18,7 +18,6 @@ import (
|
||||
|
||||
"code.dumpstack.io/tools/out-of-tree/cache"
|
||||
"code.dumpstack.io/tools/out-of-tree/config"
|
||||
"code.dumpstack.io/tools/out-of-tree/container"
|
||||
"code.dumpstack.io/tools/out-of-tree/fs"
|
||||
)
|
||||
|
||||
@ -71,15 +70,14 @@ func vsyscallAvailable() (available bool, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func GenRootfsImage(d container.Image, download bool) (rootfs string, err error) {
|
||||
func GenRootfsImage(imageFile string, download bool) (rootfs string, err error) {
|
||||
imagesPath := config.Dir("images")
|
||||
imageFile := d.Name + ".img"
|
||||
|
||||
rootfs = filepath.Join(imagesPath, imageFile)
|
||||
if !fs.PathExists(rootfs) {
|
||||
if download {
|
||||
log.Info().Msgf("%v not available, start download", imageFile)
|
||||
err = cache.DownloadQemuImage(imagesPath, imageFile)
|
||||
err = cache.DownloadRootFS(imagesPath, imageFile)
|
||||
}
|
||||
}
|
||||
return
|
||||
|
@ -15,8 +15,6 @@ import (
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/zcalusic/sysinfo"
|
||||
|
||||
"code.dumpstack.io/tools/out-of-tree/config"
|
||||
"code.dumpstack.io/tools/out-of-tree/container"
|
||||
"code.dumpstack.io/tools/out-of-tree/distro"
|
||||
"code.dumpstack.io/tools/out-of-tree/fs"
|
||||
)
|
||||
@ -46,16 +44,12 @@ func GenHostKernels(download bool) (kernels []distro.KernelInfo, err error) {
|
||||
}
|
||||
|
||||
// only for compatibility, docker is not really used
|
||||
dii := container.Image{
|
||||
Name: config.Target{
|
||||
Distro: distro.Distro{
|
||||
ID: distroType,
|
||||
Release: si.OS.Version,
|
||||
},
|
||||
}.DockerName(),
|
||||
dist := distro.Distro{
|
||||
ID: distroType,
|
||||
Release: si.OS.Version,
|
||||
}
|
||||
|
||||
rootfs, err := GenRootfsImage(dii, download)
|
||||
rootfs, err := GenRootfsImage(dist.RootFS(), download)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user