Skip to content

Commit

Permalink
WIP: HACK to export boot flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Nov 20, 2024
1 parent ce0778f commit 1e158b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions rust/agama-lib/share/storage.model.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"properties": {
"name": { "type": "string" },
"alias": { "type": "string" },
"boot": { "enum": ["implicit", "explicit"] },
"mountPath": { "type": "string" },
"filesystem": { "$ref": "#/$defs/filesystem" },
"spacePolicy": { "$ref": "#/$defs/spacePolicy" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ def conversions

# @return [Array<Hash>]
def convert_drives
valid_drives.map { |d| ToModelConversions::Drive.new(d).convert }
drives = valid_drives.map { |d| ToModelConversions::Drive.new(d).convert }
boot_drive = drives.find { |d| d[:name] == config.boot_device }
if boot_drive
boot_drive[:boot] = config.boot.device ? "explicit" : "implicit"
end
drives
end

# @return [Array<Configs::Drive>]
Expand Down
2 changes: 2 additions & 0 deletions web/src/api/storage/types/config-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type FilesystemType =
| "vfat"
| "xfs";
export type SpacePolicy = "delete" | "resize" | "keep" | "custom";
export type Boot = "implicit" | "explicit";
export type PtableType = "gpt" | "msdos" | "dasd";
export type PartitionId = "linux" | "swap" | "lvm" | "raid" | "esp" | "prep" | "bios_boot";

Expand All @@ -37,6 +38,7 @@ export interface Drive {
alias?: string;
mountPath?: string;
filesystem?: Filesystem;
boot?: Boot;
spacePolicy?: SpacePolicy;
ptableType?: PtableType;
partitions?: Partition[];
Expand Down

0 comments on commit 1e158b0

Please sign in to comment.