-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2281 - target manually partitioned disk #235
Changes from 8 commits
7d9accc
804462e
9df8781
da9065e
0a3b0c0
d8df60c
571f10d
b80dcdb
d3bf4eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,17 +40,32 @@ func (i *InstallAction) Run() (err error) { | |
i.cfg.Logger.Errorf("running kairos-uki-install.pre hook script: %s", err.Error()) | ||
} | ||
|
||
// Deactivate any active volume on target | ||
err = e.DeactivateDevices() | ||
if err != nil { | ||
i.cfg.Logger.Errorf("deactivating devices: %s", err.Error()) | ||
return err | ||
} | ||
// Partition device | ||
err = e.PartitionAndFormatDevice(i.spec) | ||
if err != nil { | ||
i.cfg.Logger.Errorf("partitioning and formating devices: %s", err.Error()) | ||
return err | ||
if i.spec.NoFormat { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm trying to add a test for the UKI case too here: kairos-io/kairos#2291 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Manually creating the disk layout that the UKI installation creates is tricky:
We can keep the code around here but writing a test for it is rather complex (creating a layout with encrypted partitions using the tpm). I'm not sure if anyone will ever be interested in this feature in UKI mode. |
||
i.cfg.Logger.Infof("NoFormat is true, skipping format and partitioning") | ||
if i.spec.Target == "" || i.spec.Target == "auto" { | ||
// This needs to run after the pre-install stage to give the user the | ||
// opportunity to prepare the target disk in the pre-install stage. | ||
device, err := config.DetectPreConfiguredDevice(i.cfg.Logger) | ||
if err != nil { | ||
return fmt.Errorf("no target device specified and no device found: %s", err) | ||
} | ||
i.cfg.Logger.Infof("No target device specified, using pre-configured device: %s", device) | ||
i.spec.Target = device | ||
} | ||
} else { | ||
// Deactivate any active volume on target | ||
err = e.DeactivateDevices() | ||
if err != nil { | ||
i.cfg.Logger.Errorf("deactivating devices: %s", err.Error()) | ||
return err | ||
} | ||
|
||
// Partition device | ||
err = e.PartitionAndFormatDevice(i.spec) | ||
if err != nil { | ||
i.cfg.Logger.Errorf("partitioning and formating devices: %s", err.Error()) | ||
return err | ||
} | ||
} | ||
|
||
err = e.MountPartitions(i.spec.GetPartitions().PartitionsByMountPoint(false)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved here: https://github.com/kairos-io/kairos-agent/pull/235/files#diff-53b724197bc14c3828ce6725322b892cb788860b0526184b63d7d114edb60941R571