Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # this rebuilds all modules built against a kernel - used after a kernel update.
- tmpfile="/tmp/rebuild.list"
- mr_packages=""
- tm_cmd="emerge -v"
- mr_modules=""
- mr_command=""
- . /etc/conf.d/mrebuild.conf
- function prep() {
- >${tmpfile}
- }
- function populate_list() {
- module-rebuild populate
- module-rebuild list |awk '{if (NR!=1) {print}}'|tr -d " " |awk '{print $1}' >>${tmpfile} |tee
- qlist -IC x11-drivers/ >>${tmpfile}
- echo "${mr_packages}" >>${tmpfile}
- }
- function rebuild_list() {
- ${tm_cmd} ${tm_opts} `cat ${tmpfile}`
- }
- function reload_modules() {
- rmmod ${mr_modules}
- ${mr_command}
- modprobe ${mr_modules}
- /etc/init.d/modules restart
- }
- function cleanup() {
- rm ${tmpfile}
- env-update
- source /etc/profile
- echo -e "\nMODULES REBUILT AND RELOADED...\n"
- }
- case ${1} in
- --go)
- prep
- populate_list
- rebuild_list
- reload_modules
- cleanup
- ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement