Hello community,

here is the log from the commit of package yast2-storage-ng for 
openSUSE:Factory checked in at 2018-05-01 22:48:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-storage-ng (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-storage-ng.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-storage-ng"

Tue May  1 22:48:24 2018 rev:17 rq:602620 version:4.0.169

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-storage-ng/yast2-storage-ng.changes        
2018-04-26 13:32:01.981268169 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-storage-ng.new/yast2-storage-ng.changes   
2018-05-01 22:48:26.225307112 +0200
@@ -1,0 +2,33 @@
+Fri Apr 27 15:23:05 UTC 2018 - an...@suse.com
+
+- Partitioner: fixed checks when the root filesystem is NFS
+  (bsc#1090752).
+- 4.0.169
+
+-------------------------------------------------------------------
+Fri Apr 27 12:57:25 UTC 2018 - jreidin...@suse.com
+
+- add method to check if system has any disk device (bsc#1090753)
+- 4.0.168
+
+-------------------------------------------------------------------
+Fri Apr 27 11:15:20 UTC 2018 - an...@suse.com
+
+- Set fs_passno to 1 for ext2/3/4 root filesystems (bsc#1078703).
+- 4.0.167
+
+-------------------------------------------------------------------
+Fri Apr 27 05:57:25 UTC 2018 - jreidin...@suse.com
+
+- fix libstorage logging that do not expect printf expansion
+  (bsc#1091062)
+- 4.0.166
+
+-------------------------------------------------------------------
+Thu Apr 26 10:59:42 UTC 2018 - an...@suse.com
+
+- Ensure the installer adds reused devices to /etc/crypttab and/or
+  /etc/mdadm.conf if needed for booting (bsc#1071350).
+- 4.0.165
+
+-------------------------------------------------------------------

Old:
----
  yast2-storage-ng-4.0.164.tar.bz2

New:
----
  yast2-storage-ng-4.0.169.tar.bz2

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

Other differences:
------------------
++++++ yast2-storage-ng.spec ++++++
--- /var/tmp/diff_new_pack.LVe3TJ/_old  2018-05-01 22:48:26.961280307 +0200
+++ /var/tmp/diff_new_pack.LVe3TJ/_new  2018-05-01 22:48:26.961280307 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-storage-ng
-Version:        4.0.164
+Version:        4.0.169
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -27,12 +27,12 @@
 Requires:       yast2 >= 4.0.61
 # for AbortException and handle direct abort
 Requires:       yast2-ruby-bindings >= 4.0.6
-# Proper handling of EBR in PartitionTable#unused_partition_slots
-Requires:       libstorage-ng-ruby >= 3.3.215
+# function light_probe
+Requires:       libstorage-ng-ruby >= 3.3.254
 
 BuildRequires:  update-desktop-files
-# Proper handling of EBR in PartitionTable#unused_partition_slots
-BuildRequires:  libstorage-ng-ruby >= 3.3.215
+# function light_probe
+BuildRequires:  libstorage-ng-ruby >= 3.3.254
 BuildRequires:  yast2-devtools
 BuildRequires:  yast2-ruby-bindings
 # yast2-xml dependency is added by yast2 but ignored in the

++++++ yast2-storage-ng-4.0.164.tar.bz2 -> yast2-storage-ng-4.0.169.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/package/yast2-storage-ng.changes 
new/yast2-storage-ng-4.0.169/package/yast2-storage-ng.changes
--- old/yast2-storage-ng-4.0.164/package/yast2-storage-ng.changes       
2018-04-25 18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/package/yast2-storage-ng.changes       
2018-04-30 21:11:18.000000000 +0200
@@ -1,4 +1,37 @@
 -------------------------------------------------------------------
+Fri Apr 27 15:23:05 UTC 2018 - an...@suse.com
+
+- Partitioner: fixed checks when the root filesystem is NFS
+  (bsc#1090752).
+- 4.0.169
+
+-------------------------------------------------------------------
+Fri Apr 27 12:57:25 UTC 2018 - jreidin...@suse.com
+
+- add method to check if system has any disk device (bsc#1090753)
+- 4.0.168
+
+-------------------------------------------------------------------
+Fri Apr 27 11:15:20 UTC 2018 - an...@suse.com
+
+- Set fs_passno to 1 for ext2/3/4 root filesystems (bsc#1078703).
+- 4.0.167
+
+-------------------------------------------------------------------
+Fri Apr 27 05:57:25 UTC 2018 - jreidin...@suse.com
+
+- fix libstorage logging that do not expect printf expansion
+  (bsc#1091062)
+- 4.0.166
+
+-------------------------------------------------------------------
+Thu Apr 26 10:59:42 UTC 2018 - an...@suse.com
+
+- Ensure the installer adds reused devices to /etc/crypttab and/or
+  /etc/mdadm.conf if needed for booting (bsc#1071350).
+- 4.0.165
+
+-------------------------------------------------------------------
 Wed Apr 25 16:07:46 UTC 2018 - jlo...@suse.com
 
 - Partitioner: fix bug after confirming changes in a running system
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/package/yast2-storage-ng.spec 
new/yast2-storage-ng-4.0.169/package/yast2-storage-ng.spec
--- old/yast2-storage-ng-4.0.164/package/yast2-storage-ng.spec  2018-04-25 
18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/package/yast2-storage-ng.spec  2018-04-30 
21:11:18.000000000 +0200
@@ -16,7 +16,7 @@
 #
 
 Name:          yast2-storage-ng
-Version:        4.0.164
+Version:        4.0.169
 Release:       0
 
 BuildRoot:     %{_tmppath}/%{name}-%{version}-build
@@ -26,12 +26,12 @@
 Requires:      yast2 >= 4.0.61
 # for AbortException and handle direct abort
 Requires:      yast2-ruby-bindings >= 4.0.6
-# Proper handling of EBR in PartitionTable#unused_partition_slots
-Requires:      libstorage-ng-ruby >= 3.3.215
+# function light_probe
+Requires:      libstorage-ng-ruby >= 3.3.254
 
 BuildRequires: update-desktop-files
-# Proper handling of EBR in PartitionTable#unused_partition_slots
-BuildRequires: libstorage-ng-ruby >= 3.3.215
+# function light_probe
+BuildRequires: libstorage-ng-ruby >= 3.3.254
 BuildRequires: yast2-ruby-bindings
 BuildRequires: yast2-devtools
 # yast2-xml dependency is added by yast2 but ignored in the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/src/lib/y2partitioner/actions/controllers/filesystem.rb
 
new/yast2-storage-ng-4.0.169/src/lib/y2partitioner/actions/controllers/filesystem.rb
--- 
old/yast2-storage-ng-4.0.164/src/lib/y2partitioner/actions/controllers/filesystem.rb
        2018-04-25 18:38:14.000000000 +0200
+++ 
new/yast2-storage-ng-4.0.169/src/lib/y2partitioner/actions/controllers/filesystem.rb
        2018-04-30 21:11:18.000000000 +0200
@@ -467,6 +467,7 @@
           @encrypt = blk_device.encrypted?
 
           restore_mount_point(mount_path, mount_by: mount_by)
+          blk_device.update_etc_status
         end
 
         # Sets options to the current mount point
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/src/lib/y2storage/boot_requirements_checker.rb 
new/yast2-storage-ng-4.0.169/src/lib/y2storage/boot_requirements_checker.rb
--- old/yast2-storage-ng-4.0.164/src/lib/y2storage/boot_requirements_checker.rb 
2018-04-25 18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/src/lib/y2storage/boot_requirements_checker.rb 
2018-04-30 21:11:18.000000000 +0200
@@ -112,7 +112,9 @@
       return @strategy unless @strategy.nil?
 
       klass =
-        if arch.efiboot?
+        if nfs_root?
+          BootRequirementsStrategies::NfsRoot
+        elsif arch.efiboot?
           BootRequirementsStrategies::UEFI
         elsif arch.s390?
           BootRequirementsStrategies::ZIPL
@@ -124,5 +126,12 @@
         end
       @strategy = klass.new(devicegraph, planned_devices, boot_disk_name)
     end
+
+    # Whether the root filesystem is NFS
+    #
+    # @return [Boolean]
+    def nfs_root?
+      devicegraph.nfs_mounts.any? { |i| i.mount_point && i.mount_point.root? }
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/src/lib/y2storage/boot_requirements_strategies/nfs_root.rb
 
new/yast2-storage-ng-4.0.169/src/lib/y2storage/boot_requirements_strategies/nfs_root.rb
--- 
old/yast2-storage-ng-4.0.164/src/lib/y2storage/boot_requirements_strategies/nfs_root.rb
     1970-01-01 01:00:00.000000000 +0100
+++ 
new/yast2-storage-ng-4.0.169/src/lib/y2storage/boot_requirements_strategies/nfs_root.rb
     2018-04-30 21:11:18.000000000 +0200
@@ -0,0 +1,35 @@
+# encoding: utf-8
+
+# Copyright (c) [2018] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
+require "y2storage/boot_requirements_strategies/base"
+
+module Y2Storage
+  module BootRequirementsStrategies
+    # Strategy to calculate the boot requirements for a system in which the 
root
+    # filesystem is an NFS share.
+    #
+    # This actually checks nothing on top of the basic checks of the base 
class,
+    # users installing on top of NFS are supposed to know what they are doing 
and
+    # are on their own.
+    class NfsRoot < Base
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/src/lib/y2storage/boot_requirements_strategies.rb 
new/yast2-storage-ng-4.0.169/src/lib/y2storage/boot_requirements_strategies.rb
--- 
old/yast2-storage-ng-4.0.164/src/lib/y2storage/boot_requirements_strategies.rb  
    2018-04-25 18:38:14.000000000 +0200
+++ 
new/yast2-storage-ng-4.0.169/src/lib/y2storage/boot_requirements_strategies.rb  
    2018-04-30 21:11:18.000000000 +0200
@@ -23,3 +23,4 @@
 require "y2storage/boot_requirements_strategies/uefi"
 require "y2storage/boot_requirements_strategies/prep"
 require "y2storage/boot_requirements_strategies/zipl"
+require "y2storage/boot_requirements_strategies/nfs_root"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-storage-ng-4.0.164/src/lib/y2storage/device.rb 
new/yast2-storage-ng-4.0.169/src/lib/y2storage/device.rb
--- old/yast2-storage-ng-4.0.164/src/lib/y2storage/device.rb    2018-04-25 
18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/src/lib/y2storage/device.rb    2018-04-30 
21:11:18.000000000 +0200
@@ -160,9 +160,8 @@
     #   @return [ResizeInfo]
     storage_forward :detect_resize_info, as: "ResizeInfo"
 
-    # @!method remove_descendants
-    #   Remove device descendants in the devicegraph it belongs to.
-    storage_forward :remove_descendants
+    storage_forward :storage_remove_descendants, to: :remove_descendants
+    private :storage_remove_descendants
 
     # @!attribute userdata
     #   Collection of free-form text fields to be stored in the devicegraph
@@ -329,6 +328,42 @@
       (types.map(&:to_sym) & types_for_is).any?
     end
 
+    # Whether there is (or there will be) an entry for this device in the
+    # relevant /etc file, to make the device available during system boot.
+    #
+    # For most kind of devices, this method makes no sense and returns always
+    # false. But some kinds of devices need to be listed in a configuration 
file
+    # (/etc/crypttab for encryption devices, /etc/fstab for filesystems,
+    # /etc/mdadm.conf for MD RAIDs, etc.) in order to be automatically
+    # recognized by the system. In those cases, the corresponding Device 
subclass
+    # will redefine this method to check the attribute corresponding to the
+    # relevant configuration file.
+    #
+    # @return [Boolean]
+    def in_etc?
+      false
+    end
+
+    # Updates the relevant attributes that are relevant for {#in_etc?} and
+    # triggers the corresponding mechanism in the parent objects so the changes
+    # are propagated.
+    #
+    # This method is used to ensure the consistency of {#in_etc?} and should be
+    # triggered by any operation that is expected to produce relevant changes
+    # in that regard. At the moment of writing, it's triggered whenever a new
+    # mount point is created or removed, to make sure all the filesystems of 
the
+    # system are available on boot.
+    def update_etc_status
+      update_etc_attributes
+      update_parents_etc_status
+    end
+
+    # Removes device descendants in the devicegraph
+    def remove_descendants
+      storage_remove_descendants
+      update_etc_status
+    end
+
   protected
 
     # Stores any object in the userdata of the device.
@@ -373,6 +408,43 @@
       YAML.load(serialized)
     end
 
+    # Generic mechanism to update the concrete attribute checked by {#in_etc?}
+    def update_etc_attributes
+      # Do something only for subclasses defining #assign_etc_attribute
+      return unless respond_to?(:assign_etc_attribute, true)
+
+      if descendants.any?(&:in_etc?)
+        # Enable the autoset flag only if the attribute was false before our 
update
+        self.etc_status_autoset = !in_etc?
+        assign_etc_attribute(true)
+      # We only set the attribute to false if we did set it to true
+      elsif etc_status_autoset?
+        self.etc_status_autoset = false
+        assign_etc_attribute(false)
+      end
+    end
+
+    # Triggers recalculation of {#in_etc?} for all parent objects
+    def update_parents_etc_status
+      parents.each(&:update_etc_status)
+    end
+
+    # Whether {#in_etc?} was set to true by {#update_etc_attributes}.
+    #
+    # @note This relies on the userdata mechanism, see {#userdata_value}.
+    #
+    # @return [Boolean]
+    def etc_status_autoset?
+      userdata_value(:etc_status_autoset) || false
+    end
+
+    # Stores the information for {#etc_status_autoset?}
+    #
+    # @param value [Boolean]
+    def etc_status_autoset=(value)
+      save_userdata(:etc_status_autoset, value)
+    end
+
     def types_for_is
       []
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/src/lib/y2storage/encryption.rb 
new/yast2-storage-ng-4.0.169/src/lib/y2storage/encryption.rb
--- old/yast2-storage-ng-4.0.164/src/lib/y2storage/encryption.rb        
2018-04-25 18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/src/lib/y2storage/encryption.rb        
2018-04-30 21:11:18.000000000 +0200
@@ -45,6 +45,14 @@
     #   @return [Array<Encryption>] all the encryption devices in the given 
devicegraph
     storage_class_forward :all, as: "Encryption"
 
+    # @!method in_etc_crypttab?
+    #   @return [Boolean] whether the device is included in /etc/crypttab
+    storage_forward :in_etc_crypttab?
+
+    # The setter is intentionally hidden. See similar comment for 
Md#in_etc_mdadm
+    storage_forward :storage_in_etc_crypttab=, to: :in_etc_crypttab=
+    private :storage_in_etc_crypttab=
+
     # @see BlkDevice#plain_device
     def plain_device
       blk_device
@@ -65,10 +73,21 @@
       "cr_#{device.basename}"
     end
 
+    # @see Device#in_etc?
+    # @see #in_etc_crypttab?
+    def in_etc?
+      in_etc_crypttab?
+    end
+
   protected
 
     def types_for_is
       super << :encryption
     end
+
+    # @see Device#update_etc_attributes
+    def assign_etc_attribute(value)
+      self.storage_in_etc_crypttab = value
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-storage-ng-4.0.164/src/lib/y2storage/md.rb 
new/yast2-storage-ng-4.0.169/src/lib/y2storage/md.rb
--- old/yast2-storage-ng-4.0.164/src/lib/y2storage/md.rb        2018-04-25 
18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/src/lib/y2storage/md.rb        2018-04-30 
21:11:18.000000000 +0200
@@ -107,10 +107,18 @@
     #   @return [Boolean] whether the MD RAID is included in /etc/mdadm.conf
     storage_forward :in_etc_mdadm?
 
-    # @!method in_etc_mdadm=(value)
-    #   @see #in_etc_mdadm?
-    #   @param value [Boolean]
-    storage_forward :in_etc_mdadm=
+    # The setter is intentionally hidden to avoid interferences with the
+    # #update_etc_status mechanism. If we decide to expose the setter, it would
+    # make sense to implement it like this:
+    #
+    #   def in_etc_mdadm=(value)
+    #     self.etc_status_autoset = false
+    #     self.storage_in_etc_mdadm = value
+    #     update_parents_etc_status
+    #     value
+    #   end
+    storage_forward :storage_in_etc_mdadm=, to: :in_etc_mdadm=
+    private :storage_in_etc_mdadm=
 
     # @!method minimal_number_of_devices
     #   Minimal number of devices required by the RAID.
@@ -274,6 +282,12 @@
       self.name = "/dev/md/#{new_name}"
     end
 
+    # @see Device#in_etc?
+    # @see #in_etc_mdadm?
+    def in_etc?
+      in_etc_mdadm?
+    end
+
   protected
 
     # Holders connecting the MD Raid to its component block devices in the
@@ -299,5 +313,10 @@
       types << :software_raid if software_defined?
       types
     end
+
+    # @see Device#update_etc_attributes
+    def assign_etc_attribute(value)
+      self.storage_in_etc_mdadm = value
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/src/lib/y2storage/mount_point.rb 
new/yast2-storage-ng-4.0.169/src/lib/y2storage/mount_point.rb
--- old/yast2-storage-ng-4.0.164/src/lib/y2storage/mount_point.rb       
2018-04-25 18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/src/lib/y2storage/mount_point.rb       
2018-04-30 21:11:18.000000000 +0200
@@ -36,12 +36,10 @@
     # @return [Pathname] Object that represents the swap path
     SWAP_PATH = Pathname.new("swap").freeze
 
-    # @!method self.create(devicegraph, path)
-    #   @param devicegraph [Devicegraph]
-    #   @param path [String]
-    #
-    #   @return [MountPoint]
-    storage_class_forward :create, as: "MountPoint"
+    # @return [Symbol] Filesystem types which should use 1 in the fs_passno
+    #   field when mounted as root
+    TYPES_WITH_PASSNO_ONE = [:ext2, :ext3, :ext4, :jfs].freeze
+    private_constant :TYPES_WITH_PASSNO_ONE
 
     # @!method self.all(devicegraph)
     #   @param devicegraph [Devicegraph]
@@ -60,10 +58,26 @@
     #   @return [String]
     storage_forward :path
 
-    # @!method path=(path)
-    #   @param path [String]
-    #   @raise [Storage::InvalidMountPointPath] if trying to set an invalid 
path
-    storage_forward :path=
+    storage_forward :storage_path=, to: :path=
+    private :storage_path=
+
+    # Sets the value for {#path} and ensures {#passno} has a value consistent
+    # with the new path
+    #
+    # @param path [String]
+    # @raise [Storage::InvalidMountPointPath] if trying to set an invalid path
+    def path=(path)
+      self.storage_path = path
+
+      if passno_must_be_one?
+        to_storage_value.passno = 1
+      elsif passno == 1
+        # passno should only be set to 1 if really needed
+        to_storage_value.passno = 0
+      end
+
+      path
+    end
 
     # @!attribute mount_by
     #   @return [Filesystems::MountByType]
@@ -143,17 +157,49 @@
     #   @return [Filesystems::Base]
     storage_forward :filesystem, as: "Filesystems::Base"
 
-    # Wheter the mount point is root
+    # @!method passno
+    #   Value for the fs_passno field for fstab(5). The passno field is used by
+    #   the fsck(8) program to determine the order in which filesystem checks
+    #   are done at reboot time.
+    #
+    #   @return [Integer]
+    storage_forward :passno
+
+    # @!method freq
+    #   Value for the fs_freq field for fstab(5). The freq field is used by the
+    #   dump(8) command to determine which filesystems need to be dumped. The
+    #   field is likely obsolete.
+    #
+    #   @return [Integer]
+    storage_forward :freq
+
+    # Whether the mount point is root
     #
     # @return [Boolean]
     def root?
       path == ROOT_PATH.to_s
     end
 
+    # @see Device#in_etc?
+    # @see #in_etc_fstab
+    def in_etc?
+      in_etc_fstab?
+    end
+
   protected
 
     def types_for_is
       super << :mount_point
     end
+
+    # Whether {#passno} should be set to 1 for this mount point
+    #
+    # @return [Boolean]
+    def passno_must_be_one?
+      return false unless root?
+      return false unless mountable && mountable.is?(:filesystem)
+
+      filesystem.type.is?(*TYPES_WITH_PASSNO_ONE)
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/src/lib/y2storage/mountable.rb 
new/yast2-storage-ng-4.0.169/src/lib/y2storage/mountable.rb
--- old/yast2-storage-ng-4.0.164/src/lib/y2storage/mountable.rb 2018-04-25 
18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/src/lib/y2storage/mountable.rb 2018-04-30 
21:11:18.000000000 +0200
@@ -36,14 +36,11 @@
     #   @return [Array<Mountable>] all mountable devices in the devicegraph
     storage_class_forward :all, as: "Mountable"
 
-    # @!method create_mount_point(path)
-    #   @param path [String]
-    #   @return [MountPoint]
-    storage_forward :create_mount_point, as: "MountPoint"
+    storage_forward :storage_create_mount_point, to: :create_mount_point, as: 
"MountPoint"
+    private :storage_create_mount_point
 
-    # @!method remove_mount_point
-    #   @raise [Storage::Exception] if the mountable has no mount point
-    storage_forward :remove_mount_point
+    storage_forward :storage_remove_mount_point, to: :remove_mount_point
+    private :storage_remove_mount_point
 
     # @!method mount_point
     #   @return [MountPoint]
@@ -109,5 +106,26 @@
       return false if mount_point.nil?
       mount_point.root?
     end
+
+    # Creates a mount point object for the device
+    #
+    # @param path [String]
+    # @return [MountPoint]
+    def create_mount_point(path)
+      mp = storage_create_mount_point(path)
+      # Trigger the calculations associated to the path (passno, etc.)
+      mp.path = path
+      # Recalculate etc status for the parent devices
+      update_etc_status
+      mp
+    end
+
+    # Removes the mount point object associated to the device
+    #
+    # @raise [Storage::Exception] if the mountable has no mount point
+    def remove_mount_point
+      storage_remove_mount_point
+      update_etc_status
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/src/lib/y2storage/setup_checker.rb 
new/yast2-storage-ng-4.0.169/src/lib/y2storage/setup_checker.rb
--- old/yast2-storage-ng-4.0.164/src/lib/y2storage/setup_checker.rb     
2018-04-25 18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/src/lib/y2storage/setup_checker.rb     
2018-04-30 21:11:18.000000000 +0200
@@ -20,6 +20,7 @@
 # find current contact information at www.suse.com.
 
 require "yast"
+require "pathname"
 require "y2storage/blk_device"
 require "y2storage/setup_error"
 require "y2storage/boot_requirements_checker"
@@ -136,9 +137,24 @@
     # @param volume [VolumeSpecification]
     # @return [Boolean] true if the volume is missing; false otherwise.
     def missing?(volume)
+      # Users mounting system volumes as NFS are supposed to know what they 
are doing
+      return false if nfs?(volume)
+
       BlkDevice.all(devicegraph).none? { |d| d.match_volume?(volume) }
     end
 
+    # Whether a volume is present in the current setup as an NFS mount
+    #
+    # @param volume [VolumeSpecification]
+    # @return [Boolean]
+    def nfs?(volume)
+      return false unless volume.mount_point
+      vol_path = Pathname.new(volume.mount_point).cleanpath
+      devicegraph.nfs_mounts.any? do |nfs|
+        nfs.mount_point && Pathname.new(nfs.mount_path).cleanpath == vol_path
+      end
+    end
+
     # @return [BootRequirementsChecker] shortcut for boot requirements checker
     # with given device graph
     def boot_requirements_checker
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/src/lib/y2storage/storage_manager.rb 
new/yast2-storage-ng-4.0.169/src/lib/y2storage/storage_manager.rb
--- old/yast2-storage-ng-4.0.164/src/lib/y2storage/storage_manager.rb   
2018-04-25 18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/src/lib/y2storage/storage_manager.rb   
2018-04-30 21:11:18.000000000 +0200
@@ -339,6 +339,29 @@
       environment.read_only? ? :ro : :rw
     end
 
+    # Whether there is any device in the system that may be used to install a
+    # system.
+    #
+    # This method does not check sizes or any other property of the devices.
+    # It performs a very simple check and returns true if there is any device
+    # of one of the acceptable types (basically disks or DASDs).
+    #
+    # It will never trigger a hardware probing. The method works even if
+    # such probing has not been performed yet.
+    #
+    # @return [Boolean]
+    def devices_for_installation?
+      if probed?
+        !probed.disk_devices.empty?
+      else
+        begin
+          Storage.light_probe
+        rescue Storage::Exception
+          false
+        end
+      end
+    end
+
   private
 
     # Value of #staging_revision right after executing the latest libstorage
@@ -643,6 +666,10 @@
     class StorageLogger < ::Storage::Logger
       # rubocop:disable Metrics/ParameterLists
       def write(level, component, filename, line, function, content)
+        # libstorage pretent that it use same logging as y2_logger but 
y2_logger support also
+        # parameter expansion via printf, so we need double escaping to 
prevent this expansion
+        # (bsc#1091062)
+        content = content.gsub(/%/, "%%")
         Yast.y2_logger(level, component, filename, line, function, content)
       end
       # rubocop:enable Metrics/ParameterLists
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/test/data/devicegraphs/subvolumes-and-empty-md.xml 
new/yast2-storage-ng-4.0.169/test/data/devicegraphs/subvolumes-and-empty-md.xml
--- 
old/yast2-storage-ng-4.0.164/test/data/devicegraphs/subvolumes-and-empty-md.xml 
    2018-04-25 18:38:14.000000000 +0200
+++ 
new/yast2-storage-ng-4.0.169/test/data/devicegraphs/subvolumes-and-empty-md.xml 
    2018-04-30 21:11:18.000000000 +0200
@@ -410,7 +410,7 @@
         <block-size>512</block-size>
       </region>
       <dm-table-name>cr_sda5</dm-table-name>
-      <in-etc-crypttab>true</in-etc-crypttab>
+      <in-etc-crypttab>false</in-etc-crypttab>
       <uuid></uuid>
     </Luks>
     <Md>
@@ -426,6 +426,7 @@
         <optimal-io-size>1048576</optimal-io-size>
       </topology>
       <range>256</range>
+      <in-etc-mdadm>false</in-etc-mdadm>
       <md-level>RAID0</md-level>
     </Md>
   </Devices>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/test/support/boot_requirements_context.rb 
new/yast2-storage-ng-4.0.169/test/support/boot_requirements_context.rb
--- old/yast2-storage-ng-4.0.164/test/support/boot_requirements_context.rb      
2018-04-25 18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/test/support/boot_requirements_context.rb      
2018-04-30 21:11:18.000000000 +0200
@@ -82,6 +82,7 @@
     allow(storage_arch).to receive(:s390?).and_return(architecture == :s390)
 
     allow(devicegraph).to receive(:disk_devices).and_return [dev_sda, dev_sdb]
+    allow(devicegraph).to receive(:nfs_mounts).and_return []
 
     allow(analyzer).to receive(:boot_ptable_type?) { |type| type == 
boot_ptable_type }
     # Assume the needed partitions are not already planned in advance
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/test/y2storage/boot_requirements_errors_test.rb 
new/yast2-storage-ng-4.0.169/test/y2storage/boot_requirements_errors_test.rb
--- 
old/yast2-storage-ng-4.0.164/test/y2storage/boot_requirements_errors_test.rb    
    2018-04-25 18:38:14.000000000 +0200
+++ 
new/yast2-storage-ng-4.0.169/test/y2storage/boot_requirements_errors_test.rb    
    2018-04-30 21:11:18.000000000 +0200
@@ -643,5 +643,38 @@
         end
       end
     end
+
+    context "using NFS for the root filesystem" do
+      before do
+        fs = Y2Storage::Filesystems::Nfs.create(fake_devicegraph, "server", 
"/path")
+        fs.create_mount_point("/")
+      end
+
+      context "in a diskless system" do
+        let(:scenario) { "nfs1.xml" }
+
+        # Regression test for bug#1090752
+        it "does not crash" do
+          expect { checker.warnings }.to_not raise_error
+          expect { checker.errors }.to_not raise_error
+        end
+
+        it "returns no warnings or errors" do
+          expect(checker.warnings).to be_empty
+          expect(checker.errors).to be_empty
+        end
+      end
+
+      context "in a system with local disks" do
+        let(:scenario) { "empty_hard_disk_50GiB" }
+
+        # This used to consider the local disk as the one to boot from, so it
+        # reported wrong errors assuming "/" was going to be there.
+        it "returns no warnings or errors" do
+          expect(checker.warnings).to be_empty
+          expect(checker.errors).to be_empty
+        end
+      end
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/test/y2storage/in_etc_test.rb 
new/yast2-storage-ng-4.0.169/test/y2storage/in_etc_test.rb
--- old/yast2-storage-ng-4.0.164/test/y2storage/in_etc_test.rb  1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-storage-ng-4.0.169/test/y2storage/in_etc_test.rb  2018-04-30 
21:11:18.000000000 +0200
@@ -0,0 +1,85 @@
+#!/usr/bin/env rspec
+# encoding: utf-8
+
+# Copyright (c) [2018] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
+require_relative "spec_helper"
+require "y2storage"
+
+describe Y2Storage::Device do
+  before { fake_scenario("subvolumes-and-empty-md.xml") }
+
+  describe "#update_etc_status" do
+    let(:md) { fake_devicegraph.find_by_name("/dev/md/strip0") }
+    let(:encryption) { fake_devicegraph.find_by_name("/dev/mapper/cr_sda5") }
+
+    # Creates a filesystem and mount point in the RAID
+    def create_mount_point
+      fs = md.create_filesystem(Y2Storage::Filesystems::Type::EXT4)
+      fs.create_mount_point("/mnt")
+    end
+
+    context "when a new mount point is created" do
+      it "sets in_etc_crypttab and in_etc_mdadm to true in the underlying 
devices" do
+        expect(md.in_etc_mdadm?).to eq false
+        expect(encryption.in_etc_crypttab?).to eq false
+
+        create_mount_point
+
+        expect(md.in_etc_mdadm?).to eq true
+        expect(encryption.in_etc_crypttab?).to eq true
+      end
+    end
+
+    context "when a mount point is removed" do
+      context "if the /etc flags were automatically set by the mount point 
creation" do
+        before { create_mount_point }
+
+        it "restores the false values for in_etc_crypttab and in_etc_mdadm" do
+          expect(md.in_etc_mdadm?).to eq true
+          expect(encryption.in_etc_crypttab?).to eq true
+
+          md.filesystem.remove_mount_point
+
+          expect(md.in_etc_mdadm?).to eq false
+          expect(encryption.in_etc_crypttab?).to eq false
+        end
+      end
+
+      context "if the /etc flags were already true before creating the mount 
point" do
+        before do
+          md.to_storage_value.in_etc_mdadm = true
+          encryption.to_storage_value.in_etc_crypttab = true
+          create_mount_point
+        end
+
+        it "keeps the original true values for in_etc_crypttab and 
in_etc_mdadm" do
+          expect(md.in_etc_mdadm?).to eq true
+          expect(encryption.in_etc_crypttab?).to eq true
+
+          md.filesystem.remove_mount_point
+
+          expect(md.in_etc_mdadm?).to eq true
+          expect(encryption.in_etc_crypttab?).to eq true
+        end
+      end
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/test/y2storage/mount_point_test.rb 
new/yast2-storage-ng-4.0.169/test/y2storage/mount_point_test.rb
--- old/yast2-storage-ng-4.0.164/test/y2storage/mount_point_test.rb     
2018-04-25 18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/test/y2storage/mount_point_test.rb     
2018-04-30 21:11:18.000000000 +0200
@@ -82,4 +82,107 @@
       end
     end
   end
+
+  describe "#passno" do
+    let(:scenario) { "empty_hard_disk_50GiB" }
+
+    let(:dev_name) { "/dev/sda" }
+    let(:filesystem) { blk_device.create_filesystem(fs_type) }
+    subject(:mount_point) { filesystem.create_mount_point(path) }
+
+    context "for an ext4 filesystem" do
+      let(:fs_type) { Y2Storage::Filesystems::Type::EXT4 }
+
+      context "mounted at /" do
+        let(:path) { "/" }
+
+        it "is set to 1" do
+          expect(mount_point.passno).to eq 1
+        end
+
+        context "and later reassigned to another path" do
+          it "is set to 0" do
+            mount_point.path = "/var"
+            expect(mount_point.passno).to eq 0
+          end
+        end
+      end
+
+      context "mounted at a non-root location" do
+        let(:path) { "/home" }
+
+        it "is set to 0" do
+          expect(mount_point.passno).to eq 0
+        end
+      end
+    end
+
+    context "for an xfs filesystem" do
+      let(:fs_type) { Y2Storage::Filesystems::Type::XFS }
+
+      context "mounted at /" do
+        let(:path) { "/" }
+
+        it "is set to 0" do
+          expect(mount_point.passno).to eq 0
+        end
+      end
+
+      context "mounted at a non-root location" do
+        let(:path) { "/home" }
+
+        it "is set to 0" do
+          expect(mount_point.passno).to eq 0
+        end
+      end
+    end
+
+    context "for an BTRFS filesystem" do
+      let(:fs_type) { Y2Storage::Filesystems::Type::BTRFS }
+      let(:specs) do
+        [Y2Storage::SubvolSpecification.new("foo"), 
Y2Storage::SubvolSpecification.new("bar")]
+      end
+
+      RSpec.shared_examples "passno 0 with subvolumes" do
+        it "is set to 0 for the filesystem and all its subvolumes" do
+          expect(mount_point.passno).to eq 0
+
+          filesystem.add_btrfs_subvolumes(specs)
+          mount_points = filesystem.btrfs_subvolumes.map(&:mount_point).compact
+          expect(mount_points.size).to eq specs.size
+          expect(mount_points.map(&:passno)).to all(eq(0))
+        end
+      end
+
+      context "mounted at /" do
+        let(:path) { "/" }
+        include_examples "passno 0 with subvolumes"
+      end
+
+      context "mounted at a non-root location" do
+        let(:path) { "/home" }
+        include_examples "passno 0 with subvolumes"
+      end
+    end
+
+    context "for an NFS filesystem" do
+      let(:filesystem) { Y2Storage::Filesystems::Nfs.create(fake_devicegraph, 
"server", path) }
+
+      context "mounted at /" do
+        let(:path) { "/" }
+
+        it "is set to 0" do
+          expect(mount_point.passno).to eq 0
+        end
+      end
+
+      context "mounted at a non-root location" do
+        let(:path) { "/home" }
+
+        it "is set to 0" do
+          expect(mount_point.passno).to eq 0
+        end
+      end
+    end
+  end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/test/y2storage/setup_checker_test.rb 
new/yast2-storage-ng-4.0.169/test/y2storage/setup_checker_test.rb
--- old/yast2-storage-ng-4.0.164/test/y2storage/setup_checker_test.rb   
2018-04-25 18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/test/y2storage/setup_checker_test.rb   
2018-04-30 21:11:18.000000000 +0200
@@ -243,6 +243,18 @@
       end
     end
 
+    context "when a mandatory product volume is mounted as NFS" do
+      before do
+        fs = Y2Storage::Filesystems::Nfs.create(fake_devicegraph, "server", 
"/path")
+        fs.mount_path = "/"
+      end
+
+      it "does not include an error for that volume" do
+        expect(subject.product_warnings)
+          .to_not include(an_object_having_attributes(missing_volume: 
root_volume))
+      end
+    end
+
     context "when all mandatory product volumes are present in the system" do
       let(:product_volumes) { [root_volume, home_volume] }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-4.0.164/test/y2storage/storage_manager_test.rb 
new/yast2-storage-ng-4.0.169/test/y2storage/storage_manager_test.rb
--- old/yast2-storage-ng-4.0.164/test/y2storage/storage_manager_test.rb 
2018-04-25 18:38:14.000000000 +0200
+++ new/yast2-storage-ng-4.0.169/test/y2storage/storage_manager_test.rb 
2018-04-30 21:11:18.000000000 +0200
@@ -970,4 +970,33 @@
       end
     end
   end
+
+  describe "#devices_for_installation?" do
+    context "system is already probed" do
+      before { fake_scenario("gpt_and_msdos") }
+      it "returns true if there is any disk device" do
+        expect(subject.devices_for_installation?).to eq true
+      end
+
+      it "returns false if there is no local disk device" do
+        fake_scenario("nfs1.xml")
+
+        expect(subject.devices_for_installation?).to eq false
+      end
+    end
+
+    context "system is not yet probed" do
+      it "returns result of libstorage method light_probe" do
+        expect(::Storage).to receive(:light_probe).and_return true
+
+        expect(subject.devices_for_installation?).to eq true
+      end
+
+      it "returns false if libstorage raise exception" do
+        expect(::Storage).to 
receive(:light_probe).and_raise(::Storage::Exception)
+
+        expect(subject.devices_for_installation?).to eq false
+      end
+    end
+  end
 end


Reply via email to