- # i use dm for crypt, not lvm, so this gives false positive. todo, send patch to remove this
- # upstream.
- # usedm=$(dmsetup ls 2>/dev/null | egrep -v '^live-rw|^live-base|^No devices found' | wc -l)
- # if [ $usedm -ne 0 ]; then
- # if [ ! -d $target/etc/lvm ]; then
- # echo ERROR: Found lvm devices, but the lvm2 package was not installed
- # error=1
- # fi
- # fi
+ if [ -f $target/etc/crypttab ] && [ ! -f $target/sbin/cryptsetup ]; then
+ echo ERROR: Encrypted devices used, but the crypsetup package was not installed.
+ echo ERROR: You want to add cryptsetup-initramfs or dracut to some package_config file.
+ fi
+
+ # note, if we used dm for crypt, not lvm, so would givee false positive. todo, send patch to fix
+ usedm=$(dmsetup ls 2>/dev/null | egrep -v '^live-rw|^live-base|^No devices found' | wc -l)
+ if [ $usedm -ne 0 ]; then
+ if [ ! -d $target/etc/lvm ]; then
+ echo ERROR: Found lvm devices, but the lvm2 package was not installed
+ error=1
+ fi
+ fi