[yast-commit] r62331 - in /trunk/storage/storage/src/modules: Partitions.ycp StorageProposal.ycp
Author: aschnell Date: Tue Aug 3 12:45:11 2010 New Revision: 62331 URL: http://svn.opensuse.org/viewcvs/yast?rev=62331&view=rev Log: - added function BootSizeK() that returns proposed, minimal and maximal size for boot Modified: trunk/storage/storage/src/modules/Partitions.ycp trunk/storage/storage/src/modules/StorageProposal.ycp Modified: trunk/storage/storage/src/modules/Partitions.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Parti... ============================================================================== --- trunk/storage/storage/src/modules/Partitions.ycp (original) +++ trunk/storage/storage/src/modules/Partitions.ycp Tue Aug 3 12:45:11 2010 @@ -83,8 +83,7 @@ global const list<integer> no_windows = [ 0x12, 0x82, 0xde, fsid_gpt_boot, fsid_gpt_service, fsid_gpt_msftres ]; - - integer minimal_needed_bootsize = 0; + map<symbol, integer> boot_size_k = $[]; symbol default_fs = `unknown; symbol default_boot_fs = `unknown; @@ -160,48 +159,58 @@ } -global define integer MinimalNeededBootsize() - ``{ - if( minimal_needed_bootsize == 0 ) +map<symbol, integer> BootSizeK() +{ + if (isempty(boot_size_k)) + { + boot_size_k = $[ `proposed : 64 * 1024, + `minimal : 64 * 1024, + `maximal : 750 * 1024 ]; + + if (Arch::ia64()) { - minimal_needed_bootsize = 64 * 1024 * 1024; - if( Arch::ia64() ) - { - minimal_needed_bootsize = 200*1024*1024; - } - else if( Arch::board_chrp() ) - { - minimal_needed_bootsize = 200*1024*1024; - } - else if( Arch::board_prep() ) - { - minimal_needed_bootsize = 200*1024*1024; - } - else if( Arch::board_iseries() ) - { - minimal_needed_bootsize = 200*1024*1024; - } - else if( Arch::board_mac() ) - { - minimal_needed_bootsize = 32*1024*1024; - } + boot_size_k[`proposed] = 200 * 1024; + boot_size_k[`minimal] = 180 * 1024; + } + else if (Arch::board_chrp() || Arch::board_prep() || Arch::board_iseries()) + { + boot_size_k[`proposed] = 200 * 1024; + boot_size_k[`minimal] = 180 * 1024; + } + else if (Arch::board_mac()) + { + boot_size_k[`proposed] = 32 * 1024; + boot_size_k[`minimal] = 800; } - return( minimal_needed_bootsize ); - } -global define integer MinimalRequiredBootsize() - ``{ - integer need = MinimalNeededBootsize(); - integer ret = need; - if( Arch::ia64() ) - ret = ret / 10 * 9; - else if( Arch::board_mac() ) - ret = 800 * 1024; - if( ret!=need ) - y2milestone( "MinimalRequiredBootsize ret %1 Req:%2", ret, need ); - return( ret ); + y2milestone("BootSizeK boot_size_k:%1", boot_size_k); } + return boot_size_k; +} + + +global integer MinimalNeededBootsize() +{ + return 1024 * BootSizeK()[`proposed]:0; +} + +global integer ProposedBootsize() +{ + return 1024 * BootSizeK()[`proposed]:0; +} + +global integer MinimalBootsize() +{ + return 1024 * BootSizeK()[`minimal]:0; +} + +global integer MaximalBootsize() +{ + return 1024 * BootSizeK()[`maximal]:0; +} + + global define integer BootCyl() ``{ if( boot_cyl == 0 ) Modified: trunk/storage/storage/src/modules/StorageProposal.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Stora... ============================================================================== --- trunk/storage/storage/src/modules/StorageProposal.ycp (original) +++ trunk/storage/storage/src/modules/StorageProposal.ycp Tue Aug 3 12:45:11 2010 @@ -419,13 +419,13 @@ { map pb = $[]; pb["mount"] = Partitions::BootMount(); - pb["size"] = Partitions::MinimalNeededBootsize(); + pb["size"] = Partitions::ProposedBootsize(); pb["fsys"] = Partitions::DefaultBootFs(); pb["id"] = Partitions::FsidBoot(); pb["auto_added"] = true; pb["max_cyl"] = Partitions::BootCyl(); pb["primary"] = Partitions::BootPrimary(); - pb["maxsize"] = 500*1024*1024; + pb["maxsize"] = Partitions::MaximalBootsize(); tc["partitions"] = add( tc["partitions"]:[], pb ); y2milestone( "try_add_boot disk_cyl %1 boot_cyl %2 need_boot %3 typ %4", disk["cyl_count"]:0, Partitions::BootCyl(), @@ -2179,7 +2179,7 @@ { if( partition["size"]:0 == -1 ) { - partition["size"] = Partitions::MinimalNeededBootsize(); + partition["size"] = Partitions::ProposedBootsize(); } if( partition["fsys"]:`none == `none ) { @@ -2398,7 +2398,7 @@ { if( part["size"]:0 == -1 ) { - part["size"] = Partitions::MinimalNeededBootsize(); + part["size"] = Partitions::ProposedBootsize(); } if( part["fsys"]:`none == `none ) { @@ -2513,11 +2513,11 @@ pl = filter( map p, partitions, ``(!p["delete"]:false && p["size_k"]:0*1024 >= - Partitions::MinimalRequiredBootsize())); + Partitions::MinimalBootsize())); map boot = find( map p, pl, ``((p["fsid"]:0 == Partitions::fsid_gpt_boot) || (p["fsid"]:0 == Partitions::FsidBoot() && - p["size_k"]:0<500*1024)|| + p["size_k"]:0*1024 <= Partitions::MaximalBootsize()) || (p["detected_fs"]:`unknown==`hfs && p["boot"]:false && label=="mac") || (p["fsid"]:0 == Partitions::fsid_prep_chrp_boot && @@ -2764,7 +2764,7 @@ if( contains( linux_pid, p["fsid"]:0 ) || (p["fsid"]:0 == Partitions::fsid_gpt_boot) || (p["fsid"]:0 == Partitions::FsidBoot() && - p["size_k"]:0<500*1024)|| + p["size_k"]:0*1024 <= Partitions::MaximalBootsize()) || (Partitions::PrepBoot() && (p["fsid"]:0 == Partitions::fsid_prep_chrp_boot|| p["fsid"]:0 == 0x06))) @@ -3690,7 +3690,7 @@ target = AddWinInfo(target); ret["target"] = target; map boot = $[ "mount" : Partitions::BootMount(), - "size" : Partitions::MinimalNeededBootsize(), + "size" : Partitions::ProposedBootsize(), "fsys" : Partitions::DefaultBootFs(), "id" : Partitions::FsidBoot(), "max_cyl" : Partitions::BootCyl() ]; @@ -3942,7 +3942,7 @@ target = remove_vm(target,key); ret["target"] = target; map boot = $[ "mount" : Partitions::BootMount(), - "size" : Partitions::MinimalNeededBootsize(), + "size" : Partitions::ProposedBootsize(), "fsys" : Partitions::DefaultBootFs(), "id" : Partitions::FsidBoot(), "max_cyl" : Partitions::BootCyl() ]; -- 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