commit yast2-bootloader for openSUSE:Factory
Hello community, here is the log from the commit of package yast2-bootloader for openSUSE:Factory checked in at 2014-05-06 13:40:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-bootloader (Old) and /work/SRC/openSUSE:Factory/.yast2-bootloader.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-bootloader" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-bootloader/yast2-bootloader.changes 2014-04-26 11:45:11.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-bootloader.new/yast2-bootloader.changes 2014-05-06 13:40:39.000000000 +0200 @@ -1,0 +2,19 @@ +Fri May 2 08:31:32 UTC 2014 - jreidinger@suse.com + +- fix activating partitions with number bigger then 4 on GPT disks + with legacy x86 boot (bnc#875757) +- 3.1.32 + +------------------------------------------------------------------- +Wed Apr 30 16:23:57 UTC 2014 - jreidinger@suse.com + +- handle diskless nfs setup for ppc (bnc#874466) +- 3.1.31 + +------------------------------------------------------------------- +Tue Apr 29 19:47:03 UTC 2014 - jreidinger@suse.com + +- fix reading of previous bootloader (bnc#874646) +- 3.1.30 + +------------------------------------------------------------------- Old: ---- yast2-bootloader-3.1.29.tar.bz2 New: ---- yast2-bootloader-3.1.32.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-bootloader.spec ++++++ --- /var/tmp/diff_new_pack.6bgmBk/_old 2014-05-06 13:40:42.000000000 +0200 +++ /var/tmp/diff_new_pack.6bgmBk/_new 2014-05-06 13:40:42.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-bootloader -Version: 3.1.29 +Version: 3.1.32 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-bootloader-3.1.29.tar.bz2 -> yast2-bootloader-3.1.32.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.29/package/yast2-bootloader.changes new/yast2-bootloader-3.1.32/package/yast2-bootloader.changes --- old/yast2-bootloader-3.1.29/package/yast2-bootloader.changes 2014-04-22 11:18:41.000000000 +0200 +++ new/yast2-bootloader-3.1.32/package/yast2-bootloader.changes 2014-05-02 12:43:49.000000000 +0200 @@ -1,4 +1,23 @@ ------------------------------------------------------------------- +Fri May 2 08:31:32 UTC 2014 - jreidinger@suse.com + +- fix activating partitions with number bigger then 4 on GPT disks + with legacy x86 boot (bnc#875757) +- 3.1.32 + +------------------------------------------------------------------- +Wed Apr 30 16:23:57 UTC 2014 - jreidinger@suse.com + +- handle diskless nfs setup for ppc (bnc#874466) +- 3.1.31 + +------------------------------------------------------------------- +Tue Apr 29 19:47:03 UTC 2014 - jreidinger@suse.com + +- fix reading of previous bootloader (bnc#874646) +- 3.1.30 + +------------------------------------------------------------------- Tue Apr 22 08:44:57 UTC 2014 - jreidinger@suse.com - Use correct check for partition setup for grub2 on s390 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.29/package/yast2-bootloader.spec new/yast2-bootloader-3.1.32/package/yast2-bootloader.spec --- old/yast2-bootloader-3.1.29/package/yast2-bootloader.spec 2014-04-22 11:18:41.000000000 +0200 +++ new/yast2-bootloader-3.1.32/package/yast2-bootloader.spec 2014-05-02 12:43:49.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-bootloader -Version: 3.1.29 +Version: 3.1.32 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.29/src/clients/bootloader_proposal.rb new/yast2-bootloader-3.1.32/src/clients/bootloader_proposal.rb --- old/yast2-bootloader-3.1.29/src/clients/bootloader_proposal.rb 2014-04-22 11:18:41.000000000 +0200 +++ new/yast2-bootloader-3.1.32/src/clients/bootloader_proposal.rb 2014-05-02 12:43:49.000000000 +0200 @@ -19,6 +19,7 @@ Yast.import "BootCommon" Yast.import "Bootloader" Yast.import "GfxMenu" + Yast.import "Installation" Yast.import "Storage" Yast.import "Mode" Yast.import "BootSupportCheck" @@ -54,7 +55,7 @@ end if Mode.update - if ["grub2", "grub2-efi"].include? Bootloader.getLoaderType + if ["grub2", "grub2-efi"].include? old_bootloader Builtins.y2milestone "update of grub2, do not repropose" Bootloader.blRead(true, true) else @@ -231,7 +232,25 @@ deep_copy(@ret) end - end + + private + BOOT_SYSCONFIG_PATH = "/etc/sysconfig/bootloader" + # read bootloader from /mnt as SCR is not yet switched in proposal + # phase of update (bnc#874646) + def old_bootloader + target_boot_sysconfig_path = ::File.join(Installation.destdir, BOOT_SYSCONFIG_PATH) + return nil unless ::File.exists? target_boot_sysconfig_path + + boot_sysconfig = ::File.read target_boot_sysconfig_path + old_bootloader = boot_sysconfig.lines.grep /^\s*LOADER_TYPE/ + Builtins.y2milestone "bootloader entry #{old_bootloader.inspect}" + retur nil if old_bootloader.empty? + + # get value from entry + old_bootloader.last.sub(/^.*=\s*(\S*).*/,"\\1").delete('"') + end + + end unless defined? Yast::BootloaderProposalClient end Yast::BootloaderProposalClient.new.main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.29/src/include/bootloader/grub2/misc.rb new/yast2-bootloader-3.1.32/src/include/bootloader/grub2/misc.rb --- old/yast2-bootloader-3.1.29/src/include/bootloader/grub2/misc.rb 2014-04-22 11:18:41.000000000 +0200 +++ new/yast2-bootloader-3.1.32/src/include/bootloader/grub2/misc.rb 2014-05-02 12:43:49.000000000 +0200 @@ -102,44 +102,6 @@ mbr_dev = Ops.get_string(p_dev2, "disk", "") end end - # If loader_device is a disk device ("/dev/sda"), that means that we - # install the bootloader to the MBR. In this case, activate /boot - # partition. - # (partial fix of #20637) - # FIXME: necessity and purpose are unclear: if we install the - # bootloader to the MBR, then why do we need to activate the /boot - # partition? Stage1 of a GRUB has the first block of the stage2 - # hard-coded inside. - # This code was added because a /boot partition on a /dev/cciss device - # was not activated in bug #20637. Anyway, it probably never worked, - # since the bootloader was not installed to the MBR in that bug (and - # thus this code is not triggered). - # The real problem may have been that Storage::GetDiskPartition() did - # not know how to parse /dev/cciss/c0d0p1, so that the default case at - # the beginning of this function did not set up correct values. These - # days, Storage::GetDiskPartition() looks OK with /dev/cciss. - # Deactivated this code, so that "/boot" does not get activated - # unecessarily when GRUB stage1 is installed to the MBR anyway (this - # would unecessarily have broken drive C: detection on older MS - # operating systems). - # else if (num == 0) - # { - # p_dev = Storage::GetDiskPartition (boot_partition); - # num = BootCommon::myToInteger( p_dev["nr"]:nil ); - # mbr_dev = p_dev["disk"]:""; - # - # if (size (BootCommon::Md2Partitions (boot_partition)) > 1) - # { - # foreach (string k, integer v, BootCommon::Md2Partitions (boot_partition),{ - # if (search (k, loader_device) == 0) - # { - # p_dev = Storage::GetDiskPartition (k); - # num = BootCommon::myToInteger( p_dev["nr"]:nil ); - # mbr_dev = p_dev["disk"]:""; - # } - # }); - # } - # } # (bnc # 337742) - Unable to boot the openSUSE (32 and 64 bits) after installation # if loader_device is disk device activate BootStorage::BootPartitionDevice @@ -150,7 +112,7 @@ end if Ops.greater_than(num, 4) - Builtins.y2milestone("Bootloader partition type is logical") + Builtins.y2milestone("Bootloader partition type can be logical") tm = Storage.GetTargetMap partitions = Ops.get_list(tm, [mbr_dev, "partitions"], []) Builtins.foreach(partitions) do |p| @@ -469,50 +431,49 @@ Builtins.foreach(grub_getPartitionsToActivate) do |m_activate| num = Ops.get_integer(m_activate, "num", 0) mbr_dev = Ops.get_string(m_activate, "mbr", "") - if num != 0 && mbr_dev != "" - # if primary partition - if !Ops.is_integer?(num) || Ops.less_or_equal(num, 4) - Builtins.y2milestone("Activating partition %1 on %2", num, mbr_dev) - # FIXME: this is the most rotten code since molded sliced bread - # move to bootloader/Core/GRUB.pm or similar - # TESTME: make sure that parted does not destroy BSD - # slices (#suse24740): cf. section 5.1 of "info parted": - # Parted only supports the BSD disk label system. - # Parted is unlikely to support the partition slice - # system in the future because the semantics are rather - # strange, and don't work like "normal" partition tables - # do. - # FIXED: investigate proper handling of the activate flag - # (kernel ioctls in parted etc.) and fix parted - - # this is needed only on gpt disks but we run it always - # anyway; parted just fails, then - command = Builtins.sformat( - "/usr/sbin/parted -s %1 set %2 legacy_boot on", - mbr_dev, - num - ) - Builtins.y2milestone("Running command %1", command) - out = Convert.to_map( - WFM.Execute(path(".local.bash_output"), command) - ) - Builtins.y2milestone("Command output: %1", out) + raise "INTERNAL ERROR: Data for partition to activate is invalid." if num == 0 || mbr_dev.empty? - command = Builtins.sformat( - "/usr/sbin/parted -s %1 set %2 boot on", - mbr_dev, - num - ) - Builtins.y2milestone("Running command %1", command) - out = Convert.to_map( - WFM.Execute(path(".local.bash_output"), command) - ) - exit = Ops.get_integer(out, "exit", 0) - Builtins.y2milestone("Command output: %1", out) - ret = ret && 0 == exit - end - else - Builtins.y2error("Cannot activate %1", m_activate) + gpt_disk = Storage.GetTargetMap[BootCommon.mbrDisk]["label"] == "gpt" + # if primary partition on old DOS MBR table, GPT do not have such limit + if gpt_disk || num <= 4 + Builtins.y2milestone("Activating partition %1 on %2", num, mbr_dev) + # FIXME: this is the most rotten code since molded sliced bread + # move to bootloader/Core/GRUB.pm or similar + # TESTME: make sure that parted does not destroy BSD + # slices (#suse24740): cf. section 5.1 of "info parted": + # Parted only supports the BSD disk label system. + # Parted is unlikely to support the partition slice + # system in the future because the semantics are rather + # strange, and don't work like "normal" partition tables + # do. + # FIXED: investigate proper handling of the activate flag + # (kernel ioctls in parted etc.) and fix parted + + # this is needed only on gpt disks but we run it always + # anyway; parted just fails, then + command = Builtins.sformat( + "/usr/sbin/parted -s %1 set %2 legacy_boot on", + mbr_dev, + num + ) + Builtins.y2milestone("Running command %1", command) + out = Convert.to_map( + WFM.Execute(path(".local.bash_output"), command) + ) + Builtins.y2milestone("Command output: %1", out) + + command = Builtins.sformat( + "/usr/sbin/parted -s %1 set %2 boot on", + mbr_dev, + num + ) + Builtins.y2milestone("Running command %1", command) + out = Convert.to_map( + WFM.Execute(path(".local.bash_output"), command) + ) + exit = Ops.get_integer(out, "exit", 0) + Builtins.y2milestone("Command output: %1", out) + ret = ret && 0 == exit end end if activate ret diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.29/src/modules/BootGRUB2.rb new/yast2-bootloader-3.1.32/src/modules/BootGRUB2.rb --- old/yast2-bootloader-3.1.29/src/modules/BootGRUB2.rb 2014-04-22 11:18:41.000000000 +0200 +++ new/yast2-bootloader-3.1.32/src/modules/BootGRUB2.rb 2014-05-02 12:43:49.000000000 +0200 @@ -24,6 +24,7 @@ module Yast import "Arch" import "Storage" + import "BootCommon" class BootGRUB2Class < GRUB2Base def main @@ -118,9 +119,19 @@ grub_LocationProposal when /ppc/ partition = prep_partitions.first - raise "there is no prep partition" unless partition - - BootCommon.globals["boot_custom"] = partition + if partition + BootCommon.globals["boot_custom"] = partition + else + # handle diskless setup, in such case do not write boot code anywhere (bnc#874466) + # we need to detect what is mount on /boot and if it is nfs, then just + # skip this proposal. In other case if it is not nfs, then it is error and raise exception + BootCommon.DetectDisks + if BootCommon.getBootDisk == "/dev/nfs" + return + else + raise "there is no prep partition" + end + end when /s390/ Builtins.y2milestone "no partition needed for grub2 on s390" else -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de