LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0004-add-reiser4-support.patch of Package yast2-storage (Project home:Ledest:test)

From 914dc30c871680ddbb003588f8ed30c57d432bc8 Mon Sep 17 00:00:00 2001
From: Led <ledest@gmail.com>
Date: Sat, 15 Oct 2016 03:06:09 +0300
Subject: [PATCH] add reiser4 support

---
 doc/README.part.info                     |   2 +-
 src/include/partitioning/ep-settings.rb  |   2 +-
 src/lib/storage/used_storage_features.rb |   2 +
 src/modules/FileSystems.rb               | 116 ++++++++++++++++++++++++++++++-
 src/modules/Partitions.rb                |   2 +-
 src/modules/Storage.rb                   |   4 +-
 src/modules/StorageProposal.rb           |   3 +-
 7 files changed, 122 insertions(+), 9 deletions(-)

diff --git a/doc/README.part.info b/doc/README.part.info
index 7a84ea0..fa9c7ec 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
-                       reiserfs,xfs,fat,vfat,ext2,ext3,ext4,btrfs,jfs,ntfs,swap
+                       reiserfs,reiser4,xfs,fat,vfat,ext2,ext3,ext4,btrfs,jfs,ntfs,swap
     Default value:     Empty list
     Example:           KEEP_PARTITION_FSYS=fat,ntfs
 
diff --git a/src/include/partitioning/ep-settings.rb b/src/include/partitioning/ep-settings.rb
index b1dd1da..92eff16 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, :reiserfs, :xfs, :jfs, :btrfs]
+        [:ext2, :ext3, :ext4, :reiserfs, :reiser4, :xfs, :jfs, :btrfs]
       ) do |fs|
         FileSystems.IsSupported(fs) && !FileSystems.IsUnsupported(fs)
       end
diff --git a/src/lib/storage/used_storage_features.rb b/src/lib/storage/used_storage_features.rb
index c92c43f..776d989 100755
--- a/src/lib/storage/used_storage_features.rb
+++ b/src/lib/storage/used_storage_features.rb
@@ -76,6 +76,7 @@ module Yast
           FT_XFS:           "xfsprogs",
           FT_JFS:           "jfsutils",
           FT_REISERFS:      "reiserfs",
+          FT_REISER4:       "reiser4progs",
           FT_HFS:           "hfsutils",
           FT_NFS:           "nfs-client",
           FT_NFS4:          "nfs-client",
