Don't create "debug" entries yet.
This apparently interacts poorly with grub2-mkconfig's title generation and causes weird errors, so it's not ready yet. This commit also fixes some quoting errors in the dtbdir n-k-p code. Resolves: rhbz#1153410 Resolves: rhbz#1088933 Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
635a3b8d37
commit
ee984748a5
@ -1,7 +1,7 @@
|
||||
From 4dbf9c7e15420eb06540bb426bf36c434787e344 Mon Sep 17 00:00:00 2001
|
||||
From 639b9ab2462d4dddd8b8cff04e8db352cb6dc5d5 Mon Sep 17 00:00:00 2001
|
||||
From: Yannick Brosseau <scientist@fb.com>
|
||||
Date: Thu, 3 Jul 2014 13:55:19 -0700
|
||||
Subject: [PATCH 1/9] Don't go past the last element of indexVars in
|
||||
Subject: [PATCH 01/10] Don't go past the last element of indexVars in
|
||||
findEntryByPath
|
||||
|
||||
We add a chance of creating an infinite loop, because we
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 98cab84501f86bd98f12653c11f4ecc632139399 Mon Sep 17 00:00:00 2001
|
||||
From 0e5c50b8dff5208b915391e3b592790bdf174cf4 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Tue, 8 Jul 2014 14:37:21 -0400
|
||||
Subject: [PATCH 2/9] Add bls test harness bits.
|
||||
Subject: [PATCH 02/10] Add bls test harness bits.
|
||||
|
||||
This expects that there are bls config files and that grubby knows how
|
||||
to deal with them, which isn't at all true, and so the test case
|
||||
@ -153,7 +153,7 @@ index 864a8ce..e7be15f 100755
|
||||
grub2DisplayTest grub2.2 defaultindex/0 --default-index
|
||||
diff --git a/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-3.8.0-2.fc19.x86_64.conf b/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-3.8.0-2.fc19.x86_64.conf
|
||||
new file mode 100644
|
||||
index 0000000..e36a1fd
|
||||
index 0000000..84b2bdf
|
||||
--- /dev/null
|
||||
+++ b/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-3.8.0-2.fc19.x86_64.conf
|
||||
@@ -0,0 +1,8 @@
|
||||
@ -167,7 +167,7 @@ index 0000000..e36a1fd
|
||||
+initrd /boot/initrd-3.8.0-2.fc19.x86_64
|
||||
diff --git a/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-3.8.1-2.fc19.x86_64.conf b/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-3.8.1-2.fc19.x86_64.conf
|
||||
new file mode 100644
|
||||
index 0000000..382d1af
|
||||
index 0000000..e1c61a8
|
||||
--- /dev/null
|
||||
+++ b/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-3.8.1-2.fc19.x86_64.conf
|
||||
@@ -0,0 +1,8 @@
|
||||
@ -181,7 +181,7 @@ index 0000000..382d1af
|
||||
+initrd /boot/initrd-3.8.1-2.fc19.x86_64
|
||||
diff --git a/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-tboot-3.8.0-2.fc19.x86_64.conf b/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-tboot-3.8.0-2.fc19.x86_64.conf
|
||||
new file mode 100644
|
||||
index 0000000..05c0910
|
||||
index 0000000..4a60fbc
|
||||
--- /dev/null
|
||||
+++ b/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-tboot-3.8.0-2.fc19.x86_64.conf
|
||||
@@ -0,0 +1,10 @@
|
||||
@ -197,7 +197,7 @@ index 0000000..05c0910
|
||||
+initrd /boot/initrd-3.8.0-2.fc19.x86_64
|
||||
diff --git a/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-tboot-3.8.1-2.fc19.x86_64.conf b/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-tboot-3.8.1-2.fc19.x86_64.conf
|
||||
new file mode 100644
|
||||
index 0000000..db17a93
|
||||
index 0000000..34c0e09
|
||||
--- /dev/null
|
||||
+++ b/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-tboot-3.8.1-2.fc19.x86_64.conf
|
||||
@@ -0,0 +1,10 @@
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 2f35781fde88a99dec22407057b1a46343bc00cc Mon Sep 17 00:00:00 2001
|
||||
From e91855ce14df65d12f681c15dfba5b22a2b4a061 Mon Sep 17 00:00:00 2001
|
||||
From: Junxiao Bi <junxiao.bi@oracle.com>
|
||||
Date: Wed, 14 May 2014 16:44:21 +0800
|
||||
Subject: [PATCH 3/9] grubby: fix initrd updating when multiboot exist
|
||||
Subject: [PATCH 03/10] grubby: fix initrd updating when multiboot exist
|
||||
|
||||
When using the following command to add an initrd for the kernel.
|
||||
grubby --update-kernel=/boot/vmlinuz-2.6.32-431.17.1.el6.x86_64.debug
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 338b08cb67a369069475f327b0fce74b506e5c46 Mon Sep 17 00:00:00 2001
|
||||
From dbd5b06ce590ca638e3c44746183f6f2379e820f Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Fri, 12 Sep 2014 15:50:05 -0400
|
||||
Subject: [PATCH 4/9] Tell a slightly better fib about default bootloader
|
||||
Subject: [PATCH 04/10] Tell a slightly better fib about default bootloader
|
||||
config paths.
|
||||
|
||||
It's not going to be right everywhere, but... whatever.
|
||||
|
@ -1,7 +1,7 @@
|
||||
From f631d090d3a78327e6d2642465be6ab559dd7f4e Mon Sep 17 00:00:00 2001
|
||||
From 629922b6dc32e4209980d7198b7d2aabb722033a Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 15 Sep 2014 14:31:01 -0400
|
||||
Subject: [PATCH 5/9] Make findTemplate actually return the saved default.
|
||||
Subject: [PATCH 05/10] Make findTemplate actually return the saved default.
|
||||
|
||||
Really not sure why this wasn't returning here before; going into the
|
||||
loop below is just going to clobber all that it's done.
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 4b927a16d3a1a8356f4ceb78c7388ca3cb6a5d87 Mon Sep 17 00:00:00 2001
|
||||
From 0950d2e8693339a36f59c966dc8558263331665c Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 15 Sep 2014 16:49:26 -0400
|
||||
Subject: [PATCH 8/9] Revert "Add bls test harness bits."
|
||||
Subject: [PATCH 06/10] Revert "Add bls test harness bits."
|
||||
|
||||
This wasn't supposed to be pushed to master yet. woops.
|
||||
|
||||
@ -147,7 +147,7 @@ index e7be15f..864a8ce 100755
|
||||
grub2DisplayTest grub2.2 defaultindex/0 --default-index
|
||||
diff --git a/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-3.8.0-2.fc19.x86_64.conf b/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-3.8.0-2.fc19.x86_64.conf
|
||||
deleted file mode 100644
|
||||
index e36a1fd..0000000
|
||||
index 84b2bdf..0000000
|
||||
--- a/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-3.8.0-2.fc19.x86_64.conf
|
||||
+++ /dev/null
|
||||
@@ -1,8 +0,0 @@
|
||||
@ -161,7 +161,7 @@ index e36a1fd..0000000
|
||||
-initrd /boot/initrd-3.8.0-2.fc19.x86_64
|
||||
diff --git a/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-3.8.1-2.fc19.x86_64.conf b/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-3.8.1-2.fc19.x86_64.conf
|
||||
deleted file mode 100644
|
||||
index 382d1af..0000000
|
||||
index e1c61a8..0000000
|
||||
--- a/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-3.8.1-2.fc19.x86_64.conf
|
||||
+++ /dev/null
|
||||
@@ -1,8 +0,0 @@
|
||||
@ -175,7 +175,7 @@ index 382d1af..0000000
|
||||
-initrd /boot/initrd-3.8.1-2.fc19.x86_64
|
||||
diff --git a/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-tboot-3.8.0-2.fc19.x86_64.conf b/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-tboot-3.8.0-2.fc19.x86_64.conf
|
||||
deleted file mode 100644
|
||||
index 05c0910..0000000
|
||||
index 4a60fbc..0000000
|
||||
--- a/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-tboot-3.8.0-2.fc19.x86_64.conf
|
||||
+++ /dev/null
|
||||
@@ -1,10 +0,0 @@
|
||||
@ -191,7 +191,7 @@ index 05c0910..0000000
|
||||
-initrd /boot/initrd-3.8.0-2.fc19.x86_64
|
||||
diff --git a/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-tboot-3.8.1-2.fc19.x86_64.conf b/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-tboot-3.8.1-2.fc19.x86_64.conf
|
||||
deleted file mode 100644
|
||||
index db17a93..0000000
|
||||
index 34c0e09..0000000
|
||||
--- a/test/grub2-support_files/6a9857a393724b7a981ebb5b8495b9ea-tboot-3.8.1-2.fc19.x86_64.conf
|
||||
+++ /dev/null
|
||||
@@ -1,10 +0,0 @@
|
@ -1,106 +0,0 @@
|
||||
From 5c3bc267ba244478284c7879c7197aad168766e6 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 15 Sep 2014 15:18:48 -0400
|
||||
Subject: [PATCH 6/9] Support filtering --update-kernel= by title as well.
|
||||
|
||||
If there are two entries with the same kernel, we need to match the
|
||||
title to uniquely identify one.
|
||||
|
||||
Related: rhbz#957681
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
grubby.c | 40 +++++++++++++++++++++++++++++++++++-----
|
||||
1 file changed, 35 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/grubby.c b/grubby.c
|
||||
index baf646b..855464a 100644
|
||||
--- a/grubby.c
|
||||
+++ b/grubby.c
|
||||
@@ -3308,7 +3308,8 @@ int updateImage(struct grubConfig * cfg, const char * image,
|
||||
}
|
||||
|
||||
int addMBInitrd(struct grubConfig * cfg, const char *newMBKernel,
|
||||
- const char * image, const char * prefix, const char * initrd) {
|
||||
+ const char * image, const char * prefix, const char * initrd,
|
||||
+ const char * title) {
|
||||
struct singleEntry * entry;
|
||||
struct singleLine * line, * kernelLine, *endLine = NULL;
|
||||
int index = 0;
|
||||
@@ -3319,6 +3320,20 @@ int addMBInitrd(struct grubConfig * cfg, const char *newMBKernel,
|
||||
kernelLine = getLineByType(LT_MBMODULE, entry->lines);
|
||||
if (!kernelLine) continue;
|
||||
|
||||
+ /* if title is supplied, the entry's title must match it. */
|
||||
+ if (title) {
|
||||
+ line = getLineByType(LT_TITLE|LT_MENUENTRY, entry->lines);
|
||||
+ char *linetitle = extractTitle(line);
|
||||
+
|
||||
+ if (!linetitle)
|
||||
+ continue;
|
||||
+ if (strcmp(title, linetitle)) {
|
||||
+ free(linetitle);
|
||||
+ continue;
|
||||
+ }
|
||||
+ free(linetitle);
|
||||
+ }
|
||||
+
|
||||
if (prefix) {
|
||||
int prefixLen = strlen(prefix);
|
||||
if (!strncmp(initrd, prefix, prefixLen))
|
||||
@@ -3344,7 +3359,7 @@ int addMBInitrd(struct grubConfig * cfg, const char *newMBKernel,
|
||||
}
|
||||
|
||||
int updateInitrd(struct grubConfig * cfg, const char * image,
|
||||
- const char * prefix, const char * initrd) {
|
||||
+ const char * prefix, const char * initrd, const char * title) {
|
||||
struct singleEntry * entry;
|
||||
struct singleLine * line, * kernelLine, *endLine = NULL;
|
||||
int index = 0;
|
||||
@@ -3355,6 +3370,20 @@ int updateInitrd(struct grubConfig * cfg, const char * image,
|
||||
kernelLine = getLineByType(LT_KERNEL|LT_KERNEL_EFI|LT_KERNEL_16, entry->lines);
|
||||
if (!kernelLine) continue;
|
||||
|
||||
+ /* if title is supplied, the entry's title must match it. */
|
||||
+ if (title) {
|
||||
+ line = getLineByType(LT_TITLE|LT_MENUENTRY, entry->lines);
|
||||
+ char *linetitle = extractTitle(line);
|
||||
+
|
||||
+ if (!linetitle)
|
||||
+ continue;
|
||||
+ if (strcmp(title, linetitle)) {
|
||||
+ free(linetitle);
|
||||
+ continue;
|
||||
+ }
|
||||
+ free(linetitle);
|
||||
+ }
|
||||
+
|
||||
line = getLineByType(LT_INITRD|LT_INITRD_EFI|LT_INITRD_16, entry->lines);
|
||||
if (line)
|
||||
removeLine(entry, line);
|
||||
@@ -4413,7 +4442,7 @@ int main(int argc, const char ** argv) {
|
||||
if (newKernelPath && !newKernelTitle) {
|
||||
fprintf(stderr, _("grubby: kernel title must be specified\n"));
|
||||
return 1;
|
||||
- } else if (!newKernelPath && (newKernelTitle || copyDefault ||
|
||||
+ } else if (!newKernelPath && (copyDefault ||
|
||||
(newKernelInitrd && !updateKernelPath)||
|
||||
makeDefault || extraInitrdCount > 0)) {
|
||||
fprintf(stderr, _("grubby: kernel path expected\n"));
|
||||
@@ -4635,11 +4664,12 @@ int main(int argc, const char ** argv) {
|
||||
if (updateKernelPath && newKernelInitrd) {
|
||||
if (newMBKernel) {
|
||||
if (addMBInitrd(config, newMBKernel, updateKernelPath,
|
||||
- bootPrefix, newKernelInitrd))
|
||||
+ bootPrefix, newKernelInitrd,
|
||||
+ newKernelTitle))
|
||||
return 1;
|
||||
} else {
|
||||
if (updateInitrd(config, updateKernelPath, bootPrefix,
|
||||
- newKernelInitrd))
|
||||
+ newKernelInitrd, newKernelTitle))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
--
|
||||
1.9.3
|
||||
|
32
0007-Always-error-check-getLineByType.patch
Normal file
32
0007-Always-error-check-getLineByType.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From e3a293332591f44a190775a3b4dceefe2e5118a1 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Thu, 25 Sep 2014 13:24:15 -0400
|
||||
Subject: [PATCH 07/10] Always error check getLineByType()
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
grubby.c | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/grubby.c b/grubby.c
|
||||
index baf646b..b202b6e 100644
|
||||
--- a/grubby.c
|
||||
+++ b/grubby.c
|
||||
@@ -2369,9 +2369,11 @@ void displayEntry(struct singleEntry * entry, const char * prefix, int index) {
|
||||
} else {
|
||||
char * title;
|
||||
line = getLineByType(LT_MENUENTRY, entry->lines);
|
||||
- title = grub2ExtractTitle(line);
|
||||
- if (title)
|
||||
- printf("title=%s\n", title);
|
||||
+ if (line) {
|
||||
+ title = grub2ExtractTitle(line);
|
||||
+ if (title)
|
||||
+ printf("title=%s\n", title);
|
||||
+ }
|
||||
}
|
||||
|
||||
for (j = 0, line = entry->lines; line; line = line->next) {
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,310 +0,0 @@
|
||||
From c3b1511221a5f542ae8b5691bcc5049249b9d29f Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 15 Sep 2014 15:20:34 -0400
|
||||
Subject: [PATCH 7/9] Conditionally create debug entries when installing
|
||||
kernels.
|
||||
|
||||
If /etc/sysconfig/kernel has MAKEDEBUG set to "yes", create non-default
|
||||
entries that have systemd.debug set.
|
||||
|
||||
Resolves: rhbz#957681
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
new-kernel-pkg | 190 ++++++++++++++++++++++++++++++++++++---------------------
|
||||
1 file changed, 119 insertions(+), 71 deletions(-)
|
||||
|
||||
diff --git a/new-kernel-pkg b/new-kernel-pkg
|
||||
index d9a9b67..70f6118 100755
|
||||
--- a/new-kernel-pkg
|
||||
+++ b/new-kernel-pkg
|
||||
@@ -50,6 +50,7 @@ grubConfig=""
|
||||
grub2Config=""
|
||||
grub2EfiConfig=""
|
||||
extlinuxConfig=""
|
||||
+ubootScript="/boot/boot.scr"
|
||||
|
||||
ARCH=$(uname -m)
|
||||
|
||||
@@ -120,6 +121,7 @@ mbkernel="$HYPERVISOR"
|
||||
mbargs="$HYPERVISOR_ARGS"
|
||||
adddracutargs=""
|
||||
addplymouthinitrd=""
|
||||
+DEBUGARG="systemd.debug"
|
||||
|
||||
usage() {
|
||||
echo "Usage: `basename $0` [-v] [--mkinitrd] [--rminitrd] [--dracut]" >&2
|
||||
@@ -134,6 +136,41 @@ usage() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
+rungrubby() {
|
||||
+ if [ "$1" == "--debug" ]; then
|
||||
+ [ "$MAKEDEBUG" != "yes" ] && return 0
|
||||
+ [ -n "$verbose" ] && echo "- First, making a debug entry."
|
||||
+ declare -x debugtitle=" with debugging"
|
||||
+ declare -x debugargs="$DEBUGARG"
|
||||
+ shift
|
||||
+ else
|
||||
+ [ -n "$verbose" ] && echo "- Making a normal entry."
|
||||
+ fi
|
||||
+ $(eval $grubby $@)
|
||||
+ export -n debugargs
|
||||
+ export -n debugtitle
|
||||
+ unset debugargs
|
||||
+ unset debugtitle
|
||||
+}
|
||||
+
|
||||
+set_title() {
|
||||
+ if [ -n "$banner" ]; then
|
||||
+ if [ $ARCH = 's390' -o $ARCH = 's390x' ]; then
|
||||
+ title=$(echo $banner | sed 's/ /_/g')
|
||||
+ else
|
||||
+ title="$banner ($version)"
|
||||
+ fi
|
||||
+ elif [ $ARCH = 's390' -o $ARCH = 's390x' ]; then
|
||||
+ title=$(echo $version | sed 's/ /_/g')
|
||||
+ elif [ -f /etc/os-release ]; then
|
||||
+ . /etc/os-release
|
||||
+ title="$NAME ($version) $VERSION"
|
||||
+ elif [ -f /etc/redhat-release ]; then
|
||||
+ title="$(sed 's/ release.*$//' < /etc/redhat-release) ($version)"
|
||||
+ else
|
||||
+ title="Red Hat Linux ($version)"
|
||||
+ fi
|
||||
+}
|
||||
|
||||
install() {
|
||||
# XXX kernel should be able to be specified also (or work right on ia64)
|
||||
@@ -184,57 +221,49 @@ install() {
|
||||
cfgLilo=""
|
||||
fi
|
||||
|
||||
-
|
||||
- if [ -n "$banner" ]; then
|
||||
- if [ $ARCH = 's390' -o $ARCH = 's390x' ]; then
|
||||
- title=$(echo $banner | sed 's/ /_/g')
|
||||
- else
|
||||
- title="$banner ($version)"
|
||||
- fi
|
||||
- elif [ $ARCH = 's390' -o $ARCH = 's390x' ]; then
|
||||
- title=$(echo $version | sed 's/ /_/g')
|
||||
- elif [ -f /etc/os-release ]; then
|
||||
- . /etc/os-release
|
||||
- title="$NAME ($version) $VERSION"
|
||||
- elif [ -f /etc/redhat-release ]; then
|
||||
- title="$(sed 's/ release.*$//' < /etc/redhat-release) ($version)"
|
||||
- else
|
||||
- title="Red Hat Linux ($version)"
|
||||
- fi
|
||||
-
|
||||
+ set_title
|
||||
|
||||
if [ -n "$cfgGrub" ]; then
|
||||
[ -n "$verbose" ] && echo "adding $version to $grubConfig"
|
||||
|
||||
- $grubby --grub -c $grubConfig \
|
||||
- --add-kernel=$kernelImage \
|
||||
- $INITRD --copy-default $makedefault --title "$title" \
|
||||
- ${mbkernel:+--add-multiboot="$mbkernel"} ${mbargs:+--mbargs="$mbargs"} \
|
||||
- --args="root=$rootdevice $kernargs" --remove-kernel="TITLE=$title"
|
||||
+ ARGS="--grub -c $grubConfig --add-kernel=$kernelImage $INITRD \
|
||||
+ ${mbkernel:+--add-multiboot=\"$mbkernel\"} \
|
||||
+ ${mbargs:+--mbargs=\"$mbargs\"} \
|
||||
+ --title=\"$title\$debugtitle\" --copy-default \
|
||||
+ --args=\"root=$rootdevice $kernargs \$debugargs\" \
|
||||
+ --remove-kernel=\"TITLE=$title\$debugtitle\""
|
||||
+
|
||||
+ rungrubby --debug ${ARGS}
|
||||
+ rungrubby ${ARGS} $makedefault
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$grubConfig does not exist, not running grubby for grub 0.97"
|
||||
fi
|
||||
if [ -n "$cfgGrub2" ]; then
|
||||
[ -n "$verbose" ] && echo "adding $version to $grub2Config"
|
||||
|
||||
- $grubby --grub2 -c $grub2Config \
|
||||
- --add-kernel=$kernelImage \
|
||||
- $INITRD --copy-default $makedefault --title "$title" \
|
||||
- ${mbkernel:+--add-multiboot="$mbkernel"} \
|
||||
- ${mbargs:+--mbargs="$mbargs"} \
|
||||
- --args="root=$rootdevice $kernargs" --remove-kernel="TITLE=$title"
|
||||
+ ARGS="--grub2 -c $grub2Config --add-kernel=$kernelImage $INITRD \
|
||||
+ --copy-default --title \"$title\$debugtitle\" \
|
||||
+ ${mbkernel:+--add-multiboot=\"$mbkernel\"} \
|
||||
+ ${mbargs:+--mbargs=\"$mbargs\"} \
|
||||
+ --args=\"root=$rootdevice $kernargs \$debugargs\" \
|
||||
+ --remove-kernel=\"TITLE=$title\$debugtitle\""
|
||||
+ rungrubby --debug ${ARGS}
|
||||
+ rungrubby ${ARGS} $makedefault
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$grub2Config does not exist, not running grubby for grub 2"
|
||||
fi
|
||||
if [ -n "$cfgGrub2Efi" ]; then
|
||||
[ -n "$verbose" ] && echo "adding $version to $grub2EfiConfig"
|
||||
|
||||
- $grubby --grub2 -c $grub2EfiConfig --efi \
|
||||
- --add-kernel=$kernelImage $DEVTREE \
|
||||
- $INITRD --copy-default $makedefault --title "$title" \
|
||||
- ${mbkernel:+--add-multiboot="$mbkernel"} \
|
||||
- ${mbargs:+--mbargs="$mbargs"} \
|
||||
- --args="root=$rootdevice $kernargs" --remove-kernel="TITLE=$title"
|
||||
+ ARGS="--grub2 -c $grub2EfiConfig --efi \
|
||||
+ --add-kernel=$kernelImage $DEVTREE $INITRD \
|
||||
+ --copy-default --title \"$title\$debugtitle\" \
|
||||
+ ${mbkernel:+--add-multiboot=\"$mbkernel\"} \
|
||||
+ ${mbargs:+--mbargs=\"$mbargs\"} \
|
||||
+ --args=\"root=$rootdevice $kernargs \$debugargs\" \
|
||||
+ --remove-kernel=\"TITLE=$title\$debugtitle\""
|
||||
+ rungrubby --debug ${ARGS}
|
||||
+ rungrubby ${ARGS} $makedefault
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$grub2EfiConfig does not exist, not running grubby for grub 2 with UEFI"
|
||||
fi
|
||||
@@ -242,12 +271,15 @@ install() {
|
||||
if [ -n "$cfgLilo" ]; then
|
||||
[ -n "$verbose" ] && echo "adding $version to $liloConfig"
|
||||
|
||||
- $grubby --add-kernel=$kernelImage $INITRD \
|
||||
- --copy-default $makedefault --title "$title" \
|
||||
- ${mbkernel:+--add-multiboot="$mbkernel"} ${mbargs:+--mbargs="$mbargs"} \
|
||||
- --args="root=$rootdevice $kernargs" --remove-kernel="TITLE=$version" \
|
||||
- --$liloFlag
|
||||
+ ARGS="--$liloFlag --add-kernel=$kernelImage $INITRD \
|
||||
+ --copy-default --title \"$title\$debugtitle\" \
|
||||
+ ${mbkernel:+--add-multiboot=\"$mbkernel\"} \
|
||||
+ ${mbargs:+--mbargs=\"$mbargs\"} \
|
||||
+ --args=\"root=$rootdevice $kernargs \$debugargs\" \
|
||||
+ --remove-kernel=\"TITLE=$version\""
|
||||
|
||||
+ rungrubby --debug ${ARGS}
|
||||
+ rungrubby ${ARGS} $makedefault
|
||||
if [ -n "$runLilo" ]; then
|
||||
[ -n "$verbose" ] && echo "running $lilo"
|
||||
if [ ! -x $lilo ] ; then
|
||||
@@ -263,11 +295,15 @@ install() {
|
||||
if [ -n "$cfgExtlinux" ]; then
|
||||
[ -n "$verbose" ] && echo "adding $version to $extlinuxConfig"
|
||||
|
||||
- $grubby --extlinux -c $extlinuxConfig \
|
||||
- --add-kernel=$kernelImage \
|
||||
- $INITRD --copy-default $makedefault --title "$title" \
|
||||
- ${mbkernel:+--add-multiboot="$mbkernel"} ${mbargs:+--mbargs="$mbargs"} \
|
||||
- --args="root=$rootdevice $kernargs" --remove-kernel="TITLE=$title"
|
||||
+ ARGS="--extlinux -c $extlinuxConfig --add-kernel=$kernelImage \
|
||||
+ $INITRD --copy-default --title \"$title\$debugtitle\" \
|
||||
+ ${mbkernel:+--add-multiboot=\"$mbkernel\"} \
|
||||
+ ${mbargs:+--mbargs=\"$mbargs\"} \
|
||||
+ --args=\"root=$rootdevice $kernargs \$debugargs\" \
|
||||
+ --remove-kernel=\"TITLE=$title\$debugtitle\""
|
||||
+
|
||||
+ rungrubby --debug ${ARGS}
|
||||
+ rungrubby ${ARGS} $makedefault
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$extlinuxConfig does not exist, not running grubby for extlinux"
|
||||
fi
|
||||
@@ -401,6 +437,8 @@ update() {
|
||||
return
|
||||
fi
|
||||
|
||||
+ set_title
|
||||
+
|
||||
INITRD=""
|
||||
if [ -f $initrdfile ]; then
|
||||
[ -n "$verbose" ] && echo "found $initrdfile and using it with grubby"
|
||||
@@ -413,45 +451,53 @@ update() {
|
||||
|
||||
if [ -n "$cfgGrub" ]; then
|
||||
[ -n "$verbose" ] && echo "updating $version from $grubConfig"
|
||||
- $grubby --grub -c $grubConfig \
|
||||
- --update-kernel=$kernelImage \
|
||||
- $INITRD \
|
||||
- ${kernargs:+--args="$kernargs"} \
|
||||
- ${removeargs:+--remove-args="$removeargs"} \
|
||||
- ${mbkernel:+--add-multiboot="$mbkernel"}
|
||||
+ ARGS="--grub -c $grubConfig --update-kernel=$kernelImage $INITRD \
|
||||
+ ${kernargs:+--args=\"$kernargs\"} \
|
||||
+ ${removeargs:+--remove-args=\"$removeargs\"} \
|
||||
+ ${mbkernel:+--add-multiboot=\"$mbkernel\"} \
|
||||
+ --title=\"$title\$debugtitle\""
|
||||
+
|
||||
+ rungrubby --debug ${ARGS}
|
||||
+ rungrubby ${ARGS}
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$grubConfig does not exist, not running grubby"
|
||||
fi
|
||||
|
||||
if [ -n "$cfgGrub2" ]; then
|
||||
[ -n "$verbose" ] && echo "updating $version from $grub2Config"
|
||||
- $grubby --grub2 -c $grub2Config \
|
||||
- --update-kernel=$kernelImage \
|
||||
- $INITRD \
|
||||
- ${kernargs:+--args="$kernargs"} \
|
||||
- ${removeargs:+--remove-args="$removeargs"}
|
||||
+ ARGS="--grub2 -c $grub2Config --update-kernel=$kernelImage $INITRD \
|
||||
+ ${kernargs:+--args=\"$kernargs\"} \
|
||||
+ ${removeargs:+--remove-args=\"$removeargs\"} \
|
||||
+ --title=\"$title\$debugtitle\""
|
||||
+
|
||||
+ rungrubby --debug ${ARGS}
|
||||
+ rungrubby ${ARGS}
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$grub2Config does not exist, not running grubby"
|
||||
fi
|
||||
|
||||
if [ -n "$cfgGrub2Efi" ]; then
|
||||
[ -n "$verbose" ] && echo "updating $version from $grub2EfiConfig"
|
||||
- $grubby --grub2 -c $grub2EfiConfig --efi \
|
||||
- --update-kernel=$kernelImage \
|
||||
- $INITRD \
|
||||
- ${kernargs:+--args="$kernargs"} \
|
||||
- ${removeargs:+--remove-args="$removeargs"}
|
||||
+ ARGS="--grub2 -c $grub2EfiConfig --efi --update-kernel=$kernelImage \
|
||||
+ $INITRD ${kernargs:+--args=\"$kernargs\"} \
|
||||
+ ${removeargs:+--remove-args=\"$removeargs\"} \
|
||||
+ --title=\"$title\$debugtitle\""
|
||||
+
|
||||
+ rungrubby --debug ${ARGS}
|
||||
+ rungrubby ${ARGS}
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$grub2EfiConfig does not exist, not running grubby"
|
||||
fi
|
||||
|
||||
if [ -n "$cfgLilo" ]; then
|
||||
[ -n "$verbose" ] && echo "updating $version from $liloConfig"
|
||||
- $grubby --update-kernel=$kernelImage \
|
||||
- $INITRD \
|
||||
- ${kernargs:+--args="$kernargs"} \
|
||||
- ${removeargs:+--remove-args="$removeargs"} \
|
||||
- --$liloFlag
|
||||
+ ARGS="--$liloFlag --update-kernel=$kernelImage $INITRD \
|
||||
+ ${kernargs:+--args=\"$kernargs\"} \
|
||||
+ ${removeargs:+--remove-args=\"$removeargs\"} \
|
||||
+ --title=\"$title\$debugtitle\""
|
||||
+
|
||||
+ rungrubby --debug ${ARGS}
|
||||
+ rungrubby ${ARGS}
|
||||
|
||||
if [ -n "$runLilo" ]; then
|
||||
[ -n "$verbose" ] && echo "running $lilo"
|
||||
@@ -497,11 +543,13 @@ update() {
|
||||
|
||||
if [ -n "$cfgExtlinux" ]; then
|
||||
[ -n "$verbose" ] && echo "updating $version from $extlinuxConfig"
|
||||
- $grubby --extlinux -c $extlinuxConfig \
|
||||
- --update-kernel=$kernelImage \
|
||||
- $INITRD \
|
||||
- ${kernargs:+--args="$kernargs"} \
|
||||
- ${removeargs:+--remove-args="$removeargs"}
|
||||
+ ARGS="--extlinux -c $extlinuxConfig --update-kernel=$kernelImage \
|
||||
+ $INITRD ${kernargs:+--args=\"$kernargs\"} \
|
||||
+ ${removeargs:+--remove-args=\"$removeargs\"} \
|
||||
+ --title=\"$title\$debugtitle\""
|
||||
+
|
||||
+ rungrubby --debug ${ARGS}
|
||||
+ rungrubby ${ARGS}
|
||||
else
|
||||
[ -n "$verbose" ] && echo "$extlinuxConfig does not exist, not running grubby"
|
||||
fi
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,23 +1,23 @@
|
||||
From aa7af717b8855bcfb9a95b80931b8ff319112b88 Mon Sep 17 00:00:00 2001
|
||||
From eb141563832f803abdfc1fde83fbfcc9031794b3 Mon Sep 17 00:00:00 2001
|
||||
From: Dennis Gilmore <dennis@ausil.us>
|
||||
Date: Fri, 10 Oct 2014 02:06:52 -0500
|
||||
Subject: [PATCH 1/3] Add --devtree support to extlinux (#1088933)
|
||||
Subject: [PATCH 08/10] Add --devtree support to extlinux (#1088933)
|
||||
|
||||
On 32 bit arm it needs the path to the dtb. This adds support for the
|
||||
fdt command to the extlinux handling. If --devtree /path/to/dtb/file.dtb
|
||||
is passed grubby will add or updated it.
|
||||
---
|
||||
grubby.c | 1 +
|
||||
new-kernel-pkg | 23 ++++++++++++++++++++---
|
||||
new-kernel-pkg | 20 ++++++++++++++++++--
|
||||
test.sh | 5 +++++
|
||||
test/extlinux.5 | 21 +++++++++++++++++++++
|
||||
test/results/add/extlinux5.1 | 21 +++++++++++++++++++++
|
||||
5 files changed, 68 insertions(+), 3 deletions(-)
|
||||
5 files changed, 66 insertions(+), 2 deletions(-)
|
||||
create mode 100644 test/extlinux.5
|
||||
create mode 100644 test/results/add/extlinux5.1
|
||||
|
||||
diff --git a/grubby.c b/grubby.c
|
||||
index 27b4547..bbe54b6 100644
|
||||
index b202b6e..cbb1cca 100644
|
||||
--- a/grubby.c
|
||||
+++ b/grubby.c
|
||||
@@ -581,6 +581,7 @@ struct keywordTypes extlinuxKeywords[] = {
|
||||
@ -29,36 +29,19 @@ index 27b4547..bbe54b6 100644
|
||||
};
|
||||
int useextlinuxmenu;
|
||||
diff --git a/new-kernel-pkg b/new-kernel-pkg
|
||||
index 70f6118..9784f2b 100755
|
||||
index d9a9b67..0f21e39 100755
|
||||
--- a/new-kernel-pkg
|
||||
+++ b/new-kernel-pkg
|
||||
@@ -7,7 +7,7 @@
|
||||
# run of depmod/removal of depmod generated files
|
||||
# addition/removal of kernel images from grub/lilo configuration (via grubby)
|
||||
#
|
||||
-# Copyright 2002-2008 Red Hat, Inc. All rights reserved.
|
||||
+# Copyright 2002-2014 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -113,6 +113,7 @@ dracut=""
|
||||
dracuthostonly=""
|
||||
initrdfile=""
|
||||
devtreefile=""
|
||||
+devtreedir=""
|
||||
moddep=""
|
||||
verbose=""
|
||||
makedefault=""
|
||||
@@ -296,7 +297,7 @@ install() {
|
||||
[ -n "$verbose" ] && echo "adding $version to $extlinuxConfig"
|
||||
@@ -265,7 +265,7 @@ install() {
|
||||
|
||||
ARGS="--extlinux -c $extlinuxConfig --add-kernel=$kernelImage \
|
||||
- $INITRD --copy-default --title \"$title\$debugtitle\" \
|
||||
+ $DEVTREE $INITRD --copy-default --title \"$title\$debugtitle\" \
|
||||
${mbkernel:+--add-multiboot=\"$mbkernel\"} \
|
||||
${mbargs:+--mbargs=\"$mbargs\"} \
|
||||
--args=\"root=$rootdevice $kernargs \$debugargs\" \
|
||||
@@ -449,6 +450,12 @@ update() {
|
||||
$grubby --extlinux -c $extlinuxConfig \
|
||||
--add-kernel=$kernelImage \
|
||||
- $INITRD --copy-default $makedefault --title "$title" \
|
||||
+ $DEVTREE $INITRD --copy-default $makedefault --title "$title" \
|
||||
${mbkernel:+--add-multiboot="$mbkernel"} ${mbargs:+--mbargs="$mbargs"} \
|
||||
--args="root=$rootdevice $kernargs" --remove-kernel="TITLE=$title"
|
||||
else
|
||||
@@ -411,6 +411,12 @@ update() {
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -70,27 +53,27 @@ index 70f6118..9784f2b 100755
|
||||
+
|
||||
if [ -n "$cfgGrub" ]; then
|
||||
[ -n "$verbose" ] && echo "updating $version from $grubConfig"
|
||||
ARGS="--grub -c $grubConfig --update-kernel=$kernelImage $INITRD \
|
||||
@@ -544,7 +551,7 @@ update() {
|
||||
if [ -n "$cfgExtlinux" ]; then
|
||||
$grubby --grub -c $grubConfig \
|
||||
@@ -499,7 +505,7 @@ update() {
|
||||
[ -n "$verbose" ] && echo "updating $version from $extlinuxConfig"
|
||||
ARGS="--extlinux -c $extlinuxConfig --update-kernel=$kernelImage \
|
||||
- $INITRD ${kernargs:+--args=\"$kernargs\"} \
|
||||
+ $DEVTREE $INITRD ${kernargs:+--args=\"$kernargs\"} \
|
||||
${removeargs:+--remove-args=\"$removeargs\"} \
|
||||
--title=\"$title\$debugtitle\""
|
||||
|
||||
@@ -772,6 +779,16 @@ if [ -z "$initrdfile" ]; then
|
||||
$grubby --extlinux -c $extlinuxConfig \
|
||||
--update-kernel=$kernelImage \
|
||||
- $INITRD \
|
||||
+ $DEVTREE $INITRD \
|
||||
${kernargs:+--args="$kernargs"} \
|
||||
${removeargs:+--remove-args="$removeargs"}
|
||||
else
|
||||
@@ -724,6 +730,16 @@ if [ -z "$initrdfile" ]; then
|
||||
fi
|
||||
[ -n "$verbose" ] && echo "initrdfile is $initrdfile"
|
||||
|
||||
+if [[ ${ARCH} =~ armv[5|7].*l ]]; then
|
||||
+ if [ -d "$bootPrefix/dtb-$version/" ]; then
|
||||
+ devtreedir="$bootPrefix/dtb-$version/"
|
||||
+ if [ -n "$dtbfile" -a -f "$devtreedir/$dtbfile" ]; then
|
||||
+ devtreefile="$devtreedir/$dtbfile"
|
||||
+ if [ -d "$bootPrefix/dtb-$version/" ]; then
|
||||
+ devtreedir="$bootPrefix/dtb-$version/"
|
||||
+ if [ -n "$dtbfile" -a -f "$devtreedir/$dtbfile" ]; then
|
||||
+ devtreefile="$devtreedir/$dtbfile"
|
||||
+ fi
|
||||
+ fi
|
||||
+ fi
|
||||
+fi
|
||||
+[ -n "$verbose" ] && echo "devtreedir is $devtreedir"
|
||||
+
|
||||
@ -168,5 +151,5 @@ index 0000000..5e97883
|
||||
+initrd /initramfs-3.15.0-0.rc1.git0.1.fc21.armv7hl.img
|
||||
+
|
||||
--
|
||||
2.1.0
|
||||
1.9.3
|
||||
|
@ -1,62 +0,0 @@
|
||||
From 65d2f744f9546dd0ef24d4579ca722afadf41c52 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Thu, 25 Sep 2014 13:24:15 -0400
|
||||
Subject: [PATCH 9/9] Always error check getLineByType()
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
grubby.c | 20 +++++++++++++++-----
|
||||
1 file changed, 15 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/grubby.c b/grubby.c
|
||||
index 855464a..27b4547 100644
|
||||
--- a/grubby.c
|
||||
+++ b/grubby.c
|
||||
@@ -2369,9 +2369,11 @@ void displayEntry(struct singleEntry * entry, const char * prefix, int index) {
|
||||
} else {
|
||||
char * title;
|
||||
line = getLineByType(LT_MENUENTRY, entry->lines);
|
||||
- title = grub2ExtractTitle(line);
|
||||
- if (title)
|
||||
- printf("title=%s\n", title);
|
||||
+ if (!line) {
|
||||
+ title = grub2ExtractTitle(line);
|
||||
+ if (title)
|
||||
+ printf("title=%s\n", title);
|
||||
+ }
|
||||
}
|
||||
|
||||
for (j = 0, line = entry->lines; line; line = line->next) {
|
||||
@@ -3322,9 +3324,13 @@ int addMBInitrd(struct grubConfig * cfg, const char *newMBKernel,
|
||||
|
||||
/* if title is supplied, the entry's title must match it. */
|
||||
if (title) {
|
||||
+ char *linetitle;
|
||||
+
|
||||
line = getLineByType(LT_TITLE|LT_MENUENTRY, entry->lines);
|
||||
- char *linetitle = extractTitle(line);
|
||||
+ if (!line)
|
||||
+ continue;
|
||||
|
||||
+ linetitle = extractTitle(line);
|
||||
if (!linetitle)
|
||||
continue;
|
||||
if (strcmp(title, linetitle)) {
|
||||
@@ -3372,9 +3378,13 @@ int updateInitrd(struct grubConfig * cfg, const char * image,
|
||||
|
||||
/* if title is supplied, the entry's title must match it. */
|
||||
if (title) {
|
||||
+ char *linetitle;
|
||||
+
|
||||
line = getLineByType(LT_TITLE|LT_MENUENTRY, entry->lines);
|
||||
- char *linetitle = extractTitle(line);
|
||||
+ if (!line)
|
||||
+ continue;
|
||||
|
||||
+ linetitle = extractTitle(line);
|
||||
if (!linetitle)
|
||||
continue;
|
||||
if (strcmp(title, linetitle)) {
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 1ea4401882f2863ae5c5313c3b28645c60fc93b3 Mon Sep 17 00:00:00 2001
|
||||
From 69dbfdc99ce993d541984f7305bb1206858f4bcf Mon Sep 17 00:00:00 2001
|
||||
From: Dennis Gilmore <dennis@ausil.us>
|
||||
Date: Fri, 10 Oct 2014 01:38:27 -0500
|
||||
Subject: [PATCH 2/3] add support for devicetree directories for use on arm
|
||||
Subject: [PATCH 09/10] add support for devicetree directories for use on arm
|
||||
|
||||
---
|
||||
grubby.c | 3 +++
|
||||
@ -14,7 +14,7 @@ Subject: [PATCH 2/3] add support for devicetree directories for use on arm
|
||||
create mode 100644 test/results/add/extlinux6.1
|
||||
|
||||
diff --git a/grubby.c b/grubby.c
|
||||
index bbe54b6..8a8df98 100644
|
||||
index cbb1cca..a4a9811 100644
|
||||
--- a/grubby.c
|
||||
+++ b/grubby.c
|
||||
@@ -582,6 +582,7 @@ struct keywordTypes extlinuxKeywords[] = {
|
||||
@ -25,7 +25,7 @@ index bbe54b6..8a8df98 100644
|
||||
{ NULL, 0, 0 },
|
||||
};
|
||||
int useextlinuxmenu;
|
||||
@@ -4269,6 +4270,8 @@ int main(int argc, const char ** argv) {
|
||||
@@ -4232,6 +4233,8 @@ int main(int argc, const char ** argv) {
|
||||
_("display the title of the default kernel") },
|
||||
{ "devtree", 0, POPT_ARG_STRING, &newDevTreePath, 0,
|
||||
_("device tree file for new stanza"), _("dtb-path") },
|
||||
@ -35,10 +35,10 @@ index bbe54b6..8a8df98 100644
|
||||
_("configure elilo bootloader") },
|
||||
{ "efi", 0, POPT_ARG_NONE, &isEfi, 0,
|
||||
diff --git a/new-kernel-pkg b/new-kernel-pkg
|
||||
index 9784f2b..8d55abf 100755
|
||||
index 0f21e39..31976a7 100755
|
||||
--- a/new-kernel-pkg
|
||||
+++ b/new-kernel-pkg
|
||||
@@ -131,7 +131,7 @@ usage() {
|
||||
@@ -128,7 +128,7 @@ usage() {
|
||||
echo " [--banner=<banner>] [--multiboot=multiboot]" >&2
|
||||
echo " [--mbargs=mbargs] [--make-default] [--add-dracut-args]" >&2
|
||||
echo " [--add-plymouth-initrd]" >&2
|
||||
@ -47,18 +47,18 @@ index 9784f2b..8d55abf 100755
|
||||
echo " <--install | --remove | --update | --rpmposttrans> <kernel-version>" >&2
|
||||
echo " (ex: `basename $0` --mkinitrd --depmod --install 2.4.7-2)" >&2
|
||||
exit 1
|
||||
@@ -191,11 +191,17 @@ install() {
|
||||
@@ -153,11 +153,17 @@ install() {
|
||||
fi
|
||||
|
||||
DEVTREE=""
|
||||
- if [ "x$devtreefile" != "x" -a -f "$devtreefile" ]; then
|
||||
+ if [ -n $devtreefile -a -f "$devtreefile" ]; then
|
||||
+ if [ -n "$devtreefile" -a -f "$devtreefile" ]; then
|
||||
[ -n "$verbose" ] && echo "found $devtreefile and using it with grubby"
|
||||
DEVTREE="--devtree $devtreefile"
|
||||
fi
|
||||
|
||||
+ DEVTREEDIR=""
|
||||
+ if [ -n $devtreedir -a -d "$devtreedir" ]; then
|
||||
+ if [ -n "$devtreedir" -a -d "$devtreedir" ]; then
|
||||
+ [ -n "$verbose" ] && echo "found $devtreedir and using it with grubby"
|
||||
+ DEVTREEDIR="--devtreedir $devtreedir"
|
||||
+ fi
|
||||
@ -66,44 +66,44 @@ index 9784f2b..8d55abf 100755
|
||||
# FIXME: is this a good heuristic to find out if we're on iSeries?
|
||||
if [ -d /proc/iSeries ]; then
|
||||
[ -n "$verbose" ] && echo "On an iSeries, just making img file"
|
||||
@@ -297,7 +303,7 @@ install() {
|
||||
@@ -264,7 +270,7 @@ install() {
|
||||
[ -n "$verbose" ] && echo "adding $version to $extlinuxConfig"
|
||||
|
||||
ARGS="--extlinux -c $extlinuxConfig --add-kernel=$kernelImage \
|
||||
- $DEVTREE $INITRD --copy-default --title \"$title\$debugtitle\" \
|
||||
+ $DEVTREE $DEVTREEDIR $INITRD --copy-default --title \"$title\$debugtitle\" \
|
||||
${mbkernel:+--add-multiboot=\"$mbkernel\"} \
|
||||
${mbargs:+--mbargs=\"$mbargs\"} \
|
||||
--args=\"root=$rootdevice $kernargs \$debugargs\" \
|
||||
@@ -451,11 +457,17 @@ update() {
|
||||
$grubby --extlinux -c $extlinuxConfig \
|
||||
- --add-kernel=$kernelImage \
|
||||
+ --add-kernel=$kernelImage $DEVTREEDIR \
|
||||
$DEVTREE $INITRD --copy-default $makedefault --title "$title" \
|
||||
${mbkernel:+--add-multiboot="$mbkernel"} ${mbargs:+--mbargs="$mbargs"} \
|
||||
--args="root=$rootdevice $kernargs" --remove-kernel="TITLE=$title"
|
||||
@@ -412,11 +418,17 @@ update() {
|
||||
fi
|
||||
|
||||
DEVTREE=""
|
||||
- if [ "x$devtreefile" != "x" -a -f "$devtreefile" ]; then
|
||||
+ if [ -n $devtreefile -a -f "$devtreefile" ]; then
|
||||
+ if [ -n "$devtreefile" -a -f "$devtreefile" ]; then
|
||||
[ -n "$verbose" ] && echo "found $devtreefile and using it with grubby"
|
||||
DEVTREE="--devtree $devtreefile"
|
||||
fi
|
||||
|
||||
+ DEVTREEDIR=""
|
||||
+ if [ -n $devtreedir -a -d "$devtreedir" ]; then
|
||||
+ [ -n "$verbose" ] && echo "found $devtreedir and using it with grubby"
|
||||
+ DEVTREEDIR="--devtreedir $devtreedir"
|
||||
+ if [ -n "$devtreedir" -a -d "$devtreedir" ]; then
|
||||
+ [ -n "$verbose" ] && echo "found $devtreedir and using it with grubby"
|
||||
+ DEVTREEDIR="--devtreedir $devtreedir"
|
||||
+ fi
|
||||
+
|
||||
if [ -n "$cfgGrub" ]; then
|
||||
[ -n "$verbose" ] && echo "updating $version from $grubConfig"
|
||||
ARGS="--grub -c $grubConfig --update-kernel=$kernelImage $INITRD \
|
||||
@@ -551,7 +563,7 @@ update() {
|
||||
if [ -n "$cfgExtlinux" ]; then
|
||||
$grubby --grub -c $grubConfig \
|
||||
@@ -505,7 +517,7 @@ update() {
|
||||
[ -n "$verbose" ] && echo "updating $version from $extlinuxConfig"
|
||||
ARGS="--extlinux -c $extlinuxConfig --update-kernel=$kernelImage \
|
||||
- $DEVTREE $INITRD ${kernargs:+--args=\"$kernargs\"} \
|
||||
+ $DEVTREE $DEVTREEDIR $INITRD ${kernargs:+--args=\"$kernargs\"} \
|
||||
${removeargs:+--remove-args=\"$removeargs\"} \
|
||||
--title=\"$title\$debugtitle\""
|
||||
|
||||
@@ -615,6 +627,15 @@ while [ $# -gt 0 ]; do
|
||||
$grubby --extlinux -c $extlinuxConfig \
|
||||
--update-kernel=$kernelImage \
|
||||
- $DEVTREE $INITRD \
|
||||
+ $DEVTREE $DEVTREEDIR $INITRD \
|
||||
${kernargs:+--args="$kernargs"} \
|
||||
${removeargs:+--remove-args="$removeargs"}
|
||||
else
|
||||
@@ -566,6 +578,15 @@ while [ $# -gt 0 ]; do
|
||||
fi
|
||||
;;
|
||||
|
||||
@ -190,5 +190,5 @@ index 0000000..ec2a2ea
|
||||
+initrd /initramfs-3.15.0-0.rc1.git0.1.fc21.armv7hl.img
|
||||
+
|
||||
--
|
||||
2.1.0
|
||||
1.9.3
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 595f8d2d3681d684dbb12eff32bf1a68636db977 Mon Sep 17 00:00:00 2001
|
||||
From 354c873f633db124d214da8a1258e32fe210c7cb Mon Sep 17 00:00:00 2001
|
||||
From: Dennis Gilmore <dennis@ausil.us>
|
||||
Date: Thu, 9 Oct 2014 01:42:03 -0500
|
||||
Subject: [PATCH 3/3] cleanup dtb handling to work in the supported usecases
|
||||
Subject: [PATCH 10/10] cleanup dtb handling to work in the supported usecases
|
||||
|
||||
add SHIPSDTB variable in the uboot defaults file that needs to be set to yes for
|
||||
platforms like the calxeda highbank that ship a dtb in u-boot that we want to use.
|
||||
@ -13,26 +13,26 @@ with an fdt entry otherwise update a fdtdir entry unless SHIPSDTB is set to yes.
|
||||
2 files changed, 12 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/new-kernel-pkg b/new-kernel-pkg
|
||||
index 8d55abf..e02f65c 100755
|
||||
index 31976a7..311deda 100755
|
||||
--- a/new-kernel-pkg
|
||||
+++ b/new-kernel-pkg
|
||||
@@ -801,14 +801,16 @@ fi
|
||||
@@ -752,14 +752,16 @@ fi
|
||||
[ -n "$verbose" ] && echo "initrdfile is $initrdfile"
|
||||
|
||||
if [[ ${ARCH} =~ armv[5|7].*l ]]; then
|
||||
- if [ -d "$bootPrefix/dtb-$version/" ]; then
|
||||
- devtreedir="$bootPrefix/dtb-$version/"
|
||||
- if [ -n "$dtbfile" -a -f "$devtreedir/$dtbfile" ]; then
|
||||
- devtreefile="$devtreedir/$dtbfile"
|
||||
+ if [ -z "$SHIPSDTB" -o "$SHIPSDTB" != "yes" ]; then
|
||||
+ if [ -n "$dtbfile" -a -f "$bootPrefix/dtb-$version/$dtbfile" ]; then
|
||||
+ devtreefile="$bootPrefix/dtb-$version/$dtbfile"
|
||||
+ [ -n "$verbose" ] && echo "devtreefile is $devtreefile"
|
||||
+ elif [ -d "$bootPrefix/dtb-$version/" ]; then
|
||||
+ devtreedir="$bootPrefix/dtb-$version/"
|
||||
+ [ -n "$verbose" ] && echo "devtreedir is $devtreedir"
|
||||
- if [ -d "$bootPrefix/dtb-$version/" ]; then
|
||||
- devtreedir="$bootPrefix/dtb-$version/"
|
||||
- if [ -n "$dtbfile" -a -f "$devtreedir/$dtbfile" ]; then
|
||||
- devtreefile="$devtreedir/$dtbfile"
|
||||
+ if [ -z "$SHIPSDTB" -o "$SHIPSDTB" != "yes" ]; then
|
||||
+ if [ -n "$dtbfile" -a -f "$bootPrefix/dtb-$version/$dtbfile" ]; then
|
||||
+ devtreefile="$bootPrefix/dtb-$version/$dtbfile"
|
||||
+ [ -n "$verbose" ] && echo "devtreefile is $devtreefile"
|
||||
+ elif [ -d "$bootPrefix/dtb-$version/" ]; then
|
||||
+ devtreedir="$bootPrefix/dtb-$version/"
|
||||
+ [ -n "$verbose" ] && echo "devtreedir is $devtreedir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
-[ -n "$verbose" ] && echo "devtreedir is $devtreedir"
|
||||
|
||||
@ -52,5 +52,5 @@ index aa663ad..07d8671 100644
|
||||
+# option to tell new-kernel-pkg a specific dtb file to load in extlinux.conf
|
||||
+#dtbfile=foo.dtb
|
||||
--
|
||||
2.1.0
|
||||
1.9.3
|
||||
|
20
grubby.spec
20
grubby.spec
@ -1,6 +1,6 @@
|
||||
Name: grubby
|
||||
Version: 8.35
|
||||
Release: 6%{?dist}
|
||||
Release: 7%{?dist}
|
||||
Summary: Command line tool for updating bootloader configs
|
||||
Group: System Environment/Base
|
||||
License: GPLv2+
|
||||
@ -14,13 +14,11 @@ Patch0002: 0002-Add-bls-test-harness-bits.patch
|
||||
Patch0003: 0003-grubby-fix-initrd-updating-when-multiboot-exist.patch
|
||||
Patch0004: 0004-Tell-a-slightly-better-fib-about-default-bootloader-.patch
|
||||
Patch0005: 0005-Make-findTemplate-actually-return-the-saved-default.patch
|
||||
Patch0006: 0006-Support-filtering-update-kernel-by-title-as-well.patch
|
||||
Patch0007: 0007-Conditionally-create-debug-entries-when-installing-k.patch
|
||||
Patch0008: 0008-Revert-Add-bls-test-harness-bits.patch
|
||||
Patch0009: 0009-Always-error-check-getLineByType.patch
|
||||
Patch0010: 0001-Add-devtree-support-to-extlinux-1088933.patch
|
||||
Patch0011: 0002-add-support-for-devicetree-directories-for-use-on-ar.patch
|
||||
Patch0012: 0003-cleanup-dtb-handling-to-work-in-the-supported-usecas.patch
|
||||
Patch0006: 0006-Revert-Add-bls-test-harness-bits.patch
|
||||
Patch0007: 0007-Always-error-check-getLineByType.patch
|
||||
Patch0008: 0008-Add-devtree-support-to-extlinux-1088933.patch
|
||||
Patch0009: 0009-add-support-for-devicetree-directories-for-use-on-ar.patch
|
||||
Patch0010: 0010-cleanup-dtb-handling-to-work-in-the-supported-usecas.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: pkgconfig glib2-devel popt-devel
|
||||
@ -90,6 +88,12 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Oct 16 2014 Peter Jones <pjones@redhat.com> - 8.35-7
|
||||
- Revert "debug" image creation for now
|
||||
Resolves: rhbz#1153410
|
||||
- Fix minor quoting errors in dtbdir code
|
||||
Resolves: rhbz#1088933
|
||||
|
||||
* Wed Oct 15 2014 Peter Jones <pjones@redhat.com> - 8.35-6
|
||||
- Update grubby to support device tree options for arm. Again.
|
||||
Resolves: rhbz#1088933
|
||||
|
Loading…
Reference in New Issue
Block a user