diff --git a/.grubby.metadata b/.grubby.metadata index 55ae099..f409427 100644 --- a/.grubby.metadata +++ b/.grubby.metadata @@ -1 +1 @@ -7f5d3eb0c5dc91158864d8acaadf21441ce8ac41 SOURCES/grubby-8.28.tar.bz2 +95fe18b3e22a7fea3cfbdb11f80f4351411b310a SOURCES/grubby-8.28-1.tar.bz2 diff --git a/SOURCES/0001-Drop-SEGV-handler.patch b/SOURCES/0001-Drop-SEGV-handler.patch new file mode 100644 index 0000000..3e9a99c --- /dev/null +++ b/SOURCES/0001-Drop-SEGV-handler.patch @@ -0,0 +1,52 @@ +From ec1c7aeb9c4d46f3e0a1362137c5eeb0902f13cd Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 27 Feb 2014 10:35:59 +0100 +Subject: [PATCH] Drop SEGV handler + +The generated tracebacks are mostly useless without debuginfo (which is likely +not present if the crash is not anticipated) and prevent ABRT from doing a +better job. + +Signed-off-by: Lubomir Rintel +--- + grubby.c | 17 ----------------- + 1 file changed, 17 deletions(-) + +diff --git a/grubby.c b/grubby.c +index b90fb4b..8d14a35 100644 +--- a/grubby.c ++++ b/grubby.c +@@ -4100,21 +4100,6 @@ int addNewKernel(struct grubConfig * config, struct singleEntry * template, + return 0; + } + +-static void traceback(int signum) +-{ +- void *array[40]; +- size_t size; +- +- signal(SIGSEGV, SIG_DFL); +- memset(array, '\0', sizeof (array)); +- size = backtrace(array, 40); +- +- fprintf(stderr, "grubby received SIGSEGV! Backtrace (%ld):\n", +- (unsigned long)size); +- backtrace_symbols_fd(array, size, STDERR_FILENO); +- exit(1); +-} +- + int main(int argc, const char ** argv) { + poptContext optCon; + const char * grubConfig = NULL; +@@ -4255,8 +4240,6 @@ int main(int argc, const char ** argv) { + + useextlinuxmenu=0; + +- signal(SIGSEGV, traceback); +- + int i = 0; + for (int j = 1; j < argc; j++) + i += strlen(argv[j]) + 1; +-- +1.8.3.1 + diff --git a/SOURCES/0001-Fix-a-crash-with-kernel.patch b/SOURCES/0001-Fix-a-crash-with-kernel.patch new file mode 100644 index 0000000..e8fc696 --- /dev/null +++ b/SOURCES/0001-Fix-a-crash-with-kernel.patch @@ -0,0 +1,39 @@ +From: Lubomir Rintel +Date: Wed, 27 Nov 2013 16:59:48 +0100 +Subject: [PATCH grubby 2/4] grub: Fix a crash with kernel line without being + preceded by title + +Quite obviously this implies a broken configuration file where a lone kernel +line is found without ever seeing an entry start, resulting in a NULL +dereference attempt. Reproducible by running GRUB code against extlinux +configuration: + +./grubby --grub -c test/extlinux.1 --default-kernel +grubby received SIGSEGV! Backtrace (6): +... + +Signed-off-by: Lubomir Rintel +--- + grubby.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grubby.c b/grubby.c +index 3de53b3..935edf1 100644 +--- a/grubby.c ++++ b/grubby.c +@@ -1175,7 +1175,7 @@ static struct grubConfig * readConfig(const char * inName, + * lines came earlier in the template, make sure to use LT_HYPER + * instead of LT_KERNEL now + */ +- if (entry->multiboot) ++ if (entry && entry->multiboot) + line->type = LT_HYPER; + + } else if (line->type == LT_MBMODULE) { +-- +1.8.4.2 + +_______________________________________________ +anaconda-patches mailing list +anaconda-patches@lists.fedorahosted.org +https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches diff --git a/SOURCES/0001-Honor-linux16-and-initrd16.patch b/SOURCES/0001-Honor-linux16-and-initrd16.patch index 5b00667..dbe3f14 100644 --- a/SOURCES/0001-Honor-linux16-and-initrd16.patch +++ b/SOURCES/0001-Honor-linux16-and-initrd16.patch @@ -1,26 +1,27 @@ -From 2f05c14de6ef2cf27816f64f3cbc80903ecef3b1 Mon Sep 17 00:00:00 2001 +From 92c61a05e30bd5e68efac2f92ea520f47ce5416b Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 18 Nov 2013 14:44:13 -0500 Subject: [PATCH] Honor "linux16" and "initrd16" Resolves: rhbz#1031192 +Resolves: rhbz#1034743 Signed-off-by: Peter Jones --- - grubby.c | 61 +++++++++++++++++++++--------- - test.sh | 9 +++++ + grubby.c | 63 ++++++++++++++++++++++--------- + test.sh | 16 ++++++++ test/grub2.10 | 84 +++++++++++++++++++++++++++++++++++++++++ test/grub2.11 | 97 +++++++++++++++++++++++++++++++++++++++++++++++ test/results/add/g2-1.10 | 96 +++++++++++++++++++++++++++++++++++++++++++++++ test/results/add/g2-1.11 | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ - 6 files changed, 428 insertions(+), 17 deletions(-) + 6 files changed, 437 insertions(+), 17 deletions(-) create mode 100644 test/grub2.10 create mode 100644 test/grub2.11 create mode 100644 test/results/add/g2-1.10 create mode 100644 test/results/add/g2-1.11 diff --git a/grubby.c b/grubby.c -index 3de53b3..96f2dd0 100644 +index 3de53b3..5dc5487 100644 --- a/grubby.c +++ b/grubby.c @@ -90,7 +90,9 @@ enum lineType_e { @@ -59,10 +60,11 @@ index 3de53b3..96f2dd0 100644 } char *grub2ExtractTitle(struct singleLine * line) { -@@ -719,6 +723,15 @@ static enum lineType_e preferredLineType(enum lineType_e type, +@@ -719,6 +723,17 @@ static enum lineType_e preferredLineType(enum lineType_e type, default: return type; } ++#if defined(__i386__) || defined(__x86_64__) + } else if (cfi == &grub2ConfigType) { + switch (type) { + case LT_KERNEL: @@ -72,10 +74,11 @@ index 3de53b3..96f2dd0 100644 + default: + return type; + } ++#endif } return type; } -@@ -1806,7 +1819,7 @@ int suitableImage(struct singleEntry * entry, const char * bootPrefix, +@@ -1806,7 +1821,7 @@ int suitableImage(struct singleEntry * entry, const char * bootPrefix, return 0; } @@ -84,7 +87,7 @@ index 3de53b3..96f2dd0 100644 if (!line) { notSuitablePrintf(entry, 0, "no line found\n"); return 0; -@@ -1940,7 +1953,7 @@ struct singleEntry * findEntryByPath(struct grubConfig * config, +@@ -1940,7 +1955,7 @@ struct singleEntry * findEntryByPath(struct grubConfig * config, entry = findEntryByIndex(config, indexVars[i]); if (!entry) return NULL; @@ -93,7 +96,7 @@ index 3de53b3..96f2dd0 100644 if (!line) return NULL; if (index) *index = indexVars[i]; -@@ -1991,9 +2004,9 @@ struct singleEntry * findEntryByPath(struct grubConfig * config, +@@ -1991,9 +2006,9 @@ struct singleEntry * findEntryByPath(struct grubConfig * config, for (line = entry->lines; line; line = line->next) { enum lineType_e ct = checkType; if (entry->multiboot && checkType == LT_KERNEL) @@ -105,7 +108,7 @@ index 3de53b3..96f2dd0 100644 line = getLineByType(ct, line); if (!line) break; /* not found in this entry */ -@@ -2015,7 +2028,7 @@ struct singleEntry * findEntryByPath(struct grubConfig * config, +@@ -2015,7 +2030,7 @@ struct singleEntry * findEntryByPath(struct grubConfig * config, * non-Linux boot entries (could find netbsd etc, though, which is * unfortunate) */ @@ -114,7 +117,7 @@ index 3de53b3..96f2dd0 100644 break; /* found 'im! */ } -@@ -2249,7 +2262,7 @@ void displayEntry(struct singleEntry * entry, const char * prefix, int index) { +@@ -2249,7 +2264,7 @@ void displayEntry(struct singleEntry * entry, const char * prefix, int index) { printf("index=%d\n", index); @@ -123,7 +126,7 @@ index 3de53b3..96f2dd0 100644 if (!line) { printf("non linux entry\n"); return; -@@ -2314,7 +2327,7 @@ void displayEntry(struct singleEntry * entry, const char * prefix, int index) { +@@ -2314,7 +2329,7 @@ void displayEntry(struct singleEntry * entry, const char * prefix, int index) { printf("root=%s\n", s); } @@ -132,7 +135,7 @@ index 3de53b3..96f2dd0 100644 if (line && line->numElements >= 2) { if (!strncmp(prefix, line->elements[1].item, strlen(prefix))) -@@ -2731,7 +2744,7 @@ struct singleLine * addLineTmpl(struct singleEntry * entry, +@@ -2731,7 +2746,7 @@ struct singleLine * addLineTmpl(struct singleEntry * entry, insertElement(newLine, val, 1, cfi); /* but try to keep the rootspec from the template... sigh */ @@ -141,7 +144,7 @@ index 3de53b3..96f2dd0 100644 char * rootspec = getRootSpecifier(tmplLine->elements[1].item); if (rootspec != NULL) { free(newLine->elements[1].item); -@@ -3101,7 +3114,7 @@ int updateActualImage(struct grubConfig * cfg, const char * image, +@@ -3101,7 +3116,7 @@ int updateActualImage(struct grubConfig * cfg, const char * image, firstElement = 2; } else { @@ -150,7 +153,7 @@ index 3de53b3..96f2dd0 100644 if (!line) { /* no LT_KERNEL or LT_MBMODULE in this entry? */ continue; -@@ -3302,10 +3315,10 @@ int updateInitrd(struct grubConfig * cfg, const char * image, +@@ -3302,10 +3317,10 @@ int updateInitrd(struct grubConfig * cfg, const char * image, if (!image) return 0; for (; (entry = findEntryByPath(cfg, image, prefix, &index)); index++) { @@ -163,7 +166,7 @@ index 3de53b3..96f2dd0 100644 if (line) removeLine(entry, line); if (prefix) { -@@ -3316,8 +3329,21 @@ int updateInitrd(struct grubConfig * cfg, const char * image, +@@ -3316,8 +3331,21 @@ int updateInitrd(struct grubConfig * cfg, const char * image, endLine = getLineByType(LT_ENTRY_END, entry->lines); if (endLine) removeLine(entry, endLine); @@ -187,7 +190,7 @@ index 3de53b3..96f2dd0 100644 if (!line) return 1; if (endLine) { -@@ -3915,6 +3941,7 @@ int addNewKernel(struct grubConfig * config, struct singleEntry * template, +@@ -3915,6 +3943,7 @@ int addNewKernel(struct grubConfig * config, struct singleEntry * template, switch (config->cfi->entryStart) { case LT_KERNEL: case LT_KERNEL_EFI: @@ -195,7 +198,7 @@ index 3de53b3..96f2dd0 100644 if (new->multiboot && config->cfi->mbHyperFirst) { /* fall through to LT_HYPER */ } else { -@@ -4473,7 +4500,7 @@ int main(int argc, const char ** argv) { +@@ -4473,7 +4502,7 @@ int main(int argc, const char ** argv) { if (!entry) return 0; if (!suitableImage(entry, bootPrefix, 0, flags)) return 0; @@ -205,29 +208,32 @@ index 3de53b3..96f2dd0 100644 rootspec = getRootSpecifier(line->elements[1].item); diff --git a/test.sh b/test.sh -index 17b40fe..0dab284 100755 +index 17b40fe..5be4006 100755 --- a/test.sh +++ b/test.sh -@@ -461,10 +461,19 @@ if [ "$testgrub2" == "y" ]; then - --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ - --copy-default +@@ -536,6 +536,22 @@ if [ "$testgrub2" == "y" ]; then -+ testing="GRUB2 add kernel with linux16" -+ grub2Test grub2.10 add/g2-1.10 --add-kernel=/boot/new-kernel.img \ -+ --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ -+ --copy-default -+ - testing="GRUB2 add initrd" - grub2Test grub2.2 add/g2-1.4 --update-kernel=/boot/new-kernel.img \ - --initrd=/boot/new-initrd --boot-filesystem=/boot/ + testing="GRUB2 --default-index with default=saved_entry and empty grubenv" + grub2DisplayTest grub2.8 defaultindex/0 --env grubenv.0 --default-index ++ ++ testlinux16=n ++ case $ARCH in ++ ia32|x86_64) testlinux16=y ;; ++ esac ++ ++ if [ "$testlinux16" == "y" ]; then ++ testing="GRUB2 add kernel with linux16" ++ grub2Test grub2.10 add/g2-1.10 --add-kernel=/boot/new-kernel.img \ ++ --title='title' --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ ++ --copy-default ++ ++ testing="GRUB2 add initrd with linux16" ++ grub2Test grub2.11 add/g2-1.11 --update-kernel=/boot/new-kernel.img \ ++ --initrd=/boot/new-initrd --boot-filesystem=/boot/ ++ fi + fi -+ testing="GRUB2 add initrd with linux16" -+ grub2Test grub2.11 add/g2-1.11 --update-kernel=/boot/new-kernel.img \ -+ --initrd=/boot/new-initrd --boot-filesystem=/boot/ -+ - testing="GRUB2 display default index" - grub2DisplayTest grub2.1 defaultindex/0 --default-index - grub2DisplayTest grub2.2 defaultindex/0 --default-index + testing="YABOOT add kernel" diff --git a/test/grub2.10 b/test/grub2.10 new file mode 100644 index 0000000..d010783 @@ -628,5 +634,5 @@ index 0000000..a11cb41 +### BEGIN /etc/grub.d/90_persistent ### +### END /etc/grub.d/90_persistent ### -- -1.8.3.1 +1.8.4.2 diff --git a/SOURCES/0001-Only-set-RPM_OPT_FLAGS-if-undefined.patch b/SOURCES/0001-Only-set-RPM_OPT_FLAGS-if-undefined.patch new file mode 100644 index 0000000..59a192c --- /dev/null +++ b/SOURCES/0001-Only-set-RPM_OPT_FLAGS-if-undefined.patch @@ -0,0 +1,32 @@ +From 28c9a212031ce7db05bf9a4bd0802f93c5e6ef39 Mon Sep 17 00:00:00 2001 +From: "d.marlin" +Date: Mon, 24 Jun 2013 14:57:40 -0500 +Subject: [PATCH grubby/master] Only set RPM_OPT_FLAGS if undefined. + +Currently RPM_OPT_FLAGS are set even if they were already defined. +This overrides any defaults set by RPM, including architecture-specific +values that may be needed to compile on some architectures. + +To avoid this issue, only set RPM_OPT_FLAGS if previously undefined. + +Signed-off-by: David A. Marlin +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index d299b77..dd8104e 100644 +--- a/Makefile ++++ b/Makefile +@@ -23,7 +23,7 @@ TARGETS = grubby + OBJECTS = grubby.o log.o + + CC = gcc +-RPM_OPT_FLAGS := -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector ++RPM_OPT_FLAGS ?= -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector + CFLAGS += $(RPM_OPT_FLAGS) -std=gnu99 -Wall -Werror -Wno-error=unused-function -Wno-unused-function -ggdb + LDFLAGS := + +-- +1.8.1.4 + diff --git a/SPECS/grubby.spec b/SPECS/grubby.spec index f25190d..24a6c94 100644 --- a/SPECS/grubby.spec +++ b/SPECS/grubby.spec @@ -1,16 +1,16 @@ Name: grubby Version: 8.28 -Release: 3%{?dist} +Release: 8%{?dist} Summary: Command line tool for updating bootloader configs Group: System Environment/Base License: GPLv2+ URL: http://git.fedorahosted.org/git/grubby.git -# we only pull git snaps at the moment -# git clone git://git.fedorahosted.org/git/grubby.git -# git archive --format=tar --prefix=grubby-%{version}/ HEAD |bzip2 > grubby-%{version}.tar.bz2 -Source0: %{name}-%{version}.tar.bz2 +Source0: https://git.fedorahosted.org/cgit/grubby.git/snapshot/%{name}-%{version}-1.tar.bz2 Patch0: 0001-Use-PREFIX-during-make-install.patch Patch1: 0001-Honor-linux16-and-initrd16.patch +Patch2: 0001-Only-set-RPM_OPT_FLAGS-if-undefined.patch +Patch3: 0001-Drop-SEGV-handler.patch +Patch4: 0001-Fix-a-crash-with-kernel.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: pkgconfig glib2-devel popt-devel @@ -35,7 +35,7 @@ which install new kernels and need to find information about the current boot environment. %prep -%setup -q +%setup -q -n %{name}-%{version}-1 git init git config user.email "noone@example.com" @@ -77,6 +77,31 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Thu Mar 06 2014 Peter Jones - 8.28-8 +- Fix crash when config file doesn't match command line. + Related: rhbz#1070646 +- Make crashes work with abrt better. + Resolves: rhbz#1070646 + +* Wed Jan 29 2014 Peter Jones - 8.28-7 +- Update to make sure the source url is correct. + Related: rhbz#1034743 + +* Fri Jan 24 2014 Daniel Mach - 8.28-6 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 8.28-5 +- Mass rebuild 2013-12-27 + +* Fri Dec 06 2013 Peter Jones - 8.28-4 +- Make patch from -3 only do that on x86. + Resolves: rhbz#1034743 + +* Wed Nov 27 2013 d.marlin +- Only set RPM_OPT_FLAGS if undefined to avoid overwriting + the platform defaults. + Resolves: rhbz#1023793 + * Mon Nov 18 2013 Peter Jones - 8.28-3 - Honor linux16 and initrd16 in grub.cfg Resolves: rhbz#1031192