Module Name: src
Committed By: jnemeth
Date: Tue Jun 9 20:35:02 UTC 2009
Modified Files:
src/sbin/modload: main.c modload.8
src/sys/kern: kern_module.c
src/sys/sys: module.h
Log Message:
Add the MODCTL_NO_PROP flag to tell the kernel to ignore <module>.prop.
Add the '-P' option to modload(8) to set this flag.
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sbin/modload/main.c
cvs rdiff -u -r1.34 -r1.35 src/sbin/modload/modload.8
cvs rdiff -u -r1.47 -r1.48 src/sys/kern/kern_module.c
cvs rdiff -u -r1.14 -r1.15 src/sys/sys/module.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/modload/main.c
diff -u src/sbin/modload/main.c:1.10 src/sbin/modload/main.c:1.11
--- src/sbin/modload/main.c:1.10 Fri Jun 5 11:37:30 2009
+++ src/sbin/modload/main.c Tue Jun 9 20:35:02 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.10 2009/06/05 11:37:30 jnemeth Exp $ */
+/* $NetBSD: main.c,v 1.11 2009/06/09 20:35:02 jnemeth Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.10 2009/06/05 11:37:30 jnemeth Exp $");
+__RCSID("$NetBSD: main.c,v 1.11 2009/06/09 20:35:02 jnemeth Exp $");
#endif /* !lint */
#include <sys/module.h>
@@ -81,8 +81,11 @@
del_props = merge_props = output_props = false;
flags = 0;
- while ((ch = getopt(argc, argv, "b:d:fi:m:ps:")) != -1) {
+ while ((ch = getopt(argc, argv, "Pb:d:fi:m:ps:")) != -1) {
switch (ch) {
+ case 'P':
+ flags |= MODCTL_NO_PROP;
+ break;
case 'b':
parse_param(props, optarg, parse_bool_param);
break;
@@ -248,9 +251,9 @@
{
(void)fprintf(stderr,
- "Usage: %s [-f] [-b var=boolean] [-i var=integer] "
+ "Usage: %s [-P] [-f] [-b var=boolean] [-i var=integer] "
"[-s var=string] module\n"
- " %s -p [-b var=boolean] [-d var] [-i var=integer] "
+ " %s -p [-P] [-b var=boolean] [-d var] [-i var=integer] "
"[-m plist]\n [-s var=string]\n",
getprogname(), getprogname());
exit(EXIT_FAILURE);
Index: src/sbin/modload/modload.8
diff -u src/sbin/modload/modload.8:1.34 src/sbin/modload/modload.8:1.35
--- src/sbin/modload/modload.8:1.34 Fri Jun 5 11:37:30 2009
+++ src/sbin/modload/modload.8 Tue Jun 9 20:35:02 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: modload.8,v 1.34 2009/06/05 11:37:30 jnemeth Exp $
+.\" $NetBSD: modload.8,v 1.35 2009/06/09 20:35:02 jnemeth Exp $
.\"
.\" Copyright (c) 1993 Christopher G. Demetriou
.\" All rights reserved.
@@ -32,7 +32,7 @@
.\"
.\" <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
.\"
-.Dd June 5, 2009
+.Dd June 9, 2009
.Dt MODLOAD 8
.Os
.Sh NAME
@@ -43,6 +43,7 @@
.Op Fl f
.Op Fl b Ar var=boolean
.Op Fl i Ar var=integer
+.Op Fl P
.Op Fl s Ar var=string
.Ar module
.Nm
@@ -51,6 +52,7 @@
.Op Fl d Ar var
.Op Fl i Ar var=integer
.Op Fl m Ar plist
+.Op Fl P
.Op Fl s Ar var=string
.Sh DESCRIPTION
The
@@ -100,6 +102,8 @@
.Fl p ,
merge new options with an existing property list contained in
.Ar plist .
+.It Fl P
+This option tells the kernel not to load an associated property list.
.It Fl p
Output a property list suitable for loading along with a module.
When using this option, you do not need to specify a module.
Index: src/sys/kern/kern_module.c
diff -u src/sys/kern/kern_module.c:1.47 src/sys/kern/kern_module.c:1.48
--- src/sys/kern/kern_module.c:1.47 Tue Jun 9 19:09:03 2009
+++ src/sys/kern/kern_module.c Tue Jun 9 20:35:02 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_module.c,v 1.47 2009/06/09 19:09:03 jnemeth Exp $ */
+/* $NetBSD: kern_module.c,v 1.48 2009/06/09 20:35:02 jnemeth Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.47 2009/06/09 19:09:03 jnemeth Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.48 2009/06/09 20:35:02 jnemeth Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -788,7 +788,8 @@
/*
* Load and process <module>.prop if it exists.
*/
- if (mod->mod_source == MODULE_SOURCE_FILESYS) {
+ if (((flags & MODCTL_NO_PROP) == 0) &&
+ (mod->mod_source == MODULE_SOURCE_FILESYS)) {
error = module_load_plist_file(path, nochroot, &plist,
&plistlen);
if (error != 0) {
Index: src/sys/sys/module.h
diff -u src/sys/sys/module.h:1.14 src/sys/sys/module.h:1.15
--- src/sys/sys/module.h:1.14 Tue Nov 25 15:14:07 2008
+++ src/sys/sys/module.h Tue Jun 9 20:35:02 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: module.h,v 1.14 2008/11/25 15:14:07 ad Exp $ */
+/* $NetBSD: module.h,v 1.15 2009/06/09 20:35:02 jnemeth Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -139,7 +139,8 @@
typedef struct modctl_load {
const char *ml_filename;
-#define MODCTL_LOAD_FORCE 1
+#define MODCTL_NO_PROP 0x2
+#define MODCTL_LOAD_FORCE 0x1
int ml_flags;
const char *ml_props;