[PATCH 1/3] Move the modules-extra processing to a script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 kernel.spec  | 68 +++++++-----------------------------------------------------
 mod-extra.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+), 61 deletions(-)
 create mode 100755 mod-extra.sh

diff --git a/kernel.spec b/kernel.spec
index 22184d0..f0b25d1 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -62,7 +62,7 @@ Summary: The Linux kernel
 # For non-released -rc kernels, this will be appended after the rcX and
 # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
 #
-%global baserelease 1
+%global baserelease 2
 %global fedora_build %{baserelease}
 
 # base_sublevel is the kernel version we're starting with and patching
@@ -563,6 +563,7 @@ Source11: genkey
 
 Source15: merge.pl
 Source16: mod-extra.list
+Source17: mod-extra.sh
 
 Source19: Makefile.release
 Source20: Makefile.config
@@ -1753,66 +1754,8 @@ BuildKernel() {
 
     rm -f modinfo modnames
 
-    pushd $RPM_BUILD_ROOT/lib/modules/$KernelVer/
-    rm -rf modnames
-    find . -name "*.ko" -type f > modnames
-    # Look through all of the modules, and throw any that have a dependency in
-    # our list into the list as well.
-    rm -rf dep.list dep2.list
-    rm -rf req.list req2.list
-    touch dep.list req.list
-    cp %{SOURCE16} .
-    for dep in `cat modnames`
-    do
-      depends=`modinfo $dep | grep depends| cut -f2 -d":" | sed -e 's/^[ \t]*//'`
-      [ -z "$depends" ] && continue;
-      for mod in `echo $depends | sed -e 's/,/ /g'`
-      do
-        match=`grep "^$mod.ko" mod-extra.list` ||:
-        if [ -z "$match" ]
-        then
-          continue
-        else
-          # check if the module we're looking at is in mod-extra too.  if so
-          # we don't need to mark the dep as required
-          mod2=`basename $dep`
-          match2=`grep "^$mod2" mod-extra.list` ||:
-          if [ -n "$match2" ]
-          then
-            continue
-            #echo $mod2 >> notreq.list
-          else
-            echo $mod.ko >> req.list
-          fi
-        fi
-      done
-    done
-
-    sort -u req.list > req2.list
-    sort -u mod-extra.list > mod-extra2.list
-    join -v 1 mod-extra2.list req2.list > mod-extra3.list
-
-    for mod in `cat mod-extra3.list`
-    do
-      # get the path for the module
-      modpath=`grep /$mod modnames` ||:
-      [ -z "$modpath" ]  && continue;
-      echo $modpath >> dep.list
-    done
-
-    sort -u dep.list > dep2.list
-
-    # now move the modules into the extra/ directory
-    for mod in `cat dep2.list`
-    do
-      newpath=`dirname $mod | sed -e 's/kernel\//extra\//'`
-      mkdir -p $newpath
-      mv $mod $newpath
-    done
-
-    rm modnames dep.list dep2.list req.list req2.list
-    rm mod-extra.list mod-extra2.list mod-extra3.list
-    popd
+    # Call the modules-extra script to move things around
+    %{SOURCE17} $RPM_BUILD_ROOT/lib/modules/$KernelVer %{SOURCE16}
 
     # remove files that will be auto generated by depmod at rpm -i time
     for i in alias alias.bin builtin.bin ccwmap dep dep.bin ieee1394map inputmap isapnpmap ofmap pcimap seriomap symbols symbols.bin usbmap devname softdep
@@ -2321,6 +2264,9 @@ fi
 #                 ||----w |
 #                 ||     ||
 %changelog
+* Fri Sep 14 2012 Josh Boyer <jwboyer@xxxxxxxxxx>
+- Move the modules-extra processing to a script
+
 * Fri Sep 14 2012 Dave Jones <davej@xxxxxxxxxx>
 - Fix license tag. (rhbz 450492)
 
diff --git a/mod-extra.sh b/mod-extra.sh
new file mode 100755
index 0000000..115950b
--- /dev/null
+++ b/mod-extra.sh
@@ -0,0 +1,66 @@
+#! /bin/bash
+
+Dir=$1
+List=$2
+
+pushd $Dir
+rm -rf modnames
+find . -name "*.ko" -type f > modnames
+# Look through all of the modules, and throw any that have a dependency in
+# our list into the list as well.
+rm -rf dep.list dep2.list
+rm -rf req.list req2.list
+touch dep.list req.list
+cp $2 .
+
+for dep in `cat modnames`
+do
+  depends=`modinfo $dep | grep depends| cut -f2 -d":" | sed -e 's/^[ \t]*//'`
+  [ -z "$depends" ] && continue;
+  for mod in `echo $depends | sed -e 's/,/ /g'`
+  do
+    match=`grep "^$mod.ko" mod-extra.list` ||:
+    if [ -z "$match" ]
+    then
+      continue
+    else
+      # check if the module we're looking at is in mod-extra too.  if so
+      # we don't need to mark the dep as required
+      mod2=`basename $dep`
+      match2=`grep "^$mod2" mod-extra.list` ||:
+      if [ -n "$match2" ]
+      then
+        continue
+          #echo $mod2 >> notreq.list
+        else
+          echo $mod.ko >> req.list
+      fi
+    fi
+  done
+done
+
+sort -u req.list > req2.list
+sort -u mod-extra.list > mod-extra2.list
+join -v 1 mod-extra2.list req2.list > mod-extra3.list
+
+for mod in `cat mod-extra3.list`
+do
+  # get the path for the module
+  modpath=`grep /$mod modnames` ||:
+  [ -z "$modpath" ]  && continue;
+  echo $modpath >> dep.list
+done
+
+sort -u dep.list > dep2.list
+
+# now move the modules into the extra/ directory
+for mod in `cat dep2.list`
+do
+  newpath=`dirname $mod | sed -e 's/kernel\//extra\//'`
+  mkdir -p $newpath
+  mv $mod $newpath
+done
+
+rm modnames dep.list dep2.list req.list req2.list
+rm mod-extra.list mod-extra2.list mod-extra3.list
+popd
-- 
1.7.11.4


_______________________________________________
kernel mailing list
kernel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/kernel



[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux