Skip to content

Commit

Permalink
feat: Allow mkpart command to create partition with no filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
matbme committed Dec 18, 2023
1 parent 0fa973a commit 678930a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion RECIPE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Create a new partition on the disk.

**Accepts**:
- *Name* (`string`): The name for the partition.
- *FsType* (`string`): The filesystem for the partition. Can be either `btrfs`,
- *FsType* (`string`): The filesystem for the partition. Can be either `none`, `btrfs`,
`ext[2,3,4]`, `linux-swap`, `ntfs`\*, `reiserfs`\*, `udf`\*, or `xfs`\*. If FsType
is prefixed with `luks-` (e.g. `luks-btrfs`), the partition will be encrypted using LUKS2.
- *Start* (`int`): The start position on disk for the new partition (in MiB).
Expand Down
5 changes: 4 additions & 1 deletion core/recipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func runSetupOperation(diskLabel, operation string, args []interface{}) error {
*
* **Accepts**:
* - *Name* (`string`): The name for the partition.
* - *FsType* (`string`): The filesystem for the partition. Can be either `btrfs`,
* - *FsType* (`string`): The filesystem for the partition. Can be either `none`, `btrfs`,
* `ext[2,3,4]`, `linux-swap`, `ntfs`\*, `reiserfs`\*, `udf`\*, or `xfs`\*. If FsType
* is prefixed with `luks-` (e.g. `luks-btrfs`), the partition will be encrypted using LUKS2.
* - *Start* (`int`): The start position on disk for the new partition (in MiB).
Expand Down Expand Up @@ -141,6 +141,9 @@ func runSetupOperation(diskLabel, operation string, args []interface{}) error {
return err
}
} else { // Unencrypted partition
if fsType == "none" {
fsType = ""
}
_, err := disk.NewPartition(name, fsType, start, end)
if err != nil {
return err
Expand Down

0 comments on commit 678930a

Please sign in to comment.