|
|
@ -179,26 +179,26 @@ func PlatformInformationWithContext(ctx context.Context) (platform string, famil
|
|
|
|
lsb = &lsbStruct{}
|
|
|
|
lsb = &lsbStruct{}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if common.PathExists(common.HostEtc("oracle-release")) {
|
|
|
|
if common.PathExistsWithContents(common.HostEtc("oracle-release")) {
|
|
|
|
platform = "oracle"
|
|
|
|
platform = "oracle"
|
|
|
|
contents, err := common.ReadLines(common.HostEtc("oracle-release"))
|
|
|
|
contents, err := common.ReadLines(common.HostEtc("oracle-release"))
|
|
|
|
if err == nil {
|
|
|
|
if err == nil {
|
|
|
|
version = getRedhatishVersion(contents)
|
|
|
|
version = getRedhatishVersion(contents)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else if common.PathExists(common.HostEtc("enterprise-release")) {
|
|
|
|
} else if common.PathExistsWithContents(common.HostEtc("enterprise-release")) {
|
|
|
|
platform = "oracle"
|
|
|
|
platform = "oracle"
|
|
|
|
contents, err := common.ReadLines(common.HostEtc("enterprise-release"))
|
|
|
|
contents, err := common.ReadLines(common.HostEtc("enterprise-release"))
|
|
|
|
if err == nil {
|
|
|
|
if err == nil {
|
|
|
|
version = getRedhatishVersion(contents)
|
|
|
|
version = getRedhatishVersion(contents)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if common.PathExists(common.HostEtc("slackware-version")) {
|
|
|
|
} else if common.PathExistsWithContents(common.HostEtc("slackware-version")) {
|
|
|
|
platform = "slackware"
|
|
|
|
platform = "slackware"
|
|
|
|
contents, err := common.ReadLines(common.HostEtc("slackware-version"))
|
|
|
|
contents, err := common.ReadLines(common.HostEtc("slackware-version"))
|
|
|
|
if err == nil {
|
|
|
|
if err == nil {
|
|
|
|
version = getSlackwareVersion(contents)
|
|
|
|
version = getSlackwareVersion(contents)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if common.PathExists(common.HostEtc("debian_version")) {
|
|
|
|
} else if common.PathExistsWithContents(common.HostEtc("debian_version")) {
|
|
|
|
if lsb.ID == "Ubuntu" {
|
|
|
|
if lsb.ID == "Ubuntu" {
|
|
|
|
platform = "ubuntu"
|
|
|
|
platform = "ubuntu"
|
|
|
|
version = lsb.Release
|
|
|
|
version = lsb.Release
|
|
|
@ -206,7 +206,7 @@ func PlatformInformationWithContext(ctx context.Context) (platform string, famil
|
|
|
|
platform = "linuxmint"
|
|
|
|
platform = "linuxmint"
|
|
|
|
version = lsb.Release
|
|
|
|
version = lsb.Release
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if common.PathExists("/usr/bin/raspi-config") {
|
|
|
|
if common.PathExistsWithContents("/usr/bin/raspi-config") {
|
|
|
|
platform = "raspbian"
|
|
|
|
platform = "raspbian"
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
platform = "debian"
|
|
|
|
platform = "debian"
|
|
|
@ -279,6 +279,8 @@ func PlatformInformationWithContext(ctx context.Context) (platform string, famil
|
|
|
|
version = lsb.Release
|
|
|
|
version = lsb.Release
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
platform = strings.Trim(platform, `"`)
|
|
|
|
|
|
|
|
|
|
|
|
switch platform {
|
|
|
|
switch platform {
|
|
|
|
case "debian", "ubuntu", "linuxmint", "raspbian":
|
|
|
|
case "debian", "ubuntu", "linuxmint", "raspbian":
|
|
|
|
family = "debian"
|
|
|
|
family = "debian"
|
|
|
|