Author: aschnell
Date: Wed Dec 30 11:46:27 2009
New Revision: 60204
URL: http://svn.opensuse.org/viewcvs/yast?rev=60204&view=rev
Log:
- ported MdPart code from SLE11 SP1
Modified:
trunk/storage/VERSION
trunk/storage/bindings/ycp/LibStorage.i
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/custom_part_check_generated.ycp
trunk/storage/storage/src/include/ep-hd.ycp
trunk/storage/storage/src/include/ep-main.ycp
trunk/storage/storage/src/inst_target_selection.ycp
trunk/storage/storage/src/modules/Storage.ycp
trunk/storage/storage/src/modules/StorageFields.ycp
trunk/storage/storage/src/modules/StorageIcons.ycp
trunk/storage/yast2-storage.spec.in
Modified: trunk/storage/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/VERSION?rev=60204&r1=60203&r2=60204&view=diff
==============================================================================
--- trunk/storage/VERSION (original)
+++ trunk/storage/VERSION Wed Dec 30 11:46:27 2009
@@ -1 +1 @@
-2.19.1
+2.19.2
Modified: trunk/storage/bindings/ycp/LibStorage.i
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/bindings/ycp/LibStorage.i?rev=60204&r1=60203&r2=60204&view=diff
==============================================================================
--- trunk/storage/bindings/ycp/LibStorage.i (original)
+++ trunk/storage/bindings/ycp/LibStorage.i Wed Dec 30 11:46:27 2009
@@ -27,6 +27,9 @@
specialize_sequence(storage::LvmLvInfo, TO_PACK, FROM_PACK, CHECK)
specialize_sequence(storage::MdInfo, TO_PACK, FROM_PACK, CHECK)
specialize_sequence(storage::MdStateInfo, TO_PACK, FROM_PACK, CHECK)
+specialize_sequence(storage::MdPartCoInfo, TO_PACK, FROM_PACK, CHECK)
+specialize_sequence(storage::MdPartInfo, TO_PACK, FROM_PACK, CHECK)
+specialize_sequence(storage::MdPartCoStateInfo, TO_PACK, FROM_PACK, CHECK)
specialize_sequence(storage::LoopInfo, TO_PACK, FROM_PACK, CHECK)
specialize_sequence(storage::DmInfo, TO_PACK, FROM_PACK, CHECK)
specialize_sequence(storage::NfsInfo, TO_PACK, FROM_PACK, CHECK)
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=60204&r1=60203&r2=60204&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Wed Dec 30 11:46:27 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Dec 29 18:53:27 CET 2009 - aschnell@suse.de
+
+- ported MdPart code from SLE11 SP1
+- 2.19.2
+
+-------------------------------------------------------------------
Tue Dec 22 14:23:40 CET 2009 - aschnell@suse.de
- support for cloning disk partition layout (fate #303809)
Modified: trunk/storage/storage/src/include/custom_part_check_generated.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_check_generated.ycp?rev=60204&r1=60203&r2=60204&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_check_generated.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_check_generated.ycp Wed Dec 30 11:46:27 2009
@@ -77,7 +77,7 @@
list<map> part_info = diskinfo["partitions"]:[];
integer cyl_size = diskinfo["cyl_size"]:1000000;
- if (contains([ `CT_DISK, `CT_DMRAID, `CT_DMMULTIPATH ], diskinfo["type"]:`CT_UNKNOWN))
+ if (contains([ `CT_DISK, `CT_DMRAID, `CT_DMMULTIPATH, `CT_MDPART ], diskinfo["type"]:`CT_UNKNOWN))
diskless = false;
foreach (map part, part_info, {
Modified: trunk/storage/storage/src/include/ep-hd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-hd.ycp?rev=60204&r1=60203&r2=60204&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-hd.ycp (original)
+++ trunk/storage/storage/src/include/ep-hd.ycp Wed Dec 30 11:46:27 2009
@@ -115,11 +115,10 @@
{
symbol Predicate(map disk, map partition)
{
- return StorageFields::PredicateDiskType(disk, partition, [`CT_DMRAID, `CT_DMMULTIPATH, `CT_DISK]);
+ return StorageFields::PredicateDiskType(disk, partition, [`CT_DMRAID, `CT_DMMULTIPATH,
+ `CT_MDPART, `CT_DISK]);
}
-
-
list<symbol> fields = StorageSettings::FilterTable([ `device, `udev_path, `udev_id, `size, `format,
`encrypted, `type, `fs_type, `label, `mount_point,
`mount_by, `start_cyl, `end_cyl, `used_by ]);
Modified: trunk/storage/storage/src/include/ep-main.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-main.ycp?rev=60204&r1=60203&r2=60204&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-main.ycp (original)
+++ trunk/storage/storage/src/include/ep-main.ycp Wed Dec 30 11:46:27 2009
@@ -158,6 +158,7 @@
case `CT_DISK:
case `CT_DMRAID:
case `CT_DMMULTIPATH:
+ case `CT_MDPART:
huhu(disk, `hd, $[ `create : CreateHdPartitionPanel, `handle : HandleHdPartitionPanel ],
$[ `create : CreateHdDiskPanel, `handle : HandleHdDiskPanel ]);
break;
@@ -246,7 +247,8 @@
switch (disk["type"]:`unknown)
{
- case `CT_DISK:
+ case `CT_DISK:
+ case `CT_MDPART:
case `CT_DMRAID:
case `CT_DMMULTIPATH:
if (part == nil)
Modified: trunk/storage/storage/src/inst_target_selection.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_target_selection.ycp?rev=60204&r1=60203&r2=60204&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_target_selection.ycp (original)
+++ trunk/storage/storage/src/inst_target_selection.ycp Wed Dec 30 11:46:27 2009
@@ -66,7 +66,7 @@
map usable_target_map = filter(string d, map e, targetMap, {
return Storage::IsPartitionable(e) &&
- !contains([ `UB_DMRAID, `UB_DMMULTIPATH ], e["used_by_type"]:`UB_NONE);
+ !contains([ `UB_DMRAID, `UB_DMMULTIPATH, `UB_MDPART ], e["used_by_type"]:`UB_NONE);
});
integer dskcnt = size(usable_target_map);
Modified: trunk/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=60204&r1=60203&r2=60204&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Wed Dec 30 11:46:27 2009
@@ -55,6 +55,8 @@
import "LibStorage::DmPartInfo";
import "LibStorage::DmraidInfo";
import "LibStorage::DmmultipathInfo";
+ import "LibStorage::MdPartCoInfo";
+ import "LibStorage::MdPartInfo";
import "LibStorage::NfsInfo";
import "LibStorage::ContainerInfo";
import "LibStorage::DiskInfo";
@@ -90,6 +92,7 @@
LibStorage::DMRAID() : `CT_DMRAID,
LibStorage::DMMULTIPATH() : `CT_DMMULTIPATH,
LibStorage::DM() : `CT_DM,
+ LibStorage::MDPART() : `CT_MDPART,
LibStorage::NFSC() : `CT_NFS
]
];
@@ -101,6 +104,7 @@
LibStorage::UB_MD() : `UB_MD,
LibStorage::UB_DMRAID() : `UB_DMRAID,
LibStorage::UB_DMMULTIPATH() : `UB_DMMULTIPATH,
+ LibStorage::UB_MDPART() : `UB_MDPART,
LibStorage::UB_DM() : `UB_DM
]
];
@@ -172,8 +176,9 @@
map DiskMapVersion = $[];
map DiskMap = $[];
-map type_order = $[ `CT_DISK : 0, `CT_MD : 1, `CT_DMRAID : 2, `CT_DMMULTIPATH : 3,
- `CT_LOOP : 4, `CT_DM : 5, `CT_LVM : 6, `CT_NFS : 7 ];
+map type_order = $[ `CT_DISK : 0, `CT_MD : 1, `CT_MDPART : 2, `CT_DMRAID : 3,
+ `CT_DMMULTIPATH : 4, `CT_LOOP : 5, `CT_DM : 6, `CT_LVM : 7,
+ `CT_NFS : 8 ];
list<string> hw_packages = [];
string part_insts = "";
@@ -577,7 +582,12 @@
}
else if( search( device, "/dev/md" )==0 && size(ls)==2 )
{
- dlen = 7;
+ integer pos = find(device, "p");
+ y2milestone("device:%1 pos:%2", device, pos);
+ if (pos == -1)
+ dlen = 7;
+ else
+ dlen = pos;
}
else if( search( device, "/dev/loop" )==0 )
{
@@ -1290,6 +1300,21 @@
return( p );
}
+map mdPartMap(any info, map p)
+{
+ any vinfo = LibStorage::MdPartInfo::swig_v_get(info);
+ p = volumeMap(vinfo, p);
+ p["nr"] = 0;
+ boolean part = LibStorage::MdPartInfo::swig_part_get(info);
+ if (part)
+ {
+ any pinfo = LibStorage::MdPartInfo::swig_p_get(info);
+ p = partAddMap(pinfo, p);
+ }
+ y2milestone("mdPartMap ret:%1", p);
+ return p;
+}
+
map getContainerInfo( map c )
{
y2milestone( "getContainerInfo %1", c );
@@ -1385,6 +1410,50 @@
c["partitions"] = add( c["partitions"]:[], p );
});
}
+ else if( c["type"]:`CT_UNKNOWN == `CT_MDPART )
+ {
+ list<any> pinfos = [];
+ any infos = LibStorage::MdPartCoInfo::new("LibStorage::MdPartCoInfo");
+ string d = c["device"]:"";
+ ret = LibStorage::StorageInterface::getMdPartCoInfo(sint, d, infos);
+ if (ret == 0)
+ {
+ any dinfo = LibStorage::MdPartCoInfo::swig_d_get(infos);
+ c = diskMap(dinfo, c);
+ }
+ else
+ y2warning( "disk \"%1\" ret:%2", c["device"]:"", ret );
+
+ list<string> ls = splitstring(LibStorage::MdPartCoInfo::swig_devices_get(infos), " ");
+ y2milestone( "ls=%1", ls );
+ c["devices"] = ls;
+
+ integer t = LibStorage::MdPartCoInfo::swig_level_get(infos);
+ c["raid_type"] = substring(sformat("%1", toSymbol(conv_mdtype, t)), 1);
+ if (c["raid_type"]:"" == "raid5")
+ {
+ t = LibStorage::MdPartCoInfo::swig_parity_get(infos);
+ symbol pt = toSymbol(conv_mdparity, t);
+ if (pt != `par_none)
+ c["parity_algorithm"] = substring(sformat("%1", pt), 1);
+ }
+ t = LibStorage::MdPartCoInfo::swig_chunk_get(infos);
+ if (t > 0)
+ {
+ c["chunk_size"] = t;
+ }
+ c["sb_ver"] = LibStorage::MdPartCoInfo::swig_sb_ver_get(infos);
+
+ c["partitions"] = [];
+ ret = LibStorage::StorageInterface::getMdPartInfo(sint, d, pinfos);
+ foreach(any info, pinfos, {
+ map p = $[];
+ p = mdPartMap(info, p);
+ p["fstype"] = Partitions::raid_name;
+ if (p["nr"]:-1 != 0)
+ c["partitions"] = add(c["partitions"]:[], p);
+ });
+ }
else if( c["type"]:`CT_UNKNOWN == `CT_LVM )
{
list<any> pinfos = [];
@@ -1572,7 +1641,7 @@
global boolean IsDiskType(symbol t)
{
- return contains([ `CT_DISK, `CT_DMRAID, `CT_DMMULTIPATH ], t);
+ return contains([ `CT_DISK, `CT_DMRAID, `CT_DMMULTIPATH, `CT_MDPART ], t);
}
/**
@@ -2817,7 +2886,7 @@
global boolean IsPartType(symbol t)
{
- return t == `CT_DMRAID || t == `CT_DMMULTIPATH || t == `CT_DISK;
+ return t == `CT_DMRAID || t == `CT_DMMULTIPATH || t == `CT_DISK || t == `CT_MDPART;
}
@@ -3067,7 +3136,7 @@
``{
map dtmp = Storage::GetDiskPartitionTg( dev, $[] )[0]:$[];
y2milestone( "probing dev %1 disk %2", dev, dtmp );
- if( search( dev, "/dev/dm-" )==0 )
+ if( search( dev, "/dev/dm-" )==0 || search( dev, "/dev/md" )==0 )
{
if( size(disk["bios_id"]:"")>0 )
bios_id_raid[dev] = disk["bios_id"]:"";
@@ -3080,6 +3149,8 @@
});
tmp = filter( string dev, map disk, tmp,
``(search( dev, "/dev/dm-" )!=0));
+ tmp = filter( string dev, map disk, tmp,
+ ``(search( dev, "/dev/md" )!=0));
if( size(rename)>0 )
{
foreach( string old, string new, rename,
@@ -3133,6 +3204,11 @@
y2milestone("addind bios_id %1 to %2", bios, dev);
tmp[dev, "bios_id"] = bios;
}
+ if (c["type"]:`CT_UNKNOWN == `CT_MDPART && c["device"]:"" == dm)
+ {
+ y2milestone("addind bios_id %1 to %2", bios, dev);
+ tmp[dev, "bios_id"] = bios;
+ }
});
});
}
@@ -3221,8 +3297,8 @@
});
keys = maplist( string k, any e, tg, ``(k));
keys = sort( string a, string b, keys,
- ``( type_order[tg[a,"type"]:`CT_UNKNOWN]:6 >
- type_order[tg[b,"type"]:`CT_UNKNOWN]:6 ));
+ ``( type_order[tg[a,"type"]:`CT_UNKNOWN]:9 >
+ type_order[tg[b,"type"]:`CT_UNKNOWN]:9 ));
y2milestone( "SetTargetMap keys %1", keys );
foreach( string k, keys,
``{
@@ -3252,8 +3328,8 @@
});
keys = maplist( string k, any e, target, ``(k));
keys = sort( string a, string b, keys,
- ``( type_order[target[a,"type"]:`CT_UNKNOWN]:6 >
- type_order[target[b,"type"]:`CT_UNKNOWN]:6 ));
+ ``( type_order[target[a,"type"]:`CT_UNKNOWN]:9 >
+ type_order[target[b,"type"]:`CT_UNKNOWN]:9 ));
y2milestone( "SetTargetMap keys %1", keys );
foreach( string k, keys,
``{
@@ -3286,8 +3362,8 @@
});
keys = maplist( string k, any e, target, ``(k));
keys = sort( string a, string b, keys,
- ``( type_order[target[a,"type"]:`CT_UNKNOWN]:6 <
- type_order[target[b,"type"]:`CT_UNKNOWN]:6 ));
+ ``( type_order[target[a,"type"]:`CT_UNKNOWN]:9 <
+ type_order[target[b,"type"]:`CT_UNKNOWN]:9 ));
y2milestone( "SetTargetMap keys %1", keys );
foreach( string k, keys,
``{
@@ -3879,7 +3955,7 @@
global boolean IsPartitionable( map entry )
{
return entry["type"]:`CT_UNKNOWN==`CT_DMRAID || entry["type"]:`CT_UNKNOWN==`CT_DMMULTIPATH ||
- IsRealDisk( entry );
+ entry["type"]:`CT_UNKNOWN==`CT_MDPART || IsRealDisk( entry );
}
global define boolean DeviceRealDisk( string device )
@@ -4738,6 +4814,8 @@
need_crypt = true;
if (e["type"]:`CT_UNKNOWN == `CT_MD && !isempty(e["partitions"]:[]))
need_md = true;
+ if( e["type"]:`CT_UNKNOWN==`CT_MDPART )
+ need_md = true;
if( e["type"]:`CT_UNKNOWN==`CT_LVM )
need_lvm = true;
if( e["type"]:`CT_UNKNOWN==`CT_DMRAID )
Modified: trunk/storage/storage/src/modules/StorageFields.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/StorageFields.ycp?rev=60204&r1=60203&r2=60204&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/StorageFields.ycp (original)
+++ trunk/storage/storage/src/modules/StorageFields.ycp Wed Dec 30 11:46:27 2009
@@ -28,13 +28,13 @@
*/
global void IterateTargetMap(map target_map, void(map, map) callback)
{
- const map disk_order = $[ `CT_DMRAID : 0, `CT_DMMULTIPATH : 1, `CT_DISK : 2,
- `CT_MD : 3, `CT_LOOP : 4, `CT_LVM : 5, `CT_DM : 6, `CT_NFS : 7 ];
+ const map disk_order = $[ `CT_DMRAID : 0, `CT_DMMULTIPATH : 1, `CT_MDPART : 2, `CT_DISK : 3,
+ `CT_MD : 4, `CT_LOOP : 5, `CT_LVM : 6, `CT_DM : 7, `CT_NFS : 8 ];
list<string> keys = maplist(string dev, map disk, target_map, { return dev; });
keys = sort(string a, string b, keys, {
- integer oa = disk_order[target_map[a, "type"]:`CT_UNKNOWN]:8;
- integer ob = disk_order[target_map[b, "type"]:`CT_UNKNOWN]:8;
+ integer oa = disk_order[target_map[a, "type"]:`CT_UNKNOWN]:9;
+ integer ob = disk_order[target_map[b, "type"]:`CT_UNKNOWN]:9;
return (oa==ob) ? (ahttp://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/StorageIcons.ycp?rev=60204&r1=60203&r2=60204&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/StorageIcons.ycp (original)
+++ trunk/storage/storage/src/modules/StorageIcons.ycp Wed Dec 30 11:46:27 2009
@@ -45,6 +45,7 @@
{
case `CT_DMRAID:
case `CT_MD:
+ case `CT_MDPART:
case `sw_raid:
return raid_icon;
Modified: trunk/storage/yast2-storage.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/yast2-storage.spec.in?rev=60204&r1=60203&r2=60204&view=diff
==============================================================================
--- trunk/storage/yast2-storage.spec.in (original)
+++ trunk/storage/yast2-storage.spec.in Wed Dec 30 11:46:27 2009
@@ -5,7 +5,7 @@
License: GPL v2 or later
BuildRequires: blocxx-devel boost-devel gcc-c++ libxcrypt-devel openssl-devel sablot swig
BuildRequires: docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer sgml-skel update-desktop-files
-BuildRequires: libstorage-devel >= 2.19.3 yast2 >= 2.18.19 yast2-core-devel >= 2.18.1 yast2-devtools
+BuildRequires: libstorage-devel >= 2.19.4 yast2 >= 2.18.19 yast2-core-devel >= 2.18.1 yast2-devtools
BuildRequires: yast2-testsuite >= 2.19.0 yast2-perl-bindings
Requires: libstorage = %(echo `rpm -q --queryformat '%{VERSION}' libstorage`)
Requires: yast2-perl-bindings yast2-core >= 2.18.3 yast2 >= 2.18.19 yast2-libyui >= 2.18.7
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org