mirror of
https://github.com/rancher/os.git
synced 2025-08-14 04:46:18 +00:00
Start rngd before format the disk
(cherry picked from commit d7f47925a1
)
This commit is contained in:
parent
bffa058379
commit
bcce7cc32c
@ -23,6 +23,13 @@ func BootstrapMain() {
|
|||||||
log.Debugf("bootstrapAction: loadingConfig")
|
log.Debugf("bootstrapAction: loadingConfig")
|
||||||
cfg := config.LoadConfig()
|
cfg := config.LoadConfig()
|
||||||
|
|
||||||
|
log.Debugf("bootstrapAction: Rngd(%v)", cfg.Rancher.State.Rngd)
|
||||||
|
if cfg.Rancher.State.Rngd {
|
||||||
|
if err := runRngd(); err != nil {
|
||||||
|
log.Errorf("Failed to run rngd: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.Debugf("bootstrapAction: MdadmScan(%v)", cfg.Rancher.State.MdadmScan)
|
log.Debugf("bootstrapAction: MdadmScan(%v)", cfg.Rancher.State.MdadmScan)
|
||||||
if cfg.Rancher.State.MdadmScan {
|
if cfg.Rancher.State.MdadmScan {
|
||||||
if err := mdadmScan(); err != nil {
|
if err := mdadmScan(); err != nil {
|
||||||
@ -68,6 +75,13 @@ func mdadmScan() error {
|
|||||||
return cmd.Run()
|
return cmd.Run()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func runRngd() error {
|
||||||
|
cmd := exec.Command("rngd", "-q")
|
||||||
|
cmd.Stdout = os.Stdout
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
return cmd.Run()
|
||||||
|
}
|
||||||
|
|
||||||
func runStateScript(script string) error {
|
func runStateScript(script string) error {
|
||||||
f, err := ioutil.TempFile("", "")
|
f, err := ioutil.TempFile("", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -169,6 +169,7 @@ var schema = `{
|
|||||||
"required": {"type": "boolean"},
|
"required": {"type": "boolean"},
|
||||||
"autoformat": {"$ref": "#/definitions/list_of_strings"},
|
"autoformat": {"$ref": "#/definitions/list_of_strings"},
|
||||||
"mdadm_scan": {"type": "boolean"},
|
"mdadm_scan": {"type": "boolean"},
|
||||||
|
"rngd": {"type": "boolean"},
|
||||||
"script": {"type": "string"},
|
"script": {"type": "string"},
|
||||||
"oem_fstype": {"type": "string"},
|
"oem_fstype": {"type": "string"},
|
||||||
"oem_dev": {"type": "string"}
|
"oem_dev": {"type": "string"}
|
||||||
|
@ -200,6 +200,7 @@ type StateConfig struct {
|
|||||||
Required bool `yaml:"required,omitempty"`
|
Required bool `yaml:"required,omitempty"`
|
||||||
Autoformat []string `yaml:"autoformat,omitempty"`
|
Autoformat []string `yaml:"autoformat,omitempty"`
|
||||||
MdadmScan bool `yaml:"mdadm_scan,omitempty"`
|
MdadmScan bool `yaml:"mdadm_scan,omitempty"`
|
||||||
|
Rngd bool `yaml:"rngd,omitempty"`
|
||||||
Script string `yaml:"script,omitempty"`
|
Script string `yaml:"script,omitempty"`
|
||||||
OemFsType string `yaml:"oem_fstype,omitempty"`
|
OemFsType string `yaml:"oem_fstype,omitempty"`
|
||||||
OemDev string `yaml:"oem_dev,omitempty"`
|
OemDev string `yaml:"oem_dev,omitempty"`
|
||||||
|
@ -82,6 +82,7 @@ rancher:
|
|||||||
fstype: auto
|
fstype: auto
|
||||||
oem_fstype: auto
|
oem_fstype: auto
|
||||||
oem_dev: LABEL=RANCHER_OEM
|
oem_dev: LABEL=RANCHER_OEM
|
||||||
|
rngd: true
|
||||||
sysctl:
|
sysctl:
|
||||||
fs.file-max: 1000000000
|
fs.file-max: 1000000000
|
||||||
services:
|
services:
|
||||||
|
Loading…
Reference in New Issue
Block a user