[yast-commit] r58150 - in /trunk/storage/storage/src/modules: Partitions.ycp Storage.ycp
Author: aschnell Date: Fri Jul 24 15:38:53 2009 New Revision: 58150 URL: http://svn.opensuse.org/viewcvs/yast?rev=58150&view=rev Log: - query partition table capabilities from libstorage instead of having extra table Modified: trunk/storage/storage/src/modules/Partitions.ycp trunk/storage/storage/src/modules/Storage.ycp Modified: trunk/storage/storage/src/modules/Partitions.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Partitions.ycp?rev=58150&r1=58149&r2=58150&view=diff ============================================================================== --- trunk/storage/storage/src/modules/Partitions.ycp (original) +++ trunk/storage/storage/src/modules/Partitions.ycp Fri Jul 24 15:38:53 2009 @@ -18,6 +18,9 @@ import "Stage"; import "AsciiFile"; + import "LibStorage"; + import "LibStorage::StorageInterface"; + import "LibStorage::DlabelCapabilities"; // The filesystem ids for the partitions global const integer fsid_empty = 0; @@ -87,6 +90,15 @@ symbol default_boot_fs = `unknown; + any sint = nil; + + + global void InitSlib(any value) + { + sint = value; + } + + global boolean EfiBoot() { // TODO: move to libstorage @@ -705,45 +717,39 @@ } -map capabilities = $[ "msdos" : $[ "extended" : true, - "max_primary" : 4 ], - "gpt" : $[ "max_primary" : 16 ], - "mac" : $[ "max_primary" : 16 ], - "amiga" : $[ "max_primary" : 16 ], - "sun" : $[ "max_primary" : 8 ], - "bsd" : $[ "max_primary" : 8 ], - "dasd" : $[ "max_primary" : 3 ] - ]; - -global define integer MaxPrimary( string label ) - ``{ - integer ret = capabilities[label,"max_primary"]:4; - y2milestone( "MaxPrimary label:%1 ret:%2", label, ret ); - return( ret ); + global integer MaxPrimary(string dlabel) + { + integer ret = 0; + any caps = LibStorage::DlabelCapabilities::new("LibStorage::DlabelCapabilities"); + if (LibStorage::StorageInterface::getDlabelCapabilities(sint, dlabel, caps)) + ret = LibStorage::DlabelCapabilities::swig_maxPrimary_get(caps); + y2milestone("MaxPrimary dlabel:%1 ret:%2", dlabel, ret); + return ret; } -global define integer MaxLogical( string device ) - ``{ - integer ret = 15; - if( search( device, "/dev/hd" )==0 ) - { - ret = 63; - } - else if( search( device, "/dev/rd/c" )==0 ) - { - ret = 7; - } - y2milestone( "MaxLogical:%1 ret:%2", device, ret ); - return( ret ); + + global boolean HasExtended(string dlabel) + { + boolean ret = false; + any caps = LibStorage::DlabelCapabilities::new("LibStorage::DlabelCapabilities"); + if (LibStorage::StorageInterface::getDlabelCapabilities(sint, dlabel, caps)) + ret = LibStorage::DlabelCapabilities::swig_extendedPossible_get(caps); + y2milestone("HasExtended dlabel:%1 ret:%2", dlabel, ret); + return ret; } -global define boolean HasExtended( string label ) - ``{ - boolean ret = capabilities[label,"extended"]:false; - y2milestone( "HasExtended label:%1 ret:%2", label, ret ); - return( ret ); + + global integer MaxLogical(string dlabel) + { + integer ret = 0; + any caps = LibStorage::DlabelCapabilities::new("LibStorage::DlabelCapabilities"); + if (LibStorage::StorageInterface::getDlabelCapabilities(sint, dlabel, caps)) + ret = LibStorage::DlabelCapabilities::swig_maxLogical_get(caps); + y2milestone("MaxLogical dlabel:%1 ret:%2", dlabel, ret); + return ret; } + global define string RdonlyText( string disk, boolean expert_partitioner ) ``{ string text = ""; Modified: trunk/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=58150&r1=58149&r2=58150&view=diff ============================================================================== --- trunk/storage/storage/src/modules/Storage.ycp (original) +++ trunk/storage/storage/src/modules/Storage.ycp Fri Jul 24 15:38:53 2009 @@ -312,6 +312,7 @@ conts = getContainers(); y2milestone("InitLibstorage conts:%1", conts); FileSystems::InitSlib(sint); + Partitions::InitSlib(sint); return true; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org