sync

# Wait until we see some android processes to consider boot is more or less complete (credits to AndiP71)
while ! /system/bin/pgrep -f com.android ; do
  sleep 1
done

rm /data/.arter97/bootdone

# try mounting exFAT on /storage/sdcard1
if ! busybox mount | busybox grep /storage/sdcard1; then
	busybox chown 0.1015 /storage/sdcard1
	busybox chmod 775 /storage/sdcard1
	busybox mount -t exfat /dev/block/mmcblk1p1 /storage/sdcard1
fi

# Wait until bootanimation, dexopt ends (arter97)

sleep 5

while /system/bin/pgrep bootanimation ; do
  sleep 1
done

sleep 5

while /system/bin/pgrep dexopt ; do
  sleep 1
done

# Wait just a bit more . . .
sleep 10

# boost-boot (arter97) - 2
sync
