Skip to content

Commit

Permalink
Merge pull request #268 from yast/create-default-subvolumes
Browse files Browse the repository at this point in the history
Create default subvolumes
  • Loading branch information
imobachgs committed Dec 1, 2016
2 parents 9c0fd57 + 945c0e6 commit 7378b91
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
7 changes: 7 additions & 0 deletions package/autoyast2.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Nov 30 09:30:26 UTC 2016 - igonzalezsosa@suse.com

- If Btrfs subvolumes are not specified, the default set
is created (bsc#1012328)
- 3.1.156

-------------------------------------------------------------------
Tue Nov 22 15:23:44 UTC 2016 - igonzalezsosa@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: autoyast2
Version: 3.1.155
Version: 3.1.156
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
12 changes: 9 additions & 3 deletions src/modules/AutoinstStorage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1137,12 +1137,18 @@ def Write
Builtins.y2milestone("disk: %1", tm[device])
tm[device] = process_partition_data(device, sol)

if data["enable_snapshots"] && tm[device].has_key?("partitions")
root_partition = tm[device]["partitions"].find{|p| p["mount"] == "/" && p["used_fs"] == :btrfs}
if root_partition
root_partition = tm[device]["partitions"].find{|p| p["mount"] == "/" && p["used_fs"] == :btrfs}
if root_partition
if data["enable_snapshots"] && tm[device].has_key?("partitions")
log.debug("Enabling snapshots for \"/\"; device #{data['device']}")
root_partition["userdata"] = { "/" => "snapshots" }
end
if root_partition["subvol"].nil?
# Add default subvolumes if none is defined (bsc#1012328)
log.info "Adding default subvolumes to #{root_partition["device"]}"
root_index = tm[device]["partitions"].index(root_partition)
tm[device]["partitions"][root_index] = Storage.AddSubvolRoot(root_partition)
end
end

changed = true
Expand Down

0 comments on commit 7378b91

Please sign in to comment.