mirror of
https://github.com/archlinux-jerry/pkgbuilds
synced 2024-11-29 09:20:41 +08:00
12 lines
528 B
Bash
12 lines
528 B
Bash
#!/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 /usr/lib/modules/running-kernel ]];then
|
|
systemd-mount --quiet --options=bind,ro --property=LazyUnmount=1 /usr/lib/modules/{running-kernel,$kver}
|
|
# Mounting read-only since the only modification here should be unmounting
|
|
# when rebooting or reinstalling the running kernel
|
|
# LazyUnmount at shutdown in case udevd is blocking us
|
|
fi
|
|
done
|