How to build Android 9 for the Rock64
#1
Follow the steps on the repository here:

https://github.com/a9rock64/manifests

Code:
repo init --depth=1 -u https://github.com/a9rock64/manifests.git -m a9rock64_us.xml -b default

Code:
repo sync  -f -c --no-clone-bundle --no-tags -j$(nproc --all)

Code:
. build/envsetup.sh
./build_box.sh

I made a docker image with the required build environment dependencies:

https://cloud.docker.com/repository/dock...-rockpro64
  Reply
#2
When I build using the method outlined above, I get the following error:


Code:
FAILED: TAs
/bin/bash -c "(make -j3 -C /home/lineageos/external/rk_tee_user O=/home/lineageos/external/rk_tee_user TA_DEV_KIT_DIR=/home/lineageos/external/rk_tee_user/export-user_ta clean ) && (make -j3 -C /home/lineageos/external/rk_tee_user CROSS_COMPILE=\$(pwd)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi- CROSS_COMPILE_HOST=\$(pwd)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi- CROSS_COMPILE_TA=\$(pwd)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi- CROSS_COMPILE_user_ta=\$(pwd)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi- TA_DEV_KIT_DIR=/home/lineageos/external/rk_tee_user/export-user_ta O=/home/lineageos/external/rk_tee_user )"
make: Entering directory '/home/lineageos/external/rk_tee_user'
make[1]: Entering directory '/home/lineageos/external/rk_tee_user/ta'
make[2]: Entering directory '/home/lineageos/external/rk_tee_user/ta/testapp'
 CLEAN   .
make[2]: Leaving directory '/home/lineageos/external/rk_tee_user/ta/testapp'
make[2]: Entering directory '/home/lineageos/external/rk_tee_user/ta/testapp_storage'
 CLEAN   .
make[2]: Leaving directory '/home/lineageos/external/rk_tee_user/ta/testapp_storage'
make[1]: Leaving directory '/home/lineageos/external/rk_tee_user/ta'
make: Leaving directory '/home/lineageos/external/rk_tee_user'
make: Entering directory '/home/lineageos/external/rk_tee_user'
make[1]: Entering directory '/home/lineageos/external/rk_tee_user/ta'
make[2]: Entering directory '/home/lineageos/external/rk_tee_user/ta/testapp'
 CPP     /home/lineageos/external/rk_tee_user/ta/testapp/ta.lds
 /home/lineageos/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi-gcc      /home/lineageos/external/rk_tee_user/ta/testapp/user_ta_header.o
 /home/lineageos/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi-gcc      /home/lineageos/external/rk_tee_user/ta/testapp/testapp_ta.o
 LD      /home/lineageos/external/rk_tee_user/ta/testapp/8cccf200-2450-11e4-abe20002a5d5c52c.elf
 OBJDUMP /home/lineageos/external/rk_tee_user/ta/testapp/8cccf200-2450-11e4-abe20002a5d5c52c.dmp
 OBJCOPY /home/lineageos/external/rk_tee_user/ta/testapp/8cccf200-2450-11e4-abe20002a5d5c52c.stripped.elf
 SIGN    /home/lineageos/external/rk_tee_user/ta/testapp/8cccf200-2450-11e4-abe20002a5d5c52c.ta
 SIGN KEY /home/lineageos/external/rk_tee_user/export-user_ta/keys/oem_privkey.pem
Traceback (most recent call last):
 File "/home/lineageos/external/rk_tee_user/export-user_ta/scripts/sign.py", line 80, in <module>
   main()
 File "/home/lineageos/external/rk_tee_user/export-user_ta/scripts/sign.py", line 40, in main
   from Crypto.Signature import PKCS1_v1_5
ImportError: No module named Crypto.Signature
/home/lineageos/external/rk_tee_user/export-user_ta/mk/link.mk:65: recipe for target '/home/lineageos/external/rk_tee_user/ta/testapp/8cccf200-2450-11e4-abe20002a5d5c52c.ta' failed
make[2]: *** [/home/lineageos/external/rk_tee_user/ta/testapp/8cccf200-2450-11e4-abe20002a5d5c52c.ta] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/lineageos/external/rk_tee_user/ta/testapp'
Makefile:37: recipe for target 'ta' failed
make[1]: *** [ta] Error 2
make[1]: Leaving directory '/home/lineageos/external/rk_tee_user/ta'
Makefile:27: recipe for target 'ta' failed
make: *** [ta] Error 2
make: Leaving directory '/home/lineageos/external/rk_tee_user'
[ 10% 9248/90512] Export includes file:  -- out/target/product/rk3...bj/SHARED_LIBRARIES/libGLESv2.ndk.24_intermediates/export_includes
ninja: build stopped: subcommand failed.
17:07:14 ninja failed with: exit status 1


Fixed by installing pycrypto:

Code:
pip install pycrypto
  Reply
#3
Good to have the instructions here. Thanks.
Are there any special tricks to include opengapps into the build?
  Reply
#4
Haven't gotten that far <3
  Reply
#5
Sorry my friend. The binary image of android9 for rock64 does not have Gapps at all. I thought i should do something special to add them to the repo. But they seem to be cloned along with other staff.
What is expected download size?
  Reply
#6
Of the repo entire 9 repo? Probably around 100 GB.

Not sure how much just the gapps repo is.
  Reply
