Skip to content

Commit

Permalink
Preserve btrfs options for root (bsc#965279)
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Feb 12, 2016
1 parent c314eef commit 65ba700
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/include/partitioning/custom_part_lib.rb
Expand Up @@ -631,7 +631,10 @@ def HandleFsChanged(init, new, old_fs, file_systems)
# @param file_systems [Hash] definitions of the supported filesystems
# @param old [Hash] map with original partition
# @param new [Hash] map with changes filled in
def HandlePartWidgetChanges(init, ret, file_systems, old, new)
# @param force_defaults [Boolean] whether to overwrite all the properties
# (like the list of subvolumes) with the expert partitioner default values.
# Useful when creating a partition for the first time
def HandlePartWidgetChanges(init, ret, file_systems, old, new, force_defaults: false)
ret = deep_copy(ret)
file_systems = deep_copy(file_systems)
old = deep_copy(old)
Expand Down Expand Up @@ -673,7 +676,8 @@ def HandlePartWidgetChanges(init, ret, file_systems, old, new)
end

# set btrfs subvolumes (bnc#872210)
if init && new.fetch("mount", "") == "/"
# only when requested from the caller (i.e. new partition) (bsc#965279)
if init && new.fetch("mount", "") == "/" && force_defaults
new = HandleSubvol(new)
end

Expand Down
10 changes: 8 additions & 2 deletions src/include/partitioning/ep-dialogs.rb
Expand Up @@ -130,7 +130,12 @@ def MiniWorkflowStepFormatMountHelptext
end


def MiniWorkflowStepFormatMount(orig_data)
# Workflow used to specify the format and options of a partition
# It is used during creation and during modification
# @param orig_data [ArgRef] reference to the map with partition information
# @param creating [Boolean] whether this call is part of the creation process
# of the partition (not a modification)
def MiniWorkflowStepFormatMount(orig_data, creating: false)
data = orig_data.value
d = Storage.GetDiskPartition(Ops.get_string(data, "device", ""))
lbl = Ops.get_string(
Expand Down Expand Up @@ -443,7 +448,8 @@ def MiniWorkflowStepFormatMount(orig_data)
widget,
all_filesystems,
orig_data.value,
data
data,
force_defaults: creating
)
begin
widget = MiniWorkflow.UserInput
Expand Down
3 changes: 2 additions & 1 deletion src/include/partitioning/ep-hd-dialogs.rb
Expand Up @@ -474,7 +474,8 @@ def DlgCreatePartition(data)
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepFormatMount_result = MiniWorkflowStepFormatMount(
data_ref
data_ref,
creating: true
);
data.value = data_ref.value;
_MiniWorkflowStepFormatMount_result
Expand Down

0 comments on commit 65ba700

Please sign in to comment.