static bool dump_system_state(const struct crash_info *cinfo, pid_t *pid)
{
- char *av[] = {"/usr/bin/dump_systemstate", "-d", "-k", "-j", "-f", cinfo->log_path, NULL};
+ char *av[] = {"/usr/bin/dump_systemstate", "-d", "-k", "-j", "-p", "-f", cinfo->log_path, NULL};
return spawn(av, NULL, NULL, NULL, pid, NULL);
}
static void usage()
{
- fprintf(stderr, "usage: dump_systemstate [-k] [-d] [-f file]\n"
+ fprintf(stderr, "usage: dump_systemstate [-k] [-d] [-j] [-p] [-f file]\n"
" -f: write to file (instead of stdout)\n"
" -k: dump kernel messages (only root)\n"
" -d: dump dlog messages\n"
" -j: dump journal log messages\n"
+ " -p: dump list of installed packages\n"
);
}
bool arg_dlog = false;
bool arg_dmesg = false;
bool arg_journal = false;
+ bool arg_pkgs = false;
char timestr[80];
time_t cur_time;
struct tm gm_tm;
struct tm loc_tm;
- while ((c = getopt(argc, argv, "hf:kdj")) != -1) {
+ while ((c = getopt(argc, argv, "hf:kdjp")) != -1) {
switch (c) {
case 'd':
arg_dlog = true;
case 'j':
arg_journal = true;
break;
+ case 'p':
+ arg_pkgs = true;
+ break;
case 'f':
arg_file = optarg;
break;
spawn_wait_checked(get_sys_args, NULL);
}
+ if (arg_pkgs) {
+ fprintf_fd(out_fd, "\n==== Installed packages (/usr/bin/pkgcmd -l)\n");
+ char *pkgcmd_args[] = {"/usr/bin/pkgcmd", "-l", NULL};
+ spawn_wait_checked(pkgcmd_args, NULL);
+ }
+
if (arg_dmesg && is_root) {
fprintf_fd(out_fd, "\n==== Kernel messages (TZ=UTC /bin/dmesg -T)\n");
char *dmesg_args[] = {"/bin/dmesg", "-T", NULL};