#7
Ohoh. Got bus error after 8 hours of compile

Copying resources from program jar [/a9rock64/out/target/common/obj/APPS/DefaultContainerService_intermediates/classes.jar]
[ 71% 64419/90512] target Package: BackupRestoreConfirmation (out/tar...328_box/obj/APPS/BackupRestoreConfirmation_intermediates/package.apk)
warning: ignoring flag -c tvdpi-v4. Use --preferred-density instead.
warning: ignoring flag -c hdpi-v4. Use --preferred-density instead.
warning: ignoring flag -c tvdpi-v4. Use --preferred-density instead.
warning: ignoring flag -c hdpi-v4. Use --preferred-density instead.
[ 71% 64422/90512] Copy: out/target/common/obj/APPS/MediaProvider_intermediates/classes.jar07:40:03 ninja failed with: signal: bus error (core dumped)

#### failed to build some targets (08:17:30 (hh:mmConfuseds)) ####

The build_box.sh seems to start from the beginning every time despite the compilation status. Is it possible to continue process somehow?
  Reply
#8
Seems that i got through the build process

/a9rock64/rockdev/Image-rk3328_box$ ll
total 4284032
drwxrwxr-x 2 als als 4096 Jul 24 14:29 .
drwxrwxr-x 3 als als 4096 Jul 24 14:28 ..
-rwxrwxr-x 1 als als 1048576 Jul 23 22:49 baseparameter.img
-rw-rw-r-- 1 als als 19806208 Jul 24 14:28 boot.img
-rwxrwxr-x 1 als als 307 Jul 23 22:49 dtbo.img
-rw-rw-r-- 1 als als 19535892 Jul 24 12:27 kernel.img
-rw-rw-r-- 1 als als 184654 Jul 24 12:13 MiniLoaderAll.bin
-rwxrwxr-x 1 als als 49152 Jul 23 22:54 misc.img
-rw-rw-r-- 1 als als 159820 Jul 24 14:28 oem.img
-rwxrwxr-x 1 als als 870 Jul 23 22:49 parameter.txt
-rw-rw-r-- 1 als als 49152 Jul 23 22:54 pcba_small_misc.img
-rw-rw-r-- 1 als als 49152 Jul 23 22:54 pcba_whole_misc.img
-rw-rw-r-- 1 als als 30148608 Jul 24 14:28 recovery.img
-rw-rw-r-- 1 als als 265728 Jul 24 12:35 resource.img
-rw-rw-r-- 1 als als 1986302160 Jul 24 14:28 system.img
-rw-rw-r-- 1 als als 4194304 Jul 24 12:13 trust.img
-rw-rw-r-- 1 als als 4194304 Jul 24 12:13 uboot.img
-rw-rw-r-- 1 als als 2184098264 Jul 24 14:29 update.img
-rwxrwxr-x 1 als als 4096 Jul 23 22:49 vbmeta.img
-rw-rw-r-- 1 als als 137805924 Jul 24 14:28 vendor.img

will try to burn this
  Reply
#9
well done - let me know how it goes <3
  Reply
#10
Thank you, dazza
Flashed it without problems, but i see some issues with screen on this build. It continuously blinks changing resolution randomly while surfing through the home screen and launching apps. The box is connected to quite old Philips fullhd TV. I do not remember this behavior on stock binary. And there is not possible to change display resolution from Auto. Not good but i can live with that.
Another annoying feature is randomly changing MAC address of eth0 with every new image - it costs 5euro every time to register SIPTV app to new MAC addr ))
I seem to find how to fix that with uboot environment CONFIG_ETHADDR written directly to u-boot/configs/rk3328_defconfig and uboot recompilation. Will check this weekend if it works. Not sure if there is any other method.
Finally i rooted the image with Magisk using the method described in RKDocs/android/Rockchip_Magisk_installation_guidelines.pdf of the repository.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Rock64 Android Oreo 8.1 TV-Install adventures (Now Android 9.0) Rocklobster 5 5,061 08-04-2021, 07:35 PM
Last Post: Rocklobster
  How do I prepare/put Android on an SD card using etcher cdotsubo3000 3 5,886 06-27-2021, 02:43 PM
Last Post: clach04
  Android and SD Card gigagames 2 4,439 06-27-2021, 02:38 PM
Last Post: clach04
  Android Images (ROCK64) pineadmin 73 166,466 05-04-2021, 01:58 AM
Last Post: zet_lab
  Android 9.0 and Pluto on Rock64-1G missdeenola 1 3,928 03-12-2021, 01:38 PM
Last Post: Wizzard
  broken android microsd images jbach50 1 3,405 01-16-2021, 09:57 PM
Last Post: jimsurvak
  Android on Rock64 SD Problem ElBoluTony 3 5,859 10-07-2020, 12:10 PM
Last Post: ElBoluTony
  Error! Android Rockchip tools method BowerR64 0 2,514 09-18-2020, 08:12 PM
Last Post: BowerR64
Lightbulb Any older versions of Android for the Rock64? BowerR64 2 4,610 09-18-2020, 07:58 PM
Last Post: BowerR64
  Can't boot android 9 on rock64 maks2204 5 8,585 09-09-2020, 08:44 AM
Last Post: BowerR64

Forum Jump:


Users browsing this thread: 1 Guest(s)