File 0001-fix-update-reiserfs-support.patch of Package yast2-storage

From 90b67edd66152e8d07c54a6e7afb55ad508af357 Mon Sep 17 00:00:00 2001
From: Led <ledest@gmail.com>
Date: Thu, 13 Oct 2016 23:50:48 +0300
Subject: [PATCH 1/2] fix/update reiserfs support

---
 doc/README.part.info                            |  8 +++----
 doc/README.target_partition                     |  6 ++---
 src/data/test_target_map.ycp                    | 20 ++++++++--------
 src/include/partitioning/custom_part_dialogs.rb | 16 ++++++-------
 src/include/partitioning/custom_part_lib.rb     |  4 ++--
 src/include/partitioning/ep-settings.rb         |  2 +-
 src/modules/FileSystems.rb                      | 31 +++++++++++++------------
 src/modules/Partitions.rb                       |  2 +-
 src/modules/Storage.rb                          |  4 ++--
 src/modules/StorageProposal.rb                  |  3 ++-
 10 files changed, 49 insertions(+), 47 deletions(-)

diff --git a/doc/README.part.info b/doc/README.part.info
index e5ddee0..5949693 100644
--- a/doc/README.part.info
+++ b/doc/README.part.info
@@ -35,7 +35,7 @@ REMOVE_SPECIAL_PARTITIONS
 KEEP_PARTITION_FSYS
 
     Possible values:   comma separated list of
-                       reiser,xfs,fat,vfat,ext2,ext3,ext4,btrfs,jfs,ntfs,swap
+                       reiserfs,xfs,fat,vfat,ext2,ext3,ext4,btrfs,jfs,ntfs,swap
     Default value:     Empty list
     Example:           KEEP_PARTITION_FSYS=fat,ntfs
 
@@ -67,7 +67,7 @@ KEEP_PARTITION_NUM
 
 PARTITION
 
-    Example:          PARTITION mount=/ size=4GB fsys=reiser
+    Example:          PARTITION mount=/ size=4GB fsys=reiserfs
 
     Description:
     Lines starting with the keyword "PARTITION" describe a partition that is
@@ -88,10 +88,10 @@ PARTITION
 	partition the special value "swap" has to be used.
 
 	Keyword: fsys
-	Example: fsys=reiser
+	Example: fsys=reiserfs
 	Description:
 	This entry describes the filesystem type created on this partition.
-	Possible Filesystem types are: reiser,ext2,ext3,ext4,btrfs,xfs,vfat,swap
+	Possible Filesystem types are: reiserfs,ext2,ext3,ext4,btrfs,xfs,vfat,swap
 	If no filesystem type is given for a partition, btrfs is used.
 
 	Keyword: formatopt
diff --git a/doc/README.target_partition b/doc/README.target_partition
index 4000aa3..7a0dd7c 100644
--- a/doc/README.target_partition
+++ b/doc/README.target_partition
@@ -84,7 +84,7 @@ partitions: [
      "format":true,		    // create a filesystem (prepdisk)
      "region":[0, 17],		    
      "type":`primary		    
-     "used_fs": `ext2               // type of filesystem: `none, `ext2 or `reiser  
+     "used_fs": `ext2               // type of filesystem: `none, `ext2 or `reiserfs
                                     // if it is not used, ext2 is default
    ]
 
@@ -161,7 +161,7 @@ The "type" key classifies the type of the partition:
         ],
         "type" : `lvm,
         "use_module" : "lvm_ll",
-        "used_fs" : `reiser
+        "used_fs" : `reiserfs
       ],
       $[
         "crypt_fs" : true,
@@ -177,7 +177,7 @@ The "type" key classifies the type of the partition:
         ],
         "type" : `lvm,
         "use_module" : "lvm_ll",
-        "used_fs" : `reiser
+        "used_fs" : `reiserfs
       ]
     ]
   ],
