From 3c6f5594e2fcd6fff2ae4a11cd676be8fb477b7cb3195e9af8794d4a603f9403 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Thu, 24 Aug 2017 03:58:08 +0000 Subject: [PATCH] Accepting request 518461 from home:michael-chang:branches:home:rwill:branches:Base:System - Fix minor oversights in and the exit value of the grub2-install helper on s390x. (bsc#1055343, fate#323298) * grub2-s390x-09-improve-zipl-setup.patch OBS-URL: https://build.opensuse.org/request/show/518461 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=274 --- grub2-s390x-09-improve-zipl-setup.patch | 74 +++++++++++++++++++++++++ grub2.changes | 7 +++ grub2.spec | 4 +- 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 grub2-s390x-09-improve-zipl-setup.patch diff --git a/grub2-s390x-09-improve-zipl-setup.patch b/grub2-s390x-09-improve-zipl-setup.patch new file mode 100644 index 0000000..a312a4f --- /dev/null +++ b/grub2-s390x-09-improve-zipl-setup.patch @@ -0,0 +1,74 @@ +--- + util/s390x/zipl2grub.conf.in | 2 +- + util/s390x/zipl2grub.pl.in | 19 +++++++++++-------- + 2 files changed, 12 insertions(+), 9 deletions(-) + +--- a/util/s390x/zipl2grub.conf.in ++++ b/util/s390x/zipl2grub.conf.in +@@ -8,7 +8,7 @@ defaultmenu = menu + target = @zipldir@ + ramdisk = @zipldir@/initrd,0x2000000 + image = @zipldir@/image +- parameters = "root=@GRUB_DEVICE@ @GRUB_EMU_CONMODE@ @GRUB_CMDLINE_LINUX@ @GRUB_CMDLINE_LINUX_DEFAULT@ initgrub quiet splash=silent plymouth.enable=0 " ++ parameters = "root=@GRUB_DEVICE@ @GRUB_EMU_CONMODE@ @GRUB_CMDLINE_LINUX@ @GRUB_CMDLINE_LINUX_DEFAULT@ initgrub quiet splash=silent plymouth.enable=0 mem=1G " + + [skip-grub2] + target = @zipldir@ +--- a/util/s390x/zipl2grub.pl.in ++++ b/util/s390x/zipl2grub.pl.in +@@ -44,12 +44,12 @@ sub System(@) { + return 0 if ($debug); + system( @C); + if ($? == -1) { +- Panic( $?, "$C[0]: Failed to execute: $!\n"); ++ Panic( 1, "$C[0]: Failed to execute: $!\n"); + } elsif ($? & 127) { +- Panic( $?, sprintf( "$C[0]: Died with signal %d with%s coredump\n", ++ Panic( 1, sprintf( "$C[0]: Died with signal %d with%s coredump\n", + ($? & 127), ($? & 128) ? '' : 'out')); + } elsif ( $? >> 8 != 0 ) { +- Panic( $?, "$C[0]: Failed\n"); ++ Panic( $? >> 8, "$C[0]: Failed\n"); + } + return( 0); + } +@@ -166,7 +166,9 @@ sub Usage($) { + "zIPL directory missing.", + "Configuration template missing.", + "Configuration template unreadable.", +- "zIPL directory not accesible.", ++ "zIPL directory not accessible.", ++ "kernel image parameter missing.", ++ "kernel image unreadable.", + "" + ); + my $msg = ""; +@@ -190,7 +192,8 @@ while ( $#ARGV >= 0 ) { + (/^--?help/ || /^-h/) && (Usage(0)); + (/^--zipldir$/ || /^-z$/) && ($zipldir = shift || Usage(2), next); + (/^--template$/ || /^-T$/) && ($in = shift || Usage(3), next); +- (/^--image$/ || /^-i$/) && ($Image = shift || Usage(5), $force = 1, next); ++ (/^--image$/ || /^-i$/) && ($Image = shift || Usage(6), ++ -r "$Image" || Usage(7), $force = 1, next); + (/^-/) && (Usage(1)); + Usage(1); + } +@@ -403,15 +406,15 @@ if ( -l $Image ) { + $Image = readlink( $Image); + } + my ($image, $version) = ($Image =~ m{^(?:/boot/)?([^-]+-(.+))$}); +-my $initrd = "initrd-$version"; +- + if ( !defined($image) || !defined($version) || ! -r "/boot/$image" ) { + Panic( 1, "$C: weird $Image. This should never happen!\n"); + } ++my $initrd = "initrd-$version"; + + if ( ! -r $ziplimage || ! -r $ziplinitrd || $refresh ) { + BootCopy( $image, $zipldir, "image"); +- BootCopy( $initrd, $zipldir, "initrd") if (-r "/boot/$initrd"); ++ BootCopy( $initrd, $zipldir, "initrd") ++ if (-r "/boot/$initrd" && ! exists( $fsdev{"/boot"})); + } + if ( $refresh || ChkInitrd( $zipldir, "initrd") <= 0 ) { + MkInitrd( $initrd, $zipldir, $version); diff --git a/grub2.changes b/grub2.changes index c8d7e76..04b8aa4 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Aug 23 17:52:32 UTC 2017 - rw@suse.com + +- Fix minor oversights in and the exit value of the grub2-install + helper on s390x. (bsc#1055343, fate#323298) + * grub2-s390x-09-improve-zipl-setup.patch + ------------------------------------------------------------------- Mon Jul 24 13:39:25 UTC 2017 - bwiedemann@suse.com diff --git a/grub2.spec b/grub2.spec index f03484c..bd046d0 100644 --- a/grub2.spec +++ b/grub2.spec @@ -211,6 +211,7 @@ Patch80: grub2-emu-4-all.patch Patch81: grub2-lvm-allocate-metadata-buffer-from-raw-contents.patch Patch82: grub2-diskfilter-support-pv-without-metadatacopies.patch Patch83: grub2-efi-uga-64bit-fb.patch +Patch84: grub2-s390x-09-improve-zipl-setup.patch # Btrfs snapshot booting related patches Patch101: grub2-btrfs-01-add-ability-to-boot-from-subvolumes.patch Patch102: grub2-btrfs-02-export-subvolume-envvars.patch @@ -356,9 +357,9 @@ provides support for %{platform} systems. %package %{grubefiarch} Summary: Bootloader with support for Linux, Multiboot and more +Group: System/Boot # Require efibootmgr # Without it grub-install is broken so break the package as well if unavailable -Group: System/Boot Requires: efibootmgr Requires(post): efibootmgr Requires: %{name} = %{version}-%{release} @@ -478,6 +479,7 @@ swap partition while in resuming %patch81 -p1 %patch82 -p1 %patch83 -p1 +%patch84 -p1 %patch101 -p1 %patch102 -p1 %patch103 -p1