Script to load all kernel modules. Courtesy of ChatGPT.
#!/bin/sh
sed -n 's#.*/\\(.*\\.ko\\)$#\\1#p' /lib/modules/$(uname -r)/modules.order | while read -r module; do
modprobe "$module"
done
Script to load 5 kernel modules every 10 seconds. Courtesy of ChatGPT.
#!/bin/sh
counter=0
lines_per_batch=5
end_line=0
sed -n 's#.*/\\(.*\\.ko\\)$#\\1#p' /lib/modules/$(uname -r)/modules.order | while read -r module; do
modprobe "$module"
counter=`expr $counter + 1`
end_line=`expr $end_line + 1`
if [ $counter -eq $lines_per_batch ]; then
counter=0
lsmod
echo "Loaded 5 modules, ending at line $end_line. Waiting 10 seconds."
for i in $(seq 1 10); do
echo -n "."
sleep 1
done
echo
fi
done