Return error code in case of invalid command line option

Currently kexec returns success even if an invalid command line option
is encountered. Kexec currently prints usage message and then returns
0. That's not right. It is an error and error code 1 should be returned.

Due to this wrapper script thinks that kdump succeeded but that's not
the case.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
kexec-tools 2.0.8-rc1

Signed-off-by: Simon Horman <horms@verge.net.au>
kexec-tools 2.0.8

Signed-off-by: Simon Horman <horms@verge.net.au>
kexec-tools 2.0.8.git

Add .git to version so it doesn't look like a release.
This is just so when people build code from git it can
be identified as such from the version string.

Signed-off-by: Simon Horman <horms@verge.net.au>
kexec: distribute kexec/arch/m68k/bootinfo.h

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
kexec/fs2dt: Fix sorting of device tree

Commit b02d735bf252 ('ppc64 kdump device_tree sort') added code to
sort device tree properties, but it had a few issues.

A compare routine needs to return -1 and 1. The special case for
sorting properties with unit addresses only returned 1 and ignored
the opposite case, which screwed up the sorting.

We were missing a few more things:

- Need to check both basenames are the same length
- Need to check both basenames match

I noticed this when looking at the NUMA topology after a kexec, and
it had shifted.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
kexec: remove some re zero-assignment

since we have already cleared kexec_info with memset,
there is no need to do that again to the struct members.

Signed-off-by: Hu Keping <hukeping@huawei.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
kexec/fs2dt: Use slurp_file_len to avoid partial read of files

The OPAL firmware is going to embed its symbol map in the device tree.
The size is large enough to be more than a page, and it takes
multiple reads to get the whole file. This is because sysfs uses
the seq_file helpers which do a page at a time.

Unfortunately fs2dt has no handling for short reads and we die with:

unrecoverable error: short read from"/proc/device-tree//ibm,opal/firmware/symbol-map"

This patch uses the slurp_file_len helper which does the right thing.
It moves the explicit open of the file further down for
add_usable_mem_property and add_dyn_reconf_usable_mem_property.
We should convert both of these to use the buffer provided by
slurp_file_len at some stage.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Simon Horman <horms@verge.net.au>