Instantly share code, notes, and snippets.

Embed
What would you like to do?
initramfs hook to add modules/files for LVM thin/cache LV into initrd.
#!/bin/sh
# see: https://bugzilla.redhat.com/show_bug.cgi?id=921235
# http://forums.debian.net/viewtopic.php?f=5&t=119644
PREREQ="lvm2"
prereqs()
{
echo "$PREREQ"
}
case $1 in
prereqs)
prereqs
exit 0
;;
esac
if [ ! -x /usr/sbin/cache_check ]; then
exit 0
fi
. /usr/share/initramfs-tools/hook-functions
copy_exec /usr/sbin/cache_check
copy_exec /usr/sbin/cache_dump
copy_exec /usr/sbin/cache_repair
copy_exec /usr/sbin/cache_restore
copy_exec /usr/sbin/thin_check
copy_exec /usr/sbin/thin_dump
copy_exec /usr/sbin/thin_repair
copy_exec /usr/sbin/thin_restore
for x in dm_cache dm_cache_smq dm_thin_pool; do
manual_add_modules ${x}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment