Fix for LineageOS build

 * Match LineageOS cryptfs_hw location
 * Fallback to toybox if busybox is not persent, and warn about this

Change-Id: I5bc1399602f59f4d22827ff7e47acb901b1e33c6
diff --git a/Android.mk b/Android.mk
index 523cfec..1a4d1fb 100644
--- a/Android.mk
+++ b/Android.mk
@@ -184,6 +184,23 @@
     LOCAL_ADDITIONAL_DEPENDENCIES += libhardware
 endif
 
+ifeq ($(wildcard external/busybox/Android.mk),)
+    TW_USE_TOOLBOX := true
+    $(warning **********************************)
+    $(warning * You're using toybox for TWRP,  *)
+    $(warning * some tools are not available,  *)
+    $(warning * busybox is highly recommended! *)
+    $(warning **********************************)
+endif
+
+ifeq ($(TARGET_HW_DISK_ENCRYPTION),true)
+    ifneq ($(wildcard vendor/qcom/opensource/cryptfs_hw/Android.mk),)
+        TARGET_CRYPTFS_HW_PATH ?= vendor/qcom/opensource/cryptfs_hw
+    else
+        TARGET_CRYPTFS_HW_PATH ?= device/qcom/common/cryptfs_hw
+    endif
+endif
+
 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
 
 #ifeq ($(TARGET_RECOVERY_UI_LIB),)