ea1e4c38fa
This reverts commitcdfc94f4e9
, reversing changes made to2051cd3e1c
. Conflicts: config/config.go config/config_test.go config/etc_hosts.go config/etcd.go config/file.go config/fleet.go config/oem.go config/unit.go config/update.go config/user.go initialize/config.go initialize/config_test.go initialize/env.go initialize/manage_etc_hosts.go initialize/workspace.go system/env.go system/etc_hosts_test.go system/etcd.go system/etcd_test.go system/fleet.go system/fleet_test.go system/oem.go system/oem_test.go system/systemd.go system/update.go system/update_test.go test
42 lines
905 B
Go
42 lines
905 B
Go
package initialize
|
|
|
|
import (
|
|
"fmt"
|
|
"path"
|
|
"strings"
|
|
|
|
"github.com/coreos/coreos-cloudinit/system"
|
|
)
|
|
|
|
type OEMRelease struct {
|
|
ID string `yaml:"id"`
|
|
Name string `yaml:"name"`
|
|
VersionID string `yaml:"version-id"`
|
|
HomeURL string `yaml:"home-url"`
|
|
BugReportURL string `yaml:"bug-report-url"`
|
|
}
|
|
|
|
func (oem OEMRelease) String() string {
|
|
fields := []string{
|
|
fmt.Sprintf("ID=%s", oem.ID),
|
|
fmt.Sprintf("VERSION_ID=%s", oem.VersionID),
|
|
fmt.Sprintf("NAME=%q", oem.Name),
|
|
fmt.Sprintf("HOME_URL=%q", oem.HomeURL),
|
|
fmt.Sprintf("BUG_REPORT_URL=%q", oem.BugReportURL),
|
|
}
|
|
|
|
return strings.Join(fields, "\n") + "\n"
|
|
}
|
|
|
|
func (oem OEMRelease) File(root string) (*system.File, error) {
|
|
if oem.ID == "" {
|
|
return nil, nil
|
|
}
|
|
|
|
return &system.File{
|
|
Path: path.Join("etc", "oem-release"),
|
|
RawFilePermissions: "0644",
|
|
Content: oem.String(),
|
|
}, nil
|
|
}
|