How to build Android P SDK
#1
Hi,

I found Android P SDK on Wiki.
Who was already downloaded and build it?

https://wiki.pine64.org/index.php/ROCKPr...ndroid_SDK

If someone tried it, i want to know how to build and burn to sd card.
#2
(06-19-2019, 06:25 PM)licux Wrote: Hi,

I found Android P SDK on Wiki.
Who was already downloaded and build it?

https://wiki.pine64.org/index.php/ROCKPr...ndroid_SDK

If someone tried it, i want to know how to build and burn to sd card.

Please follow this thread: https://forum.pine64.org/showthread.php?tid=7595
#3
I was trying to build with the following config:

#!/bin/bash
ARCH=arm64
LUNCH=rk3399_box-userdebug
UBOOT_DEFCONFIG=rk3399
KERNEL_DEFCONFIG=rockchip_defconfig
KERNEL_DTS=rk3399-rockpro64
JOBS=4


And I get the following exception:

make[2]: Entering directory '/home/lineageos/external/rk_tee_user/ta/testapp'
/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
/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
CPP /home/lineageos/external/rk_tee_user/ta/testapp/ta.lds
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'
[ 2% 2330/92547] //external/f2fs-toolsConfusedload_f2fs clang fsck/xattr.c [linux_glibc]
ninja: build stopped: subcommand failed.
21:43:51 ninja failed with: exit status 1


Any ideas on what that would be?
#4
Here are the steps I've followed:

Download SDK here:

https://wiki.pine64.org/index.php/ROCKPr...ndroid_SDK

copy build_box.sh from here to root directory:

https://github.com/a9rock64/rk_device_ro...ild_box.sh

Contents of build_box.sh

lineageos@ba44581f91b1:~$ cat build_box.sh

Code:
#!/bin/bash
ARCH=arm64
LUNCH=rk3399_mid-userdebug
UBOOT_DEFCONFIG=rk3399
KERNEL_DEFCONFIG=rockchip_defconfig
KERNEL_DTS=rk3399-rockpro64
JOBS=4

usage()
{
    echo "USAGE: build [-ovj]"
    echo "-o                    -Generate ota package"
    echo "-v                    -Set build version name for output image folder"
    echo "-j                    -Build jobs"
    exit 1
}

# check pass argument
while getopts "ovj:" arg
do
    case $arg in
        o)
            echo "will build ota package"
            BUILD_OTA=true
            ;;
        v)
            BUILD_VERSION=$OPTARG
            ;;
        j)
            JOBS=$OPTARG
            ;;
        ?)
            usage ;;
    esac
done

source device/rockchip/common/build_base.sh -a $ARCH -l $LUNCH -u $UBOOT_DEFCONFIG -k $KERNEL_DEFCONFIG -d $KERNEL_DTS -j $JOBS


In terminal in the base directory of the project do the following:

. build/envsetup.sh
./build_box.sh

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

https://cloud.docker.com/repository/dock...-rockpro64

The docker setup was borrowed from a lineage project and the instructions can be found here:

https://github.com/darran-kelinske-fives...-rockpro64
#5
Had a successful build today:


