Author: aschnell
Date: Tue May 12 15:01:34 2009
New Revision: 57136
URL: http://svn.opensuse.org/viewcvs/yast?rev=57136&view=rev
Log:
- support EFI boot on non-ia64 systems (fate #306032)
Modified:
branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Disk.cc
branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Disk.h
branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Storage.cc
branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Storage.h
branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/StorageInterface.h
branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes
branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/custom_part_check_generated.ycp
branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/do_proposal_flexible.ycp
branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/inst_target_selection.ycp
branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Partitions.ycp
branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Storage.ycp
Modified: branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Disk.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Disk.cc?rev=57136&r1=57135&r2=57136&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Disk.cc (original)
+++ branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Disk.cc Tue May 12 15:01:34 2009
@@ -413,7 +413,7 @@
if( detected_label.empty() )
detected_label = dlabel;
if( dlabel.empty() )
- dlabel = defaultLabel(size_k);
+ dlabel = defaultLabel(getStorage(), size_k);
setLabelData( dlabel );
if (label == "unsupported")
@@ -965,16 +965,18 @@
#define EB (1024ULL * 1024ULL * 1024ULL * 1024ULL)
#define PB (1024ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL)
-string Disk::defaultLabel( unsigned long long size_k )
+string Disk::defaultLabel(const Storage& storage, unsigned long long size_k)
{
string ret = "msdos";
- if( Storage::arch()=="ia64" )
+ if (storage.efiBoot())
+ ret = "gpt";
+ else if( Storage::arch()=="ia64" )
ret = "gpt";
else if( Storage::arch()=="sparc" )
ret = "sun";
if( size_k>2*TB )
ret = "gpt";
- y2milestone( "size_k:%llu ret:%s", size_k, ret.c_str() );
+ y2mil("efiboot:" << storage.efiBoot() << " size_k:" << size_k << " ret:" << ret);
return( ret );
}
Modified: branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Disk.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Disk.h?rev=57136&r1=57135&r2=57136&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Disk.h (original)
+++ branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Disk.h Tue May 12 15:01:34 2009
@@ -198,7 +198,7 @@
bool haveBsdPart( const std::list& pl) const;
void setLabelData( const string& );
- static string defaultLabel( unsigned long long size_k );
+ static string defaultLabel(const Storage&, unsigned long long size_k);
static label_info labels[];
static string p_disks[];
Modified: branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Storage.cc?rev=57136&r1=57135&r2=57136&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Storage.cc (original)
+++ branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Storage.cc Tue May 12 15:01:34 2009
@@ -91,6 +91,7 @@
char * tenv = getenv( "YAST_IS_RUNNING" );
inst_sys = tenv!=NULL && strcmp(tenv,"instsys")==0;
root_mounted = !inst_sys;
+ efiboot = false;
hald_pid = 0;
if( !testmode )
testmode = getenv( "YAST2_STORAGE_TMODE" )!=NULL;
@@ -181,6 +182,7 @@
if( autodetect )
{
detectArch();
+ efiboot = (arch() == "ia64");
}
if( testmode )
{
@@ -928,6 +930,14 @@
defaultMountBy = val;
}
+
+void Storage::setEfiBoot(bool val)
+{
+ y2milestone("val:%d", val);
+ efiboot = val;
+}
+
+
void Storage::setRootPrefix( const string& root )
{
y2milestone( "root:%s", root.c_str() );
@@ -1435,13 +1445,13 @@
string
Storage::defaultDiskLabel() const
{
- return( Disk::defaultLabel(0) );
+ return Disk::defaultLabel(this, 0);
}
string
Storage::defaultDiskLabelSize( unsigned long long size_k ) const
{
- return( Disk::defaultLabel(size_k) );
+ return Disk::defaultLabel(this, size_k);
}
unsigned long long
Modified: branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Storage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Storage.h?rev=57136&r1=57135&r2=57136&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Storage.h (original)
+++ branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/Storage.h Tue May 12 15:01:34 2009
@@ -157,6 +157,7 @@
const string& tDir() const { return( testdir ); }
const string& root() const { return( rootprefix ); }
const string& tmpDir() const;
+ bool efiBoot() const { return efiboot; }
static const string& arch() { return( proc_arch ); }
static const string& sysfsDir() { return( sysfs_dir ); }
EtcFstab* getFstab() { return fstab; }
@@ -280,6 +281,8 @@
MountByType getDefaultMountBy() const { return defaultMountBy; }
void setDetectMountedVolumes( bool val=true );
bool getDetectMountedVolumes() const { return detectMounted; }
+ void setEfiBoot(bool val);
+ bool getEfiBoot() const { return efiboot; }
void setRootPrefix( const string& root );
int removeVolume( const string& device );
int removeUsing( const string& device, const storage::usedBy& uby );
@@ -1395,6 +1398,7 @@
string rootprefix;
string logdir;
unsigned hald_pid;
+ bool efiboot;
static string proc_arch;
static string sysfs_dir;
CCont cont;
Modified: branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/StorageInterface.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/StorageInterface.h?rev=57136&r1=57135&r2=57136&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/StorageInterface.h (original)
+++ branches/SuSE-SLE-10-SP3-Branch/storage/libstorage/src/StorageInterface.h Tue May 12 15:01:34 2009
@@ -1277,6 +1277,22 @@
virtual MountByType getDefaultMountBy() const = 0;
/**
+ * Set value for EFI boot.
+ *
+ * Currently this value affects the default disk label.
+ *
+ * @param val new efi boot value
+ */
+ virtual void setEfiBoot(bool val) = 0;
+
+ /**
+ * Get value for EFI boot.
+ *
+ * @return value for efi boot
+ */
+ virtual bool getEfiBoot() const = 0;
+
+ /**
* Set value for root prefix.
* This value is appended to all mount points of volumes, when
* changes are commited. Config files fstab, cryptotab, raidtab and
Modified: branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes?rev=57136&r1=57135&r2=57136&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes (original)
+++ branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes Tue May 12 15:01:34 2009
@@ -1,9 +1,14 @@
-------------------------------------------------------------------
+Tue May 12 02:25:49 CEST 2009 - aschnell@suse.de
+
+- support EFI boot on non-ia64 systems (fate #306032)
+- version 2.13.106
+
+-------------------------------------------------------------------
Mon May 11 03:17:22 CEST 2009 - aschnell@suse.de
- ask for partition table type when creating new partition table
from menu (see fate #303026)
-- version 2.13.106
-------------------------------------------------------------------
Mon May 11 01:55:21 CEST 2009 - aschnell@suse.de
Modified: branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/custom_part_check_generated.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/custom_part_check_generated.ycp?rev=57136&r1=57135&r2=57136&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/custom_part_check_generated.ycp (original)
+++ branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/custom_part_check_generated.ycp Tue May 12 15:01:34 2009
@@ -231,7 +231,7 @@
{
gpt_warning = true;
}
- if( Arch::ia64() && diskinfo["label"]:"gpt" != "gpt" )
+ if( Partitions::EfiBoot() && diskinfo["label"]:"gpt" != "gpt" )
{
gpt_boot_ia64 = true;
}
@@ -371,7 +371,7 @@
if (ret == true) retval = `again;
}
- if ( ( !Arch::ia64 () && installation && gpt_warning) || show_all_popups )
+ if ( ( !Partitions::EfiBoot() && installation && gpt_warning) || show_all_popups )
{
// popup text %2 is a disk name e.g. /dev/hda %1 is a number
boolean ret = Popup::YesNo( sformat(_("The disk label type on your system disk is GPT.
@@ -579,7 +579,7 @@
}
- if( (Arch::ia64 () && installation && (!boot_found || boot_fs != `vfat)) ||
+ if( (Partitions::EfiBoot() && installation && (!boot_found || boot_fs != `vfat)) ||
show_all_popups )
{
// popup text
@@ -598,7 +598,7 @@
if (ret == true) retval = `again;
}
- if( (Arch::ia64() && installation && boot_found && gpt_boot_ia64) ||
+ if( (Partitions::EfiBoot() && installation && boot_found && gpt_boot_ia64) ||
show_all_popups )
{
// popup text
Modified: branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/do_proposal_flexible.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/do_proposal_flexible.ycp?rev=57136&r1=57135&r2=57136&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/do_proposal_flexible.ycp (original)
+++ branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/do_proposal_flexible.ycp Tue May 12 15:01:34 2009
@@ -50,7 +50,7 @@
``{
boolean ret = !Storage::IsRealDisk( entry ) || entry["readonly"]:false ||
Arch::s390();
- if( !ret && Arch::ia64() && entry["label"]:"gpt"!="gpt" )
+ if( !ret && Partitions::EfiBoot() && entry["label"]:"gpt"!="gpt" )
{
ret = true;
}
@@ -2800,7 +2800,7 @@
special_boot_proposal_prepare( disk["partitions"]:[] );
boolean have_home = false;
boolean have_root = false;
- boolean have_boot = (!Arch::ia64()||mode!=`free) && size(p)>0;
+ boolean have_boot = (!Partitions::EfiBoot()||mode!=`free) && size(p)>0;
if( have_boot )
disk["partitions"] = p;
map r = can_swap_reuse( s, disk["partitions"]:[], target );
Modified: branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/inst_target_selection.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/inst_target_selection.ycp?rev=57136&r1=57135&r2=57136&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/inst_target_selection.ycp (original)
+++ branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/inst_target_selection.ycp Tue May 12 15:01:34 2009
@@ -241,7 +241,7 @@
Popup::Error( Partitions::RdonlyText( (string)option, true ));
sym = `again;
}
- else if( Arch::ia64() && targetMap[(string)option,"label"]:"gpt"!="gpt" )
+ else if( Partitions::EfiBoot() && targetMap[(string)option,"label"]:"gpt"!="gpt" )
{
Popup::Error( ia64_gpt_text() );
sym = `again;
Modified: branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Partitions.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Partitions.ycp?rev=57136&r1=57135&r2=57136&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Partitions.ycp (original)
+++ branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Partitions.ycp Tue May 12 15:01:34 2009
@@ -100,12 +100,42 @@
return ;
}
+
+global boolean EfiBoot()
+{
+ boolean ret = false;
+
+ if (Arch::ia64())
+ {
+ ret = true;
+ }
+ else
+ {
+ if (Stage::initial())
+ {
+ string tmp = (string) SCR::Read(.etc.install_inf.EFI);
+ if (tmp != nil && tmp == "1")
+ ret = true;
+ }
+ else
+ {
+ string tmp = (string) SCR::Read(.etc.bootloader.LOADER_TYPE);
+ if (tmp != nil && tmp == "elilo")
+ ret = true;
+ }
+ }
+
+ y2milestone("EfiBoot ret:%1", ret);
+ return ret;
+}
+
+
global define symbol DefaultBootFs()
``{
if( default_boot_fs == `unknown )
{
default_boot_fs = `ext2;
- if( Arch::ia64 () )
+ if( EfiBoot () )
{
default_boot_fs = `vfat;
}
@@ -122,7 +152,7 @@
if( boot_mount_point == "" )
{
boot_mount_point = "/boot";
- if( Arch::ia64 () )
+ if( EfiBoot () )
{
boot_mount_point = "/boot/efi";
}
@@ -231,7 +261,7 @@
if( fsid_boot == 0 )
{
fsid_boot = fsid_native;
- if( Arch::ia64 () )
+ if (EfiBoot() || Arch::ia64())
{
fsid_boot = fsid_gpt_boot;
}
@@ -250,7 +280,7 @@
global define boolean NeedBoot()
``{
boolean ret = false;
- if( Arch::ia64()||Arch::ppc()||Arch::sparc()||Arch::alpha() )
+ if( EfiBoot()||Arch::ppc()||Arch::sparc()||Arch::alpha() )
{
ret = true;
}
Modified: branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Storage.ycp?rev=57136&r1=57135&r2=57136&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Storage.ycp (original)
+++ branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Storage.ycp Tue May 12 15:01:34 2009
@@ -285,6 +285,9 @@
LibStorage::StorageInterface::setRootPrefix( sint,
Installation::destdir );
}
+
+ LibStorage::StorageInterface::setEfiBoot(sint, Partitions::EfiBoot());
+
conts = getContainers();
y2milestone( "InitLibstorage conts:%1", conts );
FileSystems::InitSlib( sint );
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org