mirror of
https://github.com/getcompanion-ai/computer-host.git
synced 2026-04-15 05:02:05 +00:00
fix: run e2fsck before restart boot, set panic=0 to prevent reboot loops
This commit is contained in:
parent
2cef6aace5
commit
73cdf2eb74
3 changed files with 7 additions and 1 deletions
|
|
@ -16,7 +16,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
defaultGuestKernelArgs = "console=ttyS0 reboot=k"
|
defaultGuestKernelArgs = "console=ttyS0 reboot=k panic=0"
|
||||||
defaultGuestKernelArgsNoPCI = defaultGuestKernelArgs + " pci=off"
|
defaultGuestKernelArgsNoPCI = defaultGuestKernelArgs + " pci=off"
|
||||||
defaultGuestMemoryMiB = int64(3072)
|
defaultGuestMemoryMiB = int64(3072)
|
||||||
defaultGuestVCPUs = int64(2)
|
defaultGuestVCPUs = int64(2)
|
||||||
|
|
|
||||||
|
|
@ -647,3 +647,7 @@ func syncDir(path string) error {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func repairDirtyFilesystem(diskPath string) {
|
||||||
|
_ = exec.Command("e2fsck", "-fy", diskPath).Run()
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,8 @@ func (d *Daemon) StartMachine(ctx context.Context, id contracthost.MachineID) (*
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
repairDirtyFilesystem(systemVolume.Path)
|
||||||
|
|
||||||
spec, err := d.buildMachineSpec(id, artifact, userVolumes, systemVolume.Path, record.GuestConfig)
|
spec, err := d.buildMachineSpec(id, artifact, userVolumes, systemVolume.Path, record.GuestConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue