Patching rc.firewall with modprobe -l

A little note to myself:

Since ~2011, the modprobe does not include -l (--list) function anymore, hence we need some workaround to some of our scripts that rely on that function. A trusty script made by wand [at], rc.firewall was affected by this change.

The solution is to replace the function by a new one. For rc.firewall case, it can be replaced easily by lsmod.

These are the lines that we changed:

    #modprobe -l is depreciated, and replaced by
    #if (( `modprobe -l | grep -c "$MODULE"` )); then
    #changed to:
    if (( `lsmod | grep -c "$MODULE"` )); then
      modprobe $MODULE > /dev/null 2>&1

For one who need a similar output of modprobe -l, we can use this function:

    find  /lib/modules/`uname -r`/kernel -type f -printf '%f\n'

A patched rc.firewall with lsmod is available here.


Popular posts from this blog

Xeon LGA 771 di mobo LGA 775

Writing and reading float using Arduino EEPROM

NTC Thermistor Incubator Part 3: Integrating double digits 7-segment