forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
mkDerivation, | ||
}: | ||
|
||
mkDerivation { | ||
path = "sbin/mount"; | ||
meta.mainProgram = "mount"; | ||
patches = [ ./search-path.patch ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c | ||
index eaff190b572..4bce21559f6 100644 | ||
--- a/sbin/mount/mount.c | ||
+++ b/sbin/mount/mount.c | ||
@@ -338,12 +338,6 @@ mountfs(const char *vfstype, const char *spec, const char *name, | ||
{ | ||
char *cp; | ||
|
||
- /* List of directories containing mount_xxx subcommands. */ | ||
- static const char *edirs[] = { | ||
- _PATH_SBIN, | ||
- _PATH_USRSBIN, | ||
- NULL | ||
- }; | ||
const char **argv, **edir; | ||
struct statfs sf; | ||
pid_t pid; | ||
@@ -427,15 +421,12 @@ mountfs(const char *vfstype, const char *spec, const char *name, | ||
return (1); | ||
case 0: /* Child. */ | ||
/* Go find an executable. */ | ||
- edir = edirs; | ||
- do { | ||
- (void)snprintf(execname, | ||
- sizeof(execname), "%s/mount_%s", *edir, vfstype); | ||
- argv[0] = execname; | ||
- execv(execname, (char * const *)argv); | ||
- if (errno != ENOENT) | ||
- warn("exec %s for %s", execname, name); | ||
- } while (*++edir != NULL); | ||
+ (void)snprintf(execname, | ||
+ sizeof(execname), "mount_%s", vfstype); | ||
+ argv[0] = execname; | ||
+ execvp(execname, (char * const *)argv); | ||
+ if (errno != ENOENT) | ||
+ warn("exec %s for %s", execname, name); | ||
|
||
if (errno == ENOENT) | ||
warn("no mount helper program found for %s", vfstype); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
mkDerivation, | ||
}: | ||
|
||
mkDerivation { | ||
path = "sbin/mount_ffs"; | ||
extraPaths = [ "sbin/mount" ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
mkDerivation, | ||
}: | ||
|
||
mkDerivation { | ||
path = "sbin/mount_tmpfs"; | ||
extraPaths = [ "sbin/mount" ]; | ||
} |