Building/booting AOSP pie-release branch on Hikey970


#1

Hello forum!

I have been trying to build the AOSP branch pie-release branch for the Hikey970. I followed the instructions in this post and some of the posts earlier in that topic.

The build succeeds and it flashes successfully. However, when I try to boot it I only end up with a black screen from the HDMI port and I have no access to the board through fastboot and adb.

Over the Uart console I can see that kernel starts and it mounts the file system but then all of a sudden it stops.

Full console output is available here: https://pastebin.com/qbz6Ji4p

The last parts of the output are shown below. I cannot find something obviously wrong myself.

[    6.578946] file system registered
[    6.982967] (stk) :ldisc installation timeout[    6.987188] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[    8.118816] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[    9.129920] (stk) :ldisc_install = 0
[    9.466730] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=6,+++
[    9.472588] [I/hisi_pd] pd_dpm_handle_pe_event  unkonw event 
[    9.478681] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=5,+++
[    9.484524] Pending event is same --> ignore this event 2
[    9.490052] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=3,+++
[   10.150998] (stk) : timed out waiting for ldisc to be un-installed[   10.264029] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[   11.273879] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[   12.406718] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[   13.418419] (stk) :ldisc_install = 0
[   14.198408] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=6,+++
[   14.204302] [I/hisi_pd] pd_dpm_handle_pe_event  unkonw event 
[   14.210394] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=5,+++
[   14.216241] Pending event is same --> ignore this event 2
[   14.221755] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=3,+++
[   14.439526] (stk) : timed out waiting for ldisc to be un-installed[   14.552605] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[   15.561862] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[   16.695282] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[   17.706419] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[   18.733776] Bluetooth: st_register failed -22
[   18.928587] [I/hisi_pd] PE:TYPE-C Only Charger!
[   18.933267] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=3,+++
[   18.939115] [I/hisi_pd] pd_dpm_report_pd_sink_vbus : Sink 5000 mV, 500 mA
[   18.945910] [E/hisi_pd] pd_dpm_vbus_notifier_call: pd_dpm_vbus_notifier_call!!!,++++
[   18.953676] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=8,+++
[   72.147111] random: crng init done

Has anyone here been successful in building the pie-release branch?

Cheers,
Fredrik


Why is there a difference between contents of source built and pre-built system images?
#2

Hi,

Can you tell me whether you used the stock ramdisk image or the ramdisk image that you built in the AOSP to build the boot.img?

It looks like the sdd12(system) partition is getting mounted without journal.

Can you list the contents of your raw system.img ?

Thanks and regards,
Nishad


#3

Hello!

Thank you for your response. As it turns out I just managed to build it and boot it without issue. I think the problem might have been that my workspace was dirty somehow.

I removed everything and checked out a fresh copy of pie-release and started the build and now it works. I use only the images produced by the build.

Note: The system-as-root feature should not be enabled on the pie-release branch.


#4

Thats great!!

Thanks and regards,
Nishad


#5

Hello,

Have you ever built AOSP master branch on Hikey970? I meet the same issue as your discription. Over the Uart console I also see that kernel starts, and I get a black screen. But I use the master branch.

Thanks.


#6

Hi!

No I haven’t tried with AOSP master recently. Make sure you have a clean checkout and possibly you may have to enable the system-as-root feature?


#7

in the end, this did not work for me. can’t put all together when compiling AOSP branch (Pie) , problem is non-treble compliance of this repo. ( github.com/96boards-hikey/android-manifest.git -b hikey970_v1.0)

Has anyone successfully compiled and run AOSP P on Hikey970 board WITH (separate /vendor partition for all SOC/HW acceleration specific components) OR WITHOUT (/system/vendor as Android N) treble compliance ???

I have managed to solve other errors but failed in the end 99% compiling vendor.img because of lack of treble support from the branch. error: “You cannot install files to out/target/product/hikey970/system/vendor while building a separate vendor.img!”; tried compiling vendor partion by enabling BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE but looks like this is going to be huge work if i proceed in this direction. all the VINTF, HIDL implementation… :frowning:

Any help or guidance greatly appreciated.
Cheers!


#8

Really? Can you outline the EXACT steps that you took to build it? From what I see of that repo, it was updated a month ago, and it is building a RELEASE branch, which means that whether you’re building it now, a month ago, or 5 years in the future, its not going to change.


#9

