From: Alex Hornung Date: Wed, 7 Jul 2010 22:28:46 +0000 (+0100) Subject: vfs_conf - export vfs.root.realroot via sysctl X-Git-Url: https://gitweb.dragonflybsd.org/~mneumann/dragonfly.git/commitdiff_plain/b480ee284d6c223604e9a90247f2f39ea2723a24 vfs_conf - export vfs.root.realroot via sysctl * export the tunable vfs.root.realroot via vfs.real_root sysctl. --- diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c index 626a22c374..0730ccca76 100644 --- a/sys/kern/vfs_conf.c +++ b/sys/kern/vfs_conf.c @@ -63,6 +63,7 @@ #include #include #include +#include #include "opt_ddb.h" #ifdef DDB @@ -630,3 +631,26 @@ DB_SHOW_COMMAND(disk, db_getdiskbyname) db_printf("No disk device matched.\n"); } #endif + +static int +vfs_sysctl_real_root(SYSCTL_HANDLER_ARGS) +{ + char *real_root; + size_t len; + int error; + + real_root = kgetenv("vfs.root.realroot"); + + if (real_root == NULL) + real_root = ""; + + len = strlen(real_root) + 1; + + error = sysctl_handle_string(oidp, real_root, len, req); + + return error; +} + +SYSCTL_PROC(_vfs, OID_AUTO, real_root, + CTLTYPE_STRING | CTLFLAG_RD, 0, 0, vfs_sysctl_real_root, + "A", "Real root mount string");