Without this change, a successful modprobe on Android exits with status 1
because Android doesn't have /etc/modprobe.conf or /etc/modprobe.d/ ---
neither of which seem to be required on desktop Linux either.
---
 toys/pending/modprobe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toys/pending/modprobe.c b/toys/pending/modprobe.c
index cbcfac8f..923026ba 100644
--- a/toys/pending/modprobe.c
+++ b/toys/pending/modprobe.c
@@ -553,8 +553,8 @@ void modprobe_main(void)
     if (toys.optflags&FLAG_v) puts("All modules loaded");
     return;
   }
-  dirtree_read("/etc/modprobe.conf", config_action);
-  dirtree_read("/etc/modprobe.d", config_action);
+  dirtree_flagread("/etc/modprobe.conf", DIRTREE_SHUTUP, config_action);
+  dirtree_flagread("/etc/modprobe.d", DIRTREE_SHUTUP, config_action);

   for (dirs = TT.dirs; dirs; dirs = dirs->next) {
     xchdir(dirs->arg);
-- 
2.20.1.97.g81188d93c3-goog
From 5928f3661fef1bda2de0bc14774fce61d9cdb759 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Tue, 8 Jan 2019 16:24:17 -0800
Subject: [PATCH] modprobe: don't return failure just because we didn't find
 global config.

Without this change, a successful modprobe on Android exits with status 1
because Android doesn't have /etc/modprobe.conf or /etc/modprobe.d/ ---
neither of which seem to be required on desktop Linux either.
---
 toys/pending/modprobe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toys/pending/modprobe.c b/toys/pending/modprobe.c
index cbcfac8f..923026ba 100644
--- a/toys/pending/modprobe.c
+++ b/toys/pending/modprobe.c
@@ -553,8 +553,8 @@ void modprobe_main(void)
     if (toys.optflags&FLAG_v) puts("All modules loaded");
     return;
   }
-  dirtree_read("/etc/modprobe.conf", config_action);
-  dirtree_read("/etc/modprobe.d", config_action);
+  dirtree_flagread("/etc/modprobe.conf", DIRTREE_SHUTUP, config_action);
+  dirtree_flagread("/etc/modprobe.d", DIRTREE_SHUTUP, config_action);
 
   for (dirs = TT.dirs; dirs; dirs = dirs->next) {
     xchdir(dirs->arg);
-- 
2.20.1.97.g81188d93c3-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to