diff options
author | phk <phk@FreeBSD.org> | 1996-10-28 11:03:19 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1996-10-28 11:03:19 +0000 |
commit | 91bd35f309756e9550765ddef10cc8b446a07a61 (patch) | |
tree | 57ca80e3065ad9c3b45d799ef2d09fc67cdc5b9e /sbin | |
parent | ff0d6919650583d08121fa712c8211ccc498f3f8 (diff) | |
download | FreeBSD-src-91bd35f309756e9550765ddef10cc8b446a07a61.zip FreeBSD-src-91bd35f309756e9550765ddef10cc8b446a07a61.tar.gz |
If passed the -d flag, mount devfs on /dev
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/init/init.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c index 6ea6233..7e73558 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -45,6 +45,7 @@ static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 7/15/93"; #endif /* not lint */ #include <sys/param.h> +#include <sys/mount.h> #include <sys/sysctl.h> #include <sys/wait.h> @@ -121,6 +122,8 @@ enum { AUTOBOOT, FASTBOOT } runcom_mode = AUTOBOOT; int Reboot = FALSE; +int devfs; + void transition __P((state_t)); state_t requested_transition = runcom; @@ -216,8 +219,11 @@ main(argc, argv) * This code assumes that we always get arguments through flags, * never through bits set in some random machine register. */ - while ((c = getopt(argc, argv, "sf")) != -1) + while ((c = getopt(argc, argv, "dsf")) != -1) switch (c) { + case 'd': + devfs = 1; + break; case 's': requested_transition = single_user; break; @@ -232,6 +238,11 @@ main(argc, argv) if (optind != argc) warning("ignoring excess arguments"); + /* Mount devfs on /dev */ + if (devfs) { + mount(MOUNT_DEVFS, "/dev", MNT_NOEXEC|MNT_RDONLY, 0); + } + /* * We catch or block signals rather than ignore them, * so that they get reset on exec. |