Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 154369 Details for
Bug 239508
FEATURE: Add ability to specify alternate /proc/modules file
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch that actually works.
module-init-tools-add-proc-modules-opt.patch (text/plain), 5.49 KB, created by
Philip Pokorny
on 2007-05-09 01:02:41 UTC
(
hide
)
Description:
Patch that actually works.
Filename:
MIME Type:
Creator:
Philip Pokorny
Created:
2007-05-09 01:02:41 UTC
Size:
5.49 KB
patch
obsolete
>--- module-init-tools-3.1-pre5/modprobe.c.orig 2007-05-08 13:39:41.000000000 -0700 >+++ module-init-tools-3.1-pre5/modprobe.c 2007-05-08 17:56:00.000000000 -0700 >@@ -357,16 +357,20 @@ > } > } > >-/* Is module in /proc/modules? If so, fill in usecount if not NULL. >+/* Is module in the specified file (typically /proc/modules)? >+ If so, fill in usecount if not NULL. > 0 means no, 1 means yes, -1 means unknown. > */ >-static int module_in_kernel(const char *modname, int *usecount) >+static int module_in_kernel(const char *modname, char *proc_filename, int *usecount) > { > FILE *proc_modules; > char *line; > >+ /* No file to search */ >+ if( proc_filename == NULL ) >+ return -1; > /* Might not be mounted yet. Don't fail. */ >- proc_modules = fopen("/proc/modules", "r"); >+ proc_modules = fopen(proc_filename, "r"); > if (!proc_modules) > return -1; > >@@ -718,7 +722,7 @@ > const struct module_options *options, > const struct module_command *commands, > int ignore_commands, >- int ignore_proc, >+ char * proc_filename, > int strip_vermagic, > int strip_modversion) > { >@@ -735,7 +739,7 @@ > * they fail. */ > if (!list_empty(list)) { > insmod(list, NOFAIL(strdup("")), NULL, 0, warn, >- dry_run, verbose, options, commands, 0, ignore_proc, >+ dry_run, verbose, options, commands, 0, proc_filename, > strip_vermagic, strip_modversion); > } > >@@ -747,8 +751,8 @@ > } > > /* Don't do ANYTHING if already in kernel. */ >- if (!ignore_proc >- && module_in_kernel(newname ?: mod->modname, NULL) == 1) >+ if (proc_filename != NULL >+ && module_in_kernel(newname ?: mod->modname, proc_filename, NULL) == 1) > goto exists_error; > > command = find_command(mod->modname, commands); >@@ -815,7 +819,8 @@ > int verbose, > struct module_command *commands, > int ignore_commands, >- int ignore_inuse) >+ int ignore_inuse, >+ char * proc_filename) > { > const char *command; > unsigned int usecount = 0; >@@ -841,7 +846,7 @@ > goto remove_rest_no_unlock; > } > >- if (module_in_kernel(name, &usecount) == 0) >+ if (module_in_kernel(name, proc_filename, &usecount) == 0) > goto nonexistent_module; > > if (usecount != 0) { >@@ -869,7 +874,7 @@ > /* Now do things we depend. */ > if (!list_empty(list)) > rmmod(list, NULL, 0, warn, dry_run, verbose, commands, >- 0, 1); >+ 0, 1, proc_filename); > return; > > nonexistent_module: >@@ -1216,6 +1221,7 @@ > { "set-version", 1, NULL, 'S' }, > { "show-depends", 0, NULL, 'D' }, > { "first-time", 0, NULL, 3 }, >+ { "proc-modules", 1, NULL, 'p' }, > { NULL, 0, NULL, 0 } }; > > >@@ -1249,7 +1255,7 @@ > int ignore_commands = 0; > int strip_vermagic = 0; > int strip_modversion = 0; >- int ignore_proc = 0; >+ char *proc_filename = "/proc/modules" ; > int first_time = 0; > unsigned int i, num_modules; > char *type = NULL; >@@ -1272,7 +1278,7 @@ > try_old_version("modprobe", argv); > > uname(&buf); >- while ((opt = getopt_long(argc, argv, "vVC:o:rknqQsclt:aif", options, NULL)) != -1){ >+ while ((opt = getopt_long(argc, argv, "vVC:o:rknqQsclt:aifDp", options, NULL)) != -1){ > switch (opt) { > case 'v': > add_to_env_var("-v"); >@@ -1314,7 +1320,7 @@ > break; > case 'D': > dry_run = 1; >- ignore_proc = 1; >+ proc_filename = NULL; > verbose = 1; > add_to_env_var("-D"); > break; >@@ -1354,6 +1360,11 @@ > strip_vermagic = 1; > strip_modversion = 1; > break; >+ case 'p': >+ proc_filename = optarg ; >+ add_to_env_var("-p"); >+ add_to_env_var(proc_filename); >+ break ; > case 1: > strip_vermagic = 1; > break; >@@ -1476,11 +1487,12 @@ > > if (remove) > rmmod(&list, newname, first_time, error, dry_run, >- verbose, commands, ignore_commands, 0); >+ verbose, commands, ignore_commands, 0, >+ proc_filename); > else > insmod(&list, NOFAIL(strdup(optstring)), newname, > first_time, error, dry_run, verbose, modoptions, >- commands, ignore_commands, ignore_proc, >+ commands, ignore_commands, proc_filename, > strip_vermagic, strip_modversion); > free(modname); > } >--- module-init-tools-3.1-pre5/modprobe.8.orig 2007-05-08 16:39:24.000000000 -0700 >+++ module-init-tools-3.1-pre5/modprobe.8 2007-05-08 16:45:19.000000000 -0700 >@@ -9,7 +9,7 @@ > modprobe \- program to add and remove modules from the Linux Kernel > .SH SYNOPSIS > >-\fBmodprobe\fR [ \fB-v\fR ] [ \fB-V\fR ] [ \fB-C \fIconfig-file\fB\fR ] [ \fB-n\fR ] [ \fB-i\fR ] [ \fB-q\fR ] [ \fB-o \fImodulename\fB\fR ] [ \fB\fImodulename\fB\fR ] [ \fB\fImodule parameters\fB\fR\fI ...\fR ] >+\fBmodprobe\fR [ \fB-v\fR ] [ \fB-V\fR ] [ \fB-C \fIconfig-file\fB\fR ] [ \fB-p \fImodules-file\fB\fR ] [ \fB-n\fR ] [ \fB-i\fR ] [ \fB-q\fR ] [ \fB-o \fImodulename\fB\fR ] [ \fB\fImodulename\fB\fR ] [ \fB\fImodule parameters\fB\fR\fI ...\fR ] > > > \fBmodprobe\fR [ \fB-r\fR ] [ \fB-v\fR ] [ \fB-n\fR ] [ \fB-i\fR ] [ \fB\fImodulename\fB\fR\fI ...\fR ] >@@ -186,7 +186,7 @@ > compatibility checks (so > \fBmodprobe.old\fR(8) will never be run). > .TP >-\fB--show-depends \fR >+\fB-D --show-depends \fR > List the dependencies of a module (or alias), including > the module itself. This produces a (possibly empty) set > of module filenames, one per line. It does not run any >@@ -212,6 +212,11 @@ > want to know whether \fBmodprobe\fR really > did something: this option makes modprobe fail for that > case. >+.TP >+\fB-p --proc-modules \fR >+Specify an alternate filename to use for the currently >+loaded module information that would normally be read from >+/proc/modules. > .SH "BACKWARDS COMPATIBILITY" > .PP > This version of \fBmodprobe\fR is for kernels
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 239508
:
154366
| 154369