Commit Graph

5 Commits

Author SHA1 Message Date
84d682ea8c Fix kdumpst-load.sh.in with btrfs subvolumes 2026-02-19 22:04:58 -08:00
b19a940fbd kdumpst-load: Guard initrd creation against failures
Though rare, they might happen and then journal show non-handled
errors - better sanitize a bit the message.

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
2023-12-23 17:02:47 -03:00
033c781748 kdumpst-load: Don't unnecessarily recreate GRUB config on pstore load
What happens here is that the way GRUB's cmdline _removal_ was implemented
so far, it tries to remove "crashkernel=" from GRUB in pstore case, based
on kdumpst configuration. BUT it generates the GRUB config no matter what,
so if users added a crashkernel entry themselves, that doesn't match
kdumpst config file, what happens now is:

1) The code will try to sed-out our crashkernel setting from GRUB's
config, with no success (since our particular setting's not there);

2) GRUB config *will be* recreated by kdumpst (needlessly).

Fix that by checking if our crashkernel tuning is there before
the sed command is attempted (and the GRUB config, recreated).

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
2023-12-23 17:02:47 -03:00
63345d21a7 kdumpst-load/config: Add option to use crashkernel as pstore/ram memory
Currently kdumpst only allows a proper RAM buffer to be used as ramoops
memory area - this is the proper way of doing that, but there are cases
in which it's not trivial to have these buffers available:

(a) In case it's not there by default (due to kernel alignment / device-tree)
for example, there is no easy parameter to reserve such area right now
(using mem= is the way to go, but a bit complex to gather the exact size).

(b) The kernel parameter crashkernel= does something like this: reserve
a piece of memory not to be used by the kernel. It's meant for kdump, but
can be (ab)used for other purposes.

So, we hereby add a way for kdumpst to make use of crash reserved area
if the users wish so; the risks are exposed in the config file text.

Also, since we're changing this code, take the opportunity to improve the
sanitization of addresses from /proc/iomem and fix a corner case of empty
RANGE in the iomem parsing routine.

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
2023-12-23 17:02:40 -03:00
4b5746a60e all: Rename the tool to kdumpst
Big but self-explanatory commit: rename the tool. The name choice was
kdumpst, since it's a tool to enable both kdump and pstore setting, also
it's a silly wordplay with the superlative of kdump, as in "kdumpest".

It's an invasive change (touches most of the files), but should
offer no functional change other than logging messages showing
kdumpst now, instead of kdump, and some filenames.

Notice it doesn't touch documentation, which will be done in
a subsequent commit.

Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
2023-03-31 15:34:42 -03:00