Hello community,
here is the log from the commit of package yast2-bootloader for openSUSE:Factory checked in at Fri Dec 19 15:20:43 CET 2008.
-------- --- yast2-bootloader/yast2-bootloader.changes 2008-12-17 14:32:57.000000000 +0100 +++ /mounts/work_src_done/STABLE/yast2-bootloader/yast2-bootloader.changes 2008-12-19 11:11:15.000000000 +0100 @@ -1,0 +2,6 @@ +Fri Dec 19 11:00:09 CET 2008 - juhliarik@suse.cz + +- added fix for changinf EFI label in running system (bnc #269198) +- 2.17.48 + +-------------------------------------------------------------------
calling whatdependson for head-i586
Old: ---- yast2-bootloader-2.17.47.tar.bz2
New: ---- yast2-bootloader-2.17.48.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences: ------------------ ++++++ yast2-bootloader.spec ++++++ --- /var/tmp/diff_new_pack.B17816/_old 2008-12-19 15:20:29.000000000 +0100 +++ /var/tmp/diff_new_pack.B17816/_new 2008-12-19 15:20:29.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package yast2-bootloader (Version 2.17.47) +# spec file for package yast2-bootloader (Version 2.17.48) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -19,12 +19,12 @@
Name: yast2-bootloader -Version: 2.17.47 +Version: 2.17.48 Release: 1 License: GPL v2 or later Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-bootloader-2.17.47.tar.bz2 +Source0: yast2-bootloader-2.17.48.tar.bz2 Prefix: /usr BuildRequires: docbook-xsl-stylesheets doxygen gcc-c++ libxslt limal-perl perl-Bootloader perl-XML-Writer perl-gettext sgml-skel swig update-alternatives update-desktop-files yast2-devtools yast2-installation yast2-perl-bindings yast2-storage yast2-testsuite # to eliminate a cyclic dependency in autobuild: @@ -68,7 +68,7 @@ Daniel Fiser
%prep -%setup -n yast2-bootloader-2.17.47 +%setup -n yast2-bootloader-2.17.48
%build %{prefix}/bin/y2tool y2autoconf @@ -113,8 +113,10 @@ /usr/share/YaST2/scrconf/*.scr /var/adm/fillup-templates/* /usr/share/YaST2/schema/autoyast/rnc/bootloader.rnc - %changelog +* Fri Dec 19 2008 juhliarik@suse.cz +- added fix for changinf EFI label in running system (bnc #269198) +- 2.17.48 * Wed Dec 17 2008 juhliarik@suse.cz - added fix for problem with primary language in GRUB (bnc #447053) - 2.17.47
++++++ yast2-bootloader-2.17.47.tar.bz2 -> yast2-bootloader-2.17.48.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-bootloader-2.17.47/src/modules/BootELILO.ycp new/yast2-bootloader-2.17.48/src/modules/BootELILO.ycp --- old/yast2-bootloader-2.17.47/src/modules/BootELILO.ycp 2008-12-15 15:29:48.000000000 +0100 +++ new/yast2-bootloader-2.17.48/src/modules/BootELILO.ycp 2008-12-19 10:59:22.000000000 +0100 @@ -17,7 +17,7 @@ * Olaf Dabrunz od@suse.de * Philipp Thomas pth@suse.de * - * $Id: BootELILO.ycp 54071 2008-12-11 16:50:11Z juhliarik $ + * $Id: BootELILO.ycp 54283 2008-12-19 09:59:22Z juhliarik $ * */
@@ -479,6 +479,95 @@ }
+/** bnc #269198 change efi-label + * Function check if there exist same efi-label or different for + * same partition if efi-label is different delete it and create new one + * if it is same nothing to do it. + */ + +boolean updateEFILabel() +{ + boolean ret = true; + string cmd = ""; + map mp = Storage::GetMountPoints(); + string boot_dev = mp[getEfiMountPoint (), 0]:"/boot/efi"; + map splited = Storage::GetDiskPartition (boot_dev); + any boot_part = splited["nr"]:0; + any boot_disk = splited["disk"]:""; + + + // command for checking same boot entry in efi bnc #438215 (YaST creates efibootloader entry twice) + cmd = sformat("/usr/sbin/efibootmgr -v | grep -c "%1.*HD(%2.*File(.\efi.\SuSE.\elilo.efi)"", + BootCommon::globals["boot_efilabel"]:"", tomyhexa(boot_part)); + + // check how many entries with same label and partition is actually in efi + y2milestone("run command %1", cmd); + map out = (map)SCR::Execute (.target.bash_output, cmd); + y2milestone("output of command %1", out); + + // check number of same boot entries in efi + // if boot entry is added -> don't add it again + if (deletechars(out["stdout"]:"","\n") != "0") + { + if (out["exit"]:0 == 0) + y2milestone("Skip adding new boot entry - EFI Label exist"); + else + y2error("Calling command %1 faild", cmd); + return ret; + + } else { + + cmd = sformat("/usr/sbin/efibootmgr -v | grep -c "HD(%1.*File(.\efi.\SuSE.\elilo.efi)"", tomyhexa(boot_part)); + // check how many entries with same label and partition is actually in efi + y2milestone("run command %1", cmd); + map out = (map)SCR::Execute (.target.bash_output, cmd); + y2milestone("output of command %1", out); + + // check how many boot entries have same number of partitions + if (deletechars(out["stdout"]:"","\n") != "0") + { + // delete old boot entry + + cmd = sformat("efibootmgr -v |grep "HD(%1.*File(.\efi.\SuSE.\elilo.efi)" | cut -d " " -f 1", + tomyhexa(boot_part)); + y2milestone("run command %1", cmd); + out = (map)SCR::Execute (.target.bash_output, cmd); + y2milestone("output of command %1", out); + + string boot_entries = out["stdout"]:""; + y2milestone("EFI boot entries with "same" boot partition %1",boot_entries); + + list<string> list_boot_entries = splitstring(boot_entries, "\n"); + + y2milestone("list_boot_entries=%1",list_boot_entries); + + foreach(string entry, list_boot_entries, + { + if ((deletechars(entry, "\n*") != "") && (deletechars(entry, "\n*") != nil)) + { + cmd = sformat("/usr/sbin/efibootmgr --delete-bootnum --bootnum %1 -q;", + substring (deletechars(entry, "\n*"),4, 4)); + y2milestone("run command %1", cmd); + out = (map)SCR::Execute (.target.bash_output, cmd); + y2milestone("output of command %1", out); + } + }); + + } + // add new boot entry + string bl_logfile = "/var/log/YaST2/y2log_bootloader"; + string bl_command = sformat ( "/usr/sbin/efibootmgr -v --create --label "%1" " + + "--disk %2 --part %3 " + + "--loader '\efi\SuSE\elilo.efi' --write-signature >> %4 2>&1", + BootCommon::globals["boot_efilabel"]:"", boot_disk, boot_part, bl_logfile + ); + ret = ret && installBootLoader (bl_command, bl_logfile); + } + return ret; +} + + + /** * Write bootloader settings to disk * @return boolean true on success @@ -496,6 +585,9 @@ computer, you need to load ELILO via the EFI shell."), 10); }
+ if (Mode::normal()) + updateEFILabel(); + if (BootCommon::location_changed || create_efi_entry) { map mp = Storage::GetMountPoints(); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-bootloader-2.17.47/VERSION new/yast2-bootloader-2.17.48/VERSION --- old/yast2-bootloader-2.17.47/VERSION 2008-12-17 14:26:57.000000000 +0100 +++ new/yast2-bootloader-2.17.48/VERSION 2008-12-19 11:04:43.000000000 +0100 @@ -1 +1 @@ -2.17.47 +2.17.48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...