Skip to content

Commit

Permalink
init: use /run/modprobe.d instead /etc/modprobe.d
Browse files Browse the repository at this point in the history
we also switch to using 'blacklist' instead of hard blacklisting via
install /bin/false since we're now expecting that this file be read
after leaving early userspace.
  • Loading branch information
falconindy committed Jun 1, 2011
1 parent df5ae8d commit 57b1834
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions init.c
Expand Up @@ -470,18 +470,17 @@ static void disable_modules(void) { /* {{{ */
}

/* ensure parent dirs exist */
mkdir("/etc", 0755);
mkdir("/etc/modprobe.d", 0755);
mkdir("/run/modprobe.d", 0755);

fp = fopen("/etc/modprobe.d/initcpio.conf", "w");
fp = fopen("/run/modprobe.d/initcpio.conf", "w");
if (!fp) {
perror("error: /etc/modprobe.d/initcpio.conf");
perror("error: /run/modprobe.d/initcpio.conf");
return;
}

var = strdup(getenv("disablemodules"));
for (tok = strtok(var, ","); tok; tok = strtok(NULL, ",")) {
fprintf(fp, "install %s /bin/false\n", tok);
fprintf(fp, "blacklist %s\n", tok);
}

fclose(fp);
Expand Down

0 comments on commit 57b1834

Please sign in to comment.