Thanks for response.
I’ve realized i made a mistake listing repo.
anyway, result is same for me. here is what i am trying to do to compile and run AOSP on Hikey970. (my aim is to use none of the stock images or use as less as possible )
A) Compiling bootloader: DONE (fip.bin l-loader.bin ptable-aosp-64g.img sec_xloader.img)
B) Compiling Linux Kernel: DONE ( github.com/96boards-hikey/linux.git -b hikey970-v4.9)
C) Building AOSP: FAILED
latest fail happens while AOSP Master Branch (android-9.0.0_r9) with hikey970_v1.0.
used hikey970-userdebug.
so initial approach was “if you see an error, go after it in kamikaze mode” without going deeper into what is actually supported/tested in wider scheme.
-> first error i saw was, “fs_config_generator.py fsconfig: error: argument --all-partitions: expected one argument”.
somewhere i found this is because vendor partition is missing since it is now mandatory with AOSP 9 (full treble compliance compared to Android 8 where it was kinda partial). there were some fixes in dragonboard410c repo from Linaro (https://android-git.linaro.org/device/linaro/dragonboard410c.git/commit/?h=dragonboard), it basically uses cache partition as vendor partition, removes generation of cache partition and creates a vendor partition (i think build checks for separate vendor partition if you enable TARGET_COPY_OUT_VENDOR in BoardConfigCommon.mk)
now, what i see is the error,
" Non-symlink out/target/product/hikey970/system/vendor detected!
You cannot install files to out/target/product/hikey970/system/vendor while building a separate vendor.img!
ninja: build stopped: subcommand failed."
at 99%.
its the conflict because of presence of /system/vendor and trying to create a separate vendor.img (there is no /vendor directory for hikey970 in by default in repo anyway); now i am not sure if i should go the ‘script changing way’ or there is something fundamentally wrong with my approach. i still tend to think treble compliance is at the core of the problem.

if you have build AOSP 8 or 9 from scratch and run it on hikey970, please tell me.
Thanks a lot in advance.

-> there was error related with hostapd as well. i just removed the sepolicy of hostapd since AOSP no longer have a predefined hostapd domain. and added HIDL interface. (again based on fix from dragonboard. https://android-git.linaro.org/device/linaro/dragonboard410c.git/commit/?h=dragonboard&id=dbe30cae1ef227860089e1840aeb1cd140c0003a)
this worked normally atleast to solve the error.


#10

Update:
i managed to compile it (non full treble) and burn.
and now meeting same error this thread was started with. (after boot)
looks this isnt the problem but something with system image itself.
any help from anyone who has solved this? thanks.

log:
6.417454] file system registered
[ 6.884115] (stk) :ldisc installation timeout[ 6.888300] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[ 8.019813] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[ 9.031246] (stk) :ldisc_install = 0
[ 9.353259] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=6,+++
[ 9.359177] [I/hisi_pd] pd_dpm_handle_pe_event unkonw event
[ 9.365302] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=5,+++
[ 9.371175] Pending event is same --> ignore this event 2
[ 9.376713] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=3,+++
[ 10.052149] (stk) : timed out waiting for ldisc to be un-installed[ 10.165221] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[ 11.175001] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[ 12.307834] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[ 13.319076] (stk) :ldisc_install = 0
[ 14.085590] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=6,+++
[ 14.091500] [I/hisi_pd] pd_dpm_handle_pe_event unkonw event
[ 14.097628] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=5,+++
[ 14.103496] Pending event is same --> ignore this event 2
[ 14.109063] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=3,+++
[ 14.340192] (stk) : timed out waiting for ldisc to be un-installed[ 14.453217] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[ 15.463043] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[ 16.596082] (stk) :ldisc_install = 1
(stk) :ldisc installation timeout[ 17.607233] (stk) :ldisc_install = 0
(stk) : timed out waiting for ldisc to be un-installed[ 18.634858] Bluetooth: st_register failed -22
[ 18.815944] [I/hisi_pd] PE:TYPE-C Only Charger!
[ 18.820714] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=3,+++
[ 18.826578] [I/hisi_pd] pd_dpm_report_pd_sink_vbus : Sink 5000 mV, 500 mA
[ 18.833393] [E/hisi_pd] pd_dpm_vbus_notifier_call: pd_dpm_vbus_notifier_call!!!,++++
[ 18.841167] [E/hisi_pd] pd_dpm_handle_pe_event:!!!,event=8,+++
[ 179.540125] random: crng init done


#11

Update:
Managed to get latest AOSP master running on Hikey970 now.
Wi-Fi Doesn’t work.
anyone with same problem ?