Code:
Build android ok!
make and copy android images
TARGET_BOARD_PLATFORM=rk3399
TARGET_PRODUCT=rk3399_mid
TARGET_HARDWARE=rk30board
TARGET_BUILD_VARIANT=userdebug
BOARD_SYSTEMIMAGE_PARTITION_SIZE=2684354560
BOARD_USE_SPARSE_SYSTEM_IMAGE=true
TARGET_BASE_PARAMETER_IMAGE==
HIGH_RELIABLE_RECOVERY_OTA=false
BOARD_AVB_ENABLE=false
system filesysystem is ext4
create dtbo.img....
BOARD_AVB_ENABLE is false,use default dtbo.imgdone.
create boot.img....
BOARD_AVB_ENABLE is false, make boot.img from kernel.
done.
create recovery.img....
BOARD_AVB_ENABLE is false, make recovery.img from kernel && out.
done.
create system.img.... in=/home/lineageos/out/target/product/rk3399_mid/system.img out=/home/lineageos/out/target/product/rk3399_mid/system.img.out align=1024
Total of 655360 4096-byte output blocks in 22 input chunks.
Generating optimized sparse image done,total_chunk=17.
done.
create vbmeta.img.... BOARD_AVB_ENABLE is false,use default vbmeta.imgdone.
create vendor.img...in=/home/lineageos/out/target/product/rk3399_mid/vendor.img out=/home/lineageos/out/target/product/rk3399_mid/vendor.img.out align=1024
Total of 131072 4096-byte output blocks in 12 input chunks.
Generating optimized sparse image done,total_chunk=8.
done.
create oem.img...in=/home/lineageos/out/target/product/rk3399_mid/oem.img out=/home/lineageos/out/target/product/rk3399_mid/oem.img.out align=1024
Total of 131072 4096-byte output blocks in 12 input chunks.
Generating optimized sparse image done,total_chunk=8.
done.
create misc.img.... done.
create uboot.img...done.
create trust.img...done.
create loader...done.
create resource.img...done.
create kernel.img...done.
create parameter...done.
Make image ok!
Make update.img
start to make update.img...
Android Firmware Package Tool v1.62
------ PACKAGE ------
Add file: ./package-file
Add file: ./Image/MiniLoaderAll.bin
Add file: ./Image/parameter.txt
Add file: ./Image/trust.img
Add file: ./Image/uboot.img
Add file: ./Image/misc.img
Add file: ./Image/boot.img
Add file: ./Image/dtbo.img
Add file: ./Image/vbmeta.img
Add file: ./Image/recovery.img
Add file: ./Image/system.img
Add file: ./Image/vendor.img
Add file: ./Image/oem.img
Add CRC...
Make firmware OK!
------ OK ------
********RKImageMaker ver 1.63********
Generating new image, please wait...
Writing head info...
Writing boot file...
Writing firmware...
Generating MD5 data...
MD5 data generated successfully!
New image generated successfully!
Making update.img OK.
Make update image ok!
/home/lineageos
cwcw/home/lineageos
/home/lineageos/IMAGE/RK3399-ROCKPRO64_9_20190718.1752_RELEASE_TEST/PATCHES/device/rockchip/rk3399/0001-set-lcd_density.patch
Generate patch for device/rockchip/rk3399 done
/home/lineageos/IMAGE/RK3399-ROCKPRO64_9_20190718.1752_RELEASE_TEST/PATCHES/hardware/rockchip/libgralloc/0001-close-AFBC_LAYER.patch
Generate patch for hardware/rockchip/libgralloc done
/home/lineageos/IMAGE/RK3399-ROCKPRO64_9_20190718.1752_RELEASE_TEST/PATCHES/kernel/0001-add-rockpro64-configs.patch
/home/lineageos/IMAGE/RK3399-ROCKPRO64_9_20190718.1752_RELEASE_TEST/PATCHES/kernel/0002-for-tp-gt911-fw.patch
/home/lineageos/IMAGE/RK3399-ROCKPRO64_9_20190718.1752_RELEASE_TEST/PATCHES/kernel/0003-generate-ethernet-MAC-address-form-cpuid.patch
/home/lineageos/IMAGE/RK3399-ROCKPRO64_9_20190718.1752_RELEASE_TEST/PATCHES/kernel/0004-for-rockpro64-codec.patch
/home/lineageos/IMAGE/RK3399-ROCKPRO64_9_20190718.1752_RELEASE_TEST/PATCHES/kernel/0005-add-sdcard-boot.patch
/home/lineageos/IMAGE/RK3399-ROCKPRO64_9_20190718.1752_RELEASE_TEST/PATCHES/kernel/0006-set-boot_devices-sdhci.patch
Generate patch for kernel done
Generate patch for u-boot done
/home/lineageos/IMAGE/RK3399-ROCKPRO64_9_20190718.1752_RELEASE_TEST/PATCHES/vendor/rockchip/common/0001-rk3399-vpu-use-mpp-for-mpeg2.patch
Generate patch for vendor/rockchip/common done


Possibly Related Threads…
Thread Author Replies Views Last Post
  Install Playstore on Android 8.1.0 Domo 14 12,155 04-16-2021, 02:13 AM
Last Post: Wizzard
  Install Playstore on Android 7.1.2 Domo 6 6,647 04-16-2021, 02:10 AM
Last Post: Wizzard
  Kodi crashing in Android 9 Wizzard 2 888 04-16-2021, 02:03 AM
Last Post: Wizzard
  Slash TV Android for RockPro64 Wizzard 2 848 03-15-2021, 05:05 AM
Last Post: Wizzard
  Install Playstore on Android 9 image ddimension 18 11,204 02-13-2021, 12:52 AM
Last Post: chisteven
  RockPro64 line out/headphones in Android 9 Wizzard 0 1,179 11-20-2020, 04:15 AM
Last Post: Wizzard
  Android 9 drivers Firesped 1 1,756 11-19-2020, 12:39 PM
Last Post: Wizzard
  I2C on Android? ameridroid 0 1,263 03-02-2020, 03:41 PM
Last Post: ameridroid
  How to create the img file to use with etcher once you build the android SDK? dazza5000 8 4,448 01-22-2020, 10:26 AM
Last Post: webgourou
  Android 9 SDK CRC errors ddimension 2 2,104 01-21-2020, 07:32 AM
Last Post: ChristianS

Forum Jump:


Users browsing this thread: 1 Guest(s)