* [PATCH] kexec: ppc64: print help to stdout instead of stderr
@ 2023-11-16 8:41 Aditya Gupta
2023-11-16 11:34 ` Simon Horman
2023-11-17 6:06 ` Srikar Dronamraju
0 siblings, 2 replies; 3+ messages in thread
From: Aditya Gupta @ 2023-11-16 8:41 UTC (permalink / raw)
To: kexec; +Cc: Hari Bathini, Mahesh J Salgaonkar, Sourabh Jain,
Srikar Dronamraju
Currently 'kexec --help' on powerpc64 prints the generic help/usage to
stdout, and the powerpc64 specific options to stderr
That is, if the stdout of 'kexec --help' is redirected to some file,
some of the help options will not be redirected, and instead printed on
the terminal/stderr:
[root@machine kexec-tools]# kexec --help > /tmp/out
--command-line=<Command line> command line to append.
--append=<Command line> same as --command-line.
--ramdisk=<filename> Initial RAM disk.
--initrd=<filename> same as --ramdisk.
--devicetreeblob=<filename> Specify device tree blob file.
Not applicable while using
--kexec-file-syscall.
--dtb=<filename> same as --devicetreeblob.
elf support is still broken
--elf64-core-headers Prepare core headers in ELF64 format
--dt-no-old-root Do not reuse old kernel root= param.
while creating flatten device tree.
Fix this inconsistency by writing powerpc64 specific options to stdout,
similar to the generic 'kexec --help'
With the proposed changes, it is like this (nothing printed to stderr):
[root@machine kexec-tools]# ./build/sbin/kexec --help > /tmp/out
Reported-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
---
kexec/arch/ppc64/kexec-elf-ppc64.c | 22 +++++++++++-----------
kexec/arch/ppc64/kexec-ppc64.c | 6 +++---
kexec/arch/ppc64/kexec-zImage-ppc64.c | 2 +-
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c b/kexec/arch/ppc64/kexec-elf-ppc64.c
index 01d045f..bdcfd20 100644
--- a/kexec/arch/ppc64/kexec-elf-ppc64.c
+++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
@@ -482,15 +482,15 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
void elf_ppc64_usage(void)
{
- fprintf(stderr, " --command-line=<Command line> command line to append.\n");
- fprintf(stderr, " --append=<Command line> same as --command-line.\n");
- fprintf(stderr, " --ramdisk=<filename> Initial RAM disk.\n");
- fprintf(stderr, " --initrd=<filename> same as --ramdisk.\n");
- fprintf(stderr, " --devicetreeblob=<filename> Specify device tree blob file.\n");
- fprintf(stderr, " ");
- fprintf(stderr, "Not applicable while using --kexec-file-syscall.\n");
- fprintf(stderr, " --reuse-cmdline Use kernel command line from running system.\n");
- fprintf(stderr, " --dtb=<filename> same as --devicetreeblob.\n");
-
- fprintf(stderr, "elf support is still broken\n");
+ printf(" --command-line=<Command line> command line to append.\n");
+ printf(" --append=<Command line> same as --command-line.\n");
+ printf(" --ramdisk=<filename> Initial RAM disk.\n");
+ printf(" --initrd=<filename> same as --ramdisk.\n");
+ printf(" --devicetreeblob=<filename> Specify device tree blob file.\n");
+ printf(" ");
+ printf("Not applicable while using --kexec-file-syscall.\n");
+ printf(" --reuse-cmdline Use kernel command line from running system.\n");
+ printf(" --dtb=<filename> same as --devicetreeblob.\n");
+
+ printf("elf support is still broken\n");
}
diff --git a/kexec/arch/ppc64/kexec-ppc64.c b/kexec/arch/ppc64/kexec-ppc64.c
index 611809f..19f17cb 100644
--- a/kexec/arch/ppc64/kexec-ppc64.c
+++ b/kexec/arch/ppc64/kexec-ppc64.c
@@ -910,9 +910,9 @@ int file_types = sizeof(file_type) / sizeof(file_type[0]);
void arch_usage(void)
{
- fprintf(stderr, " --elf64-core-headers Prepare core headers in ELF64 format\n");
- fprintf(stderr, " --dt-no-old-root Do not reuse old kernel root= param.\n" \
- " while creating flatten device tree.\n");
+ printf(" --elf64-core-headers Prepare core headers in ELF64 format\n");
+ printf(" --dt-no-old-root Do not reuse old kernel root= param.\n"
+ " while creating flatten device tree.\n");
}
struct arch_options_t arch_options = {
diff --git a/kexec/arch/ppc64/kexec-zImage-ppc64.c b/kexec/arch/ppc64/kexec-zImage-ppc64.c
index e946205..7f45751 100644
--- a/kexec/arch/ppc64/kexec-zImage-ppc64.c
+++ b/kexec/arch/ppc64/kexec-zImage-ppc64.c
@@ -180,5 +180,5 @@ int zImage_ppc64_load(FILE *file, int UNUSED(argc), char **UNUSED(argv),
void zImage_ppc64_usage(void)
{
- fprintf(stderr, "zImage support is still broken\n");
+ printf("zImage support is still broken\n");
}
--
2.39.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] kexec: ppc64: print help to stdout instead of stderr
2023-11-16 8:41 [PATCH] kexec: ppc64: print help to stdout instead of stderr Aditya Gupta
@ 2023-11-16 11:34 ` Simon Horman
2023-11-17 6:06 ` Srikar Dronamraju
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-11-16 11:34 UTC (permalink / raw)
To: Aditya Gupta
Cc: kexec, Hari Bathini, Mahesh J Salgaonkar, Sourabh Jain,
Srikar Dronamraju
On Thu, Nov 16, 2023 at 02:11:37PM +0530, Aditya Gupta wrote:
> Currently 'kexec --help' on powerpc64 prints the generic help/usage to
> stdout, and the powerpc64 specific options to stderr
>
> That is, if the stdout of 'kexec --help' is redirected to some file,
> some of the help options will not be redirected, and instead printed on
> the terminal/stderr:
>
> [root@machine kexec-tools]# kexec --help > /tmp/out
> --command-line=<Command line> command line to append.
> --append=<Command line> same as --command-line.
> --ramdisk=<filename> Initial RAM disk.
> --initrd=<filename> same as --ramdisk.
> --devicetreeblob=<filename> Specify device tree blob file.
> Not applicable while using
> --kexec-file-syscall.
> --dtb=<filename> same as --devicetreeblob.
> elf support is still broken
> --elf64-core-headers Prepare core headers in ELF64 format
> --dt-no-old-root Do not reuse old kernel root= param.
> while creating flatten device tree.
>
> Fix this inconsistency by writing powerpc64 specific options to stdout,
> similar to the generic 'kexec --help'
>
> With the proposed changes, it is like this (nothing printed to stderr):
>
> [root@machine kexec-tools]# ./build/sbin/kexec --help > /tmp/out
>
> Reported-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Thanks Aditya,
applied.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kexec: ppc64: print help to stdout instead of stderr
2023-11-16 8:41 [PATCH] kexec: ppc64: print help to stdout instead of stderr Aditya Gupta
2023-11-16 11:34 ` Simon Horman
@ 2023-11-17 6:06 ` Srikar Dronamraju
1 sibling, 0 replies; 3+ messages in thread
From: Srikar Dronamraju @ 2023-11-17 6:06 UTC (permalink / raw)
To: Aditya Gupta; +Cc: kexec, Hari Bathini, Mahesh J Salgaonkar, Sourabh Jain
* Aditya Gupta <adityag@linux.ibm.com> [2023-11-16 14:11:37]:
> Currently 'kexec --help' on powerpc64 prints the generic help/usage to
> stdout, and the powerpc64 specific options to stderr
>
> That is, if the stdout of 'kexec --help' is redirected to some file,
> some of the help options will not be redirected, and instead printed on
> the terminal/stderr:
>
> [root@machine kexec-tools]# kexec --help > /tmp/out
> --command-line=<Command line> command line to append.
> --append=<Command line> same as --command-line.
> --ramdisk=<filename> Initial RAM disk.
> --initrd=<filename> same as --ramdisk.
> --devicetreeblob=<filename> Specify device tree blob file.
> Not applicable while using
> --kexec-file-syscall.
> --dtb=<filename> same as --devicetreeblob.
> elf support is still broken
> --elf64-core-headers Prepare core headers in ELF64 format
> --dt-no-old-root Do not reuse old kernel root= param.
> while creating flatten device tree.
>
> Fix this inconsistency by writing powerpc64 specific options to stdout,
> similar to the generic 'kexec --help'
>
> With the proposed changes, it is like this (nothing printed to stderr):
>
> [root@machine kexec-tools]# ./build/sbin/kexec --help > /tmp/out
>
> Reported-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
> ---
Thanks Aditya for looking into this.
--
Thanks and Regards
Srikar Dronamraju
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-17 6:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-16 8:41 [PATCH] kexec: ppc64: print help to stdout instead of stderr Aditya Gupta
2023-11-16 11:34 ` Simon Horman
2023-11-17 6:06 ` Srikar Dronamraju
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox