blob: 81159408e5db80a1b457ce2245739708bdd41432 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#!/bin/bash -e
kver = $(uname -r)
while read -r line; do
# We only care about the running kernel
if [[ "$line" == usr/lib/modules/$kver/vmlinuz && -d "${line/$kver/running-kernel}" ]];then
mount --mkdir --bind --options ro /usr/lib/modules/{running-kernel,$kver}
# Mounting read-only since the only modification here should be unmounting
# when rebooting or reinstalling the running kernel
fi
done
|