Author: jsrain Date: Wed Sep 3 12:02:18 2008 New Revision: 50600 URL: http://svn.opensuse.org/viewcvs/yast?rev=50600&view=rev Log: added detection of EFI, proposing ELILO in that case (fate #301882) Modified: trunk/bootloader/package/yast2-bootloader.changes trunk/bootloader/src/modules/BootCommon.ycp trunk/bootloader/src/modules/BootELILO.ycp trunk/bootloader/src/routines/global_widgets.ycp Modified: trunk/bootloader/package/yast2-bootloader.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/package/yast2-bootloader.changes?rev=50600&r1=50599&r2=50600&view=diff ============================================================================== --- trunk/bootloader/package/yast2-bootloader.changes (original) +++ trunk/bootloader/package/yast2-bootloader.changes Wed Sep 3 12:02:18 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Sep 3 12:00:58 CEST 2008 - jsrain@suse.cz + +- added detection of EFI, proposing ELILO in that case + (fate #301882) + +------------------------------------------------------------------- Wed Aug 20 15:34:22 CEST 2008 - jsrain@suse.cz - added skeleton for checking whether scenario is supported, not Modified: trunk/bootloader/src/modules/BootCommon.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootCommon.ycp?rev=50600&r1=50599&r2=50600&view=diff ============================================================================== --- trunk/bootloader/src/modules/BootCommon.ycp (original) +++ trunk/bootloader/src/modules/BootCommon.ycp Wed Sep 3 12:02:18 2008 @@ -1026,12 +1026,16 @@ y2milestone ("It is XEN domU and the bootloader should be installed"); } + if ((Arch::i386() || Arch::x86_64()) && Linuxrc::InstallInf("EFI") == "1") + { + loader_type = "elilo"; + } + if (loader_type == "grub") { prefer_lilo = true; } - loader_type = SupportedLoader (loader_type); y2milestone ("Detected bootloader %1", loader_type); setCurrentLoaderAttribs (loader_type); @@ -1115,6 +1119,8 @@ if (Arch::i386 () || Arch::x86_64 ()) { ret = (list<string>)merge (ret, ["lilo", "grub"]); + if (Arch::x86_64 ()) + ret = (list<string>)merge (ret, ["elilo"]); } // in order not to display it twice when "none" is selected ret = filter (string l, ret, { Modified: trunk/bootloader/src/modules/BootELILO.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootELILO.ycp?rev=50600&r1=50599&r2=50600&view=diff ============================================================================== --- trunk/bootloader/src/modules/BootELILO.ycp (original) +++ trunk/bootloader/src/modules/BootELILO.ycp Wed Sep 3 12:02:18 2008 @@ -63,6 +63,11 @@ string efi_vendor = "SuSE"; +/** + * Is the /sys/firmware/efi directory available? + */ +boolean efi_available = true; + // misc. functions /** @@ -299,6 +304,9 @@ create_efi_entry = true; if (Mode::update ()) create_efi_entry = false; + efi_available = 0 == (integer)SCR::Execute (.target.bash, "test -d /sys/firmware/efi"); + if (! efi_available) + create_efi_entry = false; elilo_conf_filename = getEliloConfFilename (); BootCommon::DetectDisks (); BootCommon::del_parts = BootCommon::getPartitionList (`deleted); @@ -442,6 +450,13 @@ // SCR::Execute (.target.bash, "/sbin/elilo"); boolean ret = BootCommon::UpdateBootloader (); +// FIXME find a better way to report status + if (ret && ! efi_available) { + Popup::TimedMessage( +_("System was not booted via EFI firmware. To boot your +computer, you need to load ELILO via the EFI shell."), 10); + } + if (BootCommon::location_changed || create_efi_entry) { map mp = Storage::GetMountPoints(); @@ -648,7 +663,7 @@ */ global define void BootELILO () { BootCommon::bootloader_attribs["elilo"] = $[ - "required_packages" : ["elilo"], + "required_packages" : ["elilo", "efibootmgr"], "loader_name" : "ELILO", "initializer" : BootELILO::Initializer, ]; Modified: trunk/bootloader/src/routines/global_widgets.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/global_widgets.ycp?rev=50600&r1=50599&r2=50600&view=diff ============================================================================== --- trunk/bootloader/src/routines/global_widgets.ycp (original) +++ trunk/bootloader/src/routines/global_widgets.ycp Wed Sep 3 12:02:18 2008 @@ -334,6 +334,25 @@ return `redraw; } + if (Arch::x86_64 ()) { + if (new_bl == "elilo") { +// continue/cancel pop-up + if (! Popup::ContinueCancel (_(" +ELILO supports only the EFI boot architecture. If yor +firmware does not support it, your computer will not +boot."))) + return nil; + } + else if (old_bl == "elilo") { +// continue/cancel pop-up + if (! Popup::ContinueCancel (_(" +Bootloader you selected does not support the EFI boot +architecture. If your firmware does not support legacy +booting, your computer will not boot."))) + return nil; + } + } + // warning - popup, followed by radio buttons string label = _(" You chose to change your boot loader. When converting -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org