Author: fehr
Date: Thu Jul 28 12:39:42 2011
New Revision: 65067
URL: http://svn.opensuse.org/viewcvs/yast?rev=65067&view=rev
Log:
- fix proposal to change disklabel to gpt when EFI is required (bnc#707472)
Modified:
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/auto_part_create.ycp
trunk/storage/storage/src/include/custom_part_helptexts.ycp
trunk/storage/storage/src/inst_target_part.ycp
trunk/storage/storage/src/inst_target_selection.ycp
trunk/storage/storage/src/modules/Storage.ycp
trunk/storage/storage/src/modules/StorageProposal.ycp
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=65067&r1=65066&r2=65067&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Thu Jul 28 12:39:42 2011
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Jul 28 12:38:19 CEST 2011 - fehr@suse.de
+
+- fix proposal to change disklabel to gpt when EFI is
+ required (bnc#707472)
+
+-------------------------------------------------------------------
Thu Jul 14 13:52:16 CEST 2011 - fehr@suse.de
- call Pkg::PkgSolve to fix bnc#702365
Modified: trunk/storage/storage/src/include/auto_part_create.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/auto_part_create.ycp?rev=65067&r1=65066&r2=65067&view=diff
==============================================================================
--- trunk/storage/storage/src/include/auto_part_create.ycp (original)
+++ trunk/storage/storage/src/include/auto_part_create.ycp Thu Jul 28 12:39:42 2011
@@ -31,6 +31,11 @@
string vm = StorageProposal::GetProposalVM();
y2milestone( "create_partitions flex %1 vm %2", has_flex, vm );
disk["partitions"] = partitions;
+ if( StorageProposal::NeedNewDisklabel(disk) )
+ {
+ tgmap[disk["device"]:"","disklabel"] = "gpt";
+ tgmap[disk["device"]:"","del_ptable"] = true;
+ }
map keep = find( map p, partitions,
``(!p["delete"]:false&&p["type"]:`unknown!=`free));
if( size(vm)==0 )
Modified: trunk/storage/storage/src/include/custom_part_helptexts.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_helptexts.ycp?rev=65067&r1=65066&r2=65067&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_helptexts.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_helptexts.ycp Thu Jul 28 12:39:42 2011
@@ -135,4 +135,13 @@
If you need to use this disk for installation, you should destroy
the disk label in the expert partitioner.") );
}
+
+define string ia64_gpt_fix_text()
+ {
+ return( _("Warning: Your system states that is reqires an EFI
+boot setup. Since the selected disk does not contain a
+GPT disk label we create a GPT label on this disk.
+
+You need to mark all partitions on this disk for removal.") );
+ }
}
Modified: trunk/storage/storage/src/inst_target_part.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_target_part.ycp?rev=65067&r1=65066&r2=65067&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_target_part.ycp (original)
+++ trunk/storage/storage/src/inst_target_part.ycp Thu Jul 28 12:39:42 2011
@@ -247,7 +247,8 @@
}
else if( ret == `next )
{
- if( win_partition != $[] )
+ ok = true;
+ if( ok && win_partition != $[] )
{
if( UI::QueryWidget( `id(`resize), `Value) == true)
{
@@ -354,6 +355,7 @@
// now loop through partitions and check
// if the partition is selected
+ boolean all_del = true;
partitions = maplist( map p, partitions,
``{
y2milestone( "p:%1", p );
@@ -382,21 +384,31 @@
y2milestone ("Trailing `free partition marked for deletion");
}
p["delete"] = selection;
+ if( all_del && (!selection && p["type"]:`dummy!=`free))
+ all_del = false;
}
return( p );
});
- partitions = StorageProposal::try_remove_sole_extended( partitions );
- y2milestone ("partitions '%1'", partitions);
-
- ok = create_partitions( targetMap, target, partitions );
- if( !ok )
+ if( !all_del && StorageProposal::NeedNewDisklabel(target) )
+ {
+ Popup::Error( ia64_gpt_fix_text() );
+ ok = false;
+ }
+ if( ok )
{
- string reason = _("Too few partitions are marked for removal
-or the disk is too small.
+ partitions = StorageProposal::try_remove_sole_extended( partitions );
+ y2milestone ("partitions '%1'", partitions);
+
+ ok = create_partitions( targetMap, target, partitions );
+ if( !ok )
+ {
+ string reason = _("Too few partitions are marked for removal or
+the disk is too small.
To install Linux, select more partitions to
remove or select a larger disk.");
- display_error_box (reason);
+ display_error_box (reason);
+ }
}
}
} // while (true)
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=65067&r1=65066&r2=65067&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_target_selection.ycp (original)
+++ trunk/storage/storage/src/inst_target_selection.ycp Thu Jul 28 12:39:42 2011
@@ -230,11 +230,6 @@
Popup::Error( Partitions::RdonlyText( (string)option, true ));
sym = `again;
}
- else if( (Partitions::EfiBoot() || Arch::ia64()) && targetMap[(string)option,"label"]:"gpt"!="gpt" )
- {
- Popup::Error( ia64_gpt_text() );
- sym = `again;
- }
else
{
Storage::SetPartMode( "USE_DISK" );
Modified: trunk/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=65067&r1=65066&r2=65067&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Thu Jul 28 12:39:42 2011
@@ -1220,6 +1220,9 @@
d["cyl_count"] = LibStorage::DiskInfo::swig_cyl_get(dinfo);
d["sector_size"] = LibStorage::DiskInfo::swig_sectorSize_get(dinfo);
d["label"] = LibStorage::DiskInfo::swig_disklabel_get(dinfo);
+ string tmp = LibStorage::DiskInfo::swig_orig_disklabel_get(dinfo);
+ if( size(tmp)>0 )
+ d["orig_label"] = tmp;
d["max_logical"] = LibStorage::DiskInfo::swig_maxLogical_get(dinfo);
d["max_primary"] = LibStorage::DiskInfo::swig_maxPrimary_get(dinfo);
@@ -1738,7 +1741,7 @@
map toDiskMap( map disk, map cinfo )
{
- list<string> l = [ "size_k", "cyl_size", "cyl_count", "sector_size", "label", "name", "device",
+ list<string> l = [ "size_k", "cyl_size", "cyl_count", "sector_size", "label", "orig_label", "name", "device",
"max_logical", "max_primary", "type", "readonly", "transport", "iscsi",
"used_by", "used_by_type", "used_by_device", "partitions", "dasdfmt",
"udev_id", "udev_path" ];
Modified: trunk/storage/storage/src/modules/StorageProposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/StorageProposal.ycp?rev=65067&r1=65066&r2=65067&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/StorageProposal.ycp (original)
+++ trunk/storage/storage/src/modules/StorageProposal.ycp Thu Jul 28 12:39:42 2011
@@ -333,6 +333,19 @@
return no_propose_disks;
}
+global boolean NeedNewDisklabel( map entry )
+ {
+ boolean ret = Partitions::EfiBoot();
+ if( ret )
+ {
+ string lab = entry["orig_label"]:"";
+ if( size(lab)==0 )
+ lab = entry["label"]:"gpt";
+ ret = lab!="gpt";
+ }
+ y2milestone( "NeedNewDisklabel dev:%1 ret:%2", entry["device"]:"", ret );
+ return( ret );
+ }
boolean ignore_disk(string dev, map entry, boolean soft)
{
@@ -342,6 +355,10 @@
{
ret = true;
}
+ if( !ret && soft && NeedNewDisklabel(entry) )
+ {
+ ret = true;
+ }
if( !ret && soft && Arch::board_iseries () && search( dev, "/dev/sd" )==0 )
{
ret = true;
@@ -2800,6 +2817,7 @@
{
list linux_pid = [ Partitions::fsid_native, Partitions::fsid_swap,
Partitions::fsid_lvm, Partitions::fsid_raid ];
+ list<string> remk = ["del_ptable", "disklabel"];
foreach( string s, ddev,
``{
tg[s,"partitions"] =
@@ -2817,6 +2835,11 @@
p["linux"] = false;
return( p );
});
+ foreach( string k, remk,
+ ``{
+ if( haskey( tg[s]:$[], k ))
+ tg[s] = remove( tg[s]:$[], k );
+ });
});
return( tg );
}
@@ -2994,7 +3017,6 @@
map opts = GetControlCfg();
list<string> ddev = get_disk_try_list( target, true );
string sol_disk = "";
- list modes = [ `free, `reuse, `remove, `resize, `desparate ];
map