Skip to content

Commit

Permalink
Efi boot: Select Efi Boot file system ID and allowing formating at th…
Browse files Browse the repository at this point in the history
…e same time
  • Loading branch information
schubi2 committed Mar 2, 2016
1 parent b210656 commit 2b7cb47
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/include/partitioning/ep-dialogs.rb
Expand Up @@ -48,6 +48,15 @@ def MiniWorkflowStepRole(data)

role = data.value.fetch("role", :data)

efi_select = Empty()
if Partitions.EfiBoot && (Arch.i386||Arch.x86_64)
efi_select = term(
:LeftRadioButton, Id(:efi_boot),
# radio button text
_("EFI Boot Partition"), role == :efi_boot
)
end

tmp = VBox(
term(
:LeftRadioButton, Id(:system),
Expand All @@ -59,6 +68,7 @@ def MiniWorkflowStepRole(data)
# radio button text
_("Data and ISV Applications"), role == :data
),
efi_select,
term(
:LeftRadioButton, Id(:swap),
# radio button text
Expand Down Expand Up @@ -93,7 +103,10 @@ def MiniWorkflowStepRole(data)

if widget == :next
role = UI.QueryWidget(Id(:role), :Value)
data.value["role"] = role
if data.value["role"] != role
data.value["role"] = role
data.value["formatmount_proposed"] = false #make a new proposal
end
end

log.info("MiniWorkflowStepRole data:#{data.value} ret:#{widget}")
Expand Down Expand Up @@ -256,6 +269,16 @@ def MiniWorkflowStepFormatMount(orig_data, creating: false)
data["used_fs"] = used_fs
data["mount"] = mount_point_proposal

when :efi_boot
mount_point_proposal = "/boot/efi"
used_fs = Partitions.DefaultBootFs

data["format"] = true
data["fsid"] = Partitions.FsidBoot( lbl )
data["ori_fsid"] = Partitions.FsidBoot( lbl )
data["used_fs"] = used_fs
data["mount"] = mount_point_proposal

when :raw
mount_point_proposal = ""
used_fs = :none
Expand Down Expand Up @@ -441,6 +464,14 @@ def MiniWorkflowStepFormatMount(orig_data, creating: false)
UI.ChangeWidget(Id(:do_mount_attachment), :Enabled, do_mount)
UI.ChangeWidget(Id(:mount_point), :Value, mount)

if role == :efi_boot
# Only vfat, /boot/efi and "Efi Boot" makes sense here.
# So alternative selections are disabled.
UI.ChangeWidget(Id(:mount_point), :Enabled, false)
UI.ChangeWidget(Id(:fs), :Enabled, false)
UI.ChangeWidget(Id(:fsid_point), :Enabled, false)
end

widget = nil

data = HandlePartWidgetChanges(
Expand Down

0 comments on commit 2b7cb47

Please sign in to comment.