Not Booting on Startup - hikey970 board

I had flashed system.img from factory mode and its working. But the image that I had build using latest AOSP master branch is not booting up. How to enable system as root in my aosp build? The difference between the content of my system.img and factory system.img is the placement of system folder. On mine its places at /system/ and on factory its is at /

(58)
[ 4.448421] [ISP] ov5640_main_module_init: enter!
[ 4.448469] [ISP] ov5640_main_probe: enter!
[ 4.637302] wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11)
[ 4.640571] wlcore: loaded
[ 4.699300] [ISP] isp_i2c_read_clear_intrbits: ABRT_SOURCE 0x1000001
[ 4.699304] [ISP] isp_i2c_xfer: I2C abort
[ 4.699305] [ISP] isp_i2c_write_reg: write reg fail
[ 4.699306] [ISP] ov5640_main_power: could not set init registers
[ 4.699307] [ISP] isp_i2c_read_reg: read[0x300a]
[ 4.702321] [ISP] isp_i2c_read_clear_intrbits: ABRT_SOURCE 0x1000001
[ 4.702323] [ISP] isp_i2c_xfer: I2C abort
[ 4.702327] [ISP] isp_i2c_read_reg: read reg fail
[ 4.702327] [ISP] ov5640_main_get_chip_id: get chip id high[255] fail
[ 4.702343] [ISP] ov5640_main_probe: chip id is 0x0
[ 4.702344] [ISP] ov5640_main_probe: chip id is 0x0, probe failed
[ 4.702355] hisi-ov5640_main: probe of e8400000.isp:hisi,ov5640_main failed with error -1
[ 4.702406] [ISP] ov5640_main_module_init: exit!
[ 4.702408] [ISP] ov5640_sub_module_init: enter!
[ 4.702472] [ISP] ov5640_sub_probe: enter!
[ 4.796345] usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd
[ 4.821042] usb 2-1: New USB device found, idVendor=0451, idProduct=8140
[ 4.821044] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 4.828077] hub 2-1:1.0: USB hub found
[ 4.828326] hub 2-1:1.0: 4 ports detected
[ 4.940104] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[ 4.955116] [ISP] isp_i2c_read_clear_intrbits: ABRT_SOURCE 0x1000001
[ 4.955119] [ISP] isp_i2c_xfer: I2C abort
[ 4.955120] [ISP] isp_i2c_write_reg: write reg fail
[ 4.955121] [ISP] ov5640_sub_power: could not set init registers
[ 4.955122] [ISP] isp_i2c_read_reg: read[0x300a]
[ 4.958137] [ISP] isp_i2c_read_clear_intrbits: ABRT_SOURCE 0x1000001
[ 4.958140] [ISP] isp_i2c_xfer: I2C abort
[ 4.958141] [ISP] isp_i2c_read_reg: read reg fail
[ 4.958141] [ISP] ov5640_sub_get_chip_id: get chip id high[255] fail
[ 4.958153] [ISP] ov5640_sub_probe: chip id is 0x0, probe failed
[ 4.958158] hisi-ov5640_sub: probe of e8400000.isp:hisi,ov5640_sub failed with error -1
[ 4.958184] [ISP] ov5640_sub_module_init: exit!
[ 4.958275] clk: Not disabling unused clocks
[ 4.958285] wlan-en-regulator: disabling
[ 4.958304] <[hisi_ip_to_atf_is_enabled]:regulator_id=0>
[ 4.958305] <[hisi_ip_to_atf_is_enabled]:regulator_id=1>
[ 4.958306] <[hisi_ip_to_atf_is_enabled]:regulator_id=8>
[ 4.958307] <[hisi_ip_to_atf_is_enabled]:regulator_id=2>
[ 4.958309] <[hisi_ip_to_atf_is_enabled]:regulator_id=3>
[ 4.958310] <[hisi_ip_to_atf_is_enabled]:regulator_id=4>
[ 4.958311] <[hisi_ip_to_atf_is_enabled]:regulator_id=5>
[ 4.958313] <[hisi_ip_to_atf_is_enabled]:regulator_id=6>
[ 4.958314] <[hisi_ip_to_atf_is_enabled]:regulator_id=7>
[ 4.958315] ALSA device list:
[ 4.958316] #0: hikey-hdmi
[ 5.081351] usb 1-1: New USB device found, idVendor=0451, idProduct=8142
[ 5.081353] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=1
[ 5.081354] usb 1-1: SerialNumber: 8C0608791EA2
[ 5.084076] hub 1-1:1.0: USB hub found
[ 5.084329] hub 1-1:1.0: 4 ports detected
[ 5.324108] (stk) :ldisc installation timeout
(stk) :ldisc_install = 0[ 5.509015] uart-pl011 fff32000.serial: no DMA platform data
[ 5.515661] Freeing unused kernel memory: 4096K
[ 5.523043] init: init first stage started!
[ 5.527326] init: Using Android DT directory /proc/device-tree/firmware/android/
[ 5.534757] init: First stage mount skipped (missing/incompatible fstab in device tree)
[ 5.542771] init: Skipped setting INIT_AVB_VERSION (not in recovery mode)
[ 5.549604] init: Loading SELinux policy
[ 5.554933] SELinux: 4096 avtab hash slots, 15474 rules.
[ 5.562699] SELinux: 4096 avtab hash slots, 15474 rules.
[ 5.568019] SELinux: 1 users, 4 roles, 1098 types, 0 bools, 1 sens, 1024 cats
[ 5.575252] SELinux: 92 classes, 15474 rules
[ 5.580203] SELinux: Class bpf not defined in policy.
[ 5.585342] SELinux: the above unknown classes and permissions will be denied
[ 5.592481] SELinux: Completing initialization.
[ 5.597092] SELinux: Setting up existing superblocks.
[ 5.622971] audit: type=1403 audit(59.671:2): policy loaded auid=4294967295 ses=4294967295
[ 5.631398] selinux: SELinux: Loaded policy from /sepolicy
[ 5.631398]
[ 5.639581] selinux: SELinux: Loaded file_contexts
[ 5.639581]
[ 5.648073] init: init second stage started!
[ 5.654006] init: Using Android DT directory /proc/device-tree/firmware/android/
[ 5.662206] selinux: SELinux: Loaded file_contexts
[ 5.662206]
[ 5.668482] init: Running restorecon…
[ 5.673466] selinux: SELinux: Could not stat /dev/block: No such file or directory.
[ 5.673466]
[ 5.682765] init: waitid failed: No child processes
[ 5.687671] init: Couldn’t load property file ‘/system/etc/prop.default’: open() failed: No such file or directory: No such file or directory
[ 5.700377] init: Couldn’t load property file ‘/prop.default’: open() failed: No such file or directory: No such file or directory
[ 5.712220] init: Couldn’t load property file ‘/odm/default.prop’: open() failed: No such file or directory: No such file or directory
[ 5.724330] init: Couldn’t load property file ‘/vendor/default.prop’: open() failed: No such file or directory: No such file or directory
[ 5.725969] Checking mode 1920x1080@60 clock: 148500…
[ 5.725969] OK
[ 5.725970] Checking mode 1280x720@60 clock: 74250…
[ 5.725970] OK
[ 5.725972] Checking mode 800x600@60 clock: 40000…
[ 5.725972] OK
[ 5.725973] Checking mode 720x480@60 clock: 27000…
[ 5.725973] BAD
[ 5.725975] Checking mode 1152x864@75 clock: 108000…
[ 5.725975] BAD
[ 5.725976] Checking mode 1280x1024@60 clock: 108000…
[ 5.725976] BAD
[ 5.725976] Checking mode 1600x900@60 clock: 108000…
[ 5.725977] BAD
[ 5.725978] Checking mode 640x480@75 clock: 31500…
[ 5.725978] BAD
[ 5.725979] Checking mode 640x480@60 clock: 25175…
[ 5.725979] BAD
[ 5.725980] Checking mode 720x400@70 clock: 28320…
[ 5.725980] BAD
[ 5.725981] Checking mode 1280x1024@75 clock: 135000…
[ 5.725981] BAD
[ 5.725982] Checking mode 1024x768@75 clock: 78750…
[ 5.725982] BAD
[ 5.725983] Checking mode 1024x768@60 clock: 65000…
[ 5.725983] BAD
[ 5.725984] Checking mode 800x600@75 clock: 49500…
[ 5.725984] BAD
[ 5.725984] Checking mode 1920x1080@60 clock: 148352…
[ 5.725985] BAD
[ 5.725985] Checking mode 720x480@60 clock: 27027…
[ 5.725985] BAD
[ 5.725986] Checking mode 640x480@60 clock: 25200…
[ 5.725986] BAD
[ 5.725988] Checking mode 1280x720@60 clock: 74176…
[ 5.725988] BAD
[ 5.726065] [drm] +.
[ 5.726065] [drm] -.
[ 5.726135] [drm] dss_pri_clk:[300000000]->[300000000].
[ 5.726171] [drm] dss_mmbuf_clk:[238000000]->[237142858].
[ 5.726201] [drm] mode->clock(org) = 148500
[ 5.726201] [drm] HDMI real need clock = 144000000
[ 5.726204] [drm] postdiv1=0x1, POSTDIV2=0x1
[ 5.726241] [drm] dss_pxl0_clk [144000000]->[144000000]
[ 5.726502] [drm] isr_s1 = 0x10000!
[ 5.726506] [drm] isr_s2 = 0x31!
[ 5.809308] [drm] Expected : lane_clock = 864 M
[ 5.809477] [drm] burst_mode = 0x0 (DSI_NON_BURST_SYNC_PULSES => 0)
[ 5.809477] [drm] hsa_time=33, hbp_time=111, hline_time=1650
[ 5.809478] [drm] lane_byte_clk=108000000, pixel_clk=144000000
[ 5.940806] cgroup: init (1) created nested cgroup for controller “memory” which has incomplete hierarchy support. Nested cgroups may change behavior in the future.
[ 5.944815] ueventd: ueventd started!
[ 5.945530] selinux: SELinux: Loaded file_contexts
[ 5.945530]
[ 5.945552] ueventd: Parsing file /ueventd.rc…
[ 5.945800] ueventd: Parsing file /vendor/ueventd.rc…
[ 5.945814] ueventd: Unable to read config file ‘/vendor/ueventd.rc’: open() failed: No such file or directory
[ 5.945821] ueventd: Parsing file /odm/ueventd.rc…
[ 5.945829] ueventd: Unable to read config file ‘/odm/ueventd.rc’: open() failed: No such file or directory
[ 5.945868] ueventd: Parsing file /ueventd.hikey970.rc…
[ 6.005427] cgroup: “memory” requires setting use_hierarchy to 1 on the root
[ 6.012392] ueventd: Coldboot took 0.066 seconds
[ 6.017290] audit: type=1400 audit(60.071:3): avc: denied { create } for pid=1 comm=“init” name=“cgroup.procs” scontext=u:r:init:s0 tcontext=u:object_r:cgroup:s0 tclass=file permissive=1
[ 6.039983] Registered swp emulation handler
[ 6.044765] audit: type=1400 audit(60.095:4): avc: denied { add_name } for pid=1 comm=“init” name=“enabled” scontext=u:r:init:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=1
[ 6.061218] audit: type=1400 audit(60.111:5): avc: denied { create } for pid=1 comm=“init” name=“enabled” scontext=u:r:init:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
[ 6.083576] watchdogd: watchdogd started (interval 10, margin 20)!
[ 6.083994] EXT4-fs (sdd12): mounted filesystem without journal. Opts: (null)
[ 6.085570] EXT4-fs (sdd5): Ignoring removed nomblk_io_submit option
[ 6.103380] EXT4-fs (sdd5): recovery complete
[ 6.107785] EXT4-fs (sdd5): mounted filesystem with ordered data mode. Opts: errors=remount-ro,nomblk_io_submit
[ 6.118023] watchdogd: Failed to open /dev/watchdog: No such file or directory
[ 6.134202] EXT4-fs (sdd5): mounted filesystem with ordered data mode. Opts: discard,noauto_da_alloc,data=ordered,user_xattr,discard,barrier=1
[ 6.147829] EXT4-fs (sdd15): Ignoring removed nomblk_io_submit option
[ 6.159108] EXT4-fs (sdd15): recovery complete
[ 6.163786] EXT4-fs (sdd15): mounted filesystem with ordered data mode. Opts: errors=remount-ro,nomblk_io_submit
[ 6.191941] EXT4-fs (sdd15): mounted filesystem with ordered data mode. Opts: discard,noauto_da_alloc,data=ordered,user_xattr,discard,barrier=1
[ 6.208128] audit: type=1400 audit(60.259:6): avc: denied { setattr } for pid=1 comm=“init” name=“slabinfo” dev=“proc” ino=4026532068 scontext=u:r:init:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=1
[ 6.227394] audit: type=1400 audit(60.275:7): avc: denied { write } for pid=1 comm=“init” name="/" dev=“debugfs” ino=1 scontext=u:r:init:s0 tcontext=u:object_r:debugfs:s0 tclass=dir permissive=1
[ 6.245002] audit: type=1400 audit(60.295:8): avc: denied { add_name } for pid=1 comm=“init” name=“sched_features” scontext=u:r:init:s0 tcontext=u:object_r:debugfs:s0 tclass=dir permissive=1
[ 6.262251] audit: type=1400 audit(60.311:9): avc: denied { create } for pid=1 comm=“init” name=“sched_features” scontext=u:r:init:s0 tcontext=u:object_r:debugfs:s0 tclass=file permissive=1
[ 6.297473] audit: type=1400 audit(60.347:10): avc: denied { write } for pid=56 comm=“kdevtmpfs” name="/" dev=“devtmpfs” ino=1025 scontext=u:r:kernel:s0 tcontext=u:object_r:device:s0 tclass=dir permissive=1
[ 6.316331] file system registered
[ 6.352106] (stk) : timed out waiting for ldisc to be un-installed[ 6.456098] [drm] +.
[ 6.458374] [drm] dss_pwm_clk clk_enable successed, ret=0!
[ 6.465134] (stk) :ldisc_install = 1[ 6.668342] [drm] bl_level is 255
[ 6.671659] [drm] bl_level=255.
[ 6.691113] [drm] connected : regmap_read val = 0xf0
[ 6.696184] [drm] hdmi connector status = 1
[ 6.709046] Checking mode 1920x1080@60 clock: 148500…[ 6.714110] OK
[ 6.715775] Checking mode 1280x720@60 clock: 74250…[ 6.720685] OK
[ 6.722349] Checking mode 800x600@60 clock: 40000…[ 6.727143] OK
[ 6.728868] Checking mode 720x480@60 clock: 27000…[ 6.733662] BAD
[ 6.735410] Checking mode 1152x864@75 clock: 108000…[ 6.740392] BAD
[ 6.742139] Checking mode 1280x1024@60 clock: 108000…[ 6.747194] BAD
[ 6.748963] Checking mode 1600x900@60 clock: 108000…[ 6.753925] BAD
[ 6.755670] Checking mode 640x480@75 clock: 31500…[ 6.760460] BAD
[ 6.762206] Checking mode 640x480@60 clock: 25175…[ 6.766993] BAD
[ 6.768752] Checking mode 720x400@70 clock: 28320…[ 6.773538] BAD
[ 6.775282] Checking mode 1280x1024@75 clock: 135000…[ 6.780329] BAD
[ 6.782073] Checking mode 1024x768@75 clock: 78750…[ 6.786944] BAD
[ 6.788700] Checking mode 1024x768@60 clock: 65000…[ 6.793572] BAD
[ 6.795315] Checking mode 800x600@75 clock: 49500…[ 6.800098] BAD
[ 6.801842] Checking mode 1920x1080@60 clock: 148352…[ 6.806886] BAD
[ 6.808631] Checking mode 720x480@60 clock: 27027…[ 6.813416] BAD
[ 6.815159] Checking mode 640x480@60 clock: 25200…[ 6.819942] BAD
[ 6.821687] Checking mode 1280x720@60 clock: 74176…[ 6.826557] BAD
[ 7.500114] (stk) :ldisc installation timeout[ 7.504312] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[ 8.635838] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[ 9.646993] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[ 10.779832] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[ 11.790993] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[ 12.923838] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[ 13.934994] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[ 15.067836] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[ 16.079029] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[ 17.106855] Bluetooth: st_register failed -22

Some questions to figure out what we are looking at:

Which branch did you use for your AOSP build? (Do you have a Sha or tag?)
How did you build?
Did you build a boot image with the device tree too?

@simson

Branch: AOSP Master(Android 10)

How did you build?

  1. Copied Ramdisk from factory Image
  2. Build Kernel using steps mentions on hikey970 website
    ./build_kernel.sh
  3. Build AOSP build using make
    make -j$(nproc)

Did you build a boot image with the device tree too?
Yes, boot.img is built on same branch but the ramdisk.img is from factory images.

That instruction seems to be incomplete, I’m not even sure if it is possible to mix factory images and a built kernel like that. I usaly build a kernel then copy it to aosp source tree and generate boot and system images from aosp build system by running m. Unfortunately I do not have a workspace for this at the moment.

Was using factory ramdisk as suggested from this post.