diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/mount/package.nix b/pkgs/os-specific/bsd/openbsd/pkgs/mount/package.nix new file mode 100644 index 000000000000..1fd2d02bf899 --- /dev/null +++ b/pkgs/os-specific/bsd/openbsd/pkgs/mount/package.nix @@ -0,0 +1,9 @@ +{ + mkDerivation, +}: + +mkDerivation { + path = "sbin/mount"; + meta.mainProgram = "mount"; + patches = [ ./search-path.patch ]; +} diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/mount/search-path.patch b/pkgs/os-specific/bsd/openbsd/pkgs/mount/search-path.patch new file mode 100644 index 000000000000..f764ef3f67c5 --- /dev/null +++ b/pkgs/os-specific/bsd/openbsd/pkgs/mount/search-path.patch @@ -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); diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/mount_ffs/package.nix b/pkgs/os-specific/bsd/openbsd/pkgs/mount_ffs/package.nix new file mode 100644 index 000000000000..ca00207f3efd --- /dev/null +++ b/pkgs/os-specific/bsd/openbsd/pkgs/mount_ffs/package.nix @@ -0,0 +1,8 @@ +{ + mkDerivation, +}: + +mkDerivation { + path = "sbin/mount_ffs"; + extraPaths = [ "sbin/mount" ]; +} diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/mount_tmpfs/package.nix b/pkgs/os-specific/bsd/openbsd/pkgs/mount_tmpfs/package.nix new file mode 100644 index 000000000000..641efd6df4ed --- /dev/null +++ b/pkgs/os-specific/bsd/openbsd/pkgs/mount_tmpfs/package.nix @@ -0,0 +1,8 @@ +{ + mkDerivation, +}: + +mkDerivation { + path = "sbin/mount_tmpfs"; + extraPaths = [ "sbin/mount" ]; +}