Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
find the module name
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7193

PostPosted: Sun Aug 25, 2019 11:56 am    Post subject: find the module name Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14273

PostPosted: Sun Aug 25, 2019 4:14 pm    Post subject: Re: find the module name Reply with quote

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
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7193

PostPosted: Sun Aug 25, 2019 4:45 pm    Post subject: Reply with quote

oh gawk magic :)
thanks Hu
ps: appreciate the module dir check, didn't think to make one
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum