summaryrefslogtreecommitdiff
path: root/src/pstore
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-10-04 16:14:47 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-10-04 16:15:11 +0200
commite05a72d7587ff916a983588f8393af624d330dd0 (patch)
tree1e737aac390a3f9b492827bd05917c5022c32c9c /src/pstore
parent402fecff19d42bb06caed1a3a32262c18087b7f1 (diff)
downloadsystemd-e05a72d7587ff916a983588f8393af624d330dd0.tar.gz
pstore: allow specifying src and dst dirs are arguments
This makes it much easier to debug the program as a normal user, since we don't need to set up fake input under /sys/fs/pstore/. Also, let's make the debug output a bit nicer.
Diffstat (limited to 'src/pstore')
-rw-r--r--src/pstore/pstore.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/pstore/pstore.c b/src/pstore/pstore.c
index 8ffe523830..9861758700 100644
--- a/src/pstore/pstore.c
+++ b/src/pstore/pstore.c
@@ -359,15 +359,18 @@ static int run(int argc, char *argv[]) {
log_setup_service();
- if (argc > 1)
+ if (argc == 3) {
+ arg_sourcedir = argv[1];
+ arg_archivedir = argv[2];
+ } else if (argc > 1)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
- "This program takes no arguments.");
+ "This program takes zero or two arguments.");
/* Ignore all parse errors */
(void) parse_config();
- log_debug("Selected storage '%s'.", pstore_storage_to_string(arg_storage));
- log_debug("Selected Unlink '%d'.", arg_unlink);
+ log_debug("Selected storage: %s.", pstore_storage_to_string(arg_storage));
+ log_debug("Selected unlink: %s.", yes_no(arg_unlink));
if (arg_storage == PSTORE_STORAGE_NONE)
/* Do nothing, intentionally, leaving pstore untouched */