void-packages/srcpkgs/lvm2/files/lvm2.initramfs-hook

39 lines
636 B
Bash

#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
prereqs)
prereqs
exit 0
;;
esac
if [ ! -x /usr/sbin/lvm -o ! -x /usr/sbin/dmsetup ]; then
exit 0
fi
. /usr/share/initramfs-tools/hook-functions
if [ -e /etc/lvm/lvm.conf ]; then
mkdir -p ${DESTDIR}/etc/lvm
cp /etc/lvm/lvm.conf ${DESTDIR}/etc/lvm/
fi
mkdir -p ${DESTDIR}/lib/udev/rules.d
for f in 10-dm.rules 11-dm-lvm.rules 13-dm-disk.rules 95-dm-notify.rules; do
cp /lib/udev/rules.d/${f} ${DESTDIR}/lib/udev/rules.d
done
copy_exec /usr/sbin/dmsetup /sbin
copy_exec /usr/sbin/lvm /sbin
for x in dm_mod dm_snapshot dm_mirror; do
manual_add_modules ${x}
done