aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modutils/modprobe.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index 0b81142d5..f9aa0aa55 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -170,7 +170,8 @@ static struct dep_t *find_dep ( struct dep_t *dt, char *mod )
170} 170}
171 171
172 172
173static void check_dep ( char *mod, int loadit ) 173static void check_dep ( char *mod, int do_syslog,
174 int show_only, int verbose, int recursing )
174{ 175{
175 static struct dep_t *depend = (struct dep_t *) -1; 176 static struct dep_t *depend = (struct dep_t *) -1;
176 struct dep_t *dt; 177 struct dep_t *dt;
@@ -184,13 +185,18 @@ static void check_dep ( char *mod, int loadit )
184 int i; 185 int i;
185 186
186 for ( i = 0; i < dt-> m_depcnt; i++ ) 187 for ( i = 0; i < dt-> m_depcnt; i++ )
187 check_dep ( dt-> m_deparr [i], 1 ); 188 check_dep ( dt-> m_deparr [i], do_syslog,
189 show_only, verbose, 1);
188 } 190 }
189 if ( loadit ) { 191 if ( recursing ) {
190 char lcmd [128]; 192 char lcmd [256];
191 193
192 sprintf ( lcmd, "insmod -k %s 2>/dev/null", mod ); 194 snprintf(lcmd, sizeof(lcmd)-1, "insmod %s -q -k %s 2>/dev/null",
193 system ( lcmd ); 195 do_syslog ? "-s" : "", mod );
196 if (show_only || verbose)
197 printf("%s\n", lcmd);
198 if (!show_only)
199 system ( lcmd );
194 } 200 }
195} 201}
196 202
@@ -286,7 +292,7 @@ extern int modprobe_main(int argc, char** argv)
286 autoclean ? "-k" : ""); 292 autoclean ? "-k" : "");
287 293
288#ifdef CONFIG_MODPROBE_DEPEND 294#ifdef CONFIG_MODPROBE_DEPEND
289 check_dep ( argv [optind], 0 ); 295 check_dep ( argv [optind], do_syslog, show_only, verbose, 0);
290#endif 296#endif
291 297
292 while (optind < argc) { 298 while (optind < argc) {