-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP:device_managers: add abstraction for sgdisk and sfdisk
Add an interface to abstract implementation details for partition management. TBD: need proper way to pivot implementation currently hard coded, will eventually be some type of argument
- Loading branch information
Showing
5 changed files
with
228 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package device_managers | ||
|
||
import ( | ||
"github.com/coreos/ignition/v2/config/v3_5_experimental/types" | ||
) | ||
|
||
type DeviceManager interface { | ||
CreatePartition(p Partition) | ||
DeletePartition(num int) | ||
Info(num int) | ||
WipeTable(wipe bool) | ||
Pretend() (string, error) | ||
Commit() error | ||
ParseOutput(string, []int) (map[int]Output, error) | ||
} | ||
|
||
type Partition struct { | ||
types.Partition | ||
StartSector *int64 | ||
SizeInSectors *int64 | ||
StartMiB string | ||
SizeMiB string | ||
} | ||
|
||
type Output struct { | ||
Start int64 | ||
Size int64 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.