[yast-commit] r54615 - in /trunk/bootloader: package/yast2-bootloader.changes scripts/update_gfxmenu src/modules/BootELILO.ycp
Author: juhliarik Date: Wed Jan 14 14:11:48 2009 New Revision: 54615 URL: http://svn.opensuse.org/viewcvs/yast?rev=54615&view=rev Log: added fixed from SLES branch to trunk Modified: trunk/bootloader/package/yast2-bootloader.changes trunk/bootloader/scripts/update_gfxmenu trunk/bootloader/src/modules/BootELILO.ycp Modified: trunk/bootloader/package/yast2-bootloader.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/package/yast2-bootloader.changes?rev=54615&r1=54614&r2=54615&view=diff ============================================================================== --- trunk/bootloader/package/yast2-bootloader.changes (original) +++ trunk/bootloader/package/yast2-bootloader.changes Wed Jan 14 14:11:48 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Jan 14 13:59:14 CET 2009 - juhliarik@suse.cz + +- added fix for changing EFI label in running system (bnc #269198) +- added fix for problem with primary language in GRUB (bnc #447053) + +------------------------------------------------------------------- Thu Dec 11 17:43:40 CET 2008 - juhliarik@suse.cz - added fix for problem with autoinstallation and powerlilo Modified: trunk/bootloader/scripts/update_gfxmenu URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/scripts/update_gfxmenu?rev=54615&r1=54614&r2=54615&view=diff ============================================================================== --- trunk/bootloader/scripts/update_gfxmenu (original) +++ trunk/bootloader/scripts/update_gfxmenu Wed Jan 14 14:11:48 2009 @@ -34,11 +34,19 @@ # set languages to choose if [ -f $SRC_DIR/$LOCALE.tr ]; then echo "$LOCALE" > languages || exit 6 + # always add also en_US + if [ "$LOCALE" != "en_US" ]; then + echo "en_US" >>languages || exit 6 + fi # set translations of bootloaer menu entries cp $MENU_ENTRIES ./translations.$LOCALE || exit 7; else if [ -f $SRC_DIR/$LOCALE_SHORT.tr ]; then echo "$LOCALE" > languages || exit 6 + # always add also en_US + if [ "$LOCALE" != "en_US" ]; then + echo "en_US" >>languages || exit 6 + fi else if [ "$LOCALE_SHORT" = "en" ]; then Modified: trunk/bootloader/src/modules/BootELILO.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootELILO.ycp?rev=54615&r1=54614&r2=54615&view=diff ============================================================================== --- trunk/bootloader/src/modules/BootELILO.ycp (original) +++ trunk/bootloader/src/modules/BootELILO.ycp Wed Jan 14 14:11:48 2009 @@ -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(); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
juhliarik@svn.opensuse.org