From e4cc23de2900ad432678b929c1548367a4c0e65a Mon Sep 17 00:00:00 2001 From: Jarod Wilson Date: Tue, 22 Aug 2006 14:18:04 +0000 Subject: [PATCH] - ppc64 fixups: - actually build ppc64 binaries (bug 203407) - correct usage output - avoid segfault in command-line parsing - install kexec man page - use regulation Fedora BuildRoot --- kexec-tools-1.101-ppc64-cliargs.patch | 21 +++++++++++++++++ kexec-tools-1.101-ppc64-ignore-args.patch | 27 ++++++++++++++++++++++ kexec-tools-1.101-ppc64-usage.patch | 15 ++++++++++++ kexec-tools.spec | 28 +++++++++++++++++++---- 4 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 kexec-tools-1.101-ppc64-cliargs.patch create mode 100644 kexec-tools-1.101-ppc64-ignore-args.patch create mode 100644 kexec-tools-1.101-ppc64-usage.patch diff --git a/kexec-tools-1.101-ppc64-cliargs.patch b/kexec-tools-1.101-ppc64-cliargs.patch new file mode 100644 index 0000000..8f78d25 --- /dev/null +++ b/kexec-tools-1.101-ppc64-cliargs.patch @@ -0,0 +1,21 @@ +Index: kexec-tools-1.101/kexec/arch/ppc64/fs2dt.c +=================================================================== +--- kexec-tools-1.101.orig/kexec/arch/ppc64/fs2dt.c ++++ kexec-tools-1.101/kexec/arch/ppc64/fs2dt.c +@@ -267,10 +267,12 @@ void putprops(char *fn, struct dirent ** + char *old_param; + memcpy(temp_cmdline, dt, len); + param = strstr(temp_cmdline, "root="); +- old_param = strtok(param, " "); +- if (cmd_len != 0) +- strcat(local_cmdline, " "); +- strcat(local_cmdline, old_param); ++ if (param) { ++ old_param = strtok(param, " "); ++ if (cmd_len != 0) ++ strcat(local_cmdline, " "); ++ strcat(local_cmdline, old_param); ++ } + } + strcat(local_cmdline, " "); + cmd_len = strlen(local_cmdline); diff --git a/kexec-tools-1.101-ppc64-ignore-args.patch b/kexec-tools-1.101-ppc64-ignore-args.patch new file mode 100644 index 0000000..2894b55 --- /dev/null +++ b/kexec-tools-1.101-ppc64-ignore-args.patch @@ -0,0 +1,27 @@ +--- a/kexec/arch/ppc64/kexec-elf-ppc64.c ++++ b/kexec/arch/ppc64/kexec-elf-ppc64.c +@@ -93,6 +93,7 @@ int elf_ppc64_load(int argc, char **argv + #define OPT_APPEND (OPT_ARCH_MAX+0) + #define OPT_RAMDISK (OPT_ARCH_MAX+1) + #define OPT_DEVICETREEBLOB (OPT_ARCH_MAX+2) ++#define OPT_ARGS_IGNORE (OPT_ARCH_MAX+3) + + static const struct option options[] = { + KEXEC_ARCH_OPTIONS +@@ -101,6 +102,7 @@ int elf_ppc64_load(int argc, char **argv + { "ramdisk", 1, NULL, OPT_RAMDISK }, + { "initrd", 1, NULL, OPT_RAMDISK }, + { "devicetreeblob", 1, NULL, OPT_DEVICETREEBLOB }, ++ { "args-linux", 0, NULL, OPT_ARGS_IGNORE }, + { 0, 0, NULL, 0 }, + }; + +@@ -134,6 +136,8 @@ int elf_ppc64_load(int argc, char **argv + case OPT_DEVICETREEBLOB: + devicetreeblob = optarg; + break; ++ case OPT_ARGS_IGNORE: ++ break; + } + } + diff --git a/kexec-tools-1.101-ppc64-usage.patch b/kexec-tools-1.101-ppc64-usage.patch new file mode 100644 index 0000000..a80cfd4 --- /dev/null +++ b/kexec-tools-1.101-ppc64-usage.patch @@ -0,0 +1,15 @@ +Index: kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.c +=================================================================== +--- kexec-tools-1.101.orig/kexec/arch/ppc64/kexec-ppc64.c ++++ kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.c +@@ -552,6 +552,10 @@ int file_types = sizeof(file_type) / siz + + void arch_usage(void) + { ++ fprintf(stderr, " --command-line= command line to append.\n"); ++ fprintf(stderr, " --append= same as --command-line.\n"); ++ fprintf(stderr, " --ramdisk= Initial RAM disk.\n"); ++ fprintf(stderr, " --initrd= same as --ramdisk.\n"); + fprintf(stderr, " --devicetreeblob= Specify device tree blob file.\n"); + fprintf(stderr, " --elf64-core-headers Prepare core headers in ELF64 format\n"); + } diff --git a/kexec-tools.spec b/kexec-tools.spec index 68e08fe..ed2b3ff 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools Version: 1.101 -Release: 45%{dist} +Release: 46%{dist} License: GPL Group: Applications/System Summary: The kexec/kdump userspace component. @@ -12,7 +12,7 @@ Source4: kdump.conf Source5: kcp.c Source6: Makefile.kcp Source7: makedumpfile.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires(pre): coreutils chkconfig sed BuildRequires: zlib-devel elfutils-libelf-devel glib2-devel pkgconfig @@ -34,7 +34,9 @@ Patch201: kexec-tools-1.101-ia64-fixup.patch # # Patches 301 through 400 are meant for ppc64 kexec-tools enablement # -Patch301: kexec-ppc64-ingnore-args-linux.patch +Patch301: kexec-tools-1.101-ppc64-ignore-args.patch +Patch302: kexec-tools-1.101-ppc64-usage.patch +Patch303: kexec-tools-1.101-ppc64-cliargs.patch # # Patches 401 through 500 are meant for s390 kexec-tools enablement @@ -70,6 +72,8 @@ rm -f ../kexec-tools-1.101.spec %patch101 -p1 %patch201 -p1 %patch301 -p1 +%patch302 -p1 +%patch303 -p1 %patch401 -p1 %patch501 -p1 %patch601 -p1 @@ -87,7 +91,12 @@ tar -C makedumpfile -z -x -v -f %{SOURCE7} %patch606 -p1 %build -%configure --sbindir=/sbin +%configure \ +%ifarch ppc64 + --host=powerpc64-redhat-linux-gnu \ + --build=powerpc64-redhat-linux-gnu \ +%endif + --sbindir=/sbin rm -f kexec-tools.spec.in make %ifarch %{ix86} x86_64 @@ -100,10 +109,12 @@ make install DESTDIR=$RPM_BUILD_ROOT mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig mkdir -p -m755 $RPM_BUILD_ROOT%{_localstatedir}/crash +mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man8/ install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/kdump install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/kdump install -m 755 %{SOURCE3} $RPM_BUILD_ROOT/sbin/mkdumprd install -m 755 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/kdump.conf +install -m 644 kexec/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/kexec.8 %ifarch %{ix86} x86_64 install -m 755 makedumpfile/makedumpfile $RPM_BUILD_ROOT/sbin/makedumpfile %endif @@ -138,11 +149,20 @@ exit 0 %ifarch %{ix86} x86_64 %{_libdir}/kexec-tools/kexec_test %endif +%{_mandir}/man8/kexec.8* %doc News %doc COPYING %doc TODO %changelog +* Mon Aug 21 2006 Jarod Wilson - 1.101-46%{dist} +- ppc64 fixups: + - actually build ppc64 binaries (bug 203407) + - correct usage output + - avoid segfault in command-line parsing +- install kexec man page +- use regulation Fedora BuildRoot + * Fri Aug 18 2006 Neil Horman - 1.101-45%{dist} - fixed typo in mkdumprd for bz 202983 - fixed typo in mkdumprd for bz 203053