Author: fehr Date: Wed May 18 11:59:08 2011 New Revision: 64029 URL: http://svn.opensuse.org/viewcvs/yast?rev=64029&view=rev Log: changes required due to backport of yast2-storage Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/autoyast2.spec.in branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/clients/inst_autoconfigure.ycp branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/include/autopart.ycp branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstLVM.ycp branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstStorage.ycp Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/autoyast2.spec.in URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoinstallation/autoyast2.spec.in?rev=64029&r1=64028&r2=64029&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/autoinstallation/autoyast2.spec.in (original) +++ branches/SuSE-Code-11-SP2-Branch/autoinstallation/autoyast2.spec.in Wed May 18 11:59:08 2011 @@ -6,6 +6,7 @@ BuildRequires: yast2 >= 2.16.36 Requires: yast2 >= 2.16.36 +Requires: yast2_storage >= 2.17.101 Requires: yast2-core yast2-xml libxslt Requires: autoyast2-installation = %{version} Requires: yast2-schema yast2 yast2-country yast2-storage Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes?rev=64029&r1=64028&r2=64029&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes Wed May 18 11:59:08 2011 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Wed May 18 11:57:05 CEST 2011 - fehr@suse.de + +- changes required due to backport of yast2-storage + +------------------------------------------------------------------- Fri May 13 14:24:10 CEST 2011 - ug@suse.de - keep_unknown_lv added (fate#308893) Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/clients/inst_autoconfigure.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/clients/inst_autoconfigure.ycp?rev=64029&r1=64028&r2=64029&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/clients/inst_autoconfigure.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/clients/inst_autoconfigure.ycp Wed May 18 11:59:08 2011 @@ -12,6 +12,7 @@ textdomain "autoinst"; import "Profile"; + import "Mode"; import "AutoinstScripts"; import "AutoinstConfig"; import "Popup"; Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/include/autopart.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/include/autopart.ycp?rev=64029&r1=64028&r2=64029&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/include/autopart.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/include/autopart.ycp Wed May 18 11:59:08 2011 @@ -7,6 +7,7 @@ textdomain "autoinst"; import "FileSystems"; + import "Arch"; include "partitioning/partition_defines.ycp"; @@ -120,7 +121,7 @@ ``{ if (haskey(partition, "maxsize")) { - partition["max"] = kmgt_str_to_byte(partition["maxsize"]:""); + partition["max"] = AutoinstStorage::humanStringToByte(partition["maxsize"]:"", true ); } if (partition["size"]:"" != "") @@ -136,7 +137,7 @@ } else { - partition["size"] = kmgt_str_to_byte( s ); + partition["size"] = AutoinstStorage::humanStringToByte( s, true ); } } @@ -458,7 +459,7 @@ { //p["loop_fs"] = solution["partitions",pindex,"crypt_fs"]:false; p["enc_type"] = solution["partitions",pindex,"enc_type"]:`twofish; - Storage::UpdateClassified( p["device"]:"", + Storage::SetCryptPwd( p["device"]:"", solution["partitions",pindex,"crypt_key"]:"" ); //p["crypt"] = solution["partitions",pindex,"crypt"]:"twofish256"; } @@ -579,7 +580,7 @@ { //part["loop_fs"] = solution["partitions",pindex,"crypt_fs"]:false; part["enc_type"] = solution["partitions",pindex,"enc_type"]:`twofish; - Storage::UpdateClassified( part["device"]:"", + Storage::SetCryptPwd( part["device"]:"", solution["partitions",pindex,"crypt_key"]:"" ); //part["crypt"] = solution["partitions",pindex,"crypt"]:"twofish256"; } @@ -1405,8 +1406,7 @@ if( Partitions::IsDosPartition( fsid ) ) { integer psize = (p["region",0]:0 + p["region",1]:1 - 1) * cyl_size; - win = Storage::GetFreeSpace( p["device"]:"", psize, `fat32, - false ); + win = Storage::GetFreeSpace( p["device"]:"", `fat32, false ); y2milestone( "win=%1", win ); if( win != nil && psize > 300*1024*1024 ) { Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstLVM.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstLVM.ycp?rev=64029&r1=64028&r2=64029&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstLVM.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstLVM.ycp Wed May 18 11:59:08 2011 @@ -123,7 +123,7 @@ // Process data lvm = mapmap(string device, map disk, lvm, ``{ - disk["pesize"] = pesize_str_to_byte(disk["pesize"]:"4M"); + disk["pesize"] = AutoinstStorage::humanStringToByte(disk["pesize"]:"4M", true); string vgname = substring(device, 5); disk["partitions"] = maplist(map lv, disk["partitions"]:[], ``{ @@ -137,7 +137,7 @@ y2milestone("swap slot size: %1", vgsize/1024*1024 ); lvsize = 1024*1024*Partitions::SwapSizeMb(vgsize/(1024*1024)); } else if (lvsize_str!= "") { - lvsize = kmgt_str_to_byte(lvsize_str); + lvsize = AutoinstStorage::humanStringToByte(lvsize_str,true); } lv["size_k"] = lvsize/1024; @@ -165,12 +165,12 @@ foreach(map lv, lvs, ``{ if (!contains(keepLVM[vgname]:[], lv["name"]:"")) { - Storage::DeleteDevice("","/dev/"+vgname+"/"+lv["name"]:"" ); + Storage::DeleteDevice("/dev/"+vgname+"/"+lv["name"]:""); } }); if( ! haskey( keepLVM, vgname ) && ExistingLVM["/dev/" +vgname]:$[] != $[] ) - removeVolumeGroup( vgname ); + Storage::DeleteLvmVg(vgname); return true; } @@ -230,13 +230,9 @@ map vg = $[]; if (size(volume_group["keep_lv"]:[]) == 0 ) { - vg["vgname"] = vgname; - vg["pesize"] = volume_group["pesize"]:4194304; - vg["lvm2"] = lvm2; - map addVG = $[]; - addVG = addVolumeGroup(vg, targetMap, [] ); - current_vg = addVG["vg"]:"none"; - y2milestone("addVolumeGroup returns %1",addVG); + boolean ret = Storage::CreateLvmVg(vgname, volume_group["pesize"]:4194304, lvm2); + current_vg = vgname; + y2milestone("CreateLvmVg returns %1", ret); targetMap = Storage::GetTargetMap(); y2milestone("Storage::GetTargetMap returns %1",targetMap); lvm_vgs = get_vgs( targetMap ); @@ -287,7 +283,7 @@ buffer = (buffer * 2) / 1024; volume_group["partitions"] = maplist( map lv, volume_group["partitions"]:[], ``{ - integer s = kmgt_str_to_byte( lv["size"]:"10000" ); + integer s = AutoinstStorage::humanStringToByte( lv["size"]:"10000", true ); if( s <= 100 && s > 0 ) { // we assume percentage for this lv integer integer_k = freeSpace * tointeger(lv["size"]:"0") / 100; Modified: branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstStorage.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstStorage.ycp?rev=64029&r1=64028&r2=64029&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstStorage.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/modules/AutoinstStorage.ycp Wed May 18 11:59:08 2011 @@ -15,7 +15,6 @@ import "Partitions"; import "FileSystems"; import "Summary"; - import "Storage"; import "Partitions"; import "Popup"; import "Report"; @@ -65,6 +64,19 @@ return modified; } + /** + * Wrapper function for the LibStorage call that can't be used directly + * in YCP + * @return integer + * + */ + global define integer humanStringToByte( string s, boolean b ) { + if( size(s) == 0 ) + s = "0b"; + if( findfirstof( s, "bB" ) == nil ) + s = s + "b"; + return Storage::ClassicStringToByte(s); + } include "autoinstall/autopart.ycp"; include "autoinstall/autoinst_dialogs.ycp"; @@ -427,7 +439,7 @@ integer newCyl = currentCyl * tointeger(percentage) / 100; pe["region",1] = newCyl; } else { - integer new_size = kmgt_str_to_byte( pe["size"]:"0" ); + integer new_size = humanStringToByte( pe["size"]:"0", true ); integer newCyl = new_size/realDisk["cyl_size"]:1; pe["region",1] = newCyl; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org