diff --git a/src/data/test_target_map.ycp b/src/data/test_target_map.ycp
index 156d7e0..da99191 100644
--- a/src/data/test_target_map.ycp
+++ b/src/data/test_target_map.ycp
@@ -9,7 +9,7 @@ $[
     "name" : "1. IDE, 57.27 GB, /dev/hda, IC35L060AVER07-0",
     "partitions" : [
       $[
-        "detected_fs" : `reiser,
+        "detected_fs" : `reiserfs,
         "device" : "/dev/hda1",
         "fsid" : 131,
         "fstopt" : "noauto",
@@ -20,11 +20,11 @@ $[
           600
         ],
         "type" : `primary,
-        "used_fs" : `reiser,
+        "used_fs" : `reiserfs,
         "uuid" : "b9beb663-9a7a-4931-9d5b-6dfce44768a3"
       ],
       $[
-        "detected_fs" : `reiser,
+        "detected_fs" : `reiserfs,
         "device" : "/dev/hda2",
         "fsid" : 131,
         "fstype" : "Linux native",
@@ -35,7 +35,7 @@ $[
           600
         ],
         "type" : `primary,
-        "used_fs" : `reiser,
+        "used_fs" : `reiserfs,
         "uuid" : "47aadd63-e17d-44cd-a6c7-3ea274ebda27"
       ],
       $[
@@ -67,7 +67,7 @@ $[
         "used_fs" : `unknown
       ],
       $[
-        "detected_fs" : `reiser,
+        "detected_fs" : `reiserfs,
         "device" : "/dev/hda5",
         "fsid" : 131,
         "fstype" : "Linux native",
@@ -78,11 +78,11 @@ $[
           653
         ],
         "type" : `logical,
-        "used_fs" : `reiser,
+        "used_fs" : `reiserfs,
         "uuid" : "0786ef12-8d78-4fb6-a9fa-85c6c50da9a6"
       ],
       $[
-        "detected_fs" : `reiser,
+        "detected_fs" : `reiserfs,
         "device" : "/dev/hda6",
         "fsid" : 131,
         "fstype" : "Linux native",
@@ -93,11 +93,11 @@ $[
           1959
         ],
         "type" : `logical,
-        "used_fs" : `reiser,
+        "used_fs" : `reiserfs,
         "uuid" : "02ed468b-f9c0-42d8-b696-e6f7bea0e3da"
       ],
       $[
-        "detected_fs" : `reiser,
+        "detected_fs" : `reiserfs,
         "device" : "/dev/hda7",
         "fsid" : 131,
         "fstype" : "Linux native",
@@ -108,7 +108,7 @@ $[
           3533
         ],
         "type" : `logical,
-        "used_fs" : `reiser,
+        "used_fs" : `reiserfs,
         "uuid" : "ad4b514a-9757-4b09-8b39-116a1565c5e5"
       ]
     ],
diff --git a/src/include/partitioning/custom_part_dialogs.rb b/src/include/partitioning/custom_part_dialogs.rb
index c429540..5cb61a2 100644
--- a/src/include/partitioning/custom_part_dialogs.rb
+++ b/src/include/partitioning/custom_part_dialogs.rb
@@ -1297,14 +1297,14 @@ module Yast
         txt = _(
           "\n" +
             "The file system on the partition cannot be shrunk by YaST2.\n" +
-            "Only fat, ext2, ext3, ext4, and reiser allow shrinking of a file system."
+            "Only fat, ext2, ext3, ext4 and reiserfs allow shrinking of a file system."
         )
       else
         # Popup text
         txt = _(
           "\n" +
             "The file system on the logical volume cannot be shrunk by YaST2.\n" +
-            "Only fat, ext2, ext3, ext4, and reiser allow shrinking of a file system."
+            "Only fat, ext2, ext3, ext4 and reiserfs allow shrinking of a file system."
         )
       end
       if ask
@@ -1342,14 +1342,14 @@ module Yast
         txt = _(
           "\n" +
             "The file system on the selected partition cannot be extended by YaST2.\n" +
-            "Only fat, ext2, ext3, ext4, xfs, and reiser allow extending a file system."
+            "Only fat, ext2, ext3, ext4, xfs and reiserfs allow extending a file system."
         )
       else
         # Popup text
         txt = _(
           "\n" +
             "The file system on the selected logical volume cannot be extended by YaST2.\n" +
-            "Only fat, ext2, ext3, ext4, xfs, and reiser allow extending a file system."
+            "Only fat, ext2, ext3, ext4, xfs and reiserfs allow extending a file system."
         )
       end
       if ask
@@ -1366,15 +1366,15 @@ module Yast
     end
 
 
-    def FsysShrinkReiserWarning(lvm)
+    def FsysShrinkReiserFSWarning(lvm)
       ret = true
       txt = ""
       if !lvm
         # Popup text
-        txt = _("You decreased a partition with a reiser file system on it.")
+        txt = _("You decreased a partition with a reiserfs file system on it.")
       else
         txt = _(
-          "You decreased a logical volume with a reiser file system on it."
+          "You decreased a logical volume with a reiserfs file system on it."
         )
       end
       txt = Ops.add(txt, "\n")
@@ -1382,7 +1382,7 @@ module Yast
         txt,
         _(
           "\n" +
-            "It is possible to shrink a reiser file system, but this feature is not\n" +
+            "It is possible to shrink a reiserfs file system, but this feature is not\n" +
             "very thoroughly tested. A backup of your data is recommended.\n" +
             "\n" +
             "Shrink the file system now?"
diff --git a/src/include/partitioning/custom_part_lib.rb b/src/include/partitioning/custom_part_lib.rb
index d0719e8..ba5abbe 100644
--- a/src/include/partitioning/custom_part_lib.rb
+++ b/src/include/partitioning/custom_part_lib.rb
@@ -1032,8 +1032,8 @@ module Yast
         end
       elsif Ops.less_than(resize, 0) && !Ops.get(poss, "shrink", false)
         ret = FsysCannotShrinkPopup(ask, lvm)
-      elsif Ops.less_than(resize, 0) && fsys == :reiser
-        ret = FsysShrinkReiserWarning(lvm)
+      elsif Ops.less_than(resize, 0) && fsys == :reiserfs
+        ret = FsysShrinkReiserFSWarning(lvm)
       elsif Ops.greater_than(resize, 0) && !Ops.get(poss, "extend", false)
         ret = FsysCannotGrowPopup(ask, lvm)
       end
diff --git a/src/include/partitioning/ep-settings.rb b/src/include/partitioning/ep-settings.rb
index fa6ec44..e472a8e 100644
--- a/src/include/partitioning/ep-settings.rb
+++ b/src/include/partitioning/ep-settings.rb
@@ -105,7 +105,7 @@ module Yast
       end
 
       filesystems = Builtins.filter(
-        [:ext2, :ext3, :ext4, :reiser, :xfs, :btrfs]
+        [:ext2, :ext3, :ext4, :reiserfs, :xfs, :btrfs]
       ) do |fs|
         FileSystems.IsSupported(fs) && !FileSystems.IsUnsupported(fs)
       end
diff --git a/src/modules/FileSystems.rb b/src/modules/FileSystems.rb
index abecb09..2bed646 100644
--- a/src/modules/FileSystems.rb
+++ b/src/modules/FileSystems.rb
@@ -49,7 +49,7 @@ module Yast
         "def_sym" => :unknown,
         "def_int" => ::Storage::FSUNKNOWN,
         "m"       => {
-          ::Storage::REISERFS => :reiser,
+          ::Storage::REISERFS => :reiserfs,
           ::Storage::EXT2     => :ext2,
           ::Storage::EXT3     => :ext3,
           ::Storage::EXT4     => :ext4,
@@ -71,7 +71,7 @@ module Yast
 
 
       # filesystems possible for root volume. used during scan for root volumes.
-      @possible_root_fs = [:ext2, :ext3, :ext4, :btrfs, :reiser, :xfs]
+      @possible_root_fs = [:ext2, :ext3, :ext4, :btrfs, :reiserfs, :xfs]
       @swap_m_points = ["swap"]
       @tmp_m_points = ["/tmp", "/var/tmp"]
       @default_subvol = "UNDEFINED"
@@ -255,7 +255,8 @@ module Yast
         :ext3       => true,
         :ext4       => true,
         :btrfs      => true,
-        :jfs        => false,
+        :jfs        => true,
+        :reiserfs   => true,
         :vfat       => true,
         :ntfs       => true,
         :xxefi      => false,
@@ -1127,7 +1128,7 @@ module Yast
       ext2_fst_options = []
       ext3_fst_options = []
       ext4_fst_options = []
-      reiser_fst_options = []
+      reiserfs_fst_options = []
 
 
       _RealFileSystems = {
@@ -1161,8 +1162,8 @@ module Yast
           :fst_options     => fat_fst_options,
           :options         => vfat_options
         },
-        :reiser  => {
-          :name            => "Reiser",
+        :reiserfs  => {
+          :name            => "ReiserFS",
           :fsid            => Partitions.fsid_native,
           :real_fs         => true,
           :supports_format => true,
@@ -1173,7 +1174,7 @@ module Yast
           :mount_option    => "-t reiserfs",
           :mount_string    => "reiserfs",
           :needed_modules  => ["reiserfs"],
-          :fst_options     => reiser_fst_options,
+          :fst_options     => reiserfs_fst_options,
           :options         => reiserfs_options
         },
         :xfs     => {
@@ -1371,14 +1372,14 @@ module Yast
       else
         fs = GetAllFileSystems(true, false, "")
         ret = Ops.get_list(fs, [fsys, :fst_options], [])
-        if Builtins.contains([:ext3, :ext4, :reiser], fsys)
+        if Builtins.contains([:ext3, :ext4, :reiserfs], fsys)
           ret = Convert.convert(
             Builtins.union(ret, GetJournalFstabOptions()),
             :from => "list",
             :to   => "list <map <symbol, any>>"
           )
         end
-        if Builtins.contains([:ext2, :ext3, :ext4, :reiser], fsys)
+        if Builtins.contains([:ext2, :ext3, :ext4, :reiserfs], fsys)
           ret = Convert.convert(
             Builtins.union(ret, GetAclFstabOptions()),
             :from => "list",
@@ -1425,7 +1426,7 @@ module Yast
         Ops.set(@support, :jfs, false)
         Ops.set(@support, :xxefi, true)
       end
-      Ops.set(@support, :reiser, false) if Arch.alpha
+      Ops.set(@support, :reiserfs, false) if Arch.alpha
       if Arch.board_mac
         Ops.set(@support, :hfs, true)
         Ops.set(@support, :hfsplus, true)
@@ -1642,8 +1643,8 @@ module Yast
         ret = :ext4
       elsif type == "btrfs"
         ret = :btrfs
-      elsif Builtins.regexpmatch(type, "reiser.*")
-        ret = :reiser
+      elsif type == "reiserfs"
+        ret = :reiserfs
       elsif type == "jfs"
         ret = :jfs
       elsif type == "xfs"
@@ -1734,7 +1735,7 @@ module Yast
       fsys = Ops.get_symbol(part, "used_fs", :none)
       fst_default = ""
       if Ops.get_boolean(part, "format", false) &&
-          Builtins.contains([:ext2, :ext3, :ext4, :reiser], fsys)
+          Builtins.contains([:ext2, :ext3, :ext4, :reiserfs], fsys)
         fst_default = "acl,user_xattr"
       elsif Ops.get_boolean(part, "format", false) && fsys == :btrfs &&
           @default_subvol != ""
@@ -1990,7 +1991,7 @@ module Yast
 
     def CanDoQuota(part)
       part = deep_copy(part)
-      quota_fs = [:ext2, :ext3, :ext4, :reiser, :xfs]
+      quota_fs = [:ext2, :ext3, :ext4, :reiserfs, :xfs]
       Builtins.contains(quota_fs, Ops.get_symbol(part, "used_fs", :unknown))
     end
 
@@ -2017,7 +2018,7 @@ module Yast
 
     def AddQuotaOpts(part, fst_opts)
       part = deep_copy(part)
-      journal = [:ext3, :ext4, :btrfs, :reiser]
+      journal = [:ext3, :ext4, :btrfs, :reiserfs]
       ret = RemoveQuotaOpts(fst_opts)
       if Builtins.contains(journal, Ops.get_symbol(part, "used_fs", :unknown))
         ret = Ops.add(
diff --git a/src/modules/Partitions.rb b/src/modules/Partitions.rb
index e5f9d30..1b72c7b 100644
--- a/src/modules/Partitions.rb
+++ b/src/modules/Partitions.rb
@@ -165,7 +165,7 @@ module Yast
         tmp = Convert.to_string(SCR.Read(path(".sysconfig.storage.DEFAULT_FS")))
         if tmp == nil ||
             !Builtins.contains(
-              ["ext2", "ext3", "ext4", "reiser", "xfs", "btrfs"],
+              ["ext2", "ext3", "ext4", "reiserfs", "xfs", "btrfs"],
               Builtins.tolower(tmp)
             )
           tmp = "ext4"
diff --git a/src/modules/Storage.rb b/src/modules/Storage.rb
index 6fc7ae0..9e13850 100644
--- a/src/modules/Storage.rb
+++ b/src/modules/Storage.rb
@@ -4980,7 +4980,7 @@ module Yast
       p = deep_copy(p)
       Builtins.y2milestone("DetectHomeFs p: %1", p)
       ret = false
-      poss_fs = [:ext2, :ext3, :ext4, :btrfs, :reiser, :xfs, :jfs]
+      poss_fs = [:ext2, :ext3, :ext4, :btrfs, :reiserfs, :xfs, :jfs]
       device = Ops.get_string(p, "device", "")
       if !Ops.get_boolean(p, "create", false) &&
           Builtins.contains(poss_fs, Ops.get_symbol(p, "detected_fs", :unknown)) &&
@@ -5798,7 +5798,7 @@ module Yast
           end
           l = Builtins.filter(l) do |p|
             Builtins.contains(
-              [:xfs, :ext2, :ext3, :ext4, :btrfs, :jfs, :reiser],
+              [:xfs, :ext2, :ext3, :ext4, :btrfs, :jfs, :reiserfs],
               Ops.get_symbol(p, "used_fs", :unknown)
             )
           end
diff --git a/src/modules/StorageProposal.rb b/src/modules/StorageProposal.rb
index 7428e93..720e367 100644
--- a/src/modules/StorageProposal.rb
+++ b/src/modules/StorageProposal.rb
@@ -6209,7 +6209,8 @@ module Yast
       filesystems = [
         Item(Id(:btrfs), "BtrFS"),
         Item(Id(:ext4), "Ext4"),
-        Item(Id(:xfs), "XFS")
+        Item(Id(:xfs), "XFS"),
+        Item(Id(:reiserfs), "ReiserFS")
       ]
 
       vb = VBox()
-- 
2.10.0