Module: Yast::PartitioningRaidLibInclude
- Defined in:
- ../../src/include/partitioning/raid_lib.rb
Instance Method Summary (collapse)
-
- (Object) get_possible_rds(targetMap)
Get all partitions, we can probably use as raid devices Add needed information: is_raid, disksize.
- - (Object) initialize_partitioning_raid_lib(include_target)
Instance Method Details
- (Object) get_possible_rds(targetMap)
Get all partitions, we can probably use as raid devices Add needed information: is_raid, disksize
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File '../../src/include/partitioning/raid_lib.rb', line 36 def get_possible_rds(targetMap) targetMap = deep_copy(targetMap) ret = [] #//////////////////////////////////////////////////////////////////// # add the devicename i.e /dev/hda1 or /dev/system/usr to partition list # and the device key <subdevice>/<maindevice> i.e. 1//dev/hda targetMap = Builtins.mapmap(targetMap) do |dev, devmap| partitions = Builtins.maplist(Ops.get_list(devmap, "partitions", [])) do |part| Ops.set(part, "maindev", dev) deep_copy(part) end { dev => Builtins.add(devmap, "partitions", partitions) } end #////////////////////////////////////////////////////////// # Look for all partitions: # not LVM ( here I mean /dev/<lvm_volumegroup>/<lv> entrys! # there are only the lv's in the targetMap under # /dev/<lvm_volumegroup>/<lv> !) # no mountpoint # id 0x83 or 0x8e or 0xfd # no RAID devices (this is for experts only, by hand) allret = [] allowed_ctypes = [:CT_DISK, :CT_DMRAID, :CT_DMMULTIPATH] types_no = [:lvm, :sw_raid] fsids = [ Partitions.fsid_lvm, Partitions.fsid_raid, Partitions.fsid_native, Partitions.fsid_swap ] allowed_enc_types = [:none] Builtins.foreach(targetMap) do |dev, devmap| if Builtins.contains( allowed_ctypes, Ops.get_symbol(devmap, "type", :CT_UNKNOWN) ) ret = Builtins.filter(Ops.get_list(devmap, "partitions", [])) do |p| Builtins.size(Ops.get_string(p, "mount", "")) == 0 && !Builtins.contains(types_no, Ops.get_symbol(p, "type", :primary)) && Builtins.contains( allowed_enc_types, Ops.get_symbol(p, "enc_type", :none) ) && (!Storage.IsUsedBy(p) || Ops.get_symbol(p, "used_by_type", :UB_NONE) == :UB_MD) && (!Builtins.haskey(p, "fsid") || Builtins.contains(fsids, Ops.get_integer(p, "fsid", 0))) end allret = Convert.convert( Builtins.merge(allret, ret), :from => "list", :to => "list <map>" ) end end deep_copy(allret) end |
- (Object) initialize_partitioning_raid_lib(include_target)
28 29 30 31 32 |
# File '../../src/include/partitioning/raid_lib.rb', line 28 def initialize_partitioning_raid_lib(include_target) Yast.import "Partitions" textdomain "storage" end |