[General Questions and Answers] Zyr0:
First of all, I must say that I'm quite new to this community. I've been messing around with kernels, but suddenly my device refuse to boot. I've tried resetting every single partition thats available and formatting data through TWRP. I also tried re-installing official fastboot ROM from en.miui.com that reset everything. Including boot.img and recovery.img. However, nothing seem to make any progress.

The symptoms of my problem are as follows:

1. Phone turns on; splash screen is displayed.

2. it stays there for a couple of second before displaying the couple first boot animation frames.

3. it freezes while the boot animation is running.

4. then it restarts itself and the whole process is repeated.

This actually happened to me not too long ago, but it came back to life just after a simple "battery unplug". However, this time it presist. Even after a full format of EVERYTHING in my phone. Luckly, there's none of my important data in there.

I then retrieved my log file through twrp. Here's what i got at the end of my log file:

<13>[ 3.523346] init: (Initializing SELinux non-enforcing took 0.04s.)
<13>[ 3.525498] init: init second stage started!
<13>[ 3.529071] init: Running restorecon...
<11>[ 3.568153] init: waitpid failed: No child processes
<13>[ 3.568577] init: (Loading properties from /default.prop took 0.00s.)
<11>[ 3.569064] init: /init.rc: 13: invalid keyword 'setcon'
<11>[ 3.569192] init: /init.rc: 61: invalid keyword 'load_all_props'
<11>[ 3.569300] init: could not import file '/init.recovery.logd.rc' from '/init.rc': No such file or directory
<13>[ 3.569427] init: (Parsing /init.recovery.usb.rc took 0.00s.)
<13>[ 3.569488] init: (Parsing /init.recovery.service.rc took 0.00s.)
<11>[ 3.569520] init: could not import file '/init.recovery.vold_decrypt.rc' from '/init.rc': No such file or directory
<13>[ 3.569742] init: (Parsing /init.recovery.qcom.rc took 0.00s.)
<13>[ 3.569757] init: (Parsing /init.rc took 0.00s.)
<5>[ 3.569862] audit: type=1400 audit(11.620:3): avc: denied { setcheckreqprot } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:object_r:kernel:s0 tclass=security permissive=1
<13>[ 3.569934] init: Starting service 'ueventd'...
<13>[ 3.570353] init: Waiting for /dev/.coldboot_done...
<13>[ 3.571800] ueventd: ueventd started!
<6>[ 3.605035] FG: get_prop_capacity: loading batt profile, return last soc 99
<6>[ 3.625762] FG: get_prop_capacity: loading batt profile, return last soc 99
<13>[ 3.979764] ueventd: Coldboot took 0.41s.
<13>[ 3.984123] init: Waiting for /dev/.coldboot_done took 0.41s.
<7>[ 3.986624] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
<7>[ 3.987824] SELinux: initialized (dev pstore, type pstore), uses genfs_contexts
<7>[ 3.989003] SELinux: initialized (dev functionfs, type functionfs), uses genfs_contexts
<5>[ 3.990202] audit: type=1400 audit(12.043:4): avc: denied { mounton } for pid=1 comm="init" path="/dev/usb-ffs/adb" dev="functionfs" ino=119 scontext=u:r:init:s0 tcontext=u:object_r:functionfs:s0 tclass=dir permissive=1
<6>[ 3.990243] ffs_data_put(): freeing
<3>[ 3.990494] enable_store: android_usb: already disabled
<13>[ 3.990912] init: (Loading properties from /system/build.prop took 0.00s.)
<13>[ 3.990949] init: (Loading properties from /vendor/build.prop took 0.00s.)
<13>[ 3.990981] init: (Loading properties from /factory/factory.prop took 0.00s.)
<11>[ 3.991030] fs_mgr: Cannot open file /fstab.qcom
<11>[ 3.991046] init: unable to read fstab /fstab.qcom: No such file or directory
<13>[ 3.991090] init: (Loading properties from /data/local.prop took 0.00s.)
<11>[ 3.991119] init: Unable to open persistent property directory "/data/property": No such file or directory
<13>[ 3.991667] init: Starting service 'set_permissive'...
<13>[ 3.992082] init: Starting service 'recovery'...
<13>[ 3.992380] init: Starting service 'ldconfigtxt'...
<13>[ 3.992850] init: write_file: Unable to open '/dev/cpuset/foreground/cpus': No such file or directory
<13>[ 3.992897] init: write_file: Unable to open '/dev/cpuset/foreground/boost/cpus': No such file or directory
<13>[ 3.992935] init: write_file: Unable to open '/dev/cpuset/background/cpus': No such file or directory
<13>[ 3.992973] init: write_file: Unable to open '/dev/cpuset/system-background/cpus': No such file or directory
<13>[ 3.993018] init: write_file: Unable to open '/dev/cpuset/top-app/cpus': No such file or directory
<5>[ 3.993072] random: permissive.sh urandom read with 86 bits of entropy available
<5>[ 3.993075] random: recovery urandom read with 86 bits of entropy available
<13>[ 3.993330] init: Starting service 'adbd'...
<6>[ 3.993938] msm_thermal:store_cc_enabled Core control disabled
<6>[ 3.994286] mode_store: bcl disabled
<6>[ 3.994371] hotplug_mask_store: bcl hotplug mask updated to 0
<6>[ 3.994418] hotplug_soc_mask_store: bcl soc hotplug mask updated to 0
<6>[ 3.994456] FG: get_prop_capacity: loading batt profile, return last soc 99
<6>[ 3.995388] mode_store: bcl enabled
<6>[ 3.997232] read descriptors
<6>[ 3.997250] read strings
<6>[ 3.998712] msm_thermal:store_cc_enabled Core control enabled
<6>[ 3.999004] mode_store: bcl disabled
<6>[ 3.999074] hotplug_mask_store: bcl hotplug mask updated to 12
<6>[ 3.999115] hotplug_soc_mask_store: bcl soc hotplug mask updated to 8
<6>[ 3.999154] FG: get_prop_capacity: loading batt profile, return last soc 99
<6>[ 3.999598] mode_store: bcl enabled
<13>[ 3.999842] init: write_file: Unable to write to '/proc/sys/kernel/sched_downmigrate': Invalid argument
<5>[ 4.001100] audit: type=1400 audit(12.053:5): avc: denied { write } for pid=388 comm="touch" name="sbin" dev="rootfs" ino=6900 scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=1
<5>[ 4.001144] audit: type=1400 audit(12.053:6): avc: denied { add_name } for pid=388 comm="touch" name="ld.config.txt" scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=1
<5>[ 4.001188] audit: type=1400 audit(12.053:7): avc: denied { create } for pid=388 comm="touch" name="ld.config.txt" scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=1
<5>[ 4.001266] audit: type=1400 audit(12.053:8): avc: denied { write } for pid=388 comm="touch" path="/sbin/ld.config.txt" dev="rootfs" ino=1256 scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=1
<13>[ 4.002502] init: Service 'ldconfigtxt' (pid 388) exited with status 0
<5>[ 4.009764] audit: type=1400 audit(12.060:9): avc: denied { write } for pid=396 comm="setenforce" name="enforce" dev="selinuxfs" ino=4 scontext=u:r:recovery:s0 tcontext=u:object_r:selinuxfs:s0 tclass=file permissive=1
<13>[ 4.011933] init: Service 'set_permissive' (pid 386) exited with status 0
<4>[ 4.013950] drv2604_firmware_load : firmware not found,use default settings.
<11>[ 4.049875] init: avc: denied { set } for property=twrp.crash_counter pid=387 uid=0 gid=0 scontext=u:r:recovery:s0 tcontext=u:object_r:default_prop:s0 tclass=property_service permissive=1
<3>[ 4.109934] <CORE> smem:rpm:rpm_requests[1:2] xprt_single_threaded_tx: Error -28 writing data
<3>[ 4.110070] <CORE> smem:rpm:rpm_requests[1:2] xprt_single_threaded_tx: Error -28 writing data
<3>[ 4.110206] <CORE> smem:rpm:rpm_requests[1:2] xprt_single_threaded_tx: Error -28 writing data
<5>[ 4.588221] synaptics_rmi4_sensor_report: spontaneous reset detected
<5>[ 4.684448] audit: type=1400 audit(12.736:10): avc: denied { create } for pid=387 comm="recovery" name="mtab" scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=lnk_file permissive=1
<6>[ 4.697873] EXT4-fs (sda12): recovery complete
<6>[ 4.697893] EXT4-fs (sda12): mounted filesystem with ordered data mode. Opts:
<7>[ 4.697916] SELinux: initialized (dev sda12, type ext4), uses xattr
<6>[ 4.697932] SELinux: Context u:object_r:mnt_vendor_file:s0 is not valid (left unmapped).
<6>[ 4.711393] EXT4-fs (sda13): recovery complete
<6>[ 4.711413] EXT4-fs (sda13): mounted filesystem with ordered data mode. Opts:
<7>[ 4.711433] SELinux: initialized (dev sda13, type ext4), uses xattr
<6>[ 4.721093] EXT4-fs (sda14): recovery complete
<6>[ 4.721112] EXT4-fs (sda14): mounted filesystem with ordered data mode. Opts:
<7>[ 4.721132] SELinux: initialized (dev sda14, type ext4), uses xattr
<6>[ 4.750194] EXT4-fs (sda14): mounted filesystem with ordered data mode. Opts:
<7>[ 4.750226] SELinux: initialized (dev sda14, type ext4), uses xattr
<6>[ 4.784490] EXT4-fs (sde39): mounted filesystem without journal. Opts:
<7>[ 4.784543] SELinux: initialized (dev sde39, type ext4), uses xattr
<6>[ 4.794826] EXT4-fs (sde38): mounted filesystem without journal. Opts:
<7>[ 4.794875] SELinux: initialized (dev sde38, type ext4), uses xattr
<6>[ 4.794910] SELinux: Context u:object_r:vendor_file:s0 is not valid (left unmapped).
<6>[ 4.809113] SELinux: Context u:object_r:network_watchlist_data_file:s0 is not valid (left unmapped).
<6>[ 4.809323] SELinux: Context u:object_r:textclassifier_data_file:s0 is not valid (left unmapped).
<6>[ 4.813600] SELinux: Context u:object_r:update_engine_log_data_file:s0 is not valid (left unmapped).
<6>[ 4.814065] SELinux: Context u:object_r:wm_trace_data_file:s0 is not valid (left unmapped).
<6>[ 4.816872] SELinux: Context u:object_r:incident_data_file:s0 is not valid (left unmapped).
<6>[ 4.817438] SELinux: Context u:object_r:stats_data_file:s0 is not valid (left unmapped).
<6>[ 4.818887] SELinux: Context u:object_r:trace_data_file:s0 is not valid (left unmapped).
<6>[ 4.820577] SELinux: Context u:object_r:vendor_data_file:s0 is not valid (left unmapped).
<6>[ 4.821804] SELinux: Context u:object_r:tombstone_wifi_data_file:s0 is not valid (left unmapped).
<6>[ 4.825785] SELinux: Context u:object_r:wpa_data_file:s0 is not valid (left unmapped).
<6>[ 4.826118] SELinux: Context u:object_r:hostapd_data_file:s0 is not valid (left unmapped).
<6>[ 4.860460] SELinux: Context u:object_r:fingerprint_vendor_data_file:s0 is not valid (left unmapped).
<6>[ 4.897685] SELinux: Context u:object_r:storaged_data_file:s0 is not valid (left unmapped).
<7>[ 4.915536] SELinux: initialized (dev sde35, type vfat), uses genfs_contexts
<6>[ 4.930176] EXT4-fs (sda12): mounted filesystem with ordered data mode. Opts:
<7>[ 4.930241] SELinux: initialized (dev sda12, type ext4), uses xattr
<6>[ 5.181804] FG: get_prop_capacity: loading batt profile, return last soc 99
<11>[ 5.789189] init: avc: denied { set } for property=sys.usb.config pid=387 uid=0 gid=0 scontext=u:r:recovery:s0 tcontext=u:object_r:system_radio_prop:s0 tclass=property_service permissive=1
<3>[ 5.789724] dwc3 6a00000.dwc3: ep0out: Unable to dequeue while in LPM
<6>[ 5.791610] mtp_bind_config
<6>[ 5.838362] EXT4-fs (sde39): mounted filesystem without journal. Opts:
<7>[ 5.838420] SELinux: initialized (dev sde39, type ext4), uses xattr
<4>[ 6.594007] audit_printk_skb: 531 callbacks suppressed
<5>[ 6.594064] audit: type=1400 audit(1544633104.340:188): avc: denied { read write } for pid=426 comm="recovery" name="mtp_usb" dev="tmpfs" ino=15189 scontext=u:r:recovery:s0 tcontext=u:object_r:mtp_device:s0 tclass=chr_file permissive=1
<5>[ 6.594201] audit: type=1400 audit(1544633104.340:189): avc: denied { open } for pid=426 comm="recovery" path="/dev/mtp_usb" dev="tmpfs" ino=15189 scontext=u:r:recovery:s0 tcontext=u:object_r:mtp_device:s0 tclass=chr_file permissive=1
<6>[ 6.594256] mtp_open
<5>[ 6.598416] audit: type=1400 audit(1544633104.344:190): avc: denied { read } for pid=426 comm="recovery" name="media" dev="sda14" ino=1395361 scontext=u:r:recovery:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
<5>[ 6.598552] audit: type=1400 audit(1544633104.344:191): avc: denied { open } for pid=426 comm="recovery" path="/data/media" dev="sda14" ino=1395361 scontext=u:r:recovery:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
<5>[ 6.598967] audit: type=1400 audit(1544633104.344:192): avc: denied { getattr } for pid=426 comm="recovery" path="/data/media" dev="sda14" ino=1395361 scontext=u:r:recovery:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
<5>[ 10.405497] random: nonblocking pool is initialized
<6>[ 11.121590] of_batterydata_get_best_profile: a1_atl found
<6>[ 12.054328] FG: fg_batt_profile_init: Battery profile not same, clearing data
<6>[ 14.162783] FG: get_prop_capacity: loading batt profile, return last soc 99
<6>[ 14.163578] FG: get_prop_capacity: loading batt profile, return last soc 99
<5>[ 14.981843] audit: type=1400 audit(1544633112.730:193): avc: denied { read } for pid=387 comm="recovery" scontext=u:r:recovery:s0 tcontext=u:r:recovery:s0 tclass=netlink_kobject_uevent_socket permissive=1
<6>[ 15.012520] FG: get_prop_capacity: loading batt profile, return last soc 99
<6>[ 15.013021] FG: get_prop_capacity: loading batt profile, return last soc 99
<6>[ 15.015172] FG: get_prop_capacity: loading batt profile, return last soc 99
<6>[ 15.015706] FG: get_prop_capacity: loading batt profile, return last soc 99
<6>[ 15.016153] FG: get_prop_capacity: loading batt profile, return last soc 99
<3>[ 15.081192] msm-usb-ssphy-qmp 7410000.ssphy: QMP PHY initialization timeout
<3>[ 15.081271] msm-usb-ssphy-qmp 7410000.ssphy: USB3_PHY_PCS_STATUS:69696969
<6>[ 15.081554] msm-dwc3 6a00000.ssusb: DWC3 exited from low power mode
<6>[ 15.279496] android_work: android_work: sent uevent USB_STATE=CONNECTED
<6>[ 15.306046] android_usb gadget: high-speed config #1: 66bf0c8.android_usb
<6>[ 15.306476] msm-dwc3 6a00000.ssusb: Avail curr from USB = 500
<6>[ 15.307078] FG: get_prop_capacity: loading batt profile, return last soc 99
<6>[ 15.308538] FG: get_prop_capacity: loading batt profile, return last soc 99
<6>[ 15.360394] android_work: android_work: sent uevent USB_STATE=CONFIGURED
<6>[ 17.188434] FG: fg_batt_profile_init: Battery SOC: 82, V: 4110693uV
<6>[ 29.173731] FG: soc_work_fn: adjust_soc: s 82 r 192626 i -136260 v 4221319 t 285
<6>[ 48.447759] EXT4-fs (sde38): mounted filesystem without journal. Opts:
<7>[ 48.447794] SELinux: initialized (dev sde38, type ext4), uses xattr
<6>[ 49.119820] EXT4-fs (sde39): mounted filesystem without journal. Opts:
<7>[ 49.119854] SELinux: initialized (dev sde39, type ext4), uses xattr
<6>[ 49.228534] FG: soc_work_fn: adjust_soc: s 82 r 192626 i -136260 v 4221319 t 285
<6>[ 49.368692] EXT4-fs (sde38): mounted filesystem without journal. Opts:
<7>[ 49.368727] SELinux: initialized (dev sde38, type ext4), uses xattr
<7>[ 49.757427] SELinux: initialized (dev sde35, type vfat), uses genfs_contexts
<6>[ 50.081666] EXT4-fs (sda12): mounted filesystem with ordered data mode. Opts:
<7>[ 50.081699] SELinux: initialized (dev sda12, type ext4), uses xattr
<6>[ 69.280324] FG: soc_work_fn: adjust_soc: s 82 r 185424 i -124816 v 4222692 t 287
<6>[ 89.333668] FG: soc_work_fn: adjust_soc: s 82 r 191894 i -141753 v 4233526 t 285
<6>[ 109.387047] FG: soc_work_fn: adjust_soc: s 82 r 191894 i -141753 v 4233526 t 285
<6>[ 129.440299] FG: soc_work_fn: adjust_soc: s 82 r 191894 i -141905 v 4236120 t 285
<6>[ 149.493760] FG: soc_work_fn: adjust_soc: s 82 r 187133 i -141295 v 4237493 t 285
<6>[ 169.547246] FG: soc_work_fn: adjust_soc: s 83 r 187133 i -141295 v 4237493 t 285
<6>[ 189.600279] FG: soc_work_fn: adjust_soc: s 83 r 180297 i -142211 v 4238714 t 287
<6>[ 209.653574] FG: soc_work_fn: adjust_soc: s 83 r 184692 i -142058 v 4238714 t 287
<6>[ 229.707022] FG: soc_work_fn: adjust_soc: s 83 r 184692 i -142058 v 4238714 t 290
<6>[ 249.760250] FG: soc_work_fn: adjust_soc: s 84 r 191406 i -140685 v 4238714 t 290
<6>[ 269.813554] FG: soc_work_fn: adjust_soc: s 84 r 186645 i -137328 v 4238103 t 292
<6>[ 289.867179] FG: soc_work_fn: adjust_soc: s 84 r 186645 i -137328 v 4238103 t 292
<5>[ 300.903686] audit: type=1400 audit(1544633398.650:194): avc: denied { read } for pid=387 comm="recovery" name="/" dev="sde35" ino=1 scontext=u:r:recovery:s0 tcontext=u:object_r:vfat:s0 tclass=dir permissive=1
<5>[ 300.903714] audit: type=1400 audit(1544633398.650:195): avc: denied { open } for pid=387 comm="recovery" path="/firmware" dev="sde35" ino=1 scontext=u:r:recovery:s0 tcontext=u:object_r:vfat:s0 tclass=dir permissive=1
<5>[ 301.914814] audit: type=1400 audit(1544633399.660:196): avc: denied { getattr } for pid=387 comm="recovery" path="/firmware/image/data.msc" dev="sde35" ino=137 scontext=u:r:recovery:s0 tcontext=u:object_r:vfat:s0 tclass=file permissive=1
<6>[ 309.920528] FG: soc_work_fn: adjust_soc: s 84 r 185424 i 55083 v 4196600 t 295
<6>[ 329.973595] FG: soc_work_fn: adjust_soc: s 84 r 182983 i -141600 v 4238714 t 297
<6>[ 350.026950] FG: soc_work_fn: adjust_soc: s 84 r 182983 i -141600 v 4238714 t 297
<6>[ 370.080360] FG: soc_work_fn: adjust_soc: s 84 r 178344 i -142363 v 4240392 t 300
<6>[ 390.136894] FG: soc_work_fn: adjust_soc: s 84 r 178344 i -142363 v 4240392 t 300
<6>[ 410.187239] FG: soc_work_fn: adjust_soc: s 84 r 161499 i -141600 v 4241308 t 300
<6>[ 430.240222] FG: soc_work_fn: adjust_soc: s 85 r 159057 i -141600 v 4241766 t 300
<6>[ 450.293799] FG: soc_work_fn: adjust_soc: s 85 r 159057 i -141600 v 4241766 t 302
<6>[ 470.346808] FG: soc_work_fn: adjust_soc: s 85 r 159057 i -141905 v 4242528 t 302
<6>[ 490.400247] FG: soc_work_fn: adjust_soc: s 85 r 156982 i 37688 v 4213384 t 305
<6>[ 510.453593] FG: soc_work_fn: adjust_soc: s 85 r 156982 i 37688 v 4213384 t 305
<6>[ 530.507006] FG: soc_work_fn: adjust_soc: s 85 r 158813 i -141600 v 4243597 t 305
<6>[ 550.560363] FG: soc_work_fn: adjust_soc: s 85 r 154907 i -140685 v 4243749 t 305
<5>[ 563.384221] audit: type=1400 audit(1544633661.130:197): avc: denied { write } for pid=387 comm="recovery" name="media" dev="sda14" ino=1395361 scontext=u:r:recovery:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
<5>[ 563.384246] audit: type=1400 audit(1544633661.130:198): avc: denied { add_name } for pid=387 comm="recovery" name="recovery.log" scontext=u:r:recovery:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
<5>[ 563.384307] audit: type=1400 audit(1544633661.130:199): avc: denied { create } for pid=387 comm="recovery" name="recovery.log" scontext=u:r:recovery:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
<5>[ 563.391292] audit: type=1400 audit(1544633661.137:200): avc: denied { write open } for pid=387 comm="recovery" path="/data/media/recovery.log" dev="sda14" ino=1395366 scontext=u:r:recovery:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
<5>[ 563.391389] audit: type=1400 audit(1544633661.137:201): avc: denied { getattr } for pid=387 comm="recovery" path="/data/media/recovery.log" dev="sda14" ino=1395366 scontext=u:r:recovery:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
<5>[ 563.391532] audit: type=1400 audit(1544633661.137:202): avc: denied { ioctl } for pid=426 comm="recovery" path="/dev/mtp_usb" dev="tmpfs" ino=15189 ioctlcmd=4d03 scontext=u:r:recovery:s0 tcontext=u:object_r:mtp_device:s0 tclass=chr_file permissive=1
<5>[ 563.391862] audit: type=1400 audit(1544633661.137:203): avc: denied { setattr } for pid=387 comm="recovery" name="recovery.log" dev="sda14" ino=1395366 scontext=u:r:recovery:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
<5>[ 563.391908] audit: type=1400 audit(1544633661.137:204): avc: denied { relabelfrom } for pid=387 comm="recovery" name="recovery.log" dev="sda14" ino=1395366 scontext=u:r:recovery:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
<5>[ 563.391930] audit: type=1400 audit(1544633661.137:205): avc: denied { relabelto } for pid=387 comm="recovery" name="recovery.log" dev="sda14" ino=1395366 scontext=u:r:recovery:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1

I'll be delighted if someone with more experience in this field can help me out with this.

Thanks in advance.