func Bootstrap(ctx context.Context, logger clogger.CiaoLog) {
	InstallDeps(ctx, BootstrapRequirements, logger)
}
Bootstrap installs all the core dependencies required to bootstrap the core
configuration of all Ciao components
package osprepare
import (
	"context"
	"strings"
	"github.com/ciao-project/ciao/clogger"
)
const (
	MinDockerVersion = "1.11.0"
	MinQemuVersion   = "2.5.0"
)
type PackageRequirement struct {
	BinaryName  string
	PackageName string
}
type PackageRequirements map[string][]PackageRequirement
func NewPackageRequirements() PackageRequirements {
	return make(PackageRequirements)
}
func (cur *PackageRequirements) Append(newReqs PackageRequirements) {
	curReqs := *cur
	for distro, reqList := range newReqs {
		curReqs[distro] = append(curReqs[distro], reqList...)
	}
}
var BootstrapRequirements = PackageRequirements{
	"ubuntu": {
		{"/usr/bin/ceph", "ceph-common"},
	},
	"fedora": {
		{"/usr/bin/ceph", "ceph-common"},
	},
	"clearlinux": {
		{"/usr/bin/ceph", "storage-cluster"},
	},
}
func collectPackages(dist distro, reqs PackageRequirements) []string {
	var pkgsMissing []string
	if reqs == nil {
		return nil
	}
	id := dist.getID()
	if pkgs, success := reqs[id]; success {
		for _, pkg := range pkgs {
			if pkg.BinaryName == "" || pkg.PackageName == "" {
				continue
			}
			if pathExists(pkg.BinaryName) {
				continue
			}
			pkgsMissing = append(pkgsMissing, pkg.PackageName)
		}
		return pkgsMissing
	}
	return nil
}
func InstallDeps(ctx context.Context, reqs PackageRequirements, logger clogger.CiaoLog) {
	if logger == nil {
		logger = clogger.CiaoNullLogger{}
	}
	distro := getDistro()
	if distro == nil {
		logger.Errorf("Running on an unsupported distro")
		if rel := getOSRelease(); rel != nil {
			logger.Errorf("Unsupported distro: %s %s", rel.Name, rel.Version)
		} else {
			logger.Errorf("No os-release found on this host")
		}
		return
	}
	logger.Infof("OS Detected: %s", distro.getID())
	if reqs == nil {
		return
	}
	if reqPkgs := collectPackages(distro, reqs); reqPkgs != nil {
		logger.Infof("Missing packages detected: %v", reqPkgs)
		if !distro.InstallPackages(ctx, reqPkgs, logger) {
			logger.Errorf("Failed to install: %s", strings.Join(reqPkgs, ", "))
			return
		}
		logger.Infof("Missing packages installed.")
	}
}