#!/bin/bash # rebuilds all modules (for portage versions without sets, those that have sets may can use the set 'module-rebuild') emerge -av --oneshot $(find /var/db/pkg/ -name CONTENTS -exec grep -Hn /lib/modules {} \; | sed 's_.*/\(.*/.*\)/CON.*_=\1_' | sort -u)