Accepting request 492386 from Base:System

1

OBS-URL: https://build.opensuse.org/request/show/492386
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=161
This commit is contained in:
Dominique Leuenberger 2017-05-06 18:45:23 +00:00 committed by Git OBS Bridge
parent 119ac5f17c
commit 6d75b85fc1
9 changed files with 24 additions and 361 deletions

3
grub-2.02.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f
size 6113260

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:053bfcbe366733e4f5a1baf4eb15e1efd977225bdd323b78087ce5fa172fc246
size 6055836

View File

@ -1,313 +0,0 @@
From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] i386, x86_64, ppc: fix switch fallthrough cases with GCC7
In util/getroot and efidisk slightly modify exitsing comment to mostly
retain it but still make GCC7 compliant with respect to fall through
annotation.
In grub-core/lib/xzembed/xz_dec_lzma2.c it adds same comments as
upstream (I plan to update after release).
In grub-core/tests/setjmp_tets.c declare functions as "noreturn" to
suppress GCC7 warning.
In grub-core/gnulib/regexec.c move FALLTHROUGH outside of #ifdef block,
otherwise it is not accepted by GCC7 parser (which requires that comment
immediately precedes case statement).
Otherwise add FALLTHROUGH comment.
Closes: 50598
---
grub-core/commands/hdparm.c | 1 +
grub-core/commands/nativedisk.c | 1 +
grub-core/disk/cryptodisk.c | 1 +
grub-core/disk/efi/efidisk.c | 2 +-
grub-core/efiemu/mm.c | 1 +
grub-core/gdb/cstub.c | 1 +
grub-core/gnulib/regexec.c | 4 +++-
grub-core/lib/xzembed/xz_dec_lzma2.c | 4 ++++
grub-core/lib/xzembed/xz_dec_stream.c | 6 ++++++
grub-core/loader/i386/linux.c | 3 +++
grub-core/tests/setjmp_test.c | 5 ++++-
grub-core/video/ieee1275.c | 1 +
grub-core/video/readers/jpeg.c | 1 +
util/getroot.c | 2 +-
util/grub-install.c | 1 +
util/grub-mkimagexx.c | 1 +
util/grub-mount.c | 1 +
17 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/grub-core/commands/hdparm.c b/grub-core/commands/hdparm.c
index f6b178e..d3fa966 100644
--- a/grub-core/commands/hdparm.c
+++ b/grub-core/commands/hdparm.c
@@ -328,6 +328,7 @@ grub_cmd_hdparm (grub_extcmd_context_t ctxt, int argc, char **args)
ata = ((struct grub_scsi *) disk->data)->data;
break;
}
+ /* FALLTHROUGH */
default:
grub_disk_close (disk);
return grub_error (GRUB_ERR_IO, "not an ATA device");
diff --git a/grub-core/commands/nativedisk.c b/grub-core/commands/nativedisk.c
index 345f97c..2f56a87 100644
--- a/grub-core/commands/nativedisk.c
+++ b/grub-core/commands/nativedisk.c
@@ -79,6 +79,7 @@ get_uuid (const char *name, char **uuid, int getnative)
case GRUB_DISK_DEVICE_XEN:
if (getnative)
break;
+ /* FALLTHROUGH */
/* Virtual disks. */
/* GRUB dynamically generated files. */
diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c
index 1e03a09..bd60a66 100644
--- a/grub-core/disk/cryptodisk.c
+++ b/grub-core/disk/cryptodisk.c
@@ -282,6 +282,7 @@ grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev,
break;
case GRUB_CRYPTODISK_MODE_IV_PLAIN64:
iv[1] = grub_cpu_to_le32 (sector >> 32);
+ /* FALLTHROUGH */
case GRUB_CRYPTODISK_MODE_IV_PLAIN:
iv[0] = grub_cpu_to_le32 (sector & 0xFFFFFFFF);
break;
diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c
index e66b35d..5d2400f 100644
--- a/grub-core/disk/efi/efidisk.c
+++ b/grub-core/disk/efi/efidisk.c
@@ -224,7 +224,7 @@ name_devices (struct grub_efidisk_data *devices)
{
case GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE:
is_hard_drive = 1;
- /* Fall through by intention. */
+ /* Intentionally fall through. */
case GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE:
{
struct grub_efidisk_data *parent, *parent2;
diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c
index e606dbf..52a032f 100644
--- a/grub-core/efiemu/mm.c
+++ b/grub-core/efiemu/mm.c
@@ -417,6 +417,7 @@ fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type,
default:
grub_dprintf ("efiemu",
"Unknown memory type %d. Assuming unusable\n", type);
+ /* FALLTHROUGH */
case GRUB_MEMORY_RESERVED:
return grub_efiemu_add_to_mmap (addr, size,
GRUB_EFI_UNUSABLE_MEMORY);
diff --git a/grub-core/gdb/cstub.c b/grub-core/gdb/cstub.c
index c94411b..b64acd7 100644
--- a/grub-core/gdb/cstub.c
+++ b/grub-core/gdb/cstub.c
@@ -336,6 +336,7 @@ grub_gdb_trap (int trap_no)
/* sAA..AA: Step one instruction from AA..AA(optional). */
case 's':
stepping = 1;
+ /* FALLTHROUGH */
/* cAA..AA: Continue at address AA..AA(optional). */
case 'c':
diff --git a/grub-core/gnulib/regexec.c b/grub-core/gnulib/regexec.c
index f632cd4..c8d2f09 100644
--- a/grub-core/gnulib/regexec.c
+++ b/grub-core/gnulib/regexec.c
@@ -4099,8 +4099,10 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
case OP_UTF8_PERIOD:
if (ch >= ASCII_CHARS)
return false;
- /* FALLTHROUGH */
+ goto FALLTHROUGH_TO_OP_PERIOD;
+ FALLTHROUGH_TO_OP_PERIOD:
#endif
+
case OP_PERIOD:
if ((ch == '\n' && !(mctx->dfa->syntax & RE_DOT_NEWLINE))
|| (ch == '\0' && (mctx->dfa->syntax & RE_DOT_NOT_NULL)))
diff --git a/grub-core/lib/xzembed/xz_dec_lzma2.c b/grub-core/lib/xzembed/xz_dec_lzma2.c
index 8a2a118..af7b770 100644
--- a/grub-core/lib/xzembed/xz_dec_lzma2.c
+++ b/grub-core/lib/xzembed/xz_dec_lzma2.c
@@ -1044,6 +1044,8 @@ enum xz_ret xz_dec_lzma2_run(
s->lzma2.sequence = SEQ_LZMA_PREPARE;
+ /* Fall through */
+
case SEQ_LZMA_PREPARE:
if (s->lzma2.compressed < RC_INIT_BYTES)
return XZ_DATA_ERROR;
@@ -1054,6 +1056,8 @@ enum xz_ret xz_dec_lzma2_run(
s->lzma2.compressed -= RC_INIT_BYTES;
s->lzma2.sequence = SEQ_LZMA_RUN;
+ /* Fall through */
+
case SEQ_LZMA_RUN:
/*
* Set dictionary limit to indicate how much we want
diff --git a/grub-core/lib/xzembed/xz_dec_stream.c b/grub-core/lib/xzembed/xz_dec_stream.c
index c16b130..a29751e 100644
--- a/grub-core/lib/xzembed/xz_dec_stream.c
+++ b/grub-core/lib/xzembed/xz_dec_stream.c
@@ -750,6 +750,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_START;
+ /* FALLTHROUGH */
case SEQ_BLOCK_START:
/* We need one byte of input to continue. */
if (b->in_pos == b->in_size)
@@ -773,6 +774,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.pos = 0;
s->sequence = SEQ_BLOCK_HEADER;
+ /* FALLTHROUGH */
case SEQ_BLOCK_HEADER:
if (!fill_temp(s, b))
return XZ_OK;
@@ -783,6 +785,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_UNCOMPRESS;
+ /* FALLTHROUGH */
case SEQ_BLOCK_UNCOMPRESS:
ret = dec_block(s, b);
if (ret != XZ_STREAM_END)
@@ -810,6 +813,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_CHECK;
+ /* FALLTHROUGH */
case SEQ_BLOCK_CHECK:
ret = hash_validate(s, b, 0);
if (ret != XZ_STREAM_END)
@@ -858,6 +862,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_INDEX_CRC32;
+ /* FALLTHROUGH */
case SEQ_INDEX_CRC32:
ret = hash_validate(s, b, 1);
if (ret != XZ_STREAM_END)
@@ -866,6 +871,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.size = STREAM_HEADER_SIZE;
s->sequence = SEQ_STREAM_FOOTER;
+ /* FALLTHROUGH */
case SEQ_STREAM_FOOTER:
if (!fill_temp(s, b))
return XZ_OK;
diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
index b15b8cc..083f941 100644
--- a/grub-core/loader/i386/linux.c
+++ b/grub-core/loader/i386/linux.c
@@ -984,10 +984,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
{
case 'g':
shift += 10;
+ /* FALLTHROUGH */
case 'm':
shift += 10;
+ /* FALLTHROUGH */
case 'k':
shift += 10;
+ /* FALLTHROUGH */
default:
break;
}
diff --git a/grub-core/tests/setjmp_test.c b/grub-core/tests/setjmp_test.c
index 390cb26..604a6ce 100644
--- a/grub-core/tests/setjmp_test.c
+++ b/grub-core/tests/setjmp_test.c
@@ -25,7 +25,10 @@ GRUB_MOD_LICENSE ("GPLv3+");
static grub_jmp_buf jmp_point;
static int expected, ctr;
-#pragma GCC diagnostic ignored "-Wmissing-noreturn"
+/* This fixes GCC7 "unintentional fallthrough" warning */
+static void jmp0 (void) __attribute__ ((noreturn));
+static void jmp1 (void) __attribute__ ((noreturn));
+static void jmp2 (void) __attribute__ ((noreturn));
static void
jmp0 (void)
diff --git a/grub-core/video/ieee1275.c b/grub-core/video/ieee1275.c
index 0b150ec..17a3dbb 100644
--- a/grub-core/video/ieee1275.c
+++ b/grub-core/video/ieee1275.c
@@ -181,6 +181,7 @@ grub_video_ieee1275_fill_mode_info (grub_ieee1275_phandle_t dev,
case 32:
out->reserved_mask_size = 8;
out->reserved_field_pos = 24;
+ /* FALLTHROUGH */
case 24:
out->red_mask_size = 8;
diff --git a/grub-core/video/readers/jpeg.c b/grub-core/video/readers/jpeg.c
index c3e0df2..21b0d9d 100644
--- a/grub-core/video/readers/jpeg.c
+++ b/grub-core/video/readers/jpeg.c
@@ -736,6 +736,7 @@ grub_jpeg_decode_jpeg (struct grub_jpeg_data *data)
case JPEG_MARKER_SOS: /* Start Of Scan. */
if (grub_jpeg_decode_sos (data))
break;
+ /* FALLTHROUGH */
case JPEG_MARKER_RST0: /* Restart. */
case JPEG_MARKER_RST1:
case JPEG_MARKER_RST2:
diff --git a/util/getroot.c b/util/getroot.c
index 92c0d70..847406f 100644
--- a/util/getroot.c
+++ b/util/getroot.c
@@ -99,7 +99,7 @@ grub_util_pull_device (const char *os_dev)
{
case GRUB_DEV_ABSTRACTION_LVM:
grub_util_pull_lvm_by_command (os_dev);
- /* Fallthrough in case that lvm-tools are unavailable. */
+ /* Fallthrough - in case that lvm-tools are unavailable. */
case GRUB_DEV_ABSTRACTION_LUKS:
grub_util_pull_devmapper (os_dev);
return;
diff --git a/util/grub-install.c b/util/grub-install.c
index 6c89c2b..9074d3e 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -1851,6 +1851,7 @@ main (int argc, char *argv[])
free (mach_kernel);
break;
}
+ /* FALLTHROUGH */
case GRUB_INSTALL_PLATFORM_ARM_EFI:
case GRUB_INSTALL_PLATFORM_ARM64_EFI:
case GRUB_INSTALL_PLATFORM_IA64_EFI:
diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
index f8faae8..e63f148 100644
--- a/util/grub-mkimagexx.c
+++ b/util/grub-mkimagexx.c
@@ -907,6 +907,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
+ sym->st_value
- image_target->vaddr_offset));
}
+ /* FALLTHROUGH */
case R_IA64_LTOFF_FPTR22:
*gpptr = grub_host_to_target64 (addend + sym_addr);
grub_ia64_add_value_to_slot_21 ((grub_addr_t) target,
diff --git a/util/grub-mount.c b/util/grub-mount.c
index aca5f82..a25db8a 100644
--- a/util/grub-mount.c
+++ b/util/grub-mount.c
@@ -530,6 +530,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
if (arg[0] != '-')
break;
+ /* FALLTHROUGH */
default:
if (!arg)
return 0;
--
tg: (8014b7b..) bug/50598 (depends on: master)

View File

@ -1,31 +0,0 @@
From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] btrfs: avoid "used uninitialized" error with GCC7
sblock was local and so considered new variable on every loop
iteration.
Closes: 50597
---
grub-core/fs/btrfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
index 9cffa91..4849c1c 100644
--- a/grub-core/fs/btrfs.c
+++ b/grub-core/fs/btrfs.c
@@ -227,11 +227,11 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data,
static grub_err_t
read_sblock (grub_disk_t disk, struct grub_btrfs_superblock *sb)
{
+ struct grub_btrfs_superblock sblock;
unsigned i;
grub_err_t err = GRUB_ERR_NONE;
for (i = 0; i < ARRAY_SIZE (superblock_sectors); i++)
{
- struct grub_btrfs_superblock sblock;
/* Don't try additional superblocks beyond device size. */
if (i && (grub_le_to_cpu64 (sblock.this_device.size)
>> GRUB_DISK_SECTOR_BITS) <= superblock_sectors[i])
--
tg: (ec4af11..) bug/50597-light (depends on: master)

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Thu Apr 27 18:39:21 UTC 2017 - arvidjaar@gmail.com
- new upstream version 2.02
* rediff
- use-grub2-as-a-package-name.patch
* drop upstream patches
- grub2-fix-uninitialized-variable-in-btrfs-with-GCC7.patch
- grub2-add-FALLTHROUGH-annotations.patch
- update translations
-------------------------------------------------------------------
Sun Mar 26 18:08:20 UTC 2017 - arvidjaar@gmail.com

View File

@ -136,7 +136,7 @@ BuildRequires: update-bootloader-rpm-macros
%define only_x86_64 %{nil}
%endif
Version: 2.02~rc2
Version: 2.02
Release: 0
Summary: Bootloader with support for Linux, Multiboot and more
License: GPL-3.0+
@ -148,7 +148,7 @@ Source1: 90_persistent
Source2: grub.default
Source4: grub2.rpmlintrc
# rsync -Lrtvz translationproject.org::tp/latest/grub/ po
Source5: translations-20140921.tar.xz
Source5: translations-20170427.tar.xz
Source6: grub2-once
Source7: 20_memtest86+
Source8: README.ibm3215
@ -208,8 +208,6 @@ Patch78: grub2-commands-introduce-read_file-subcommand.patch
Patch79: grub2-efi-chainload-harder.patch
Patch80: grub2-emu-4-all.patch
Patch81: grub2-lvm-allocate-metadata-buffer-from-raw-contents.patch
Patch82: grub2-fix-uninitialized-variable-in-btrfs-with-GCC7.patch
Patch83: grub2-add-FALLTHROUGH-annotations.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
@ -472,8 +470,6 @@ swap partition while in resuming
%patch79 -p1
%patch80 -p1
%patch81 -p1
%patch82 -p1
%patch83 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:36885e7f4039a2634a0abeca7f8ab631c32abc5977119eb33c06c752fb3cecc5
size 516764

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2793b20ede25e0d3a63ab5939a4fca6786d40d09946711350f8bf3cf9639f079
size 585860

View File

@ -12,16 +12,16 @@ Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
configure.ac | 2 +-
2 files changed, 13 insertions(+), 13 deletions(-)
Index: grub-2.02~rc2/configure.ac
Index: grub-2.02/configure.ac
===================================================================
--- grub-2.02~rc2.orig/configure.ac
+++ grub-2.02~rc2/configure.ac
--- grub-2.02.orig/configure.ac
+++ grub-2.02/configure.ac
@@ -31,7 +31,7 @@ dnl (such as BUILD_CC, BUILD_CFLAGS, etc
dnl with the prefix "TARGET_" (such as TARGET_CC, TARGET_CFLAGS, etc.) are
dnl used for the target type. See INSTALL for full list of variables.
-AC_INIT([GRUB],[2.02~rc2],[bug-grub@gnu.org])
+AC_INIT([GRUB2],[2.02~rc2],[bug-grub@gnu.org])
-AC_INIT([GRUB],[2.02],[bug-grub@gnu.org])
+AC_INIT([GRUB2],[2.02],[bug-grub@gnu.org])
AC_CONFIG_AUX_DIR([build-aux])