@@ -129,6 +130,7 @@ module Yast
       FILESYSTEM_FEATURES =
         {
           ::Storage::REISERFS => :FT_REISERFS,
+          ::Storage::REISER4  => :FT_REISER4,
           ::Storage::EXT2     => :FT_EXT2,
           ::Storage::EXT3     => :FT_EXT3,
           ::Storage::EXT4     => :FT_EXT4,
diff --git a/src/modules/FileSystems.rb b/src/modules/FileSystems.rb
index 26a7536..2607256 100644
--- a/src/modules/FileSystems.rb
+++ b/src/modules/FileSystems.rb
@@ -50,6 +50,7 @@ module Yast
         "def_int" => ::Storage::FSUNKNOWN,
         "m"       => {
           ::Storage::REISERFS => :reiserfs,
+          ::Storage::REISER4  => :reiser4,
           ::Storage::EXT2     => :ext2,
           ::Storage::EXT3     => :ext3,
           ::Storage::EXT4     => :ext4,
@@ -71,7 +72,7 @@ module Yast
 
 
       # filesystems possible for root volume. used during scan for root volumes.
-      @possible_root_fs = [:ext2, :ext3, :ext4, :btrfs, :reiserfs, :xfs, :jfs]
+      @possible_root_fs = [:ext2, :ext3, :ext4, :btrfs, :reiserfs, :reiser4, :xfs, :jfs]
       @swap_m_points = ["swap"]
       @tmp_m_points = ["/tmp", "/var/tmp"]
       @default_subvol = "UNDEFINED"
@@ -257,6 +258,7 @@ module Yast
         :btrfs      => true,
         :jfs        => true,
         :reiserfs   => true,
+        :reiser4    => true,
         :vfat       => true,
         :ntfs       => true,
         :xxefi      => false,
@@ -791,7 +793,7 @@ module Yast
         },
         {
           # label text
-          :widget       => ComboBox(
+          :widget     => ComboBox(
             Id("opt_blocksize"),
             Opt(:hstretch),
             _("Block &Size in Bytes"),
@@ -800,13 +802,104 @@ module Yast
           :query_key  => "opt_blocksize",
           :option_str => "--block-size=",
           # help text, richtext format
-          :help_text    => _(
+          :help_text  => _(
             "<p><b>Block Size:</b>\nSpecify the size of blocks in bytes. Valid block size values are 512, 1024, 2048, 4096 and 8192 bytes per block. If auto is selected, the standard block size of 4096 is used.</p>\n"
           )
         }
       ]
 
 
+      reiser4_options = [
+        {
+          # label text
+          :widget     => ComboBox(
+            Id("opt_hash"),
+            Opt(:hstretch),
+            _("&Hash Function"),
+            ["default", "r5_hash", "tea_hash", "rupasov_hash", "fnv1_hash", "deg_hash"]
+          ),
+          :query_key  => "opt_hash",
+          :option_str => "-o hash=",
+          :type       => :text,
+          # help text, richtext format
+          :help_text  => _(
+            "<p><b>Hash Function:</b>\nThis specifies the name of the hash function to use to sort the file names in directories.</p>\n"
+          ),
+        },
+        {
+          # label text
+          :widget     => ComboBox(
+            Id("opt_compress"),
+            Opt(:hstretch),
+            _("&Compression Plugin"),
+            ["default", "lzo1", "gzip1"]
+          ),
+          :query_key  => "opt_compress",
+          :option_str => "-o compress=",
+          # help text, richtext format
+          :help_text  => _(
+            "<p><b>Compression Plugin:</b>\nSpecify the comression plugin. Valid methods are default, lzo1, gzip1. If default is selected, compression plugin lzo1 is used.</p>\n"
+          )
+        },
+        {
+          # label text
+          :widget     => ComboBox(
+            Id("opt_compress_mode"),
+            Opt(:hstretch),
+            _("Compression &Mode"),
+            ["default", "none", "conv", "latt", "ultim", "force"]
+          ),
+          :query_key  => "opt_compress_mode",
+          :option_str => "-o compressMode=",
+          # help text, richtext format
+          :help_text  => _(
+            "<p><b>Compression Mode:</b>\nSpecify the comression mode. Valid methods are default, none, conv, latt, ultim, force. If default is selected, compression mode conv is used.</p>\n"
+          )
+        },
+        {
+          # label text
+          :widget     => ComboBox(
+            Id("opt_cluster"),
+            Opt(:hstretch),
+            _("Cluster &Size"),
+            ["default", "4K", "8K", "16K", "32K", "64K"]
+          ),
+          :query_key  => "opt_cluster",
+          :option_str => "-o cluster=",
+          # help text, richtext format
+          :help_text  => _(
+            "<p><b>Cluster Size:</b>\nSpecify the cluster size. Valid values are default, 4K, 8K, 16K, 32K, 64K. If default is selected, 64K is used.</p>\n"
+          )
+        },
+        {
+          # label text
+          :widget        => TextEntry(
+            Id("opt_label"),
+            Opt(:hstretch),
+            _("&Label"),
+            ""
+          ),
+          :query_key     => "opt_label",
+          :option_str    => "-L",
+          :str_length    => 16,
+          :invalid_chars => "\t ",
+          # popup text
+          :error_text    => _(
+            "The \"Label\" value is incorrect.\n"
+          ),
+          :type          => :text,
+          # xgettext: no-c-format
+          # help text, richtext format
+          :help_text     => _(
+            "<p><b>Label</b>\nSet the volume label. If empty, label will not be set.</p>\n"
+          )
+        }
+      ]
+
+
+      reiser4_fst_options = []
+
+
       xfs_options = [
         {
           # label text
@@ -1176,6 +1269,21 @@ module Yast
           :fst_options     => reiserfs_fst_options,
           :options         => reiserfs_options
         },
+        :reiser4  => {
+          :name            => "Reiser4",
+          :fsid            => Partitions.fsid_native,
+          :real_fs         => true,
+          :supports_format => true,
+          :fsid_item       => "0x83 Linux ",
+          :fstype          => "Linux native",
+          :crypt           => true,
+          :mountpoints     => SuggestMPoints(),
+          :mount_option    => "-t reiser4",
+          :mount_string    => "reiser4",
+          :needed_modules  => ["reiser4"],
+          :fst_options     => reiser4_fst_options,
+          :options         => reiser4_options
+        },
         :xfs     => {
           :name            => "XFS",
           :fsid            => Partitions.fsid_native,
@@ -1644,6 +1752,8 @@ module Yast
         ret = :btrfs
       elsif type == "reiserfs"
         ret = :reiserfs
+      elsif type == "reiser4"
+        ret = :reiser4
       elsif type == "jfs"
         ret = :jfs
       elsif type == "xfs"
diff --git a/src/modules/Partitions.rb b/src/modules/Partitions.rb
index b16fa09..b00e720 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", "reiserfs", "xfs", "jfs", "btrfs"],
+              ["ext2", "ext3", "ext4", "reiserfs", "reiser4", "xfs", "jfs", "btrfs"],
               Builtins.tolower(tmp)
             )
           tmp = "ext4"
diff --git a/src/modules/Storage.rb b/src/modules/Storage.rb
index 9e13850..a956ed0 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, :reiserfs, :xfs, :jfs]
+      poss_fs = [:ext2, :ext3, :ext4, :btrfs, :reiserfs, :reiser4, :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, :reiserfs],
+              [:xfs, :ext2, :ext3, :ext4, :btrfs, :jfs, :reiserfs, :reiser4],
               Ops.get_symbol(p, "used_fs", :unknown)
             )
           end
diff --git a/src/modules/StorageProposal.rb b/src/modules/StorageProposal.rb
index f3e5635..0d09a9b 100644
--- a/src/modules/StorageProposal.rb
+++ b/src/modules/StorageProposal.rb
@@ -6211,7 +6211,8 @@ module Yast
         Item(Id(:ext4), "Ext4"),
         Item(Id(:xfs), "XFS"),
         Item(Id(:jfs), "JFS"),
-        Item(Id(:reiserfs), "ReiserFS")
+        Item(Id(:reiserfs), "ReiserFS"),
+        Item(Id(:reiser4), "Reiser4")
       ]
 
       vb = VBox()
-- 
2.10.0