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.
  Reply
#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
  Reply
#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?
  Reply
#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

[email protected]:~$ 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
  Reply
#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
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Android 9 SDK not Booting hgarrison 0 336 10-15-2019, 07:08 AM
Last Post: hgarrison
Exclamation Android 9: HDMI and PCI not working cetygamer 0 183 08-20-2019, 03:46 AM
Last Post: cetygamer
  Android Geekbench Results dazza5000 0 324 08-19-2019, 09:45 AM
Last Post: dazza5000
  How to create the img file to use with etcher once you build the android SDK? dazza5000 7 365 08-18-2019, 03:08 AM
Last Post: octavian
  Android 7.1.2 Source Code dazza5000 3 162 08-18-2019, 12:38 AM
Last Post: tllim
  Android 9 from eMMC with ayufan SPI uboot octavian 1 222 08-17-2019, 07:39 PM
Last Post: dazza5000
  android Tv SBCraok 3 277 08-06-2019, 04:12 PM
Last Post: dazza5000
  RockPro64 Build Environment Docker Container dazza5000 0 113 07-17-2019, 01:22 PM
Last Post: dazza5000
  Source code Android pececitozipi 30 3,716 07-16-2019, 10:24 AM
Last Post: dazza5000
  Kernel files (to be able to build kernel modules) cetygamer 1 358 07-11-2019, 06:50 AM
Last Post: cetygamer

Forum Jump:


Users browsing this thread: 1 Guest(s)