Control: tags 694870 +patch

I made an *untested* patch based on:

  
http://tcosproject.org/cgit/tcos.git/commit/?id=bd77023afadfe96a0c6ab86343b02b695567439f

It only fixes the "modprobe -l" issues, leaving out the other changes:

diff --git a/bin/gentcos b/bin/gentcos
index 4999489..6632fac 100755
--- a/bin/gentcos
+++ b/bin/gentcos
@@ -466,14 +466,10 @@ check_modules() {
        if [ "$(echo $_module | awk -F "|" '{print $2}')" != "" ]; then
          for _mod in $(echo $_module | sed 's/|/ /g'); do
            #_echo "searching for module $_mod"
-           have_one_module=$(modprobe --set-version="${TCOS_KERNEL}" -l 
${_mod} | wc -l)
-           if [ ${have_one_module} != 0 ]; then
-              #_echo "have $_mod !!!"
-              have_module=1
-           fi
+           tcos_find_module "${_mod}" && have_module=1
          done
        else
-         have_module=$(modprobe --set-version="${TCOS_KERNEL}" -l ${_module} | 
wc -l)
+         tcos_find_module "${_module}" && have_module=1
        fi
 
        if [ ${have_module} = 0 ] ; then
diff --git a/conf/tcos-generation-functions.sh 
b/conf/tcos-generation-functions.sh
index 7b6e7a5..f860952 100644
--- a/conf/tcos-generation-functions.sh
+++ b/conf/tcos-generation-functions.sh
@@ -247,6 +247,17 @@ force_add_module() {
         # end of force copy
 }
 
+tcos_find_module() {
+  mod=$(find /lib/modules/${TCOS_KERNEL} -name ${1}.ko | tail -1)
+  if [ "$mod" = "" ] ; then
+    return 1
+  fi
+  if [ "$(basename $mod .ko)" = "$1" ]; then
+    return 0
+  fi
+  return 1
+}
+
 parse_pxelinuxcfg() {
         if [ $TCOS_NETBOOT_MENU ] && [ -z $2 ]; then
           TEMPLATE=${TCOS_CONF}/${TCOS_PXECFG_MENU}
diff --git a/conf/tcos-run-functions.sh b/conf/tcos-run-functions.sh
index 7bcd8a7..4e79180 100644
--- a/conf/tcos-run-functions.sh
+++ b/conf/tcos-run-functions.sh
@@ -103,6 +103,17 @@ _log () {
   /bin/logger -t "$(echo $1| awk '{print $1}')" "$@" >> /tmp/initramfs.debug 
2>&1
 }
 
+tcos_find_module() {
+  mod=$(find /lib/modules/${version} -name ${1}.ko | tail -1)
+  if [ "$mod" = "" ] ; then
+    return 1
+  fi
+  if [ "$(basename $mod .ko)" = "$1" ]; then
+    return 0
+  fi
+  return 1
+}
+
 read_server() {
   # $1 is server hostname
   nSERVER=$(grep "$1" /etc/hosts | awk '{print $1}' | head -1)
diff --git a/hooks-addons/05compcache b/hooks-addons/05compcache
index 586cc6a..f8cae1e 100644
--- a/hooks-addons/05compcache
+++ b/hooks-addons/05compcache
@@ -35,6 +35,9 @@ fi
 
 quiet=n
 
+. /conf/tcos.conf
+. /conf/tcos-run-functions
+
 # find total amount of available ram
 TOTAL_RAM=\$(grep MemTotal /proc/meminfo |tr -d ': [A-Z][a-z]')
 
@@ -52,8 +55,8 @@ if [ "\${kbytes}" -gt "\${AVALAIBLE_RAM}" ]; then
 fi
 
 
-if modprobe --list zram | grep -q zram; then
-  modprobe zram num_devices=1
+if tcos_find_module "zram"; then
+  modprobe zram
   echo \$((1024*\$kbytes)) > /sys/block/zram0/disksize
   /sbin/mkswap /dev/zram0 >/dev/null 2>&1
   /sbin/swapon -p 100 /dev/zram0 >/dev/null 2>&1
diff --git a/hooks-addons/40etc2300 b/hooks-addons/40etc2300
index 84775f3..1bbd177 100644
--- a/hooks-addons/40etc2300
+++ b/hooks-addons/40etc2300
@@ -34,7 +34,7 @@ chmod +x ${DESTDIR}/scripts/tcos-bottom/15etc2300
 stat_before
  
   manual_add_modules sis5513
-  if modprobe --set-version="${TCOS_KERNEL}" -l| grep -q snd-sis7019 ; then
+  if ! tcos_find_module "snd-sis7019" ; then
     manual_add_modules ac97_codec
     manual_add_modules sis7019
   else
diff --git a/hooks/tcosmods b/hooks/tcosmods
index a01aa31..7def177 100755
--- a/hooks/tcosmods
+++ b/hooks/tcosmods
@@ -92,16 +92,11 @@ TCOS_DISABLE_IDE=$(read_env_var "TCOS_DISABLE_IDE" 
"$TCOS_DISABLE_IDE")
 
     # put floppy outside /lib/modules
     mkdir -p $DESTDIR/lib/extramodules
-    FLOPPY_MOD=$(modprobe --set-version="${TCOS_KERNEL}" --list "floppy" 
2>/dev/null)
-    FLOPPY_IDE_MOD=$(modprobe --set-version="${TCOS_KERNEL}" --list 
"ide-floppy")
-
-    # new modprobe versions return relative PATH
-    if [ ! -e "${FLOPPY_MOD}" ] && [ "${FLOPPY_MOD}" != "" ] && [ -e 
"/lib/modules/${TCOS_KERNEL}/${FLOPPY_MOD}" ]; then
-      FLOPPY_MOD="/lib/modules/${TCOS_KERNEL}/${FLOPPY_MOD}"
+    if tcos_find_module "floppy"; then
+        FLOPPY_MOD=$(find /lib/modules/${TCOS_KERNEL} -name floppy.ko | tail 
-1)
     fi
-
-    if [ ! -e "${FLOPPY_IDE_MOD}" ] && [ "${FLOPPY_IDE_MOD}" != "" ] && [ -e 
"/lib/modules/${TCOS_KERNEL}/${FLOPPY_IDE_MOD}" ]; then
-      FLOPPY_IDE_MOD="/lib/modules/${TCOS_KERNEL}/${FLOPPY_IDE_MOD}"
+    if tcos_find_module "ide-floppy"; then
+        FLOPPY_IDE_MOD=$(find /lib/modules/${TCOS_KERNEL} -name ide-floppy.ko 
| tail -1)
     fi
 
 
@@ -166,15 +161,8 @@ TCOS_DISABLE_IDE=$(read_env_var "TCOS_DISABLE_IDE" 
"$TCOS_DISABLE_IDE")
 
 
     if [ "$TCOS_CPUFREQ" = "1" ]; then
-        # modprobe -l| grep cpufreq_| awk -F"/" '{print $NF}'| sed -e 
's/.ko//g'
-        CPUFREQ_MODS=$(modprobe --set-version="${TCOS_KERNEL}" --list 
2>/dev/null| awk -F"/" '/cpufreq_/ {print $NF}'| sed -e s/".ko"//g)
-        CPUFREQ_CPU_MODS=$(modprobe --set-version="${TCOS_KERNEL}" --list 
2>/dev/null| awk -F"/" '/cpu\/cpufreq/ {print $NF}' | sed -e s/".ko"//g)
-         _echo "   TCOS adding CPUFREQ modules"
-        for _mod in $CPUFREQ_MODS; do
-            tcos_manual_add_modules $_mod
-        done
-        for _mod in $CPUFREQ_CPU_MODS; do
-            tcos_manual_add_modules $_mod
+        for _mod in $(find /lib/modules/${TCOS_KERNEL} | grep cpufreq| grep 
ko$); do
+            tcos_manual_add_modules $(basename $_mod .ko)
         done
     fi
 

live well,
  vagrant


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to