View previous topic :: View next topic |
Author |
Message |
krinn Watchman


Joined: 02 May 2003 Posts: 7470
|
Posted: Sun Aug 25, 2019 11:56 am Post subject: find the module name |
|
|
for ones (like me) who always forget that this f@!#@ module name for /proc/config.gz is named configs, i made a script that browse all modules and output their names and description
simple but it do the work
Code: | #/bin/sh
modules_dir="/lib/modules/$(uname -r)/"
modules_list="$(cut -d ':' -f1 ${modules_dir}modules.dep)"
while read -r line; do
name="$(modinfo ${modules_dir}${line} | grep '^name:' | sed -r 's/.{16}//')"
desc="$(modinfo ${modules_dir}${line} | grep '^description:' | sed -r 's/.{16}//')"
echo "$name: $desc"
done <<< "${modules_list}" |
|
|
Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 23121
|
Posted: Sun Aug 25, 2019 4:14 pm Post subject: Re: find the module name |
|
|
Code: | #/bin/sh
cd "/lib/modules/$(uname -r)/" || exit 1
cut -d ':' -f1 "modules.dep" | while read -r line; do
modinfo "$line" | gawk '/^name:/ { NAME=$2; } /^description:/ { $1=""; DESC = $0; } END { print NAME ":" DESC; }'
done
|
|
|
Back to top |
|
 |
krinn Watchman


Joined: 02 May 2003 Posts: 7470
|
Posted: Sun Aug 25, 2019 4:45 pm Post subject: |
|
|
oh gawk magic
thanks Hu
ps: appreciate the module dir check, didn't think to make one |
|
Back to top |
|
 |
|