mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Document that init(8) mounts the filesystems of fstab(5).
Remove --help and --version in favor of the init(8) manual page.
This commit is contained in:
parent
67471b55e7
commit
fdfe16ad30
2 changed files with 8 additions and 30 deletions
|
@ -111,6 +111,10 @@ set keyboard layout (see
|
||||||
set graphics resolution (see
|
set graphics resolution (see
|
||||||
.Xr videomode 5 )
|
.Xr videomode 5 )
|
||||||
.El
|
.El
|
||||||
|
.Ss Mountpoints
|
||||||
|
.Nm
|
||||||
|
mounts all the filesystems according to
|
||||||
|
.Xr fstab 5 .
|
||||||
.Ss Session
|
.Ss Session
|
||||||
Finally
|
Finally
|
||||||
.Nm
|
.Nm
|
||||||
|
|
34
init/init.c
34
init/init.c
|
@ -25,9 +25,9 @@
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <err.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <error.h>
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <fstab.h>
|
#include <fstab.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
|
@ -935,17 +935,6 @@ static void compact_arguments(int* argc, char*** argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void help(FILE* fp, const char* argv0)
|
|
||||||
{
|
|
||||||
fprintf(fp, "Usage: %s [OPTION]...\n", argv0);
|
|
||||||
fprintf(fp, "Initialize and manage the userland.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void version(FILE* fp, const char* argv0)
|
|
||||||
{
|
|
||||||
fprintf(fp, "%s (Sortix) %s\n", argv0, VERSIONSTR);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
main_pid = getpid();
|
main_pid = getpid();
|
||||||
|
@ -954,7 +943,6 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
const char* target = NULL;
|
const char* target = NULL;
|
||||||
|
|
||||||
const char* argv0 = argv[0];
|
|
||||||
for ( int i = 1; i < argc; i++ )
|
for ( int i = 1; i < argc; i++ )
|
||||||
{
|
{
|
||||||
const char* arg = argv[i];
|
const char* arg = argv[i];
|
||||||
|
@ -969,9 +957,7 @@ int main(int argc, char* argv[])
|
||||||
while ( (c = *++arg) ) switch ( c )
|
while ( (c = *++arg) ) switch ( c )
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "%s: unknown option -- '%c'\n", argv0, c);
|
errx(2, "unknown option -- '%c'", c);
|
||||||
help(stderr, argv0);
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( !strncmp(arg, "--target=", strlen("--target=")) )
|
else if ( !strncmp(arg, "--target=", strlen("--target=")) )
|
||||||
|
@ -979,24 +965,12 @@ int main(int argc, char* argv[])
|
||||||
else if ( !strcmp(arg, "--target") )
|
else if ( !strcmp(arg, "--target") )
|
||||||
{
|
{
|
||||||
if ( i + 1 == argc )
|
if ( i + 1 == argc )
|
||||||
{
|
errx(2, "option '--target' requires an argument");
|
||||||
error(0, 0, "option '--target' requires an argument");
|
|
||||||
fprintf(stderr, "Try `%s --help' for more information.\n", argv[0]);
|
|
||||||
exit(125);
|
|
||||||
}
|
|
||||||
target = argv[i+1];
|
target = argv[i+1];
|
||||||
argv[++i] = NULL;
|
argv[++i] = NULL;
|
||||||
}
|
}
|
||||||
else if ( !strcmp(arg, "--help") )
|
|
||||||
help(stdout, argv0), exit(0);
|
|
||||||
else if ( !strcmp(arg, "--version") )
|
|
||||||
version(stdout, argv0), exit(0);
|
|
||||||
else
|
else
|
||||||
{
|
errx(2, "unknown option: %s", arg);
|
||||||
fprintf(stderr, "%s: unknown option: %s\n", argv0, arg);
|
|
||||||
help(stderr, argv0);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
compact_arguments(&argc, &argv);
|
compact_arguments(&argc, &argv);
|
||||||
|
|
Loading…
Reference in a new issue