Skip to content

Commit

Permalink
fix(install): sane default --kerneldir
Browse files Browse the repository at this point in the history
If --kerneldir is not specified, use /lib/modules/$(uname -r).

Fixes #1505
  • Loading branch information
marcosfrm authored and johannbg committed May 20, 2021
1 parent 9355cb8 commit c1ab361
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/install/dracut-install.c
Expand Up @@ -1167,7 +1167,10 @@ static int parse_argv(int argc, char *argv[])
if (!kerneldir) {
struct utsname buf;
uname(&buf);
kerneldir = strdup(buf.version);
if (asprintf(&kerneldir, "%s%s", "/lib/modules/", buf.release) < 0) {
log_error("Out of memory!");
exit(EXIT_FAILURE);
}
}

if (arg_modalias) {
Expand Down

0 comments on commit c1ab361

Please sign in to comment.