pkgbuilds/kernel-modules-hook-hardlinks/linux-modules-restore

12 lines
433 B
Text
Raw Normal View History

#!/bin/bash -e
kver=$(uname -r)
while read -r line; do
# We only care about the running kernel
2023-04-02 11:05:50 +08:00
if [[ "$line" == usr/lib/modules/$kver/vmlinuz && -d usr/lib/modules/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