以下為使用 Ubuntu 18.04 編譯 Rockpi4 Android7 的過程記錄。

1. 建立編譯環境

參考 Rockpi 4 官網 和 AOSP官網 的建議,安裝必要元件。

# From Rockpi4 official web site
$ sudo apt-get update -y && sudo apt-get install -y openjdk-8-jdk python git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip mtools u-boot-tools \
htop iotop sysstat iftop pigz bc device-tree-compiler lunzip \
dosfstools vim-common parted udev
 
# From AOSP official web site
$ sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 libncurses5 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig
 

2. 下載 Source Code

取得 repo 。

$ mkdir rockpi4-android7
$ cd rockpi4-android7
$ wget 'https://storage.googleapis.com/git-repo-downloads/repo'
$ chmod a+x repo

下載 Source code 。

$ ./repo init -u https://github.com/radxa/manifests -b rk3399-all-7.1 -m rk3399_n_all_release.xml
$ ./repo sync -d --no-tags -j4

3. 編譯

編譯 U-boot 。

$ cd u-boot
$ ./make.sh rock-pi-4b-rk3399
$ cd ..

編譯 Kernel 。

$ cd kernel
$ make rockchip_defconfig
$ make rk3399-rockpi-4b-hdmi.img -j$(nproc)
$ cd ..

編譯 Android 。

$ source build/envsetup.sh
$ lunch rk3399_all-userdebug
$ make -j$(nproc)

在編譯的過程中遇到了以下的問題。

 

  • locale error

 

flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)

解決方法

$ export LC_ALL=C

 

  • jack sever error

 

Communication error with Jack server (35), try 'jack-diagnose' or see Jack server log
SSL error when connecting to the Jack server. Try 'jack-diagnose'
SSL error when connecting to the Jack server. Try 'jack-diagnose'

解決方法。編輯 /etc/java-8-openjdk/security/java.security 。將 TLSv1 , TLSv1.1 從jdk.tls.disabledAlgorithms 裡移除

jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves
 
改為
 
jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, \
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves

 

參考連結

https://wiki.radxa.com/Rockpi4/rockpi-android7

https://source.android.com/setup/build/initializing#installing-required-packages-ubuntu-1804

https://askubuntu.com/questions/1081901/what-is-the-correct-way-to-fix-an-assertion-in-loadlocale-c

https://stackoverflow.com/questions/67363030/rebuild-android-code-with-error-ssl-error-when-connecting-to-the-jack-server-t

arrow
arrow

    阿轟師 發表在 痞客邦 留言(0) 人氣()