[PATCH RFC] module-setup.sh: install usb serial driver for ttyUSB0
by Dave Young
In case one want to use usb serial console, we need to pack the usb serial
driver into kdump initramfs so that one can see the console output on the usb
console.
I only handled ttyUSB0, this is like a hard code, but it should be enough for
most cases. Also only install the driver for the ttyUSB0 device.
Tested with adding "console=ttyUSB0" in 2nd kernel commandline.
Tested latest F22 kernel, there's CONFIG_USB_SERIAL_CONSOLE=y, kdump work ok.
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
dracut-module-setup.sh | 8 ++++++++
1 file changed, 8 insertions(+)
--- kexec-tools.orig/dracut-module-setup.sh
+++ kexec-tools/dracut-module-setup.sh
@@ -626,4 +626,12 @@ installkernel() {
[ "$wdt" = "iTCO_wdt" ] && instmods lpc_ich
instmods $wdt
fi
+
+ if [ -c /dev/ttyUSB0 ]; then
+ _majmin=$(get_maj_min /dev/ttyUSB0)
+
+ _driver=$(readlink /sys/dev/char/$_majmin/device/driver)
+ _driver=$(basename $_driver)
+ instmods $_driver
+ fi
}
7 years, 3 months
[PATCH 0/2] kdumpctl: force rebuild when dump target is modified
by Pratyush Anand
When dump target is re-formatted then its UUID changes. These patches add
support to recognize such changes and then force initramfs rebuild, if
dracut argument has an UUID based root location.
Pratyush Anand (2):
kdumpctl: force rebuild in case of dynamic system modification
kdumpctl: force rebuild in case of dump target modification
kdumpctl | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
--
2.5.0
7 years, 5 months
kdump daemon not starting
by Ronit Halder
I am installed kdump in fedora 23 in efi (workstation edition).
But it isn't starting and systemctl status kdump.service showing (in
log.txt)
My /boot/grub2/grub.cfg attached below.
7 years, 5 months
[PATCH update] ppc64le: fix kexec hang due to ppc64 elf abi breakage
by Dave Young
Fixes Fedora bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1310495
kexec kernel hangs in ppc64le test. It is caused by kexec does not support
abi v2 properly.
Backport upstream patches below fixes the issue:
There is no code conflicts.
commit 3debb8cf3272216119cb2e59a4963ce3c18fe8e3
Author: Alan Modra <amodra(a)gmail.com>
Date: Fri Feb 26 18:06:15 2016 +1100
Properly align powerpc64 .toc
gcc leaves .toc byte aligned, relying on the linker to align the section.
* kexec/arch/ppc64/kexec-elf-rel-ppc64.c (machine_verify_elf_rel):
Fudge alignment of .toc section.
Signed-off-by: Alan Modra <amodra(a)gmail.com>
Signed-off-by: Anton Blanchard <anton(a)samba.org>
Tested-by: Dave Young <dyoung(a)redhat.com>
Signed-off-by: Simon Horman <horms(a)verge.net.au>
commit 1e423dc297d10eb7ff25c829d2856ef12fc81d77
Author: Anton Blanchard <anton(a)samba.org>
Date: Fri Feb 26 18:04:16 2016 +1100
ppc64: purgatory: Handle local symbols in ELF ABIv2
The PowerPC64 ELF ABIv2 has the concept of global and local symbols
and information on this is encoded in sym->st_other. When doing a
R_PPC64_REL24 branch we want to hit the local entry point, so adjust
it as necessary.
Signed-off-by: Anton Blanchard <anton(a)samba.org>
Tested-by: Dave Young <dyoung(a)redhat.com>
Signed-off-by: Simon Horman <horms(a)verge.net.au>
commit 4a2ae3a39c64dc43e9d094be9541253234ff4822
Author: Anton Blanchard <anton(a)samba.org>
Date: Fri Feb 26 18:03:11 2016 +1100
Pass struct mem_sym into machine_apply_elf_rel()
On PowerPC64 ABIv2 we need to look at the symbol to determine
if it has a local entry point. Pass struct mem_sym into
machine_apply_elf_rel() so we can.
Signed-off-by: Anton Blanchard <anton(a)samba.org>
Tested-by: Dave Young <dyoung(a)redhat.com>
Signed-off-by: Simon Horman <horms(a)verge.net.au>
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
...struct-mem_sym-into-machine_apply_elf_rel.patch | 231 +++++++++++++++++++++
...ools-2.0.12-Properly-align-powerpc64-.toc.patch | 69 ++++++
...rgatory-Handle-local-symbols-in-ELF-ABIv2.patch | 57 +++++
kexec-tools.spec | 6 +
4 files changed, 363 insertions(+)
create mode 100644 kexec-tools-2.0.12-Pass-struct-mem_sym-into-machine_apply_elf_rel.patch
create mode 100644 kexec-tools-2.0.12-Properly-align-powerpc64-.toc.patch
create mode 100644 kexec-tools-2.0.12-ppc64-purgatory-Handle-local-symbols-in-ELF-ABIv2.patch
diff --git a/kexec-tools-2.0.12-Pass-struct-mem_sym-into-machine_apply_elf_rel.patch b/kexec-tools-2.0.12-Pass-struct-mem_sym-into-machine_apply_elf_rel.patch
new file mode 100644
index 0000000..3d72611
--- /dev/null
+++ b/kexec-tools-2.0.12-Pass-struct-mem_sym-into-machine_apply_elf_rel.patch
@@ -0,0 +1,231 @@
+From 4a2ae3a39c64dc43e9d094be9541253234ff4822 Mon Sep 17 00:00:00 2001
+From: Anton Blanchard <anton(a)samba.org>
+Date: Fri, 26 Feb 2016 18:03:11 +1100
+Subject: [PATCH 1/3] Pass struct mem_sym into machine_apply_elf_rel()
+
+On PowerPC64 ABIv2 we need to look at the symbol to determine
+if it has a local entry point. Pass struct mem_sym into
+machine_apply_elf_rel() so we can.
+
+Signed-off-by: Anton Blanchard <anton(a)samba.org>
+Tested-by: Dave Young <dyoung(a)redhat.com>
+Signed-off-by: Simon Horman <horms(a)verge.net.au>
+---
+ kexec/arch/arm/kexec-elf-rel-arm.c | 5 +++--
+ kexec/arch/cris/kexec-elf-rel-cris.c | 5 +++--
+ kexec/arch/i386/kexec-elf-rel-x86.c | 5 +++--
+ kexec/arch/ia64/kexec-elf-rel-ia64.c | 5 +++--
+ kexec/arch/m68k/kexec-elf-rel-m68k.c | 4 +++-
+ kexec/arch/mips/kexec-elf-rel-mips.c | 4 +++-
+ kexec/arch/ppc/kexec-elf-rel-ppc.c | 5 +++--
+ kexec/arch/ppc64/kexec-elf-rel-ppc64.c | 5 +++--
+ kexec/arch/s390/kexec-elf-rel-s390.c | 3 ++-
+ kexec/arch/sh/kexec-elf-rel-sh.c | 5 +++--
+ kexec/arch/x86_64/kexec-elf-rel-x86_64.c | 5 +++--
+ kexec/kexec-elf-rel.c | 2 +-
+ kexec/kexec-elf.h | 5 +++--
+ 13 files changed, 36 insertions(+), 22 deletions(-)
+
+diff --git a/kexec/arch/arm/kexec-elf-rel-arm.c b/kexec/arch/arm/kexec-elf-rel-arm.c
+index 214f0cc..a939cf4 100644
+--- a/kexec/arch/arm/kexec-elf-rel-arm.c
++++ b/kexec/arch/arm/kexec-elf-rel-arm.c
+@@ -18,8 +18,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *location,
++ unsigned long address, unsigned long value)
+ {
+ switch(r_type) {
+ case R_ARM_ABS32:
+diff --git a/kexec/arch/cris/kexec-elf-rel-cris.c b/kexec/arch/cris/kexec-elf-rel-cris.c
+index c4427cc..255cc2c 100644
+--- a/kexec/arch/cris/kexec-elf-rel-cris.c
++++ b/kexec/arch/cris/kexec-elf-rel-cris.c
+@@ -29,8 +29,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *location,
++ unsigned long address, unsigned long value)
+ {
+ switch(r_type) {
+
+diff --git a/kexec/arch/i386/kexec-elf-rel-x86.c b/kexec/arch/i386/kexec-elf-rel-x86.c
+index fdc3d52..55a214e 100644
+--- a/kexec/arch/i386/kexec-elf-rel-x86.c
++++ b/kexec/arch/i386/kexec-elf-rel-x86.c
+@@ -18,8 +18,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *location,
++ unsigned long address, unsigned long value)
+ {
+ switch(r_type) {
+ case R_386_32:
+diff --git a/kexec/arch/ia64/kexec-elf-rel-ia64.c b/kexec/arch/ia64/kexec-elf-rel-ia64.c
+index cfb1061..f847626 100644
+--- a/kexec/arch/ia64/kexec-elf-rel-ia64.c
++++ b/kexec/arch/ia64/kexec-elf-rel-ia64.c
+@@ -72,8 +72,9 @@ bundle (const uint64_t insn)
+ return insn & ~0xfUL;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *location,
++ unsigned long address, unsigned long value)
+ {
+ uint64_t gp_value = ehdr->rel_addr + 0x200000;
+ switch(r_type) {
+diff --git a/kexec/arch/m68k/kexec-elf-rel-m68k.c b/kexec/arch/m68k/kexec-elf-rel-m68k.c
+index fa12a16..0cc38cc 100644
+--- a/kexec/arch/m68k/kexec-elf-rel-m68k.c
++++ b/kexec/arch/m68k/kexec-elf-rel-m68k.c
+@@ -23,7 +23,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym),
++ unsigned long r_type,
+ void *UNUSED(location),
+ unsigned long UNUSED(address),
+ unsigned long UNUSED(value))
+diff --git a/kexec/arch/mips/kexec-elf-rel-mips.c b/kexec/arch/mips/kexec-elf-rel-mips.c
+index 6f43639..5bc22d5 100644
+--- a/kexec/arch/mips/kexec-elf-rel-mips.c
++++ b/kexec/arch/mips/kexec-elf-rel-mips.c
+@@ -29,7 +29,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym),
++ unsigned long r_type,
+ void *UNUSED(location),
+ unsigned long UNUSED(address),
+ unsigned long UNUSED(value))
+diff --git a/kexec/arch/ppc/kexec-elf-rel-ppc.c b/kexec/arch/ppc/kexec-elf-rel-ppc.c
+index 90a66f4..1acbd86 100644
+--- a/kexec/arch/ppc/kexec-elf-rel-ppc.c
++++ b/kexec/arch/ppc/kexec-elf-rel-ppc.c
+@@ -17,8 +17,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *location,
++ unsigned long address, unsigned long value)
+ {
+ switch(r_type) {
+ case R_PPC_ADDR32:
+diff --git a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+index 9b191d0..8604c4f 100644
+--- a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
++++ b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+@@ -63,8 +63,9 @@ static void do_relative_toc(unsigned long value, uint16_t *location,
+ *location = (*location & ~mask) | (value & mask);
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *sym,
++ unsigned long r_type, void *location, unsigned long address,
++ unsigned long value)
+ {
+ switch(r_type) {
+ case R_PPC64_ADDR32:
+diff --git a/kexec/arch/s390/kexec-elf-rel-s390.c b/kexec/arch/s390/kexec-elf-rel-s390.c
+index 80bcd1b..a5e1b73 100644
+--- a/kexec/arch/s390/kexec-elf-rel-s390.c
++++ b/kexec/arch/s390/kexec-elf-rel-s390.c
+@@ -23,7 +23,8 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *ehdr,
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym),
+ unsigned long r_type,
+ void *loc,
+ unsigned long address,
+diff --git a/kexec/arch/sh/kexec-elf-rel-sh.c b/kexec/arch/sh/kexec-elf-rel-sh.c
+index 0bfc45e..3993ee8 100644
+--- a/kexec/arch/sh/kexec-elf-rel-sh.c
++++ b/kexec/arch/sh/kexec-elf-rel-sh.c
+@@ -28,8 +28,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
+- void *orig_loc, unsigned long UNUSED(address), unsigned long relocation)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *orig_loc,
++ unsigned long UNUSED(address), unsigned long relocation)
+ {
+ uint32_t *location = orig_loc;
+ uint32_t value;
+diff --git a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+index c795037..7fdde73 100644
+--- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
++++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+@@ -57,8 +57,9 @@ static const char *reloc_name(unsigned long r_type)
+ return name;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *location,
++ unsigned long address, unsigned long value)
+ {
+ dbgprintf("%s\n", reloc_name(r_type));
+ switch(r_type) {
+diff --git a/kexec/kexec-elf-rel.c b/kexec/kexec-elf-rel.c
+index c625f30..9a6e63d 100644
+--- a/kexec/kexec-elf-rel.c
++++ b/kexec/kexec-elf-rel.c
+@@ -408,7 +408,7 @@ int elf_rel_load(struct mem_ehdr *ehdr, struct kexec_info *info,
+ dbgprintf("sym: %s value: %lx addr: %lx\n",
+ name, value, address);
+
+- machine_apply_elf_rel(ehdr, rel.r_type,
++ machine_apply_elf_rel(ehdr, &sym, rel.r_type,
+ (void *)location, address, value);
+ }
+ }
+diff --git a/kexec/kexec-elf.h b/kexec/kexec-elf.h
+index d0e9dc0..1164db4 100644
+--- a/kexec/kexec-elf.h
++++ b/kexec/kexec-elf.h
+@@ -129,7 +129,8 @@ unsigned long elf_max_addr(const struct mem_ehdr *ehdr);
+
+ /* Architecture specific helper functions */
+ extern int machine_verify_elf_rel(struct mem_ehdr *ehdr);
+-extern void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
+- void *location, unsigned long address, unsigned long value);
++extern void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *sym,
++ unsigned long r_type, void *location, unsigned long address,
++ unsigned long value);
+ #endif /* KEXEC_ELF_H */
+
+--
+2.5.0
+
diff --git a/kexec-tools-2.0.12-Properly-align-powerpc64-.toc.patch b/kexec-tools-2.0.12-Properly-align-powerpc64-.toc.patch
new file mode 100644
index 0000000..5316e53
--- /dev/null
+++ b/kexec-tools-2.0.12-Properly-align-powerpc64-.toc.patch
@@ -0,0 +1,69 @@
+From 3debb8cf3272216119cb2e59a4963ce3c18fe8e3 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra(a)gmail.com>
+Date: Fri, 26 Feb 2016 18:06:15 +1100
+Subject: [PATCH 3/3] Properly align powerpc64 .toc
+
+gcc leaves .toc byte aligned, relying on the linker to align the section.
+
+ * kexec/arch/ppc64/kexec-elf-rel-ppc64.c (machine_verify_elf_rel):
+ Fudge alignment of .toc section.
+
+Signed-off-by: Alan Modra <amodra(a)gmail.com>
+Signed-off-by: Anton Blanchard <anton(a)samba.org>
+Tested-by: Dave Young <dyoung(a)redhat.com>
+Signed-off-by: Simon Horman <horms(a)verge.net.au>
+---
+ kexec/arch/ppc64/kexec-elf-rel-ppc64.c | 30 ++++++++++++++++++------------
+ 1 file changed, 18 insertions(+), 12 deletions(-)
+
+diff --git a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+index 43851f6..5f8e3f2 100644
+--- a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
++++ b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+@@ -23,18 +23,6 @@ static unsigned int local_entry_offset(struct mem_sym *UNUSED(sym))
+ }
+ #endif
+
+-int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+-{
+- if (ehdr->ei_class != ELFCLASS64) {
+- return 0;
+- }
+- if (ehdr->e_machine != EM_PPC64) {
+- return 0;
+- }
+-
+- return 1;
+-}
+-
+ static struct mem_shdr *toc_section(const struct mem_ehdr *ehdr)
+ {
+ struct mem_shdr *shdr, *shdr_end;
+@@ -52,6 +40,24 @@ static struct mem_shdr *toc_section(const struct mem_ehdr *ehdr)
+ return NULL;
+ }
+
++int machine_verify_elf_rel(struct mem_ehdr *ehdr)
++{
++ struct mem_shdr *toc;
++
++ if (ehdr->ei_class != ELFCLASS64) {
++ return 0;
++ }
++ if (ehdr->e_machine != EM_PPC64) {
++ return 0;
++ }
++
++ /* Ensure .toc is sufficiently aligned. */
++ toc = toc_section(ehdr);
++ if (toc && toc->sh_addralign < 256)
++ toc->sh_addralign = 256;
++ return 1;
++}
++
+ /* r2 is the TOC pointer: it actually points 0x8000 into the TOC (this
+ gives the value maximum span in an instruction which uses a signed
+ offset) */
+--
+2.5.0
+
diff --git a/kexec-tools-2.0.12-ppc64-purgatory-Handle-local-symbols-in-ELF-ABIv2.patch b/kexec-tools-2.0.12-ppc64-purgatory-Handle-local-symbols-in-ELF-ABIv2.patch
new file mode 100644
index 0000000..d513030
--- /dev/null
+++ b/kexec-tools-2.0.12-ppc64-purgatory-Handle-local-symbols-in-ELF-ABIv2.patch
@@ -0,0 +1,57 @@
+From 1e423dc297d10eb7ff25c829d2856ef12fc81d77 Mon Sep 17 00:00:00 2001
+From: Anton Blanchard <anton(a)samba.org>
+Date: Fri, 26 Feb 2016 18:04:16 +1100
+Subject: [PATCH 2/3] ppc64: purgatory: Handle local symbols in ELF ABIv2
+
+The PowerPC64 ELF ABIv2 has the concept of global and local symbols
+and information on this is encoded in sym->st_other. When doing a
+R_PPC64_REL24 branch we want to hit the local entry point, so adjust
+it as necessary.
+
+Signed-off-by: Anton Blanchard <anton(a)samba.org>
+Tested-by: Dave Young <dyoung(a)redhat.com>
+Signed-off-by: Simon Horman <horms(a)verge.net.au>
+---
+ kexec/arch/ppc64/kexec-elf-rel-ppc64.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+index 8604c4f..43851f6 100644
+--- a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
++++ b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+@@ -5,6 +5,24 @@
+ #include "../../kexec-elf.h"
+ #include "kexec-ppc64.h"
+
++#if defined(_CALL_ELF) && _CALL_ELF == 2
++#define STO_PPC64_LOCAL_BIT 5
++#define STO_PPC64_LOCAL_MASK (7 << STO_PPC64_LOCAL_BIT)
++#define PPC64_LOCAL_ENTRY_OFFSET(other) \
++ (((1 << (((other) & STO_PPC64_LOCAL_MASK) >> STO_PPC64_LOCAL_BIT)) >> 2) << 2)
++
++static unsigned int local_entry_offset(struct mem_sym *sym)
++{
++ /* If this symbol has a local entry point, use it. */
++ return PPC64_LOCAL_ENTRY_OFFSET(sym->st_other);
++}
++#else
++static unsigned int local_entry_offset(struct mem_sym *UNUSED(sym))
++{
++ return 0;
++}
++#endif
++
+ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ {
+ if (ehdr->ei_class != ELFCLASS64) {
+@@ -114,6 +132,7 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *sym,
+ break;
+
+ case R_PPC64_REL24:
++ value += local_entry_offset(sym);
+ /* Convert value to relative */
+ value -= address;
+ if (value + 0x2000000 > 0x3ffffff || (value & 3) != 0) {
+--
+2.5.0
+
diff --git a/kexec-tools.spec b/kexec-tools.spec
index c740e54..8326e69 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -70,6 +70,9 @@ ExcludeArch: aarch64
#
# Patches 301 through 400 are meant for ppc64 kexec-tools enablement
#
+Patch501: kexec-tools-2.0.12-Pass-struct-mem_sym-into-machine_apply_elf_rel.patch
+Patch502: kexec-tools-2.0.12-ppc64-purgatory-Handle-local-symbols-in-ELF-ABIv2.patch
+Patch503: kexec-tools-2.0.12-Properly-align-powerpc64-.toc.patch
#
# Patches 401 through 500 are meant for s390 kexec-tools enablement
@@ -105,6 +108,9 @@ tar -z -x -v -f %{SOURCE19}
tar -z -x -v -f %{SOURCE23}
+%patch501 -p1
+%patch502 -p1
+%patch503 -p1
%patch601 -p1
%ifarch ppc
--
2.5.0
7 years, 6 months
[PATCH] ppc64le: fix kexec hang due to ppc64 elf abi breakage
by Dave Young
Fixes below fedora bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1310495
kexec kernel hangs in ppc64le test. It is caused by kexec does not support
abi v2 properly.
Backport upstream patches below fixes the issue:
There are no code conflicts.
commit 3debb8cf3272216119cb2e59a4963ce3c18fe8e3
Author: Alan Modra <amodra(a)gmail.com>
Date: Fri Feb 26 18:06:15 2016 +1100
Properly align powerpc64 .toc
gcc leaves .toc byte aligned, relying on the linker to align the section.
* kexec/arch/ppc64/kexec-elf-rel-ppc64.c (machine_verify_elf_rel):
Fudge alignment of .toc section.
Signed-off-by: Alan Modra <amodra(a)gmail.com>
Signed-off-by: Anton Blanchard <anton(a)samba.org>
Tested-by: Dave Young <dyoung(a)redhat.com>
Signed-off-by: Simon Horman <horms(a)verge.net.au>
commit 1e423dc297d10eb7ff25c829d2856ef12fc81d77
Author: Anton Blanchard <anton(a)samba.org>
Date: Fri Feb 26 18:04:16 2016 +1100
ppc64: purgatory: Handle local symbols in ELF ABIv2
The PowerPC64 ELF ABIv2 has the concept of global and local symbols
and information on this is encoded in sym->st_other. When doing a
R_PPC64_REL24 branch we want to hit the local entry point, so adjust
it as necessary.
Signed-off-by: Anton Blanchard <anton(a)samba.org>
Tested-by: Dave Young <dyoung(a)redhat.com>
Signed-off-by: Simon Horman <horms(a)verge.net.au>
commit 4a2ae3a39c64dc43e9d094be9541253234ff4822
Author: Anton Blanchard <anton(a)samba.org>
Date: Fri Feb 26 18:03:11 2016 +1100
Pass struct mem_sym into machine_apply_elf_rel()
On PowerPC64 ABIv2 we need to look at the symbol to determine
if it has a local entry point. Pass struct mem_sym into
machine_apply_elf_rel() so we can.
Signed-off-by: Anton Blanchard <anton(a)samba.org>
Tested-by: Dave Young <dyoung(a)redhat.com>
Signed-off-by: Simon Horman <horms(a)verge.net.au>
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
...struct-mem_sym-into-machine_apply_elf_rel.patch | 231 +++++++++++++++++++++
...ools-2.0.12-Properly-align-powerpc64-.toc.patch | 69 ++++++
...rgatory-Handle-local-symbols-in-ELF-ABIv2.patch | 57 +++++
kexec-tools.spec | 7 +-
4 files changed, 363 insertions(+), 1 deletion(-)
create mode 100644 kexec-tools-2.0.12-Pass-struct-mem_sym-into-machine_apply_elf_rel.patch
create mode 100644 kexec-tools-2.0.12-Properly-align-powerpc64-.toc.patch
create mode 100644 kexec-tools-2.0.12-ppc64-purgatory-Handle-local-symbols-in-ELF-ABIv2.patch
diff --git a/kexec-tools-2.0.12-Pass-struct-mem_sym-into-machine_apply_elf_rel.patch b/kexec-tools-2.0.12-Pass-struct-mem_sym-into-machine_apply_elf_rel.patch
new file mode 100644
index 0000000..3d72611
--- /dev/null
+++ b/kexec-tools-2.0.12-Pass-struct-mem_sym-into-machine_apply_elf_rel.patch
@@ -0,0 +1,231 @@
+From 4a2ae3a39c64dc43e9d094be9541253234ff4822 Mon Sep 17 00:00:00 2001
+From: Anton Blanchard <anton(a)samba.org>
+Date: Fri, 26 Feb 2016 18:03:11 +1100
+Subject: [PATCH 1/3] Pass struct mem_sym into machine_apply_elf_rel()
+
+On PowerPC64 ABIv2 we need to look at the symbol to determine
+if it has a local entry point. Pass struct mem_sym into
+machine_apply_elf_rel() so we can.
+
+Signed-off-by: Anton Blanchard <anton(a)samba.org>
+Tested-by: Dave Young <dyoung(a)redhat.com>
+Signed-off-by: Simon Horman <horms(a)verge.net.au>
+---
+ kexec/arch/arm/kexec-elf-rel-arm.c | 5 +++--
+ kexec/arch/cris/kexec-elf-rel-cris.c | 5 +++--
+ kexec/arch/i386/kexec-elf-rel-x86.c | 5 +++--
+ kexec/arch/ia64/kexec-elf-rel-ia64.c | 5 +++--
+ kexec/arch/m68k/kexec-elf-rel-m68k.c | 4 +++-
+ kexec/arch/mips/kexec-elf-rel-mips.c | 4 +++-
+ kexec/arch/ppc/kexec-elf-rel-ppc.c | 5 +++--
+ kexec/arch/ppc64/kexec-elf-rel-ppc64.c | 5 +++--
+ kexec/arch/s390/kexec-elf-rel-s390.c | 3 ++-
+ kexec/arch/sh/kexec-elf-rel-sh.c | 5 +++--
+ kexec/arch/x86_64/kexec-elf-rel-x86_64.c | 5 +++--
+ kexec/kexec-elf-rel.c | 2 +-
+ kexec/kexec-elf.h | 5 +++--
+ 13 files changed, 36 insertions(+), 22 deletions(-)
+
+diff --git a/kexec/arch/arm/kexec-elf-rel-arm.c b/kexec/arch/arm/kexec-elf-rel-arm.c
+index 214f0cc..a939cf4 100644
+--- a/kexec/arch/arm/kexec-elf-rel-arm.c
++++ b/kexec/arch/arm/kexec-elf-rel-arm.c
+@@ -18,8 +18,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *location,
++ unsigned long address, unsigned long value)
+ {
+ switch(r_type) {
+ case R_ARM_ABS32:
+diff --git a/kexec/arch/cris/kexec-elf-rel-cris.c b/kexec/arch/cris/kexec-elf-rel-cris.c
+index c4427cc..255cc2c 100644
+--- a/kexec/arch/cris/kexec-elf-rel-cris.c
++++ b/kexec/arch/cris/kexec-elf-rel-cris.c
+@@ -29,8 +29,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *location,
++ unsigned long address, unsigned long value)
+ {
+ switch(r_type) {
+
+diff --git a/kexec/arch/i386/kexec-elf-rel-x86.c b/kexec/arch/i386/kexec-elf-rel-x86.c
+index fdc3d52..55a214e 100644
+--- a/kexec/arch/i386/kexec-elf-rel-x86.c
++++ b/kexec/arch/i386/kexec-elf-rel-x86.c
+@@ -18,8 +18,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *location,
++ unsigned long address, unsigned long value)
+ {
+ switch(r_type) {
+ case R_386_32:
+diff --git a/kexec/arch/ia64/kexec-elf-rel-ia64.c b/kexec/arch/ia64/kexec-elf-rel-ia64.c
+index cfb1061..f847626 100644
+--- a/kexec/arch/ia64/kexec-elf-rel-ia64.c
++++ b/kexec/arch/ia64/kexec-elf-rel-ia64.c
+@@ -72,8 +72,9 @@ bundle (const uint64_t insn)
+ return insn & ~0xfUL;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *location,
++ unsigned long address, unsigned long value)
+ {
+ uint64_t gp_value = ehdr->rel_addr + 0x200000;
+ switch(r_type) {
+diff --git a/kexec/arch/m68k/kexec-elf-rel-m68k.c b/kexec/arch/m68k/kexec-elf-rel-m68k.c
+index fa12a16..0cc38cc 100644
+--- a/kexec/arch/m68k/kexec-elf-rel-m68k.c
++++ b/kexec/arch/m68k/kexec-elf-rel-m68k.c
+@@ -23,7 +23,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym),
++ unsigned long r_type,
+ void *UNUSED(location),
+ unsigned long UNUSED(address),
+ unsigned long UNUSED(value))
+diff --git a/kexec/arch/mips/kexec-elf-rel-mips.c b/kexec/arch/mips/kexec-elf-rel-mips.c
+index 6f43639..5bc22d5 100644
+--- a/kexec/arch/mips/kexec-elf-rel-mips.c
++++ b/kexec/arch/mips/kexec-elf-rel-mips.c
+@@ -29,7 +29,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym),
++ unsigned long r_type,
+ void *UNUSED(location),
+ unsigned long UNUSED(address),
+ unsigned long UNUSED(value))
+diff --git a/kexec/arch/ppc/kexec-elf-rel-ppc.c b/kexec/arch/ppc/kexec-elf-rel-ppc.c
+index 90a66f4..1acbd86 100644
+--- a/kexec/arch/ppc/kexec-elf-rel-ppc.c
++++ b/kexec/arch/ppc/kexec-elf-rel-ppc.c
+@@ -17,8 +17,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *location,
++ unsigned long address, unsigned long value)
+ {
+ switch(r_type) {
+ case R_PPC_ADDR32:
+diff --git a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+index 9b191d0..8604c4f 100644
+--- a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
++++ b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+@@ -63,8 +63,9 @@ static void do_relative_toc(unsigned long value, uint16_t *location,
+ *location = (*location & ~mask) | (value & mask);
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *sym,
++ unsigned long r_type, void *location, unsigned long address,
++ unsigned long value)
+ {
+ switch(r_type) {
+ case R_PPC64_ADDR32:
+diff --git a/kexec/arch/s390/kexec-elf-rel-s390.c b/kexec/arch/s390/kexec-elf-rel-s390.c
+index 80bcd1b..a5e1b73 100644
+--- a/kexec/arch/s390/kexec-elf-rel-s390.c
++++ b/kexec/arch/s390/kexec-elf-rel-s390.c
+@@ -23,7 +23,8 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *ehdr,
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym),
+ unsigned long r_type,
+ void *loc,
+ unsigned long address,
+diff --git a/kexec/arch/sh/kexec-elf-rel-sh.c b/kexec/arch/sh/kexec-elf-rel-sh.c
+index 0bfc45e..3993ee8 100644
+--- a/kexec/arch/sh/kexec-elf-rel-sh.c
++++ b/kexec/arch/sh/kexec-elf-rel-sh.c
+@@ -28,8 +28,9 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ return 1;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
+- void *orig_loc, unsigned long UNUSED(address), unsigned long relocation)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *orig_loc,
++ unsigned long UNUSED(address), unsigned long relocation)
+ {
+ uint32_t *location = orig_loc;
+ uint32_t value;
+diff --git a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+index c795037..7fdde73 100644
+--- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
++++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+@@ -57,8 +57,9 @@ static const char *reloc_name(unsigned long r_type)
+ return name;
+ }
+
+-void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr), unsigned long r_type,
+- void *location, unsigned long address, unsigned long value)
++void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
++ struct mem_sym *UNUSED(sym), unsigned long r_type, void *location,
++ unsigned long address, unsigned long value)
+ {
+ dbgprintf("%s\n", reloc_name(r_type));
+ switch(r_type) {
+diff --git a/kexec/kexec-elf-rel.c b/kexec/kexec-elf-rel.c
+index c625f30..9a6e63d 100644
+--- a/kexec/kexec-elf-rel.c
++++ b/kexec/kexec-elf-rel.c
+@@ -408,7 +408,7 @@ int elf_rel_load(struct mem_ehdr *ehdr, struct kexec_info *info,
+ dbgprintf("sym: %s value: %lx addr: %lx\n",
+ name, value, address);
+
+- machine_apply_elf_rel(ehdr, rel.r_type,
++ machine_apply_elf_rel(ehdr, &sym, rel.r_type,
+ (void *)location, address, value);
+ }
+ }
+diff --git a/kexec/kexec-elf.h b/kexec/kexec-elf.h
+index d0e9dc0..1164db4 100644
+--- a/kexec/kexec-elf.h
++++ b/kexec/kexec-elf.h
+@@ -129,7 +129,8 @@ unsigned long elf_max_addr(const struct mem_ehdr *ehdr);
+
+ /* Architecture specific helper functions */
+ extern int machine_verify_elf_rel(struct mem_ehdr *ehdr);
+-extern void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
+- void *location, unsigned long address, unsigned long value);
++extern void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *sym,
++ unsigned long r_type, void *location, unsigned long address,
++ unsigned long value);
+ #endif /* KEXEC_ELF_H */
+
+--
+2.5.0
+
diff --git a/kexec-tools-2.0.12-Properly-align-powerpc64-.toc.patch b/kexec-tools-2.0.12-Properly-align-powerpc64-.toc.patch
new file mode 100644
index 0000000..5316e53
--- /dev/null
+++ b/kexec-tools-2.0.12-Properly-align-powerpc64-.toc.patch
@@ -0,0 +1,69 @@
+From 3debb8cf3272216119cb2e59a4963ce3c18fe8e3 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra(a)gmail.com>
+Date: Fri, 26 Feb 2016 18:06:15 +1100
+Subject: [PATCH 3/3] Properly align powerpc64 .toc
+
+gcc leaves .toc byte aligned, relying on the linker to align the section.
+
+ * kexec/arch/ppc64/kexec-elf-rel-ppc64.c (machine_verify_elf_rel):
+ Fudge alignment of .toc section.
+
+Signed-off-by: Alan Modra <amodra(a)gmail.com>
+Signed-off-by: Anton Blanchard <anton(a)samba.org>
+Tested-by: Dave Young <dyoung(a)redhat.com>
+Signed-off-by: Simon Horman <horms(a)verge.net.au>
+---
+ kexec/arch/ppc64/kexec-elf-rel-ppc64.c | 30 ++++++++++++++++++------------
+ 1 file changed, 18 insertions(+), 12 deletions(-)
+
+diff --git a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+index 43851f6..5f8e3f2 100644
+--- a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
++++ b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+@@ -23,18 +23,6 @@ static unsigned int local_entry_offset(struct mem_sym *UNUSED(sym))
+ }
+ #endif
+
+-int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+-{
+- if (ehdr->ei_class != ELFCLASS64) {
+- return 0;
+- }
+- if (ehdr->e_machine != EM_PPC64) {
+- return 0;
+- }
+-
+- return 1;
+-}
+-
+ static struct mem_shdr *toc_section(const struct mem_ehdr *ehdr)
+ {
+ struct mem_shdr *shdr, *shdr_end;
+@@ -52,6 +40,24 @@ static struct mem_shdr *toc_section(const struct mem_ehdr *ehdr)
+ return NULL;
+ }
+
++int machine_verify_elf_rel(struct mem_ehdr *ehdr)
++{
++ struct mem_shdr *toc;
++
++ if (ehdr->ei_class != ELFCLASS64) {
++ return 0;
++ }
++ if (ehdr->e_machine != EM_PPC64) {
++ return 0;
++ }
++
++ /* Ensure .toc is sufficiently aligned. */
++ toc = toc_section(ehdr);
++ if (toc && toc->sh_addralign < 256)
++ toc->sh_addralign = 256;
++ return 1;
++}
++
+ /* r2 is the TOC pointer: it actually points 0x8000 into the TOC (this
+ gives the value maximum span in an instruction which uses a signed
+ offset) */
+--
+2.5.0
+
diff --git a/kexec-tools-2.0.12-ppc64-purgatory-Handle-local-symbols-in-ELF-ABIv2.patch b/kexec-tools-2.0.12-ppc64-purgatory-Handle-local-symbols-in-ELF-ABIv2.patch
new file mode 100644
index 0000000..d513030
--- /dev/null
+++ b/kexec-tools-2.0.12-ppc64-purgatory-Handle-local-symbols-in-ELF-ABIv2.patch
@@ -0,0 +1,57 @@
+From 1e423dc297d10eb7ff25c829d2856ef12fc81d77 Mon Sep 17 00:00:00 2001
+From: Anton Blanchard <anton(a)samba.org>
+Date: Fri, 26 Feb 2016 18:04:16 +1100
+Subject: [PATCH 2/3] ppc64: purgatory: Handle local symbols in ELF ABIv2
+
+The PowerPC64 ELF ABIv2 has the concept of global and local symbols
+and information on this is encoded in sym->st_other. When doing a
+R_PPC64_REL24 branch we want to hit the local entry point, so adjust
+it as necessary.
+
+Signed-off-by: Anton Blanchard <anton(a)samba.org>
+Tested-by: Dave Young <dyoung(a)redhat.com>
+Signed-off-by: Simon Horman <horms(a)verge.net.au>
+---
+ kexec/arch/ppc64/kexec-elf-rel-ppc64.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+index 8604c4f..43851f6 100644
+--- a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
++++ b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
+@@ -5,6 +5,24 @@
+ #include "../../kexec-elf.h"
+ #include "kexec-ppc64.h"
+
++#if defined(_CALL_ELF) && _CALL_ELF == 2
++#define STO_PPC64_LOCAL_BIT 5
++#define STO_PPC64_LOCAL_MASK (7 << STO_PPC64_LOCAL_BIT)
++#define PPC64_LOCAL_ENTRY_OFFSET(other) \
++ (((1 << (((other) & STO_PPC64_LOCAL_MASK) >> STO_PPC64_LOCAL_BIT)) >> 2) << 2)
++
++static unsigned int local_entry_offset(struct mem_sym *sym)
++{
++ /* If this symbol has a local entry point, use it. */
++ return PPC64_LOCAL_ENTRY_OFFSET(sym->st_other);
++}
++#else
++static unsigned int local_entry_offset(struct mem_sym *UNUSED(sym))
++{
++ return 0;
++}
++#endif
++
+ int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+ {
+ if (ehdr->ei_class != ELFCLASS64) {
+@@ -114,6 +132,7 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *sym,
+ break;
+
+ case R_PPC64_REL24:
++ value += local_entry_offset(sym);
+ /* Convert value to relative */
+ value -= address;
+ if (value + 0x2000000 > 0x3ffffff || (value & 3) != 0) {
+--
+2.5.0
+
diff --git a/kexec-tools.spec b/kexec-tools.spec
index c740e54..d2a5544 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -77,7 +77,9 @@ ExcludeArch: aarch64
#
# Patches 501 through 600 are meant for ppc kexec-tools enablement
#
-
+Patch501: kexec-tools-2.0.12-Pass-struct-mem_sym-into-machine_apply_elf_rel.patch
+Patch502: kexec-tools-2.0.12-ppc64-purgatory-Handle-local-symbols-in-ELF-ABIv2.patch
+Patch503: kexec-tools-2.0.12-Properly-align-powerpc64-.toc.patch
#
# Patches 601 onward are generic patches
#
@@ -105,6 +107,9 @@ tar -z -x -v -f %{SOURCE19}
tar -z -x -v -f %{SOURCE23}
+%patch501 -p1
+%patch502 -p1
+%patch503 -p1
%patch601 -p1
%ifarch ppc
--
2.5.0
7 years, 6 months
[PATCH] module-setup: Use "ip=" command of the dracut to handle DNS
by Xunlei Pang
Currently kdump uses dracut's "nameserver=" command to hande DNS,
it is acquired both from ifcfg files and "/etc/resolv.conf".
This is improper for dhcp cases, as "/etc/resolv.conf" is generated
by dhcp, the proper logic should be:
1) For static cases, DNS can be acquired from corresponding ifcfg file.
2) For dhcp cases, DNS is normally generated by dhcp, but extra DNS
can still be specified in the ifcfg files mannually.
3) For special user-assigned DNS not specified in any ifcfg file, we can
pass it to dracut via "nameserver=".
This patch improves the logic using the following "ip=" command format
provided by dracut:
ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:
<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
dracut-module-setup.sh | 46 ++++++++++++++++++++++++----------------------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 4cd7107..a18fdc0 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -63,26 +63,19 @@ kdump_is_vlan() {
}
# $1: netdev name
-kdump_setup_dns() {
- local _nameserver _dns
- local _dnsfile=${initdir}/etc/cmdline.d/42dns.conf
- . /etc/sysconfig/network-scripts/ifcfg-$1
-
- [ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile"
- [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile"
+# return pattern ":<dns1>[<:dns2>]" if not ""
+kdump_get_dns_from_ifcfg() {
+ local _dns
- while read content;
- do
- _nameserver=$(echo $content | grep ^nameserver)
- [ -z "$_nameserver" ] && continue
+ unset DNS1 DNS2
+ if [ -e /etc/sysconfig/network-scripts/ifcfg-$1 ]; then
+ . /etc/sysconfig/network-scripts/ifcfg-$1
+ fi
- _dns=$(echo $_nameserver | cut -d' ' -f2)
- [ -z "$_dns" ] && continue
+ [ -n "$DNS1" ] && _dns=${_dns}:$(echo $DNS1)
+ [ -n "$DNS2" ] && _dns=${_dns}:$(echo $DNS2)
- if [ ! -f $_dnsfile ] || [ ! $(cat $_dnsfile | grep -q $_dns) ]; then
- echo "nameserver=$_dns" >> "$_dnsfile"
- fi
- done < "/etc/resolv.conf"
+ echo -n "${_dns}" | cut -d':' -f1,2,3
}
#$1: netdev name
@@ -254,22 +247,27 @@ kdump_setup_znet() {
# Setup dracut to bringup a given network interface
kdump_setup_netdev() {
local _netdev=$1 _srcaddr=$2
- local _static _proto _ip_conf _ip_opts _ifname_opts
+ local _static _proto _ip_conf _ip_opts _ifname_opts _ifcfg_dns
+ local _global_dnsfile=${initdir}/etc/cmdline.d/42dns.conf
if [ "$(uname -m)" = "s390x" ]; then
kdump_setup_znet $_netdev
fi
- _netmac=$(kdump_get_mac_addr $_netdev)
+ # Using below "ip=" command format provided by dracut:
+ # ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:
+ # <interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]
_static=$(kdump_static_ip $_netdev $_srcaddr)
if [ -n "$_static" ]; then
_proto=none
else
_proto=dhcp
+ _static=":::::"
fi
+ _ifcfg_dns=$(kdump_get_dns_from_ifcfg $_netdev)
_ip_conf="${initdir}/etc/cmdline.d/40ip.conf"
- _ip_opts=" ip=${_static}$(kdump_setup_ifname $_netdev):${_proto}"
+ _ip_opts=" ip=${_static}$(kdump_setup_ifname $_netdev):${_proto}${_ifcfg_dns}"
# dracut doesn't allow duplicated configuration for same NIC, even they're exactly the same.
# so we have to avoid adding duplicates
@@ -278,6 +276,12 @@ kdump_setup_netdev() {
if [ ! -f $_ip_conf ] || ! grep -q $_ip_opts $_ip_conf &&\
! grep -q "ip=[^[:space:]]*$_netdev" /proc/cmdline; then
echo "$_ip_opts" >> $_ip_conf
+ # In case of no DNS specified by iscsi.
+ if [ -n "${_ifcfg_dns}" ]; then
+ _ifcfg_dns=${_ifcfg_dns##:}
+ echo "nameserver=${_ifcfg_dns%%:*}" >> ${_global_dnsfile}
+ [ "${_ifcfg_dns}" = "${_ifcfg_dns%%:*}" ] || echo "nameserver=${_ifcfg_dns##*:}" >> ${_global_dnsfile}
+ fi
fi
if kdump_is_bridge "$_netdev"; then
@@ -292,8 +296,6 @@ kdump_setup_netdev() {
_ifname_opts=" ifname=$(kdump_setup_ifname $_netdev):$(kdump_get_mac_addr $_netdev)"
echo "$_ifname_opts" >> $_ip_conf
fi
-
- kdump_setup_dns "$_netdev"
}
get_ip_route_field()
--
1.8.3.1
7 years, 6 months
[PATCH] Document declaration to support iSCSI HBA
by Minfei Huang
Hi, Chris.
Could you help take a look at this patch? Please feel free to
point out if there is somewhere incorrect.
---
iSCSI adapter (also known as iSCSI HBA or iSCSI NIC)
Provides storage area network (SAN) connectivity over TCP/IP and
Ethernet network infrastructure, and offloads the iSCSI and TCP/IP
processing to the adapter to speed performance.
iSCSI boot from iBFT(iSCSI boot from table)
The iSCSI Boot Firmware Table (iBFT) is a component of the ACPI 3.0b
standard that provides operating systems a standard way to boot from
software-initiated iSCSI protocol.
Software iSCSI
Use software initiator to connect SAN server.
For iSCSI adapter, all of iSCSI diskes can be brought up by itself,
without any extra OS's work. It is independent of OS. This type of iSCSI
uses hardware initiator to connect SAN server.
For iSCSI boot from iBFT, iSCSI seesion configuration will be loaded
from firmware firstly, then software iSCSI initiator is used to connect
SAN server.
CC: Chris Leech <cleech(a)redhat.com>
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
supported-kdump-targets.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/supported-kdump-targets.txt b/supported-kdump-targets.txt
index 65c95fc..c4f9fae 100644
--- a/supported-kdump-targets.txt
+++ b/supported-kdump-targets.txt
@@ -41,6 +41,7 @@ storage:
software RAID (mdraid)
hardware RAID (cciss, hpsa, megaraid_sas, mpt2sas, aacraid)
SCSI/SATA disks
+ iSCSI HBA
network:
Hardware using kernel modules: (tg3, igb, ixgbe, sfc, e1000e, bna,
@@ -76,7 +77,7 @@ Unsupported Dump targets
storage:
BIOS RAID
Thin provisioning volume
- hardware iSCSI
+ iSCSI boot from iBFT
FCoE
legacy IDE
glusterfs
--
2.1.0
7 years, 6 months
[PATCH] module-setup: Use "ip=" command of the dracut to handle DNS
by xunlei@fedoraproject.org
From: Xunlei Pang <xunlei(a)fedoraproject.org>
Currently kdump uses dracut's "nameserver=" command to hande DNS,
it is acquired both from ifcfg files and "/etc/resolv.conf".
This is improper for dhcp cases, as "/etc/resolv.conf" is generated
by dhcp, the proper logic should be:
1) For static cases, DNS can be acquired from corresponding ifcfg file.
2) For dhcp cases, DNS is normally generated by dhcp, but extra DNS
can still be specified in the ifcfg files mannually.
3) For special user-assigned DNS not specified in any ifcfg file, we can
pass it to dracut via "nameserver=".
This patch improves the logic using the following "ip=" command format
provided by dracut:
ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:
<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
dracut-module-setup.sh | 46 ++++++++++++++++++++++++----------------------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 4cd7107..a18fdc0 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -63,26 +63,19 @@ kdump_is_vlan() {
}
# $1: netdev name
-kdump_setup_dns() {
- local _nameserver _dns
- local _dnsfile=${initdir}/etc/cmdline.d/42dns.conf
- . /etc/sysconfig/network-scripts/ifcfg-$1
-
- [ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile"
- [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile"
+# return pattern ":<dns1>[<:dns2>]" if not ""
+kdump_get_dns_from_ifcfg() {
+ local _dns
- while read content;
- do
- _nameserver=$(echo $content | grep ^nameserver)
- [ -z "$_nameserver" ] && continue
+ unset DNS1 DNS2
+ if [ -e /etc/sysconfig/network-scripts/ifcfg-$1 ]; then
+ . /etc/sysconfig/network-scripts/ifcfg-$1
+ fi
- _dns=$(echo $_nameserver | cut -d' ' -f2)
- [ -z "$_dns" ] && continue
+ [ -n "$DNS1" ] && _dns=${_dns}:$(echo $DNS1)
+ [ -n "$DNS2" ] && _dns=${_dns}:$(echo $DNS2)
- if [ ! -f $_dnsfile ] || [ ! $(cat $_dnsfile | grep -q $_dns) ]; then
- echo "nameserver=$_dns" >> "$_dnsfile"
- fi
- done < "/etc/resolv.conf"
+ echo -n "${_dns}" | cut -d':' -f1,2,3
}
#$1: netdev name
@@ -254,22 +247,27 @@ kdump_setup_znet() {
# Setup dracut to bringup a given network interface
kdump_setup_netdev() {
local _netdev=$1 _srcaddr=$2
- local _static _proto _ip_conf _ip_opts _ifname_opts
+ local _static _proto _ip_conf _ip_opts _ifname_opts _ifcfg_dns
+ local _global_dnsfile=${initdir}/etc/cmdline.d/42dns.conf
if [ "$(uname -m)" = "s390x" ]; then
kdump_setup_znet $_netdev
fi
- _netmac=$(kdump_get_mac_addr $_netdev)
+ # Using below "ip=" command format provided by dracut:
+ # ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:
+ # <interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]
_static=$(kdump_static_ip $_netdev $_srcaddr)
if [ -n "$_static" ]; then
_proto=none
else
_proto=dhcp
+ _static=":::::"
fi
+ _ifcfg_dns=$(kdump_get_dns_from_ifcfg $_netdev)
_ip_conf="${initdir}/etc/cmdline.d/40ip.conf"
- _ip_opts=" ip=${_static}$(kdump_setup_ifname $_netdev):${_proto}"
+ _ip_opts=" ip=${_static}$(kdump_setup_ifname $_netdev):${_proto}${_ifcfg_dns}"
# dracut doesn't allow duplicated configuration for same NIC, even they're exactly the same.
# so we have to avoid adding duplicates
@@ -278,6 +276,12 @@ kdump_setup_netdev() {
if [ ! -f $_ip_conf ] || ! grep -q $_ip_opts $_ip_conf &&\
! grep -q "ip=[^[:space:]]*$_netdev" /proc/cmdline; then
echo "$_ip_opts" >> $_ip_conf
+ # In case of no DNS specified by iscsi.
+ if [ -n "${_ifcfg_dns}" ]; then
+ _ifcfg_dns=${_ifcfg_dns##:}
+ echo "nameserver=${_ifcfg_dns%%:*}" >> ${_global_dnsfile}
+ [ "${_ifcfg_dns}" = "${_ifcfg_dns%%:*}" ] || echo "nameserver=${_ifcfg_dns##*:}" >> ${_global_dnsfile}
+ fi
fi
if kdump_is_bridge "$_netdev"; then
@@ -292,8 +296,6 @@ kdump_setup_netdev() {
_ifname_opts=" ifname=$(kdump_setup_ifname $_netdev):$(kdump_get_mac_addr $_netdev)"
echo "$_ifname_opts" >> $_ip_conf
fi
-
- kdump_setup_dns "$_netdev"
}
get_ip_route_field()
--
1.8.3.1
7 years, 6 months
[PATCH] module-setup: Use "ip=" command of the dracut to handle DNS
by xunlei@fedoraproject.org
From: Xunlei Pang <xlpang(a)redhat.com>
Currently kdump uses dracut's "nameserver=" command to hande DNS,
it is acquired both from ifcfg files and "/etc/resolv.conf".
This is improper for dhcp cases, as "/etc/resolv.conf" is generated
by dhcp, the proper logic should be:
1) For static cases, DNS can be acquired from corresponding ifcfg file.
2) For dhcp cases, DNS is normally generated by dhcp, but extra DNS
can still be specified in the ifcfg files mannually.
3) For special user-assigned DNS not specified in any ifcfg file, we can
pass it to dracut via "nameserver=".
This patch improves the logic using the following "ip=" command format
provided by dracut:
ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:
<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
dracut-module-setup.sh | 46 ++++++++++++++++++++++++----------------------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 4cd7107..a18fdc0 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -63,26 +63,19 @@ kdump_is_vlan() {
}
# $1: netdev name
-kdump_setup_dns() {
- local _nameserver _dns
- local _dnsfile=${initdir}/etc/cmdline.d/42dns.conf
- . /etc/sysconfig/network-scripts/ifcfg-$1
-
- [ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile"
- [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile"
+# return pattern ":<dns1>[<:dns2>]" if not ""
+kdump_get_dns_from_ifcfg() {
+ local _dns
- while read content;
- do
- _nameserver=$(echo $content | grep ^nameserver)
- [ -z "$_nameserver" ] && continue
+ unset DNS1 DNS2
+ if [ -e /etc/sysconfig/network-scripts/ifcfg-$1 ]; then
+ . /etc/sysconfig/network-scripts/ifcfg-$1
+ fi
- _dns=$(echo $_nameserver | cut -d' ' -f2)
- [ -z "$_dns" ] && continue
+ [ -n "$DNS1" ] && _dns=${_dns}:$(echo $DNS1)
+ [ -n "$DNS2" ] && _dns=${_dns}:$(echo $DNS2)
- if [ ! -f $_dnsfile ] || [ ! $(cat $_dnsfile | grep -q $_dns) ]; then
- echo "nameserver=$_dns" >> "$_dnsfile"
- fi
- done < "/etc/resolv.conf"
+ echo -n "${_dns}" | cut -d':' -f1,2,3
}
#$1: netdev name
@@ -254,22 +247,27 @@ kdump_setup_znet() {
# Setup dracut to bringup a given network interface
kdump_setup_netdev() {
local _netdev=$1 _srcaddr=$2
- local _static _proto _ip_conf _ip_opts _ifname_opts
+ local _static _proto _ip_conf _ip_opts _ifname_opts _ifcfg_dns
+ local _global_dnsfile=${initdir}/etc/cmdline.d/42dns.conf
if [ "$(uname -m)" = "s390x" ]; then
kdump_setup_znet $_netdev
fi
- _netmac=$(kdump_get_mac_addr $_netdev)
+ # Using below "ip=" command format provided by dracut:
+ # ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:
+ # <interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]
_static=$(kdump_static_ip $_netdev $_srcaddr)
if [ -n "$_static" ]; then
_proto=none
else
_proto=dhcp
+ _static=":::::"
fi
+ _ifcfg_dns=$(kdump_get_dns_from_ifcfg $_netdev)
_ip_conf="${initdir}/etc/cmdline.d/40ip.conf"
- _ip_opts=" ip=${_static}$(kdump_setup_ifname $_netdev):${_proto}"
+ _ip_opts=" ip=${_static}$(kdump_setup_ifname $_netdev):${_proto}${_ifcfg_dns}"
# dracut doesn't allow duplicated configuration for same NIC, even they're exactly the same.
# so we have to avoid adding duplicates
@@ -278,6 +276,12 @@ kdump_setup_netdev() {
if [ ! -f $_ip_conf ] || ! grep -q $_ip_opts $_ip_conf &&\
! grep -q "ip=[^[:space:]]*$_netdev" /proc/cmdline; then
echo "$_ip_opts" >> $_ip_conf
+ # In case of no DNS specified by iscsi.
+ if [ -n "${_ifcfg_dns}" ]; then
+ _ifcfg_dns=${_ifcfg_dns##:}
+ echo "nameserver=${_ifcfg_dns%%:*}" >> ${_global_dnsfile}
+ [ "${_ifcfg_dns}" = "${_ifcfg_dns%%:*}" ] || echo "nameserver=${_ifcfg_dns##*:}" >> ${_global_dnsfile}
+ fi
fi
if kdump_is_bridge "$_netdev"; then
@@ -292,8 +296,6 @@ kdump_setup_netdev() {
_ifname_opts=" ifname=$(kdump_setup_ifname $_netdev):$(kdump_get_mac_addr $_netdev)"
echo "$_ifname_opts" >> $_ip_conf
fi
-
- kdump_setup_dns "$_netdev"
}
get_ip_route_field()
--
1.8.3.1
7 years, 6 months
[PATCH] module-setup: Use "ip=" command of the dracut to handle DNS
by xunlei@fedoraproject.org
From: Xunlei Pang <xunlei(a)fedoraproject.org>
Currently kdump uses dracut's "nameserver=" command to hande DNS,
it is acquired both from ifcfg files and "/etc/resolv.conf".
This is improper for dhcp cases, as "/etc/resolv.conf" is generated
by dhcp, the proper logic should be:
1) For static cases, DNS can be acquired from corresponding ifcfg file.
2) For dhcp cases, DNS is normally generated by dhcp, but extra DNS
can still be specified in the ifcfg files mannually.
3) For special user-assigned DNS not specified in any ifcfg file, we can
pass it to dracut via "nameserver=".
This patch improves the logic using the following "ip=" command format
provided by dracut:
ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:
<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
dracut-module-setup.sh | 46 ++++++++++++++++++++++++----------------------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 4cd7107..a18fdc0 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -63,26 +63,19 @@ kdump_is_vlan() {
}
# $1: netdev name
-kdump_setup_dns() {
- local _nameserver _dns
- local _dnsfile=${initdir}/etc/cmdline.d/42dns.conf
- . /etc/sysconfig/network-scripts/ifcfg-$1
-
- [ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile"
- [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile"
+# return pattern ":<dns1>[<:dns2>]" if not ""
+kdump_get_dns_from_ifcfg() {
+ local _dns
- while read content;
- do
- _nameserver=$(echo $content | grep ^nameserver)
- [ -z "$_nameserver" ] && continue
+ unset DNS1 DNS2
+ if [ -e /etc/sysconfig/network-scripts/ifcfg-$1 ]; then
+ . /etc/sysconfig/network-scripts/ifcfg-$1
+ fi
- _dns=$(echo $_nameserver | cut -d' ' -f2)
- [ -z "$_dns" ] && continue
+ [ -n "$DNS1" ] && _dns=${_dns}:$(echo $DNS1)
+ [ -n "$DNS2" ] && _dns=${_dns}:$(echo $DNS2)
- if [ ! -f $_dnsfile ] || [ ! $(cat $_dnsfile | grep -q $_dns) ]; then
- echo "nameserver=$_dns" >> "$_dnsfile"
- fi
- done < "/etc/resolv.conf"
+ echo -n "${_dns}" | cut -d':' -f1,2,3
}
#$1: netdev name
@@ -254,22 +247,27 @@ kdump_setup_znet() {
# Setup dracut to bringup a given network interface
kdump_setup_netdev() {
local _netdev=$1 _srcaddr=$2
- local _static _proto _ip_conf _ip_opts _ifname_opts
+ local _static _proto _ip_conf _ip_opts _ifname_opts _ifcfg_dns
+ local _global_dnsfile=${initdir}/etc/cmdline.d/42dns.conf
if [ "$(uname -m)" = "s390x" ]; then
kdump_setup_znet $_netdev
fi
- _netmac=$(kdump_get_mac_addr $_netdev)
+ # Using below "ip=" command format provided by dracut:
+ # ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:
+ # <interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]
_static=$(kdump_static_ip $_netdev $_srcaddr)
if [ -n "$_static" ]; then
_proto=none
else
_proto=dhcp
+ _static=":::::"
fi
+ _ifcfg_dns=$(kdump_get_dns_from_ifcfg $_netdev)
_ip_conf="${initdir}/etc/cmdline.d/40ip.conf"
- _ip_opts=" ip=${_static}$(kdump_setup_ifname $_netdev):${_proto}"
+ _ip_opts=" ip=${_static}$(kdump_setup_ifname $_netdev):${_proto}${_ifcfg_dns}"
# dracut doesn't allow duplicated configuration for same NIC, even they're exactly the same.
# so we have to avoid adding duplicates
@@ -278,6 +276,12 @@ kdump_setup_netdev() {
if [ ! -f $_ip_conf ] || ! grep -q $_ip_opts $_ip_conf &&\
! grep -q "ip=[^[:space:]]*$_netdev" /proc/cmdline; then
echo "$_ip_opts" >> $_ip_conf
+ # In case of no DNS specified by iscsi.
+ if [ -n "${_ifcfg_dns}" ]; then
+ _ifcfg_dns=${_ifcfg_dns##:}
+ echo "nameserver=${_ifcfg_dns%%:*}" >> ${_global_dnsfile}
+ [ "${_ifcfg_dns}" = "${_ifcfg_dns%%:*}" ] || echo "nameserver=${_ifcfg_dns##*:}" >> ${_global_dnsfile}
+ fi
fi
if kdump_is_bridge "$_netdev"; then
@@ -292,8 +296,6 @@ kdump_setup_netdev() {
_ifname_opts=" ifname=$(kdump_setup_ifname $_netdev):$(kdump_get_mac_addr $_netdev)"
echo "$_ifname_opts" >> $_ip_conf
fi
-
- kdump_setup_dns "$_netdev"
}
get_ip_route_field()
--
1.8.3.1
7 years, 6 months