Hello community,

here is the log from the commit of package yast2-storage for openSUSE:Factory 
checked in at 2017-03-13 15:29:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-storage (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-storage.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-storage"

Mon Mar 13 15:29:47 2017 rev:289 rq:477953 version:3.2.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-storage/yast2-storage.changes      
2017-02-07 11:57:40.858803606 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-storage.new/yast2-storage.changes 
2017-03-13 15:29:48.705411633 +0100
@@ -1,0 +2,7 @@
+Tue Feb  7 16:59:55 CET 2017 - shundham...@suse.de
+
+- Warn user in expert partitioner if Btrfs root partition is too
+  small for snapshots (Fate#320416)
+- 3.2.8
+
+-------------------------------------------------------------------

Old:
----
  yast2-storage-3.2.7.tar.bz2

New:
----
  yast2-storage-3.2.8.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-storage.spec ++++++
--- /var/tmp/diff_new_pack.L5jepv/_old  2017-03-13 15:29:49.349320627 +0100
+++ /var/tmp/diff_new_pack.L5jepv/_new  2017-03-13 15:29:49.349320627 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-storage
-Version:        3.2.7
+Version:        3.2.8
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-storage-3.2.7.tar.bz2 -> yast2-storage-3.2.8.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-storage-3.2.7/doc/config.xml.description 
new/yast2-storage-3.2.8/doc/config.xml.description
--- old/yast2-storage-3.2.7/doc/config.xml.description  2017-02-02 
22:01:49.973603628 +0100
+++ new/yast2-storage-3.2.8/doc/config.xml.description  2017-03-09 
13:06:31.423111309 +0100
@@ -41,7 +41,15 @@
     it needs to create a new volume group. If a suitable volume group
     is already on the disks this is used and no new volume group is
     created.
+    This value is only used if proposal_lvm and vm_keep_unpartitioned_region
+    are both true.
+
+vm_keep_unpartitioned_region:
+    Whether to limit the size of the new volume group according to
+    vm_desired_size. If set to false, the new volume group will use all the
+    available free space.
     This value is only used if proposal_lvm is true.
+    Default value if omitted: false.
 
 vm_home_max_size:
     Maximal size of home filesystem if a separate filesystem for /home is to
@@ -54,3 +62,17 @@
     this percentage. This is because to the usage of snapshots makes only
     sense if there is a certain amount of free space available.
 
+swap_for_suspend:
+    Whether the option "enlarge swap for suspend" is enabled by default.
+    Default value if omitted: false.
+
+root_subvolume_read_only:
+    Whether the root Btrfs subvolume should be read-only. Only relevant if 
Btrfs
+    is used for "/".
+    Default value if omitted: false.
+
+prefer_remove:
+    Deprecated. It was used for flexible_partitioning.
+
+remove_special_partitions:
+    Deprecated. It was used for flexible_partitioning.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-storage-3.2.7/package/yast2-storage.changes 
new/yast2-storage-3.2.8/package/yast2-storage.changes
--- old/yast2-storage-3.2.7/package/yast2-storage.changes       2017-02-02 
22:01:49.977603628 +0100
+++ new/yast2-storage-3.2.8/package/yast2-storage.changes       2017-03-09 
13:06:31.467111309 +0100
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Tue Feb  7 16:59:55 CET 2017 - shundham...@suse.de
+
+- Warn user in expert partitioner if Btrfs root partition is too
+  small for snapshots (Fate#320416)
+- 3.2.8
+
+-------------------------------------------------------------------
 Thu Feb  2 16:42:01 CET 2017 - shundham...@suse.de
 
 - Move snapshots check box to "edit partition" dialog (Fate#321094)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-storage-3.2.7/package/yast2-storage.spec 
new/yast2-storage-3.2.8/package/yast2-storage.spec
--- old/yast2-storage-3.2.7/package/yast2-storage.spec  2017-02-02 
22:01:49.977603628 +0100
+++ new/yast2-storage-3.2.8/package/yast2-storage.spec  2017-03-09 
13:06:31.471111309 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-storage
-Version:        3.2.7
+Version:        3.2.8
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-3.2.7/src/include/partitioning/custom_part_check_generated.rb 
new/yast2-storage-3.2.8/src/include/partitioning/custom_part_check_generated.rb
--- 
old/yast2-storage-3.2.7/src/include/partitioning/custom_part_check_generated.rb 
    2017-02-02 22:01:49.981603628 +0100
+++ 
new/yast2-storage-3.2.8/src/include/partitioning/custom_part_check_generated.rb 
    2017-03-09 13:06:31.575111309 +0100
@@ -38,8 +38,10 @@
     def initialize_partitioning_custom_part_check_generated(include_target)
       Yast.import "Arch"
       Yast.import "Storage"
+      Yast.import "StorageProposal"
       Yast.import "Partitions"
       Yast.import "Label"
+      Yast.import "Mode"
       Yast.import "Product"
       Yast.import "AutoinstData"
       Yast.import "FileSystems"
@@ -64,7 +66,7 @@
     def check_created_partition_table(targetMap, installation)
       targetMap = deep_copy(targetMap)
       Builtins.y2milestone(
-        "now checking generated target map installation:%1",
+        "Now checking generated target map. installation: %1",
         installation
       )
 
@@ -85,6 +87,7 @@
       boot_raid = false
       root_lvm = false
       root_fs = :unknown
+      snapshots_size_warning = false
       boot_fs = :unknown
       boot_fsid = 0
       boot_size_k = 0
@@ -131,9 +134,10 @@
             end
             raid_type = Ops.get_string(part, "raid_type", "") if !boot_raid
             root_lvm = true if Ops.get_symbol(part, "type", :unknown) == :lvm
-            if diskinfo.fetch( "type", :CT_UNKNOWN ) == :CT_DISK 
+            if diskinfo.fetch( "type", :CT_UNKNOWN ) == :CT_DISK
                rootdlabel = diskinfo.fetch( "label", "" )
             end
+            snapshots_size_warning = !check_root_for_snapshot_size(part)
 
             # search for shadowed subvolumes of root filesystem
             targetMap.each do |dev, disk|
@@ -336,7 +340,7 @@
                 "Your boot partition is smaller than %1.\n" +
                 "We recommend to increase the size of /boot.\n" +
                 "\n" +
-                "Really keep this size of boot partition?\n"
+                "Really keep this size of the boot partition?\n"
             ),
             Storage.KByteToHumanStringOmitZeroes(12 * 1024)
           )
@@ -346,7 +350,7 @@
       end
 
       #/////////////////////////// NO BOOT ///////////////////////////
-      if (!boot_found && installation && 
+      if (!boot_found && installation &&
           !Partitions.EfiBoot && rootdlabel=="gpt") || show_all_popups
         message = _(
           "Warning: There is no partition of type bios_grub present.\n" \
@@ -425,6 +429,8 @@
         ok = false if !Popup.YesNo(message)
       end
 
+      ok = show_snapshots_size_warning if snapshots_size_warning || 
show_all_popups
+
       # iSeries has no problems with this configuration
       # an initrd will be created and you can boot from a kernel slot
       if installation && !Arch.board_iseries &&
@@ -849,5 +855,65 @@
       ret
     end
 
+    # Check if a Btrfs root filesystem is large enough for snapshots (if it has
+    # snapshots enabled).
+    #
+    # @param part [Hash] hash representing the partition
+    # @return [Boolean] true if ok, false if a warning should be shown
+    #
+    def check_root_for_snapshot_size(part)
+      return true unless Mode.installation
+      return true unless part["mount"] == "/"
+      return true unless part["used_fs"] == :btrfs
+      return true unless part.has_key?("userdata")
+      userdata = part["userdata"]
+      return true unless userdata["/"] == "snapshots"
+      root_size_k = part["size_k"].to_i || 0
+      min_root_size_k = recommended_root_size_k_for_snapshots
+      log.info("check_root_for_snapshot_size: root: 
#{format_size_k(root_size_k)}; " +
+               "recommended min: #{format_size_k(min_root_size_k)}")
+      root_size_k >= min_root_size_k
+    end
+
+    # Format a size_k (kiB) human readable
+    #
+    # @param size_k [Fixnum]
+    # @return [String]
+    #
+    def format_size_k(size_k)
+      Storage.KByteToHumanStringOmitZeroes(size_k.to_i)
+    end
+
+    # Calculate the recommended minimum root filesystem size in kiB if
+    # snapshots are enabled.
+    #
+    # @return [Integer] size_k
+    #
+    def recommended_root_size_k_for_snapshots
+      proposal_settings = StorageProposal.GetControlCfg()
+      1024 * (proposal_settings["root_base"] || 0)
+    end
+
+    # Show a warning that the root partition is too small.
+    #
+    # @return [Boolean] true: user confirmed with "Yes", false: "No"
+    #
+    def show_snapshots_size_warning
+      recommended_k = recommended_root_size_k_for_snapshots
+      # popup text, %1 is a size
+      message = Builtins.sformat(
+        _(
+          "Warning:\n" +
+          "\n" +
+          "Your root partition is very small for snapshots.\n" +
+          "We recommend to increase the size of the root partition\n" +
+          "to %1 or more or to disable snapshots.\n" +
+          "\n" +
+          "Really keep the current setup?\n"
+        ),
+        format_size_k(recommended_k)
+      )
+      Popup.YesNo(message)
+    end
   end
 end


Reply via email to