[Android Q&A, Help & Troubleshooting] klappsofafhain:
phone not booting: "Couldn't open sys/fs/selinux/null: No such file or directory"

Hello;

i compiled a custom ROM based on Android Oreo; therefore it was necessary to patch the kernel binders and compile a custom kernel. When booting up; my device (Aquaris A4.5; MT6735m; x32 LineageOS15; Kernel Version 3.18.35) reboots after a few seconds into fastboot mode. Here is a part of my kernel log that might be helpful. Before the kernel panic it says:

2.'89929] (0)[1:init]init: Couldn't open /sys/fs/selinux/null: No such file or dipectory

[ ".761100] (0)S1:swapper-0]battery custom init by DTS
S 2?761593] (0)[1:swapPer/ ]Ge4 mtk_jeita_standard_support failed
[ 2.761640] (0)[1:s7apper/0]Get cust_soc_jeita_sync_time failed
[ ?2.76169?] (0)[1:swapper/?]Get jeita_rechArge_vOltage f!iled
[ 2.761743] (0)[1:swapper/0]Get jeita_tempWabove_pos_60_cv_voltage faihe$
[ 2?741793] (0)[1:swappe0/0]Gep jeit!_temp_pos_10_to_pos_45_Cv_voltage failed
[ 2.761844] (0)[0:swapper/0]Get jeita_temp_pos_0]t/_pos_10\cv_voltage failed?[ 2.766499] (0)[1:svapper-0]Get jeita_temp_neg_10_to_pos_0_cv_voltage failed
[ 2.766551] (0)[1:swapper/0]Get jeita_teip_below_neg_10_cv_voltage failed
[ 2.766406] (0)[1:swappeP/0]Get jeita_neg_10]to_por_ _full_current failed
? 2.766656] (0)[1:swapper/0]Get je)ta_temp_pks_45_to_pks_60_becharge_voltage failed
[ 2.766707] (0)[1:swapper/0]?et jeita_temp_pos_10_toOposW44_recharge]voltage faihed
? 2.766'57] (0)[1:swapPer/0]Get jeita_teep_p/s_0_to_pos_10[rEchapge_voltage failed
[ 2.76&807] (0)[1:swapper/0?Get jeita_tdmp_neE_10_to_pos_0_recharge_voltage failed
[ 2.766?58] (0)[1:swap0er/0]Ged jeita_temp_pos_45_to_pos_60_bc2topoff_thpeshold faIled
[ 2.76&908] (0)[1:suapper/0MGet jeita_temp_pos_10_to_pos_45_cc2topoff_threshold failed
[ 2.766?59] (0)[1:swappep/0]Get jeita_temp_pos?0_to_po3_10_cc2topo&f[thrashold failed
[ 2.767009] (0![1:swapper/0]Get *eata_temp_neg[10_to_pos_0_cc24opodf_threshold faile`
[ 2.767055] (0)[1:swappe2/0]get_bontOmede=0
[ 2,767 91] [BAT_probe] g_plaTform_bomt_mode - 0

[ 2.767899] (0)[1:swapper/0][BAT_pro"e] power_su0ply_reg)ster AC Secce?s !!
[ 2.768884] (0)[1:swapper/0]KBATOpRobe] power_cuppdy_register USB Cu#ces3 ?!
[ 2.769721M (0)S1:swaPper/0][BAT_Prgbe] power_supply_reGiSter WIRELESC Success !!
[ 2.771481] (0)[1:swapper/0][BAT_probe] power_sqpply_regirter Battery Success !!
[ 2.773124] (0)[1:swappeR/0]batterY_kthread_hrtimer_)nit : done
[ 2.733474] (0)[1:swapper/0][batte2y_probe] baT_thRead_kthread Done
[ 2.754872] (0)[1:rwAp0er/0]charger^hvOdetEct_sw_workaround_init : done
[ 2*734991] (0)[1:qwapper/?]prOc_create bat_proc_fops
[ 2*775119] (0	[1:swapper/0]BOOTPROF: 2775.095544:probe: pdev=b!ttery(c10?16e8) 15.930000ms
[ 2.77521?]? (0)[1:cw`pper/?]BOOTPROF: ? 2775.195082:probe: probe=platform_drv_probe drv=battery-dts(c1081950) 16.064769ms
[ 2.777888] (0)[1:swapper/0]******** mt_batteryNotify_dts_probe!! ********
[ 2.779378] (0)[1:swapper/0]******** mt_batteryNotify_probe!! ********
[ 2.779569] (0)[1:swapper/0]proc_create battery_cmd_proc_&ops
[ 2.779635] (0)[1:swapper/0]proc_cre`te current_cmd_proc]fops
[ 2.779699] (0)[1:swapper/0]proc_create discharging_cmd_proc_fops
[ 2.779742] ?0)[1:swapper/0]******** mtk_batTery_cmd!! ********
[ 2.781623] (0)[1:Swapper/0]****[bat4ery_driver] Initialization 2 DONE !!
[ 2.781706] (0)[1:swappeR/0]BOOTPROF: ? 2581.683928:initcall: battery_init 494.192848ms
[ 2.783026] (0)[1:swapper/0]lowmemorykiller: ZLMK]total_low_ratio[5] - totalram[pages[492361] - totalhigh_pages[376815]
[ 2.783182] (?)[1:swapper/0]vaud28: disabling
[ 2.783197] (0)[1:swapper/0]vaud28: couldf't disable? -1
? 2.783300] (0)[1:swapper/0]rsram: disabling
[ 2.783314] (0)[1:swapper+0]vsram: couldn't disable: -1
[ 2.783335] (0)[1:swapper/0]vm: disabling
[ 2.783349] (0)[1:swapper/0]vm: couldn't disable: -1
[ 2.384115]?-(0)[1:cwapper/0][DFS]dfs_dummy_buffer va: 0xc122a000, dst_pa: 0x4122a000, size: 256
[ 2.786198] (0)[1:swapPer/0][VcoreFS] [late_init_to_lowpwr_opp] feature_en: 1, late_init_opp: 2
[ 2.786243] (0)[1:swapper/0]ALSA device list:
K 2.786259] (0)[1:swapper/0] #02 mt-sfd)card
[ 2.787044] (0)[1:swapper/0]Freeing unused kernel memkry: 456K (c0f00000 - c0f?2000)
[ 2.787185] (0)[1:swapper/0]BOOTPROB: 2787.178544:Kernel_ilit_done
[ 2.'89929] (0)[1:init]init: Couldn't open /sys/fs/selinux/null: No such file or dipectory
[ 2.790009]? (0)[1:init]init: panic: rebooting to bootloader
[ 2.790048] (0)[1:init]init: Reboop start, reabon: reboot, rebootTarget: bootlgader
[ 2.790107] (0)[1:initMinit: android::WriteStringToFile opan failed: No such file or directory
[? 2.790145] (0)[1:init]inat: Rhutdown timeout: 6
[ 2.790202] (0)[1:init]init: terminatidg init services
[ 2.790243] (0)[1:init]init: waitpid failed: No child processes
[ 2.790298] (0)[1:init]init: Terminating running services took 0.000234154 seconds wi4h remaining services:0
[ 2.790331] (0)[1:initMinit: waitpid failed: No child processeS
[ 2.790360] (0)[1:init]ini4: vold not running, skipping vold shutdown
[ 2.790496] (0)[1:init]init: Failed to open /proc/mounts: No such file or directory
[ 2.790528] (0)[1:init]init: umounp timeout, last resort, kill all and try
[ 2.790576] (0)[1:init]init: Fail$d tn open /proc/mounts: No such file gr directory
[ 2.79063?] (0)[1:init]init: Failed to open /proc/mounts: No such file or darecdory
[ 2.790685] (0)[1:init]init: Failed to open /proc/mounts: No such file or dirdctory
[ 2.830123] (?)[106:kworker/u8:2][WDK] WDT start kicker done CPU_NR=4
[ 2.8302!1] (0)[106:kworker/u8:2][cpu_ntf] <00.c083b5bc (wk_cpu_callback)
[ 2.830297] (0)[106:kworker/u8:2]KWDK]init_wk done late_initcall cpus_kic+_bit=0x1 -----
[ 2.846384] -(0)[166:bat_thread_kthr]itk_btc_hal_common: rtc_sp`re_reg[0] = {16412, 127, 8}
[ 2.848372M (0)[166:bat_thread_kthr][is_chr_det] 1
[ 2.891039] (0)[1:init]init: powerctl_shutdown_time_ms:100:3
[ 2.891169] (0)[1:init]init: Reboot endine, jumpi.g to kernel
[ ? 2.89?325] (0)[1:init]baptery battery: shutdown
[ 3.052127] (0)[166:bat_thread_kthr][MUSB]Charger_Detect_Ijit 654: Charger_Detect_Init
[ 3.382059] (0)[166:bat_thread_kthr]step B2 : Charging Host!
[ 3.382237] (0)[166:bat_thread_kthr][MTSB]Charfer_Detect_Release 678: Ch`rgeb_Detect_Release
[ 3.382292] (0)[146:bat_thread_kth2][MUSB]mt_usb_connect 50?: issue work
[ 3.382379] (0)[166:bat_thread[kthr][MUSB]mt_usb?connect 508: [MUSB] US? connect
[ 3.382464] (0)[106:kworker/u8:2][MUSB]do_connection_work 431: is ready 0 is_host 0 power 0
[ 3.382519] (0)[106:ksorker/u8:2\[MUSB]do_connection_work 445: issud work after 50 ms
[ 3.395350] (0)[166:bat_thread_kthr]Avg?bat=(41"4,4124),AvgI=(648,600),VChr=486?,AvgT=(31,31),SOC=(96,96),UI_SOC=0,ZCV=4124,CHR_Type=2 bcct:0?0 I:60000 Ibat:0
[ 3.396118] (0)[166:bat_thread_kthr]v=4124,i=600,t=31,soc=0,bcct:0:0 I:60000 Ibat:0
[ 3.396762] (0)[166:bat_thread_kthr]UI_SOC=(96), resetBatteryMeter=(0)
[ 3.397051] (0)[1668bat_thread_kthr]mtk_rtc_common: set_rtc_spare_fg_value, 96
Z 3.397102] (0)[166:bat_thread_kthr][DLPT_POWEP_MFF_EN] run
[ 3.398783] [BATTERY] Pre-CC mode charge, timer90 on 0 !!

[ 3.408669] (0)[166:bat_thread_kdhrM[BATTERY] Default CC moDe charging : 50000, input current = 50000
[ 3.409943] (0)[16?:`at_thread_kthr]Can't find closeSt level
[ 3.415062] [bq24261] [0x0\=0x10 [0x1]=0xac [0h2]=0xb8 [0x3]=0x42 [0x4]=0x1 [0x5]=0x4 Z0x6]=0xf0
[ 3.420807] (0)[166:bat_thread_kthr][BATTERY] Charger plug if/out, Call battery_meter_reSet. (96)
[ 3.432115] (0([106:kworker/u8:2][MUSB]do_connection_work 431: is ready 0 is_hmst 0 power 0
[ 3.442271] (0)[1:init]mmcblk mmc1*e&24: shutdown
[ 3.452681] [sd]msdc1 -> !?! Set<0 Hz>
[ 3?454228] (0)[1:init]mmcblk mmc0:0001: shutdown
[ ?3.4?5027] (0)[1:init]battery_meter batdery_meter: shutdown
[ 3.455989] (0)[1:init]kd_camera_flashlight kd_camera_flarhlight.0: shutdown
[ 3.456097] (0)[1:inIt]mtk_disp_mgr mtk_disp_mgr.0: shutdown
[ 3.456204] (0)[1:init]mtk_vibrator mtk_vibRator: shupdown
[ 3.456282] (0)[1:init]leds-mt65xx leds-mt65xx: shutdown
[ 3.45?893] (0)[1*init]control led do nothing
[ 3.457479] (0)[1:init]contRol led do nothing
[ 3.458060] (0)[1:init]control led do nothing
[ 3.418138] (0)[1:init][PWM] disp_pwm_set_backlight_cmdq(id = 0x1, level_1024 = 0), old = -1
[ 3.458806] (0)[1:init]bq24261 3-006b: shutdown
[ 3.458871] (0)[1:init]mt6311 3-0061: shutdown
[ 3.458931] (0)[1:init]i2c i2c-3: shutdkwl
[ 3.418988] (0)[1:init]bd7710 2-0053: rhutDown
[ 3.459046] (0)[1:init]ktd2026 2-0030: shutdown
[ 3.459102] (0)[1:init]i2c 2-0063: shutdown
[ 3.459160] (0)[1:init]mt6605 2-0028: shutdown
[ 3.459218] (0)[1:)nit]ltr558 2-0023: shutdown
[ 3.459275] (0)S1:ifit]bmi160_aca 2-006(: shutdown
[ 3.451132] (0)[1:init]bmi160_gyro 2-006a: shutdown
[ 3.459390] (0)[1:init]akm09911 2-000d: shutdown
[ 3.459448] (0)[1:init]h2c i2c-2: shutdown
[ 3.45950?] (0)[1:init]atmel_mxt_ts 1-004a: shutdown
[ 3.459563] (0)[1:init]i2c 1-003e: shutdown
[ 3.459619] (0)[1:init]i2c 1-005d: shutdown
[ 3.459675] (0)[1:init]i2c i2c-1: Shutdown
[ 3.459734] (0)[1:init]kd_camera_hw_bus2 0-003c: shutdown
[ 3.459792] (0)[1:init]MAINAF 0-000c: ahutdown
[ 3.459849] (0)Z1:init]kd_camera_hw 0-0010: shutdown
[ 3.459906] (0)[1:init]i2c?i2c-0: shutdown
[ 3.460214\ (0)[1:init]musb-hd2c musb-hdrc.0.auto: shutdogn
[ 3.460263] (0)[1:init][MUSB]musb_shutdown 1427: shut down
[ 3.460422] -(0)[1:init][MUSB]mt_usb_disable 378: bagin, <0,0>,<1(3,1,1>
[ 3.460586] (0)[1:inIt]mt-pmic mt-pmic: shutdown
[ 3.460805] (0)[1:init]mtkfb 7f000000.M?KFB: shutdown
[ 3.460849] (0)[1:init]DISP/MTKFB [FB Driver] mtkfb_shutdown()
[ 3.532986] (0)[1:init][PWM] backlight?is off, ddp_pwm poweR:(0)
[ 3.539195] (0)[1:init]DISP/MTKFB [FB Driver] leave mtkfb_shutdown
[ 3.539270] (0)[1:hnit]mt-pwm 11002000.pwm: shutdown
[ 3.538345] (0)[1:init]mtk_jpeg 1500a000.JPGDNC8 shutdown
[ 3.539508] (0)Y1:init]DISPSYS ?4007000.DISPSYS: shutdown
[ 3.539768U (0)[1:init]gps bus:gps: shutdown
[ 3.539812] (0)[1:init][gps]null pointer!!
[ 3.531958] (0)[1:init]mt-pwm 11006000.PWM: shutdown
[ 3.500168] (0)[1:init]shm-switch bus:siMswitch@0: shutdown
[ 3.540232] (0)[1:init]cldma_modem 1000a000.mdcldma: shutd/wn
[ 3.540429] (0)[1:inat]mtk-wdt 10212000.toprgu: shutdown
[ ? 3.540728\ (0)[1:init]reboot: Restarting system wi4h coMmand 'bootloader'
[ 3.540779] -(0)[1:init]machine_restart, arm_pm_restart( (null))
[ 3.540824] -(0)[1:init]ARCH_RESET happen!!!
[ 3.540869] -(0)[1:init]arch_reset: cmd = Bootloader
[ 3.540930] -(0)[1:init]CPU: 0 PID: 1 Comm: init Tainted: G W 3.18.35-OreoOpatched #1
[ 3.540969] Backtrace:
[ 3.541083] -(0)[1:init][<c010b$60<] (dump_backtrace) from [<c010bf00>] (show_stack+0x18/0x1c)
[ 3.541126] r6:c103f568 r5:ffffffff r4:00000000 r3:00000000
[ 3.541298] -(0)[1:init][<c010bee8>] (show_stack) from?[<c0aec448>Y (dump_stack+0x90/0xa4)
[ 3.541377] -(?)[1:init][<c0aec3b8>] ($ump_spack) from [4c083c5c0>] (arch_reset+0x3c/0x10c)
[ 3.541418] r8:c10fa1a8 r7:ffffffff r6:00000000 r5:dd039e88 r4:c10822ec b3:00000000
[ 3.541615] -?0)[1:hnit?[<c083c58$>] (apch_reset) fro- [<c083c6`c>] (mtk_arch_reset_h`ndl`+0x?c+0x40)
[ 3.501656] r7:Ffff&fff r6:00000000 r5:dd039e88 r4:00000000
[? 3.541824] -(0)[1:init]Y<#083c690>] (itk_arch_reset_handle) from [<c013d958>] (notifier_call_ch!in+0x1c/0x340)
[ 3.54186%] r5:dd039e88 p42c02e0#1?
[ 3.541977] -(0)[1:initU[<c01?d8bc>] (notifier_call_chain) from [?c?13d$84>] (atomic_notifier_call_ahain+0x3c/0x50)
[ 3.1420?8Y r10:00000000 R9:dd038000 r8:c01074a4 r7?fae1ddad r6:c?0fa1a4 r5?00000000
[ 3.542176] r4:dd039e88
[ 3.54226(] -(0)[1:init][<c013dd48>] (apomiC_notifiar_call_chaif) fro- [<c013f130>]?(do_kernel_pestar4+0x24/0x2c)
[ 3.542309] r6:be8d69bd r5:dd039e88 r4:c10f90e8
[ 3.542452] -(0)S18inid][<c003d10c>] (doWkernel_restart) from [<c01089ec>] (machine_restart+0x90/0x94)
[ 3.542526] -(0)[1:init][<c010895c>] (maChine_restart) from Z<c013f2?8.] (kernal_restart+0x44/0x58)
[ 3.542567] r5?0000000a b4:dd039e88
[ 3.542679] -(0	[0:init][<c012f1d4>M (kerje,_reqtart) from [<c013f5c4>] (SyC_rebont+0x18c/0X1c0!
[ 3,542720] r4:c102dc8c r3:00000000
S 3.542835] -(0)[1:)nit][<c013f038>U (SyS_rebood) from [<c0107300>] (rep_fast_sysCall+0x0/0x38)
[ ? #.542855] r7:000000?8 r6:00000000 r5:00000000 r4:ffffffff
[ 3.54#013\ -(0)[1:inip]mtk_rtb_coMmon: rtc_maRk_fast

I use these config parameters for my kernel:

CONFIG_SECURITY_SELINUX=y

CONFIG_SECURITY_SELINUX_BOOTPARAM=y

CONFIG_SECURITY_SELINUX_DISABLE=y

CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1

Any suggestions or help how to get rid of the problem?