import grubby-8.40-34.el8
This commit is contained in:
commit
108908dc41
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
SOURCES/8.40-1.tar.gz
|
1
.grubby.metadata
Normal file
1
.grubby.metadata
Normal file
@ -0,0 +1 @@
|
||||
97ae8d113b74538c05f05083dcff4f44012fd0cd SOURCES/8.40-1.tar.gz
|
@ -0,0 +1,30 @@
|
||||
From b5c0a31ae38c2c42f0dea8c2d7282694f020e976 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Mon, 13 Apr 2015 13:57:33 -0700
|
||||
Subject: [PATCH 01/55] Set envFile from --env when bootloader is not specified
|
||||
|
||||
---
|
||||
grubby.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/grubby.c b/grubby.c
|
||||
index d4ebb86168d..53fe9250e27 100644
|
||||
--- a/grubby.c
|
||||
+++ b/grubby.c
|
||||
@@ -4423,9 +4423,11 @@ int main(int argc, const char ** argv) {
|
||||
}
|
||||
|
||||
if (!cfi) {
|
||||
- if (grub2FindConfig(&grub2ConfigType))
|
||||
+ if (grub2FindConfig(&grub2ConfigType)) {
|
||||
cfi = &grub2ConfigType;
|
||||
- else
|
||||
+ if (envPath)
|
||||
+ cfi->envFile = envPath;
|
||||
+ } else
|
||||
#ifdef __ia64__
|
||||
cfi = &eliloConfigType;
|
||||
#elif __powerpc__
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,91 @@
|
||||
From 9c9587feca7413b34498064db19d796e1c402b51 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Todorov <atodorov@redhat.com>
|
||||
Date: Thu, 11 Jun 2015 08:45:37 -0400
|
||||
Subject: [PATCH 02/55] add README with description of the test suite
|
||||
|
||||
---
|
||||
README.rst | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 72 insertions(+)
|
||||
create mode 100644 README.rst
|
||||
|
||||
diff --git a/README.rst b/README.rst
|
||||
new file mode 100644
|
||||
index 00000000000..a5743ff2f96
|
||||
--- /dev/null
|
||||
+++ b/README.rst
|
||||
@@ -0,0 +1,72 @@
|
||||
+grubby is a command line tool for updating and displaying information about
|
||||
+the configuration files for the grub, lilo, elilo (ia64), yaboot (powerpc)
|
||||
+and zipl (s390) boot loaders. It is primarily designed to be used from scripts
|
||||
+which install new kernels and need to find information about the current boot
|
||||
+environment.
|
||||
+
|
||||
+
|
||||
+Testing grubby
|
||||
+==============
|
||||
+
|
||||
+To execute the integrated test suite from inside the source directory run the
|
||||
+command::
|
||||
+
|
||||
+ make test
|
||||
+
|
||||
+
|
||||
+Test Suite Architecture
|
||||
+------------------------
|
||||
+
|
||||
+grubby's test suite is written in Bash. The file `test.sh` contains several
|
||||
+helper functions and a list of different test scenarios which are exercised
|
||||
+upon execution. Important functions are:
|
||||
+
|
||||
+- oneTest() - test if the configuration generated by the supplied grubby
|
||||
+ parameters matches a well known configuration file;
|
||||
+
|
||||
+- oneDisplayTest() - test grubby features that display some information,
|
||||
+ checking grubby's output against well known values;
|
||||
+
|
||||
+- commandTest() - test if the output of some commands matches the provided
|
||||
+ text. This function is only used for grub2 testing in a few places.
|
||||
+
|
||||
+
|
||||
+Note: the test suite creates aliases for oneTest() and oneDisplayTest(), which
|
||||
+are prefixed with the corresponding boot loader name. For example:
|
||||
+grubTest(). eliloTest(), etc.
|
||||
+
|
||||
+The invocation syntax is::
|
||||
+
|
||||
+ testFunction config_file results_file --grubby --options
|
||||
+
|
||||
+For example the line::
|
||||
+
|
||||
+ grubTest grub.1 updargs/g1.1 --update-kernel=DEFAULT --args="root=/dev/hda1"
|
||||
+
|
||||
+means execute the command::
|
||||
+
|
||||
+ ./grubby --grub --config-file tests/grub.1 --update-kernel=DEFAULT \
|
||||
+ --args="root=/dev/hda1"
|
||||
+
|
||||
+and compare the resulting configuration with the file
|
||||
+`tests/results/updargs/g1.1`.
|
||||
+
|
||||
+
|
||||
+The line::
|
||||
+
|
||||
+ grubDisplayTest grub.1 defaultindex/0 --default-index
|
||||
+
|
||||
+means execute::
|
||||
+
|
||||
+ ./grubby --grub --config-file tests/grub.1 --default-index
|
||||
+
|
||||
+and compare the output with the file `tests/results/defaultindex/0`.
|
||||
+
|
||||
+Writing New Test Cases
|
||||
+----------------------
|
||||
+
|
||||
+To write a new test case for grubby you need a config file which matches the
|
||||
+initial test conditions (either existing one or a new one), provide a
|
||||
+results file (likely a new one) which contains the expected configuration or
|
||||
+output and finally add a call to the test function(s) using the desired grubby
|
||||
+parameters in an appropriate section of `test.sh`.
|
||||
--
|
||||
2.17.1
|
||||
|
35
SOURCES/0003-Fix-some-stray-whitespace.patch
Normal file
35
SOURCES/0003-Fix-some-stray-whitespace.patch
Normal file
@ -0,0 +1,35 @@
|
||||
From d4b710802da3d780799f1e01e18b613e77b95bb3 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Wed, 24 Jun 2015 09:20:35 -0400
|
||||
Subject: [PATCH 03/55] Fix some stray whitespace
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
README.rst | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/README.rst b/README.rst
|
||||
index a5743ff2f96..754454b7bca 100644
|
||||
--- a/README.rst
|
||||
+++ b/README.rst
|
||||
@@ -42,7 +42,7 @@ The invocation syntax is::
|
||||
For example the line::
|
||||
|
||||
grubTest grub.1 updargs/g1.1 --update-kernel=DEFAULT --args="root=/dev/hda1"
|
||||
-
|
||||
+
|
||||
means execute the command::
|
||||
|
||||
./grubby --grub --config-file tests/grub.1 --update-kernel=DEFAULT \
|
||||
@@ -66,7 +66,7 @@ Writing New Test Cases
|
||||
----------------------
|
||||
|
||||
To write a new test case for grubby you need a config file which matches the
|
||||
-initial test conditions (either existing one or a new one), provide a
|
||||
+initial test conditions (either existing one or a new one), provide a
|
||||
results file (likely a new one) which contains the expected configuration or
|
||||
output and finally add a call to the test function(s) using the desired grubby
|
||||
parameters in an appropriate section of `test.sh`.
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,162 @@
|
||||
From d58e447819e96d84560b16d7632bb7bdf88cc412 Mon Sep 17 00:00:00 2001
|
||||
From: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
|
||||
Date: Tue, 16 Jun 2015 10:43:21 -0700
|
||||
Subject: [PATCH 04/55] grubby: properly handle mixed ' and " and nested quotes
|
||||
|
||||
The SLES12 grub2.cfg file on ppc64le by default contains a line like:
|
||||
|
||||
submenu "Bootable snapshot #$snapshot_num" {
|
||||
menuentry "If OK, run 'snapper rollback $snapshot_num' reboot." { true; }
|
||||
}
|
||||
|
||||
On any grubby (tested with 8.40) invocation that updates the config
|
||||
file, the combination of nested quotes and mixed quotes leads to a
|
||||
generated file content like:
|
||||
|
||||
submenu "Bootable snapshot #$snapshot_num" {
|
||||
menuentry 'If OK, run snapper rollback $snapshot_num' rollback $snapshot_num' and reboot." { true; }
|
||||
}
|
||||
|
||||
which includes both a change from " to ', but also improperly quoted
|
||||
strings and trailing characters relative to the string. This actually
|
||||
leads to a failure to boot from the disk by default when using grubby
|
||||
(e.g., Autotest) on SLES12 ppc64le. Whether SLES12 should be adding an
|
||||
entry like this by default or not is probably open to debate, but grubby
|
||||
should be able to hand this input file.
|
||||
|
||||
To fix the issue, three changes were necessary:
|
||||
|
||||
1) grub2ExtractTitle needs to check that if the second element starts
|
||||
with a quote, that the matching element found ends with the same
|
||||
quote-type (' vs. ")
|
||||
|
||||
2) lineWrite needs to output the right kind of quote based upon if the
|
||||
string to be outputted itself contains quotes. This is not currently
|
||||
possible in the code, because quotes are stripped out normally by
|
||||
readConfig, but with the change in 3), that only happens now for the
|
||||
quotes that actually delineate a string.
|
||||
|
||||
3) readConfig needs to check that when it is extracting titles and
|
||||
determining extras, it uses matching quotes.
|
||||
|
||||
With these changes, a simple grubby --set-default=SLES12 (for example),
|
||||
now produces:
|
||||
|
||||
submenu "Bootable snapshot #$snapshot_num" {
|
||||
menuentry "If OK, run 'snapper rollback $snapshot_num' and reboot." { true; }
|
||||
}
|
||||
|
||||
as expected.
|
||||
|
||||
Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
|
||||
---
|
||||
grubby.c | 42 +++++++++++++++++++++++++++++++++---------
|
||||
1 file changed, 33 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/grubby.c b/grubby.c
|
||||
index 53fe9250e27..440c6277935 100644
|
||||
--- a/grubby.c
|
||||
+++ b/grubby.c
|
||||
@@ -451,6 +451,8 @@ char *grub2ExtractTitle(struct singleLine * line) {
|
||||
* whose last character is also quote (assuming it's the closing one) */
|
||||
int resultMaxSize;
|
||||
char * result;
|
||||
+ /* need to ensure that ' does not match " as we search */
|
||||
+ char quote_char = *current;
|
||||
|
||||
resultMaxSize = sizeOfSingleLine(line);
|
||||
result = malloc(resultMaxSize);
|
||||
@@ -464,7 +466,7 @@ char *grub2ExtractTitle(struct singleLine * line) {
|
||||
current_indent_len = strlen(current_indent);
|
||||
|
||||
strncat(result, current_indent, current_indent_len);
|
||||
- if (!isquote(current[current_len-1])) {
|
||||
+ if (current[current_len-1] != quote_char) {
|
||||
strncat(result, current, current_len);
|
||||
} else {
|
||||
strncat(result, current, current_len - 1);
|
||||
@@ -928,10 +930,23 @@ static int lineWrite(FILE * out, struct singleLine * line,
|
||||
/* Need to handle this, because we strip the quotes from
|
||||
* menuentry when read it. */
|
||||
if (line->type == LT_MENUENTRY && i == 1) {
|
||||
- if(!isquote(*line->elements[i].item))
|
||||
- fprintf(out, "\'%s\'", line->elements[i].item);
|
||||
- else
|
||||
+ if(!isquote(*line->elements[i].item)) {
|
||||
+ int substring = 0;
|
||||
+ /* If the line contains nested quotes, we did not strip
|
||||
+ * the "interna" quotes and we must use the right quotes
|
||||
+ * again when writing the updated file. */
|
||||
+ for (int j = i; j < line->numElements; j++) {
|
||||
+ if (strchr(line->elements[i].item, '\'') != NULL) {
|
||||
+ substring = 1;
|
||||
+ fprintf(out, "\"%s\"", line->elements[i].item);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!substring)
|
||||
+ fprintf(out, "\'%s\'", line->elements[i].item);
|
||||
+ } else {
|
||||
fprintf(out, "%s", line->elements[i].item);
|
||||
+ }
|
||||
fprintf(out, "%s", line->elements[i].indent);
|
||||
|
||||
continue;
|
||||
@@ -1267,6 +1282,8 @@ static struct grubConfig * readConfig(const char * inName,
|
||||
len = 0;
|
||||
char *extras;
|
||||
char *title;
|
||||
+ /* initially unseen value */
|
||||
+ char quote_char = '\0';
|
||||
|
||||
for (int i = 1; i < line->numElements; i++) {
|
||||
len += strlen(line->elements[i].item);
|
||||
@@ -1283,13 +1300,16 @@ static struct grubConfig * readConfig(const char * inName,
|
||||
for (int i = 0; i < line->numElements; i++) {
|
||||
if (!strcmp(line->elements[i].item, "menuentry"))
|
||||
continue;
|
||||
- if (isquote(*line->elements[i].item))
|
||||
+ if (isquote(*line->elements[i].item) && quote_char == '\0') {
|
||||
+ /* ensure we properly pair off quotes */
|
||||
+ quote_char = *line->elements[i].item;
|
||||
title = line->elements[i].item + 1;
|
||||
- else
|
||||
+ } else {
|
||||
title = line->elements[i].item;
|
||||
+ }
|
||||
|
||||
len = strlen(title);
|
||||
- if (isquote(title[len-1])) {
|
||||
+ if (title[len-1] == quote_char) {
|
||||
strncat(buf, title,len-1);
|
||||
break;
|
||||
} else {
|
||||
@@ -1300,6 +1320,7 @@ static struct grubConfig * readConfig(const char * inName,
|
||||
|
||||
/* get extras */
|
||||
int count = 0;
|
||||
+ quote_char = '\0';
|
||||
for (int i = 0; i < line->numElements; i++) {
|
||||
if (count >= 2) {
|
||||
strcat(extras, line->elements[i].item);
|
||||
@@ -1310,12 +1331,15 @@ static struct grubConfig * readConfig(const char * inName,
|
||||
continue;
|
||||
|
||||
/* count ' or ", there should be two in menuentry line. */
|
||||
- if (isquote(*line->elements[i].item))
|
||||
+ if (isquote(*line->elements[i].item) && quote_char == '\0') {
|
||||
+ /* ensure we properly pair off quotes */
|
||||
+ quote_char = *line->elements[i].item;
|
||||
count++;
|
||||
+ }
|
||||
|
||||
len = strlen(line->elements[i].item);
|
||||
|
||||
- if (isquote(line->elements[i].item[len -1]))
|
||||
+ if (line->elements[i].item[len -1] == quote_char)
|
||||
count++;
|
||||
|
||||
/* ok, we get the final ' or ", others are extras. */
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,34 @@
|
||||
From 9659e65a9f7ccc2549b75262a4af50ed99cc4bb9 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Tue, 11 Nov 2014 10:46:08 -0500
|
||||
Subject: [PATCH 05/55] Don't put spaces in debug entries on zipl platforms.
|
||||
|
||||
Because of course zipl can't handle spaces.
|
||||
|
||||
Related: rhbz#1152152
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
new-kernel-pkg | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/new-kernel-pkg b/new-kernel-pkg
|
||||
index b634388a83f..1cdbbb99501 100755
|
||||
--- a/new-kernel-pkg
|
||||
+++ b/new-kernel-pkg
|
||||
@@ -140,7 +140,11 @@ rungrubby() {
|
||||
if [ "$1" == "--debug" ]; then
|
||||
[ "$MAKEDEBUG" != "yes" ] && return 0
|
||||
[ -n "$verbose" ] && echo "- First, making a debug entry."
|
||||
- declare -x debugtitle=" with debugging"
|
||||
+ if [ $ARCH = 's390' -o $ARCH = 's390x' ]; then
|
||||
+ declare -x debugtitle="_with_debugging"
|
||||
+ else
|
||||
+ declare -x debugtitle=" with debugging"
|
||||
+ fi
|
||||
declare -x debugargs="$DEBUGARG"
|
||||
shift
|
||||
else
|
||||
--
|
||||
2.17.1
|
||||
|
52
SOURCES/0006-Drop-SEGV-handler.patch
Normal file
52
SOURCES/0006-Drop-SEGV-handler.patch
Normal file
@ -0,0 +1,52 @@
|
||||
From d9600e2dd1b35a6e74494c8c98ba399d06685041 Mon Sep 17 00:00:00 2001
|
||||
From: Lubomir Rintel <lkundrak@v3.sk>
|
||||
Date: Thu, 27 Feb 2014 10:35:59 +0100
|
||||
Subject: [PATCH 06/55] 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 <lkundrak@v3.sk>
|
||||
---
|
||||
grubby.c | 17 -----------------
|
||||
1 file changed, 17 deletions(-)
|
||||
|
||||
diff --git a/grubby.c b/grubby.c
|
||||
index 440c6277935..649597ed92b 100644
|
||||
--- a/grubby.c
|
||||
+++ b/grubby.c
|
||||
@@ -4211,21 +4211,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;
|
||||
@@ -4368,8 +4353,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;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,183 @@
|
||||
From 1da1f577419e85a4e2d717b73af67b79382ad93e Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Thu, 2 Jul 2015 12:34:30 -0400
|
||||
Subject: [PATCH 07/55] Add a bunch of tests for various
|
||||
--default-{kernel,title,index}.
|
||||
|
||||
... and fix some failures where we see them.
|
||||
|
||||
Related: rhbz#1184014
|
||||
|
||||
(though I can't actually replicate his failure.)
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
grubby.c | 52 ++++++++++++++++++++-------------
|
||||
test.sh | 10 +++++++
|
||||
test/results/defaultkernel/g.1 | 1 +
|
||||
test/results/defaultkernel/l1.1 | 1 +
|
||||
test/results/defaultkernel/z.1 | 1 +
|
||||
test/results/defaulttitle/z.1 | 1 +
|
||||
6 files changed, 45 insertions(+), 21 deletions(-)
|
||||
create mode 100644 test/results/defaultkernel/g.1
|
||||
create mode 100644 test/results/defaultkernel/l1.1
|
||||
create mode 100644 test/results/defaultkernel/z.1
|
||||
create mode 100644 test/results/defaulttitle/z.1
|
||||
|
||||
diff --git a/grubby.c b/grubby.c
|
||||
index 649597ed92b..0bb486967bf 100644
|
||||
--- a/grubby.c
|
||||
+++ b/grubby.c
|
||||
@@ -428,7 +428,7 @@ char *grub2ExtractTitle(struct singleLine * line) {
|
||||
|
||||
/* bail out if line does not start with menuentry */
|
||||
if (strcmp(line->elements[0].item, "menuentry"))
|
||||
- return NULL;
|
||||
+ return NULL;
|
||||
|
||||
i = 1;
|
||||
current = line->elements[i].item;
|
||||
@@ -437,10 +437,12 @@ char *grub2ExtractTitle(struct singleLine * line) {
|
||||
/* if second word is quoted, strip the quotes and return single word */
|
||||
if (isquote(*current) && isquote(current[current_len - 1])) {
|
||||
char *tmp;
|
||||
-
|
||||
- tmp = strdup(current);
|
||||
- *(tmp + current_len - 1) = '\0';
|
||||
- return ++tmp;
|
||||
+
|
||||
+ tmp = strdup(current+1);
|
||||
+ if (!tmp)
|
||||
+ return NULL;
|
||||
+ tmp[strlen(tmp)-1] = '\0';
|
||||
+ return tmp;
|
||||
}
|
||||
|
||||
/* if no quotes, return second word verbatim */
|
||||
@@ -453,11 +455,11 @@ char *grub2ExtractTitle(struct singleLine * line) {
|
||||
char * result;
|
||||
/* need to ensure that ' does not match " as we search */
|
||||
char quote_char = *current;
|
||||
-
|
||||
+
|
||||
resultMaxSize = sizeOfSingleLine(line);
|
||||
result = malloc(resultMaxSize);
|
||||
snprintf(result, resultMaxSize, "%s", ++current);
|
||||
-
|
||||
+
|
||||
i++;
|
||||
for (; i < line->numElements; ++i) {
|
||||
current = line->elements[i].item;
|
||||
@@ -4648,27 +4650,35 @@ int main(int argc, const char ** argv) {
|
||||
struct singleLine * line;
|
||||
struct singleEntry * entry;
|
||||
|
||||
- if (config->defaultImage == -1) return 0;
|
||||
+ if (config->defaultImage == -1)
|
||||
+ return 0;
|
||||
if (config->defaultImage == DEFAULT_SAVED_GRUB2 &&
|
||||
cfi->defaultIsSaved)
|
||||
config->defaultImage = 0;
|
||||
entry = findEntryByIndex(config, config->defaultImage);
|
||||
- if (!entry) return 0;
|
||||
+ if (!entry)
|
||||
+ return 0;
|
||||
|
||||
if (!configureGrub2) {
|
||||
- line = getLineByType(LT_TITLE, entry->lines);
|
||||
- if (!line) return 0;
|
||||
- printf("%s\n", line->elements[1].item);
|
||||
-
|
||||
- } else {
|
||||
- char * title;
|
||||
-
|
||||
- dbgPrintf("This is GRUB2, default title is embeded in menuentry\n");
|
||||
- line = getLineByType(LT_MENUENTRY, entry->lines);
|
||||
- if (!line) return 0;
|
||||
- title = grub2ExtractTitle(line);
|
||||
- if (title)
|
||||
+ char *title;
|
||||
+ line = getLineByType(LT_TITLE, entry->lines);
|
||||
+ if (!line)
|
||||
+ return 0;
|
||||
+ title = extractTitle(config, line);
|
||||
+ if (!title)
|
||||
+ return 0;
|
||||
printf("%s\n", title);
|
||||
+ free(title);
|
||||
+ } else {
|
||||
+ char * title;
|
||||
+
|
||||
+ dbgPrintf("This is GRUB2, default title is embeded in menuentry\n");
|
||||
+ line = getLineByType(LT_MENUENTRY, entry->lines);
|
||||
+ if (!line)
|
||||
+ return 0;
|
||||
+ title = grub2ExtractTitle(line);
|
||||
+ if (title)
|
||||
+ printf("%s\n", title);
|
||||
}
|
||||
return 0;
|
||||
|
||||
diff --git a/test.sh b/test.sh
|
||||
index 6379698c6de..96e0087b1e2 100755
|
||||
--- a/test.sh
|
||||
+++ b/test.sh
|
||||
@@ -298,6 +298,9 @@ grubDisplayTest grub.9 defaulttitle/g.9 --default-title
|
||||
grubDisplayTest grub.10 defaulttitle/g.10 --default-title
|
||||
grubDisplayTest grub.11 defaulttitle/g.11 --default-title
|
||||
|
||||
+testing="GRUB display default kernel"
|
||||
+grubDisplayTest grub.1 defaultkernel/g.1 --default-kernel
|
||||
+
|
||||
testing="LILO default directive"
|
||||
liloTest lilo.1 default/l1.1 --set-default=/boot/vmlinuz-2.4.18-4
|
||||
liloTest lilo.1 default/l1.2 --remove-kernel=/boot/vmlinuz-2.4.18-4smp
|
||||
@@ -305,10 +308,17 @@ liloTest lilo.1 default/l1.3 --add-kernel /boot/kernel --title label \
|
||||
--copy-default
|
||||
liloTest lilo.1 default/l1.4 --add-kernel /boot/kernel --title label \
|
||||
--copy-default --make-default
|
||||
+liloDisplayTest lilo.1 defaultkernel/l1.1 --default-kernel
|
||||
|
||||
testing="Z/IPL default directive"
|
||||
ziplTest zipl.1 default/z1.1 --add-kernel /boot/new-kernel --title test
|
||||
ziplTest zipl.1 default/z1.2 --add-kernel /boot/new-kernel --title test --make-default
|
||||
+testing="Z/IPL display default index"
|
||||
+ziplDisplayTest zipl.1 defaultindex/0 --default-index
|
||||
+testing="Z/IPL display default title"
|
||||
+ziplDisplayTest zipl.1 defaulttitle/z.1 --default-title
|
||||
+testing="Z/IPL display default kernel"
|
||||
+ziplDisplayTest zipl.1 defaultkernel/z.1 --default-kernel
|
||||
|
||||
testing="GRUB fallback directive"
|
||||
grubTest grub.5 fallback/g5.1 --remove-kernel=/boot/vmlinuz-2.4.7-ac3 \
|
||||
diff --git a/test/results/defaultkernel/g.1 b/test/results/defaultkernel/g.1
|
||||
new file mode 100644
|
||||
index 00000000000..2c3ac11ead6
|
||||
--- /dev/null
|
||||
+++ b/test/results/defaultkernel/g.1
|
||||
@@ -0,0 +1 @@
|
||||
+/boot/vmlinuz-2.4.7-2
|
||||
diff --git a/test/results/defaultkernel/l1.1 b/test/results/defaultkernel/l1.1
|
||||
new file mode 100644
|
||||
index 00000000000..fd22b1be2b9
|
||||
--- /dev/null
|
||||
+++ b/test/results/defaultkernel/l1.1
|
||||
@@ -0,0 +1 @@
|
||||
+/boot/vmlinuz-2.4.18-4smp
|
||||
diff --git a/test/results/defaultkernel/z.1 b/test/results/defaultkernel/z.1
|
||||
new file mode 100644
|
||||
index 00000000000..2c62e98d4d9
|
||||
--- /dev/null
|
||||
+++ b/test/results/defaultkernel/z.1
|
||||
@@ -0,0 +1 @@
|
||||
+/boot/vmlinuz-2.4.9-37
|
||||
diff --git a/test/results/defaulttitle/z.1 b/test/results/defaulttitle/z.1
|
||||
new file mode 100644
|
||||
index 00000000000..a08e1f35eb7
|
||||
--- /dev/null
|
||||
+++ b/test/results/defaulttitle/z.1
|
||||
@@ -0,0 +1 @@
|
||||
+linux
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,28 @@
|
||||
From 5de1b279749f02a126932f9e03ac62706efde699 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Thu, 2 Jul 2015 12:44:51 -0400
|
||||
Subject: [PATCH 08/55] Emit better systemd debug settings on debug entries.
|
||||
|
||||
Resolves: rhbz#1212128
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
new-kernel-pkg | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/new-kernel-pkg b/new-kernel-pkg
|
||||
index 1cdbbb99501..1f6ab39499f 100755
|
||||
--- a/new-kernel-pkg
|
||||
+++ b/new-kernel-pkg
|
||||
@@ -121,7 +121,7 @@ mbkernel="$HYPERVISOR"
|
||||
mbargs="$HYPERVISOR_ARGS"
|
||||
adddracutargs=""
|
||||
addplymouthinitrd=""
|
||||
-DEBUGARG="systemd.debug"
|
||||
+DEBUGARG="systemd.log_level=debug systemd.log_target=kmsg"
|
||||
|
||||
usage() {
|
||||
echo "Usage: `basename $0` [-v] [--mkinitrd] [--rminitrd] [--dracut]" >&2
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,25 @@
|
||||
From 80e43f6b8c8316075d8f9f6553ad271e168060b1 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Lumens <clumens@redhat.com>
|
||||
Date: Wed, 22 Jul 2015 09:13:11 -0400
|
||||
Subject: [PATCH 09/55] Add a new makefile target that does everything needed
|
||||
for jenkins.
|
||||
|
||||
We should have as much of the logic of how the CI tests are run in source
|
||||
control as possible, so that's what this target is for. Besides this, jenkins
|
||||
just runs a "git clean" first.
|
||||
---
|
||||
Makefile | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index ac144046133..ade4421aa25 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -84,3 +84,4 @@ archive:
|
||||
upload: archive
|
||||
@scp grubby-$(VERSION).tar.bz2 fedorahosted.org:grubby
|
||||
|
||||
+ci: test
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,41 @@
|
||||
From ec969de50ea5fa31d98cd00afa6a3f8a43e606a4 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Thu, 2 Jul 2015 14:30:09 -0400
|
||||
Subject: [PATCH 10/55] Make the grub1 "defaultkernel" test more reliable.
|
||||
|
||||
Basically just do it twice with various incarnations of
|
||||
--boot-filesystem={/,/boot}
|
||||
|
||||
Related: rhbz#1184014
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
test.sh | 3 ++-
|
||||
test/results/defaultkernel/g.2 | 1 +
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
create mode 100644 test/results/defaultkernel/g.2
|
||||
|
||||
diff --git a/test.sh b/test.sh
|
||||
index 96e0087b1e2..2985fd62bf9 100755
|
||||
--- a/test.sh
|
||||
+++ b/test.sh
|
||||
@@ -299,7 +299,8 @@ grubDisplayTest grub.10 defaulttitle/g.10 --default-title
|
||||
grubDisplayTest grub.11 defaulttitle/g.11 --default-title
|
||||
|
||||
testing="GRUB display default kernel"
|
||||
-grubDisplayTest grub.1 defaultkernel/g.1 --default-kernel
|
||||
+grubDisplayTest grub.1 defaultkernel/g.1 --boot-filesystem=/boot --default-kernel
|
||||
+grubDisplayTest grub.1 defaultkernel/g.2 --boot-filesystem=/ --default-kernel
|
||||
|
||||
testing="LILO default directive"
|
||||
liloTest lilo.1 default/l1.1 --set-default=/boot/vmlinuz-2.4.18-4
|
||||
diff --git a/test/results/defaultkernel/g.2 b/test/results/defaultkernel/g.2
|
||||
new file mode 100644
|
||||
index 00000000000..d15855e1b57
|
||||
--- /dev/null
|
||||
+++ b/test/results/defaultkernel/g.2
|
||||
@@ -0,0 +1 @@
|
||||
+/vmlinuz-2.4.7-2
|
||||
--
|
||||
2.17.1
|
||||
|
85
SOURCES/0011-Don-t-leak-from-one-extractTitle-call.patch
Normal file
85
SOURCES/0011-Don-t-leak-from-one-extractTitle-call.patch
Normal file
@ -0,0 +1,85 @@
|
||||
From 38d8178482ea7dabf7c4ab8c2973faa2b469e9c7 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Thu, 2 Jul 2015 16:26:59 -0400
|
||||
Subject: [PATCH 11/55] Don't leak from one extractTitle() call.
|
||||
|
||||
Found by coverity.
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
grubby.c | 27 +++++++++++++++++----------
|
||||
1 file changed, 17 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/grubby.c b/grubby.c
|
||||
index 0bb486967bf..70477ba14ee 100644
|
||||
--- a/grubby.c
|
||||
+++ b/grubby.c
|
||||
@@ -1510,13 +1510,14 @@ static struct grubConfig * readConfig(const char * inName,
|
||||
return cfg;
|
||||
}
|
||||
|
||||
-static void writeDefault(FILE * out, char * indent,
|
||||
+static void writeDefault(FILE * out, char * indent,
|
||||
char * separator, struct grubConfig * cfg) {
|
||||
struct singleEntry * entry;
|
||||
struct singleLine * line;
|
||||
int i;
|
||||
|
||||
- if (!cfg->defaultImage && cfg->flags == GRUB_CONFIG_NO_DEFAULT) return;
|
||||
+ if (!cfg->defaultImage && cfg->flags == GRUB_CONFIG_NO_DEFAULT)
|
||||
+ return;
|
||||
|
||||
if (cfg->defaultImage == DEFAULT_SAVED)
|
||||
fprintf(out, "%sdefault%ssaved\n", indent, separator);
|
||||
@@ -1540,34 +1541,40 @@ static void writeDefault(FILE * out, char * indent,
|
||||
fprintf(out, "%sset default=\"%d\"\n", indent,
|
||||
cfg->defaultImage);
|
||||
} else {
|
||||
- fprintf(out, "%sdefault%s%d\n", indent, separator,
|
||||
+ fprintf(out, "%sdefault%s%d\n", indent, separator,
|
||||
cfg->defaultImage);
|
||||
}
|
||||
} else {
|
||||
int image = cfg->defaultImage;
|
||||
|
||||
entry = cfg->entries;
|
||||
- while (entry && entry->skip) entry = entry->next;
|
||||
+ while (entry && entry->skip)
|
||||
+ entry = entry->next;
|
||||
|
||||
i = 0;
|
||||
while (entry && i < image) {
|
||||
entry = entry->next;
|
||||
|
||||
- while (entry && entry->skip) entry = entry->next;
|
||||
+ while (entry && entry->skip)
|
||||
+ entry = entry->next;
|
||||
i++;
|
||||
}
|
||||
|
||||
- if (!entry) return;
|
||||
+ if (!entry)
|
||||
+ return;
|
||||
|
||||
line = getLineByType(LT_TITLE, entry->lines);
|
||||
|
||||
if (line && line->numElements >= 2)
|
||||
- fprintf(out, "%sdefault%s%s\n", indent, separator,
|
||||
+ fprintf(out, "%sdefault%s%s\n", indent, separator,
|
||||
line->elements[1].item);
|
||||
- else if (line && (line->numElements == 1) &&
|
||||
+ else if (line && (line->numElements == 1) &&
|
||||
cfg->cfi->titleBracketed) {
|
||||
- fprintf(out, "%sdefault%s%s\n", indent, separator,
|
||||
- extractTitle(cfg, line));
|
||||
+ char *title = extractTitle(cfg, line);
|
||||
+ if (title) {
|
||||
+ fprintf(out, "%sdefault%s%s\n", indent, separator, title);
|
||||
+ free(title);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,42 @@
|
||||
From 3a0171fd435765161406238c8df6f66e859ddd93 Mon Sep 17 00:00:00 2001
|
||||
From: Don Zickus <dzickus@redhat.com>
|
||||
Date: Wed, 22 Jul 2015 13:58:53 -0400
|
||||
Subject: [PATCH 12/55] ppc64le sync grub.cfg changes to disk (#1212114)
|
||||
|
||||
After installing a new kernel, if a panic is induced, not all the kernel
|
||||
pieces are on the disk (most importantly the grub.cfg changes). This can
|
||||
lead to a hung system on a reboot because the older kernel can not be found.
|
||||
|
||||
Address this by forcing all the changes (mainly the fs meta data) to disk
|
||||
before finishing the kernel package installation.
|
||||
|
||||
Tested by 'yum install kernel-...; echo c > /proc/sysrq-trigger'.
|
||||
|
||||
Before, the machine would panic and on reboot be stuck without a grub.cfg
|
||||
to read. After, works as expected.
|
||||
|
||||
Resolves: rhbz#1212114
|
||||
---
|
||||
new-kernel-pkg | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/new-kernel-pkg b/new-kernel-pkg
|
||||
index 1f6ab39499f..90652da06b7 100755
|
||||
--- a/new-kernel-pkg
|
||||
+++ b/new-kernel-pkg
|
||||
@@ -927,4 +927,12 @@ fi
|
||||
# if we mounted the U-Boot directory, unmount it.
|
||||
[ -n "$mounted" ] && umount $ubootDir
|
||||
|
||||
+# make sure changes make it to the disk.
|
||||
+# if /boot is a mountpoint, force the meta data on disk
|
||||
+# to by-pass writeback delay.
|
||||
+# PPC64LE-only to deal with Petitboot issues
|
||||
+if [ "$ARCH" = "ppc64le" ]; then
|
||||
+ sync && mountpoint -q /boot &&fsfreeze -f /boot && fsfreeze -u /boot
|
||||
+fi
|
||||
+
|
||||
exit 0
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,38 @@
|
||||
From 92adaf4e655c3e6833e6f3b96fe1f5b75f75fd64 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Thu, 6 Aug 2015 10:06:13 -0400
|
||||
Subject: [PATCH 13/55] Make it possible to run "test.sh --verbose" from the
|
||||
make command line.
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
Makefile | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index ade4421aa25..cc7e823959f 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -26,6 +26,10 @@ CC = gcc
|
||||
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 :=
|
||||
+VERBOSE_TEST :=
|
||||
+ifneq ($(VERBOSE_TEST),)
|
||||
+ VERBOSE_TEST="--verbose"
|
||||
+endif
|
||||
|
||||
grubby_LIBS = -lblkid -lpopt
|
||||
|
||||
@@ -39,7 +43,7 @@ debug : clean
|
||||
|
||||
test: all
|
||||
@export TOPDIR=$(TOPDIR)
|
||||
- @./test.sh
|
||||
+ @./test.sh $(VERBOSE_TEST)
|
||||
|
||||
install: all
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/sbin
|
||||
--
|
||||
2.17.1
|
||||
|
9239
SOURCES/0014-Lindent-dammit.patch
Normal file
9239
SOURCES/0014-Lindent-dammit.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,586 @@
|
||||
From 5c8744420dfc891b2422db8f0be4bad2368f9970 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Thu, 6 Aug 2015 10:07:11 -0400
|
||||
Subject: [PATCH 15/55] Make SET_VARIABLE get handled individually in
|
||||
GetNextLine()
|
||||
|
||||
Resolves: rhbz#1152550
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
grubby.c | 119 ++++++++++++++++++++++-----
|
||||
.gitignore | 2 +
|
||||
test.sh | 8 ++
|
||||
test/grub2.16 | 156 +++++++++++++++++++++++++++++++++++
|
||||
test/results/add/g2-1.16 | 170 +++++++++++++++++++++++++++++++++++++++
|
||||
5 files changed, 433 insertions(+), 22 deletions(-)
|
||||
create mode 100644 test/grub2.16
|
||||
create mode 100644 test/results/add/g2-1.16
|
||||
|
||||
diff --git a/grubby.c b/grubby.c
|
||||
index fe6595b8386..d66c1c5a40a 100644
|
||||
--- a/grubby.c
|
||||
+++ b/grubby.c
|
||||
@@ -75,6 +75,7 @@ struct lineElement {
|
||||
};
|
||||
|
||||
enum lineType_e {
|
||||
+ LT_UNIDENTIFIED = 0,
|
||||
LT_WHITESPACE = 1 << 0,
|
||||
LT_TITLE = 1 << 1,
|
||||
LT_KERNEL = 1 << 2,
|
||||
@@ -747,6 +748,33 @@ static char *sdupprintf(const char *format, ...)
|
||||
return buf;
|
||||
}
|
||||
|
||||
+static inline int
|
||||
+kwcmp(struct keywordTypes *kw, const char * label, int case_insensitive)
|
||||
+{
|
||||
+ int kwl = strlen(kw->key);
|
||||
+ int ll = strlen(label);
|
||||
+ int rc;
|
||||
+ int (*snc)(const char *s1, const char *s2, size_t n) =
|
||||
+ case_insensitive ? strncasecmp : strncmp;
|
||||
+ int (*sc)(const char *s1, const char *s2) =
|
||||
+ case_insensitive ? strcasecmp : strcmp;
|
||||
+
|
||||
+ rc = snc(kw->key, label, kwl);
|
||||
+ if (rc)
|
||||
+ return rc;
|
||||
+
|
||||
+ for (int i = kwl; i < ll; i++) {
|
||||
+ if (isspace(label[i]))
|
||||
+ return 0;
|
||||
+ if (kw->separatorChar && label[i] == kw->separatorChar)
|
||||
+ return 0;
|
||||
+ else if (kw->nextChar && label[i] == kw->nextChar)
|
||||
+ return 0;
|
||||
+ return sc(kw->key+kwl, label+kwl);
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static enum lineType_e preferredLineType(enum lineType_e type,
|
||||
struct configFileInfo *cfi)
|
||||
{
|
||||
@@ -812,13 +840,8 @@ static enum lineType_e getTypeByKeyword(char *keyword,
|
||||
struct configFileInfo *cfi)
|
||||
{
|
||||
for (struct keywordTypes * kw = cfi->keywords; kw->key; kw++) {
|
||||
- if (cfi->caseInsensitive) {
|
||||
- if (!strcasecmp(keyword, kw->key))
|
||||
- return kw->type;
|
||||
- } else {
|
||||
- if (!strcmp(keyword, kw->key))
|
||||
- return kw->type;
|
||||
- }
|
||||
+ if (!kwcmp(kw, keyword, cfi->caseInsensitive))
|
||||
+ return kw->type;
|
||||
}
|
||||
return LT_UNKNOWN;
|
||||
}
|
||||
@@ -913,6 +936,7 @@ static int readFile(int fd, char **bufPtr)
|
||||
|
||||
static void lineInit(struct singleLine *line)
|
||||
{
|
||||
+ line->type = LT_UNIDENTIFIED;
|
||||
line->indent = NULL;
|
||||
line->elements = NULL;
|
||||
line->numElements = 0;
|
||||
@@ -995,7 +1019,7 @@ static int lineWrite(FILE * out, struct singleLine *line,
|
||||
|
||||
if (fprintf(out, "%s", line->elements[i].item) == -1)
|
||||
return -1;
|
||||
- if (i < line->numElements - 1)
|
||||
+ if (i < line->numElements - 1 || line->type == LT_SET_VARIABLE)
|
||||
if (fprintf(out, "%s", line->elements[i].indent) == -1)
|
||||
return -1;
|
||||
}
|
||||
@@ -1050,6 +1074,8 @@ static int getNextLine(char **bufPtr, struct singleLine *line,
|
||||
break;
|
||||
chptr++;
|
||||
}
|
||||
+ if (line->type == LT_UNIDENTIFIED)
|
||||
+ line->type = getTypeByKeyword(start, cfi);
|
||||
element->item = strndup(start, chptr - start);
|
||||
start = chptr;
|
||||
|
||||
@@ -1115,7 +1141,7 @@ static int getNextLine(char **bufPtr, struct singleLine *line,
|
||||
line->type = LT_WHITESPACE;
|
||||
line->numElements = 0;
|
||||
}
|
||||
- } else {
|
||||
+ } else if (line->type == LT_INITRD) {
|
||||
struct keywordTypes *kw;
|
||||
|
||||
kw = getKeywordByType(line->type, cfi);
|
||||
@@ -1177,6 +1203,39 @@ static int getNextLine(char **bufPtr, struct singleLine *line,
|
||||
}
|
||||
}
|
||||
}
|
||||
+ } else if (line->type == LT_SET_VARIABLE) {
|
||||
+ /* and if it's a "set blah=" we need to split it
|
||||
+ * yet a third way to avoid rhbz# XXX FIXME :/
|
||||
+ */
|
||||
+ char *eq;
|
||||
+ int l;
|
||||
+ int numElements = line->numElements;
|
||||
+ struct lineElement *newElements;
|
||||
+ eq = strchr(line->elements[1].item, '=');
|
||||
+ if (!eq)
|
||||
+ return 0;
|
||||
+ l = eq - line->elements[1].item;
|
||||
+ if (eq[1] != 0)
|
||||
+ numElements++;
|
||||
+ newElements = calloc(numElements,sizeof (*newElements));
|
||||
+ memcpy(&newElements[0], &line->elements[0],
|
||||
+ sizeof (newElements[0]));
|
||||
+ newElements[1].item =
|
||||
+ strndup(line->elements[1].item, l);
|
||||
+ newElements[1].indent = "=";
|
||||
+ *(eq++) = '\0';
|
||||
+ newElements[2].item = strdup(eq);
|
||||
+ free(line->elements[1].item);
|
||||
+ if (line->elements[1].indent)
|
||||
+ newElements[2].indent = line->elements[1].indent;
|
||||
+ for (int i = 2; i < line->numElements; i++) {
|
||||
+ newElements[i+1].item = line->elements[i].item;
|
||||
+ newElements[i+1].indent =
|
||||
+ line->elements[i].indent;
|
||||
+ }
|
||||
+ free(line->elements);
|
||||
+ line->elements = newElements;
|
||||
+ line->numElements = numElements;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1282,13 +1341,12 @@ static struct grubConfig *readConfig(const char *inName,
|
||||
getKeywordByType(LT_DEFAULT, cfi);
|
||||
if (kwType && line->numElements == 3
|
||||
&& !strcmp(line->elements[1].item, kwType->key)
|
||||
- && !is_special_grub2_variable(line->elements[2].
|
||||
- item)) {
|
||||
+ && !is_special_grub2_variable(
|
||||
+ line->elements[2].item)) {
|
||||
dbgPrintf("Line sets default config\n");
|
||||
cfg->flags &= ~GRUB_CONFIG_NO_DEFAULT;
|
||||
defaultLine = line;
|
||||
}
|
||||
-
|
||||
} else if (iskernel(line->type)) {
|
||||
/* if by some freak chance this is multiboot and the
|
||||
* "module" lines came earlier in the template, make
|
||||
@@ -1542,16 +1600,33 @@ static struct grubConfig *readConfig(const char *inName,
|
||||
}
|
||||
}
|
||||
} else if (cfi->defaultIsVariable) {
|
||||
- char *value = defaultLine->elements[2].item;
|
||||
- while (*value && (*value == '"' || *value == '\'' ||
|
||||
- *value == ' ' || *value == '\t'))
|
||||
- value++;
|
||||
- cfg->defaultImage = strtol(value, &end, 10);
|
||||
- while (*end && (*end == '"' || *end == '\'' ||
|
||||
- *end == ' ' || *end == '\t'))
|
||||
- end++;
|
||||
- if (*end)
|
||||
- cfg->defaultImage = -1;
|
||||
+ if (defaultLine->numElements == 2) {
|
||||
+ char *value = defaultLine->elements[1].item + 8;
|
||||
+ while (*value && (*value == '"' ||
|
||||
+ *value == '\'' ||
|
||||
+ *value == ' ' ||
|
||||
+ *value == '\t'))
|
||||
+ value++;
|
||||
+ cfg->defaultImage = strtol(value, &end, 10);
|
||||
+ while (*end && (*end == '"' || *end == '\'' ||
|
||||
+ *end == ' ' || *end == '\t'))
|
||||
+ end++;
|
||||
+ if (*end)
|
||||
+ cfg->defaultImage = -1;
|
||||
+ } else if (defaultLine->numElements == 3) {
|
||||
+ char *value = defaultLine->elements[2].item;
|
||||
+ while (*value && (*value == '"' ||
|
||||
+ *value == '\'' ||
|
||||
+ *value == ' ' ||
|
||||
+ *value == '\t'))
|
||||
+ value++;
|
||||
+ cfg->defaultImage = strtol(value, &end, 10);
|
||||
+ while (*end && (*end == '"' || *end == '\'' ||
|
||||
+ *end == ' ' || *end == '\t'))
|
||||
+ end++;
|
||||
+ if (*end)
|
||||
+ cfg->defaultImage = -1;
|
||||
+ }
|
||||
} else if (cfi->defaultSupportSaved &&
|
||||
!strncmp(defaultLine->elements[1].item, "saved",
|
||||
5)) {
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index e64d3bc0986..e78a392d601 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -1,3 +1,5 @@
|
||||
grubby
|
||||
version.h
|
||||
*.o
|
||||
+core.*
|
||||
+vgcore.*
|
||||
diff --git a/test.sh b/test.sh
|
||||
index 2985fd62bf9..cd2d8707b5f 100755
|
||||
--- a/test.sh
|
||||
+++ b/test.sh
|
||||
@@ -543,6 +543,14 @@ if [ "$testgrub2" == "y" ]; then
|
||||
--copy-default --title "Fedora 21 Rescue" --args=root=/fooooo \
|
||||
--remove-kernel=wtf --boot-filesystem=/boot/ --efi
|
||||
|
||||
+ # a grub2 add with a "set" of the form: set foo="bar=1,2". bz#1152550
|
||||
+ # has this being emitted as: set foo="bar=1,2"=1,2"
|
||||
+ # which is wrong.
|
||||
+ grub2Test grub2.16 add/g2-1.16 \
|
||||
+ --add-kernel=/boot/vmlinuz-foo \
|
||||
+ --copy-default --title 'Red Hat Enterprise Linux Server' \
|
||||
+ --args=root=/dev/mapper/foo--
|
||||
+
|
||||
testing="GRUB2 add initrd"
|
||||
grub2Test grub2.2 add/g2-1.4 --update-kernel=/boot/new-kernel.img \
|
||||
--initrd=/boot/new-initrd --boot-filesystem=/boot/
|
||||
diff --git a/test/grub2.16 b/test/grub2.16
|
||||
new file mode 100644
|
||||
index 00000000000..136880a61ee
|
||||
--- /dev/null
|
||||
+++ b/test/grub2.16
|
||||
@@ -0,0 +1,156 @@
|
||||
+#
|
||||
+# DO NOT EDIT THIS FILE
|
||||
+#
|
||||
+# It is automatically generated by grub2-mkconfig using templates
|
||||
+# from /etc/grub.d and settings from /etc/default/grub
|
||||
+#
|
||||
+
|
||||
+### BEGIN /etc/grub.d/00_header ###
|
||||
+set pager=1
|
||||
+
|
||||
+if [ -s $prefix/grubenv ]; then
|
||||
+ load_env
|
||||
+fi
|
||||
+if [ "${next_entry}" ] ; then
|
||||
+ set default="${next_entry}"
|
||||
+ set next_entry=
|
||||
+ save_env next_entry
|
||||
+ set boot_once=true
|
||||
+else
|
||||
+ set default="${saved_entry}"
|
||||
+fi
|
||||
+
|
||||
+if [ x"${feature_menuentry_id}" = xy ]; then
|
||||
+ menuentry_id_option="--id"
|
||||
+else
|
||||
+ menuentry_id_option=""
|
||||
+fi
|
||||
+
|
||||
+export menuentry_id_option
|
||||
+
|
||||
+if [ "${prev_saved_entry}" ]; then
|
||||
+ set saved_entry="${prev_saved_entry}"
|
||||
+ save_env saved_entry
|
||||
+ set prev_saved_entry=
|
||||
+ save_env prev_saved_entry
|
||||
+ set boot_once=true
|
||||
+fi
|
||||
+
|
||||
+function savedefault {
|
||||
+ if [ -z "${boot_once}" ]; then
|
||||
+ saved_entry="${chosen}"
|
||||
+ save_env saved_entry
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+function load_video {
|
||||
+ if [ x$feature_all_video_module = xy ]; then
|
||||
+ insmod all_video
|
||||
+ else
|
||||
+ insmod efi_gop
|
||||
+ insmod efi_uga
|
||||
+ insmod ieee1275_fb
|
||||
+ insmod vbe
|
||||
+ insmod vga
|
||||
+ insmod video_bochs
|
||||
+ insmod video_cirrus
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+serial --speed=115200
|
||||
+terminal_input serial console
|
||||
+terminal_output serial console
|
||||
+if [ x$feature_timeout_style = xy ] ; then
|
||||
+ set timeout_style=menu
|
||||
+ set timeout=5
|
||||
+# Fallback normal timeout code in case the timeout_style feature is
|
||||
+# unavailable.
|
||||
+else
|
||||
+ set timeout=5
|
||||
+fi
|
||||
+### END /etc/grub.d/00_header ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/00_tuned ###
|
||||
+set tuned_params="isolcpus=1,3"
|
||||
+### END /etc/grub.d/00_tuned ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/01_users ###
|
||||
+if [ -f ${prefix}/user.cfg ]; then
|
||||
+ source ${prefix}/user.cfg
|
||||
+ if [ -n ${GRUB2_PASSWORD} ]; then
|
||||
+ set superusers="root"
|
||||
+ export superusers
|
||||
+ password_pbkdf2 root ${GRUB2_PASSWORD}
|
||||
+ fi
|
||||
+fi
|
||||
+### END /etc/grub.d/01_users ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/10_linux ###
|
||||
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-297.el7.x86_64) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-296.el7.x86_64-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
|
||||
+ load_video
|
||||
+ set gfxpayload=keep
|
||||
+ insmod gzio
|
||||
+ insmod part_msdos
|
||||
+ insmod xfs
|
||||
+ set root='hd0,msdos1'
|
||||
+ if [ x$feature_platform_search_hint = xy ]; then
|
||||
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ else
|
||||
+ search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ fi
|
||||
+ linux16 /vmlinuz-3.10.0-297.el7.x86_64 root=/dev/mapper/rhel_hp--dl380pgen8--02--vm--10-root ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81 $tuned_params LANG=en_US.UTF-8
|
||||
+}
|
||||
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-296.el7.x86_64) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-296.el7.x86_64-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
|
||||
+ load_video
|
||||
+ set gfxpayload=keep
|
||||
+ insmod gzio
|
||||
+ insmod part_msdos
|
||||
+ insmod xfs
|
||||
+ set root='hd0,msdos1'
|
||||
+ if [ x$feature_platform_search_hint = xy ]; then
|
||||
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ else
|
||||
+ search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ fi
|
||||
+ linux16 /vmlinuz-3.10.0-296.el7.x86_64 root=/dev/mapper/rhel_hp--dl380pgen8--02--vm--10-root ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81 $tuned_params
|
||||
+ initrd16 /initramfs-3.10.0-296.el7.x86_64.img
|
||||
+}
|
||||
+menuentry 'Red Hat Enterprise Linux Server (0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
|
||||
+ load_video
|
||||
+ insmod gzio
|
||||
+ insmod part_msdos
|
||||
+ insmod xfs
|
||||
+ set root='hd0,msdos1'
|
||||
+ if [ x$feature_platform_search_hint = xy ]; then
|
||||
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ else
|
||||
+ search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ fi
|
||||
+ linux16 /vmlinuz-0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7 root=/dev/mapper/rhel_hp--dl380pgen8--02--vm--10-root ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81 $tuned_params
|
||||
+ initrd16 /initramfs-0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7.img
|
||||
+}
|
||||
+if [ "x$default" = 'Red Hat Enterprise Linux Server (3.10.0-296.el7.x86_64) 7.2 (Maipo)' ]; then default='Advanced options for Red Hat Enterprise Linux Server>Red Hat Enterprise Linux Server (3.10.0-296.el7.x86_64) 7.2 (Maipo)'; fi;
|
||||
+### END /etc/grub.d/10_linux ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/20_linux_xen ###
|
||||
+### END /etc/grub.d/20_linux_xen ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
||||
+### END /etc/grub.d/20_ppc_terminfo ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/30_os-prober ###
|
||||
+### END /etc/grub.d/30_os-prober ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/40_custom ###
|
||||
+# This file provides an easy way to add custom menu entries. Simply type the
|
||||
+# menu entries you want to add after this comment. Be careful not to change
|
||||
+# the 'exec tail' line above.
|
||||
+### END /etc/grub.d/40_custom ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/41_custom ###
|
||||
+if [ -f ${config_directory}/custom.cfg ]; then
|
||||
+ source ${config_directory}/custom.cfg
|
||||
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
||||
+ source $prefix/custom.cfg;
|
||||
+fi
|
||||
+### END /etc/grub.d/41_custom ###
|
||||
diff --git a/test/results/add/g2-1.16 b/test/results/add/g2-1.16
|
||||
new file mode 100644
|
||||
index 00000000000..fc98757f4fc
|
||||
--- /dev/null
|
||||
+++ b/test/results/add/g2-1.16
|
||||
@@ -0,0 +1,170 @@
|
||||
+#
|
||||
+# DO NOT EDIT THIS FILE
|
||||
+#
|
||||
+# It is automatically generated by grub2-mkconfig using templates
|
||||
+# from /etc/grub.d and settings from /etc/default/grub
|
||||
+#
|
||||
+
|
||||
+### BEGIN /etc/grub.d/00_header ###
|
||||
+set pager=1
|
||||
+
|
||||
+if [ -s $prefix/grubenv ]; then
|
||||
+ load_env
|
||||
+fi
|
||||
+if [ "${next_entry}" ] ; then
|
||||
+ set default="${next_entry}"
|
||||
+ set next_entry=
|
||||
+ save_env next_entry
|
||||
+ set boot_once=true
|
||||
+else
|
||||
+ set default="${saved_entry}"
|
||||
+fi
|
||||
+
|
||||
+if [ x"${feature_menuentry_id}" = xy ]; then
|
||||
+ menuentry_id_option="--id"
|
||||
+else
|
||||
+ menuentry_id_option=""
|
||||
+fi
|
||||
+
|
||||
+export menuentry_id_option
|
||||
+
|
||||
+if [ "${prev_saved_entry}" ]; then
|
||||
+ set saved_entry="${prev_saved_entry}"
|
||||
+ save_env saved_entry
|
||||
+ set prev_saved_entry=
|
||||
+ save_env prev_saved_entry
|
||||
+ set boot_once=true
|
||||
+fi
|
||||
+
|
||||
+function savedefault {
|
||||
+ if [ -z "${boot_once}" ]; then
|
||||
+ saved_entry="${chosen}"
|
||||
+ save_env saved_entry
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+function load_video {
|
||||
+ if [ x$feature_all_video_module = xy ]; then
|
||||
+ insmod all_video
|
||||
+ else
|
||||
+ insmod efi_gop
|
||||
+ insmod efi_uga
|
||||
+ insmod ieee1275_fb
|
||||
+ insmod vbe
|
||||
+ insmod vga
|
||||
+ insmod video_bochs
|
||||
+ insmod video_cirrus
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+serial --speed=115200
|
||||
+terminal_input serial console
|
||||
+terminal_output serial console
|
||||
+if [ x$feature_timeout_style = xy ] ; then
|
||||
+ set timeout_style=menu
|
||||
+ set timeout=5
|
||||
+# Fallback normal timeout code in case the timeout_style feature is
|
||||
+# unavailable.
|
||||
+else
|
||||
+ set timeout=5
|
||||
+fi
|
||||
+### END /etc/grub.d/00_header ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/00_tuned ###
|
||||
+set tuned_params="isolcpus=1,3"
|
||||
+### END /etc/grub.d/00_tuned ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/01_users ###
|
||||
+if [ -f ${prefix}/user.cfg ]; then
|
||||
+ source ${prefix}/user.cfg
|
||||
+ if [ -n ${GRUB2_PASSWORD} ]; then
|
||||
+ set superusers="root"
|
||||
+ export superusers
|
||||
+ password_pbkdf2 root ${GRUB2_PASSWORD}
|
||||
+ fi
|
||||
+fi
|
||||
+### END /etc/grub.d/01_users ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/10_linux ###
|
||||
+menuentry 'Red Hat Enterprise Linux Server' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-296.el7.x86_64-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
|
||||
+ load_video
|
||||
+ set gfxpayload=keep
|
||||
+ insmod gzio
|
||||
+ insmod part_msdos
|
||||
+ insmod xfs
|
||||
+ set root='hd0,msdos1'
|
||||
+ if [ x$feature_platform_search_hint = xy ]; then
|
||||
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ else
|
||||
+ search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ fi
|
||||
+ linux16 /vmlinuz-foo root=/dev/mapper/foo-- ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81 $tuned_params LANG=en_US.UTF-8
|
||||
+}
|
||||
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-297.el7.x86_64) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-296.el7.x86_64-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
|
||||
+ load_video
|
||||
+ set gfxpayload=keep
|
||||
+ insmod gzio
|
||||
+ insmod part_msdos
|
||||
+ insmod xfs
|
||||
+ set root='hd0,msdos1'
|
||||
+ if [ x$feature_platform_search_hint = xy ]; then
|
||||
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ else
|
||||
+ search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ fi
|
||||
+ linux16 /vmlinuz-3.10.0-297.el7.x86_64 root=/dev/mapper/rhel_hp--dl380pgen8--02--vm--10-root ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81 $tuned_params LANG=en_US.UTF-8
|
||||
+}
|
||||
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-296.el7.x86_64) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-296.el7.x86_64-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
|
||||
+ load_video
|
||||
+ set gfxpayload=keep
|
||||
+ insmod gzio
|
||||
+ insmod part_msdos
|
||||
+ insmod xfs
|
||||
+ set root='hd0,msdos1'
|
||||
+ if [ x$feature_platform_search_hint = xy ]; then
|
||||
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ else
|
||||
+ search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ fi
|
||||
+ linux16 /vmlinuz-3.10.0-296.el7.x86_64 root=/dev/mapper/rhel_hp--dl380pgen8--02--vm--10-root ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81 $tuned_params
|
||||
+ initrd16 /initramfs-3.10.0-296.el7.x86_64.img
|
||||
+}
|
||||
+menuentry 'Red Hat Enterprise Linux Server (0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7-advanced-ae7b3742-9092-4432-9f7f-8abdbf0dc3db' {
|
||||
+ load_video
|
||||
+ insmod gzio
|
||||
+ insmod part_msdos
|
||||
+ insmod xfs
|
||||
+ set root='hd0,msdos1'
|
||||
+ if [ x$feature_platform_search_hint = xy ]; then
|
||||
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ else
|
||||
+ search --no-floppy --fs-uuid --set=root cae02b39-f239-4d26-9032-674d261c93d8
|
||||
+ fi
|
||||
+ linux16 /vmlinuz-0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7 root=/dev/mapper/rhel_hp--dl380pgen8--02--vm--10-root ro crashkernel=auto rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/root rd.lvm.lv=rhel_hp-dl380pgen8-02-vm-10/swap console=ttyS0,115200n81 $tuned_params
|
||||
+ initrd16 /initramfs-0-rescue-cc21b92886f9ebbd3ed5a494639b7fd7.img
|
||||
+}
|
||||
+if [ "x$default" = 'Red Hat Enterprise Linux Server (3.10.0-296.el7.x86_64) 7.2 (Maipo)' ]; then default='Advanced options for Red Hat Enterprise Linux Server>Red Hat Enterprise Linux Server (3.10.0-296.el7.x86_64) 7.2 (Maipo)'; fi;
|
||||
+### END /etc/grub.d/10_linux ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/20_linux_xen ###
|
||||
+### END /etc/grub.d/20_linux_xen ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
||||
+### END /etc/grub.d/20_ppc_terminfo ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/30_os-prober ###
|
||||
+### END /etc/grub.d/30_os-prober ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/40_custom ###
|
||||
+# This file provides an easy way to add custom menu entries. Simply type the
|
||||
+# menu entries you want to add after this comment. Be careful not to change
|
||||
+# the 'exec tail' line above.
|
||||
+### END /etc/grub.d/40_custom ###
|
||||
+
|
||||
+### BEGIN /etc/grub.d/41_custom ###
|
||||
+if [ -f ${config_directory}/custom.cfg ]; then
|
||||
+ source ${config_directory}/custom.cfg
|
||||
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
||||
+ source $prefix/custom.cfg;
|
||||
+fi
|
||||
+### END /etc/grub.d/41_custom ###
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,31 @@
|
||||
From c014354834f496ade11dda3f6406cbddbee25f75 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Tue, 1 Sep 2015 11:02:07 -0400
|
||||
Subject: [PATCH 16/55] Specify bootloader directory in the test case for
|
||||
1152550.
|
||||
|
||||
Because otherwise it blows up when built in mock without /boot mounted.
|
||||
|
||||
Related: rhbz#1152550
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
test.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test.sh b/test.sh
|
||||
index cd2d8707b5f..ba466a50501 100755
|
||||
--- a/test.sh
|
||||
+++ b/test.sh
|
||||
@@ -547,7 +547,7 @@ if [ "$testgrub2" == "y" ]; then
|
||||
# has this being emitted as: set foo="bar=1,2"=1,2"
|
||||
# which is wrong.
|
||||
grub2Test grub2.16 add/g2-1.16 \
|
||||
- --add-kernel=/boot/vmlinuz-foo \
|
||||
+ --boot-filesystem=/boot --add-kernel=/boot/vmlinuz-foo \
|
||||
--copy-default --title 'Red Hat Enterprise Linux Server' \
|
||||
--args=root=/dev/mapper/foo--
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,63 @@
|
||||
From a8fd0f15979d5f4632c337c8bcfbdbae2b957f67 Mon Sep 17 00:00:00 2001
|
||||
From: marcosfrm <marcosfrm@users.noreply.github.com>
|
||||
Date: Tue, 6 Oct 2015 08:29:02 -0300
|
||||
Subject: [PATCH 17/55] Fix dracut cmdline options and conditionalize them to
|
||||
--add-dracut-args
|
||||
|
||||
By default initramfs generated by dracut is HostOnly and has vconsole.conf and locale.conf included. Instead of killing this import section, conditionalize it to --add-dracut-args.
|
||||
|
||||
Reference: http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/modules.d/10i18n/parse-i18n.sh
|
||||
---
|
||||
new-kernel-pkg | 35 ++++++++++++++---------------------
|
||||
1 file changed, 14 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/new-kernel-pkg b/new-kernel-pkg
|
||||
index 90652da06b7..997fb1f4987 100755
|
||||
--- a/new-kernel-pkg
|
||||
+++ b/new-kernel-pkg
|
||||
@@ -825,28 +825,21 @@ if [[ ${ARCH} =~ armv[5|7].*l ]]; then
|
||||
fi
|
||||
[ -n "$verbose" ] && echo "devtreedir is $devtreedir"
|
||||
|
||||
-# add dracut i18n, keyboard and plymouth kernel args if requested
|
||||
-if [ -n "$dracut" -o -n "$adddracutargs" ]; then
|
||||
- if [ -r /etc/vconsole.conf ]; then
|
||||
- . /etc/vconsole.conf
|
||||
- elif [ -r /etc/sysconfig/keyboard ]; then
|
||||
- . /etc/sysconfig/keyboard
|
||||
- fi
|
||||
+# add dracut kernel args if requested
|
||||
+if [ -n "$dracut" -a -n "$adddracutargs" ]; then
|
||||
+ [ -r /etc/vconsole.conf ] && . /etc/vconsole.conf
|
||||
+ [ -r /etc/locale.conf ] && . /etc/locale.conf
|
||||
|
||||
- if [ -r /etc/locale.conf ]; then
|
||||
- . /etc/locale.conf
|
||||
- elif [ -r /etc/sysconfig/i18n ]; then
|
||||
- . /etc/sysconfig/i18n
|
||||
- fi
|
||||
-
|
||||
- for i in SYSFONT SYSFONTACM UNIMAP LANG KEYTABLE; do
|
||||
- val=$(eval echo \$$i)
|
||||
- [ -n "$val" ] && kernargs="$kernargs $i=$val"
|
||||
- done
|
||||
-
|
||||
- if [ -n "$KEYBOARDTYPE" -a "$KEYBOARDTYPE" != "pc" ]; then
|
||||
- kernargs="$kernargs KEYBOARDTYPE=$KEYBOARDTYPE"
|
||||
- fi
|
||||
+ while read opt rd_opt; do
|
||||
+ [ -n "${!opt}" ] && kernargs="$kernargs $rd_opt=\"${!opt}\""
|
||||
+ done <<< 'KEYMAP rd.vconsole.keymap
|
||||
+ FONT rd.vconsole.font
|
||||
+ FONT_MAP rd.vconsole.font.map
|
||||
+ FONT_UNIMAP rd.vconsole.font.unimap
|
||||
+ UNICODE rd.vconsole.font.unicode
|
||||
+ EXT_KEYMAP rd.vconsole.keymap.ext
|
||||
+ LANG rd.locale.LANG
|
||||
+ LC_ALL rd.locale.LC_ALL'
|
||||
fi
|
||||
|
||||
# set this as the default if we have the package and it matches
|
||||
--
|
||||
2.17.1
|
||||
|
25
SOURCES/0018-Add-missing-space.patch
Normal file
25
SOURCES/0018-Add-missing-space.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 7ee039e026fe02e01dd4c7fd2b18682b8737697c Mon Sep 17 00:00:00 2001
|
||||
From: marcosfrm <marcosfrm@users.noreply.github.com>
|
||||
Date: Tue, 6 Oct 2015 08:40:44 -0300
|
||||
Subject: [PATCH 18/55] Add missing space
|
||||
|
||||
---
|
||||
new-kernel-pkg | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/new-kernel-pkg b/new-kernel-pkg
|
||||
index 997fb1f4987..9f56c470b4a 100755
|
||||
--- a/new-kernel-pkg
|
||||
+++ b/new-kernel-pkg
|
||||
@@ -925,7 +925,7 @@ fi
|
||||
# to by-pass writeback delay.
|
||||
# PPC64LE-only to deal with Petitboot issues
|
||||
if [ "$ARCH" = "ppc64le" ]; then
|
||||
- sync && mountpoint -q /boot &&fsfreeze -f /boot && fsfreeze -u /boot
|
||||
+ sync && mountpoint -q /boot && fsfreeze -f /boot && fsfreeze -u /boot
|
||||
fi
|
||||
|
||||
exit 0
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,123 @@
|
||||
From ae22f8322d2f2dccd19003fccd390fe19f7126c1 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 26 Oct 2015 14:22:39 -0400
|
||||
Subject: [PATCH 19/55] Always do the "rungrubby --debug" after the normal
|
||||
kernel on install.
|
||||
|
||||
This way the during an update, the right kernel is picked as "default"
|
||||
for the command line arguments.
|
||||
|
||||
Related: rhbz#1212128
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
new-kernel-pkg | 20 ++++++++++----------
|
||||
1 file changed, 10 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/new-kernel-pkg b/new-kernel-pkg
|
||||
index 9f56c470b4a..9574dbbf10b 100755
|
||||
--- a/new-kernel-pkg
|
||||
+++ b/new-kernel-pkg
|
||||
@@ -243,8 +243,8 @@ install() {
|
||||
--args=\"root=$rootdevice $kernargs \$debugargs\" \
|
||||
--remove-kernel=\"TITLE=$title\$debugtitle\""
|
||||
|
||||
- rungrubby --debug ${ARGS}
|
||||
rungrubby ${ARGS} $makedefault
|
||||
+ rungrubby --debug ${ARGS}
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$grubConfig does not exist, not running grubby for grub 0.97"
|
||||
fi
|
||||
@@ -257,8 +257,8 @@ install() {
|
||||
${mbargs:+--mbargs=\"$mbargs\"} \
|
||||
--args=\"root=$rootdevice $kernargs \$debugargs\" \
|
||||
--remove-kernel=\"TITLE=$title\$debugtitle\""
|
||||
- rungrubby --debug ${ARGS}
|
||||
rungrubby ${ARGS} $makedefault
|
||||
+ rungrubby --debug ${ARGS}
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$grub2Config does not exist, not running grubby for grub 2"
|
||||
fi
|
||||
@@ -272,8 +272,8 @@ install() {
|
||||
${mbargs:+--mbargs=\"$mbargs\"} \
|
||||
--args=\"root=$rootdevice $kernargs \$debugargs\" \
|
||||
--remove-kernel=\"TITLE=$title\$debugtitle\""
|
||||
- rungrubby --debug ${ARGS}
|
||||
rungrubby ${ARGS} $makedefault
|
||||
+ rungrubby --debug ${ARGS}
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$grub2EfiConfig does not exist, not running grubby for grub 2 with UEFI"
|
||||
fi
|
||||
@@ -288,8 +288,8 @@ install() {
|
||||
--args=\"root=$rootdevice $kernargs \$debugargs\" \
|
||||
--remove-kernel=\"TITLE=$version\""
|
||||
|
||||
- rungrubby --debug ${ARGS}
|
||||
rungrubby ${ARGS} $makedefault
|
||||
+ rungrubby --debug ${ARGS}
|
||||
if [ -n "$runLilo" ]; then
|
||||
[ -n "$verbose" ] && echo "running $lilo"
|
||||
if [ ! -x $lilo ] ; then
|
||||
@@ -313,8 +313,8 @@ install() {
|
||||
--args=\"root=$rootdevice $kernargs \$debugargs\" \
|
||||
--remove-kernel=\"TITLE=$title\$debugtitle\""
|
||||
|
||||
- rungrubby --debug ${ARGS}
|
||||
rungrubby ${ARGS} $makedefault
|
||||
+ rungrubby --debug ${ARGS}
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$extlinuxConfig does not exist, not running grubby for extlinux"
|
||||
fi
|
||||
@@ -480,8 +480,8 @@ update() {
|
||||
${mbkernel:+--add-multiboot=\"$mbkernel\"} \
|
||||
--title=\"$title\$debugtitle\""
|
||||
|
||||
- rungrubby --debug ${ARGS}
|
||||
rungrubby ${ARGS}
|
||||
+ rungrubby --debug ${ARGS}
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$grubConfig does not exist, not running grubby"
|
||||
fi
|
||||
@@ -493,8 +493,8 @@ update() {
|
||||
${removeargs:+--remove-args=\"$removeargs\"} \
|
||||
--title=\"$title\$debugtitle\""
|
||||
|
||||
- rungrubby --debug ${ARGS}
|
||||
rungrubby ${ARGS}
|
||||
+ rungrubby --debug ${ARGS}
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$grub2Config does not exist, not running grubby"
|
||||
fi
|
||||
@@ -506,8 +506,8 @@ update() {
|
||||
${removeargs:+--remove-args=\"$removeargs\"} \
|
||||
--title=\"$title\$debugtitle\""
|
||||
|
||||
- rungrubby --debug ${ARGS}
|
||||
rungrubby ${ARGS}
|
||||
+ rungrubby --debug ${ARGS}
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$grub2EfiConfig does not exist, not running grubby"
|
||||
fi
|
||||
@@ -519,8 +519,8 @@ update() {
|
||||
${removeargs:+--remove-args=\"$removeargs\"} \
|
||||
--title=\"$title\$debugtitle\""
|
||||
|
||||
- rungrubby --debug ${ARGS}
|
||||
rungrubby ${ARGS}
|
||||
+ rungrubby --debug ${ARGS}
|
||||
|
||||
if [ -n "$runLilo" ]; then
|
||||
[ -n "$verbose" ] && echo "running $lilo"
|
||||
@@ -571,8 +571,8 @@ update() {
|
||||
${removeargs:+--remove-args=\"$removeargs\"} \
|
||||
--title=\"$title\$debugtitle\""
|
||||
|
||||
- rungrubby --debug ${ARGS}
|
||||
rungrubby ${ARGS}
|
||||
+ rungrubby --debug ${ARGS}
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$extlinuxConfig does not exist, not running grubby"
|
||||
< |