On 06/03/2011 03:13 PM, Dave Reisner wrote:
Do a single grep to compare the contents of the module file (if exists)
against the results of all_modules for the provided arguments. If
there's no module file, this is still just pass through to all_modules.

Signed-off-by: Dave Reisner<[email protected]>
---
  functions |   11 +++--------
  1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/functions b/functions
index c93701d..5aa8435 100644
--- a/functions
+++ b/functions
@@ -66,16 +66,11 @@ all_modules ()

  checked_modules ()
  {
-    if [ -e "${MODULE_FILE}" ]; then
-        for mod in $(all_modules $@); do
-            modname=$(get_module_name "${mod}")
-            if grep -q "^${modname}$" "${MODULE_FILE}"; then
-                echo ${modname}
-            fi
-        done
+    if [ -s "${MODULE_FILE}" ]; then
+        grep -xFf "$MODULE_FILE"<(all_modules "$@")
          return 1
      else
-        all_modules ${@}
+        all_modules "$@"
      fi
  }

Hi Dave,

I guess this commit cause an issue with this used in archiso_pxe_nbd hook:

MODULES="nbd $(checked_modules "/drivers/net/" | grep -v -e "/irda/" -e "/phy/" -e "/plip" -e "/ppp" -e "/wimax/" -e "/wireless/") "

Excluded paths are present in initramfs image.


--
Gerardo Exequiel Pozzi
\cos^2\alpha + \sin^2\alpha = 1

Reply via email to