[WIP] Try to see which code breaks it

Fixes https://github.com/kairos-io/kairos/issues/2281

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
Dimitris Karakasilis 2024-02-23 11:47:15 +02:00
parent 6fe65c4c97
commit 7d9accccd7
No known key found for this signature in database
GPG Key ID: 286DCAFD2C97DDE3
3 changed files with 13 additions and 4 deletions

View File

@ -213,9 +213,10 @@ func RunInstall(c *config.Config) error {
utils.SetEnv(c.Env)
utils.SetEnv(c.Install.Env)
if c.Install.Device == "" || c.Install.Device == "auto" {
c.Install.Device = detectDevice()
}
// if c.Install.Device == "" || c.Install.Device == "auto" {
// c.Install.Device = detectDevice()
// }
c.Install.Device = "/dev/vdb"
// UKI path. Check if we are on UKI AND if we are running off a cd, otherwise it makes no sense to run the install
// From the installed system
@ -267,7 +268,9 @@ func runInstall(c *config.Config) error {
}
// TODO: This should not be neccessary
installSpec.NoFormat = c.Install.NoFormat
fmt.Printf("!!!!!!!!!! installSpec.NoFormat = %+v\n", installSpec.NoFormat)
fmt.Printf("!!!!!!!!!! c.Install.NoFormat = %+v\n", c.Install.NoFormat)
//installSpec.NoFormat = c.Install.NoFormat
// Set our cloud-init to the file we just created
f, err := dumpCCStringToFile(c)

View File

@ -146,6 +146,7 @@ func (i InstallAction) Run() (err error) {
// Check no-format flag
if i.spec.NoFormat {
fmt.Println("!!!!!!!!!!!! won't format")
// Check force flag against current device
labels := []string{i.spec.Active.Label, i.spec.Recovery.Label}
if e.CheckActiveDeployment(labels) && !i.spec.Force {
@ -164,6 +165,8 @@ func (i InstallAction) Run() (err error) {
}
}
fmt.Printf("!!!!!!!!!!!! i.spec.Target = %+v\n", i.spec.Target)
err = e.MountPartitions(i.spec.Partitions.PartitionsByMountPoint(false))
if err != nil {
return err

View File

@ -97,6 +97,7 @@ func NewInstallSpec(cfg *Config) (*v1.InstallSpec, error) {
FS: constants.LinuxImgFs,
Size: constants.ImgSize,
}
fmt.Printf("!!!!!!!!!!!!!!! cfg.Install.Device = %+v\n", cfg.Install.Device)
spec := &v1.InstallSpec{
Target: cfg.Install.Device,
@ -564,6 +565,8 @@ func ReadInstallSpecFromConfig(c *Config) (*v1.InstallSpec, error) {
// So instead we do the check here and override the installSpec.Target with the Config.Install.Device
// as its the soonest we have access to both
if installSpec.Target == "auto" {
fmt.Printf("!!!!!!! installSpec.Target = %+v\n", installSpec.Target)
fmt.Printf("!!!!!!! c.Install.Device = %+v\n", c.Install.Device)
installSpec.Target = c.Install.Device
}
return installSpec, nil