This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Google Play Store installed on Clean TinkerOS_Android 7 Nougat V14.3.2.82
#21
[Image: C9Cl6II.jpg]
Compiling TinkerOS_Android 7 Nougat V14.3.2.82 from Source

following Compiling Tinkerboard's Android / How to Build Android ROMs on Ubuntu 16.04Build AOSP Nougat 7.1.2


Code:
[100% 35930/35930] host Executable: primitives_tests_32 (out/host/linux-x86/obj32/EXECUTABLES/primitives_tests_intermediates/primitives_tests32)

^[[0;32m#### make completed successfully (10:32:56 (hh:mm:ss)) ####^[[00m

10 hours & 33 minutes +..

using Lenovo Yoga 700-11ISK.. with Samsung 860 EVO 2 TB SATA M.2 (2280).. 
Intel Core m3-6Y30 2 x 0.9 - 2.2 GHz, Skylake / with 8GB LPDDR3-1866, dual-channel, soldered RAM...
& clean install.. Ubuntu desktop 20.04 LTS..

Code:
k247@yoga700-11isk:~/build
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal
k247@yoga700-11isk:~/build
$
Code:
k247@yoga700-11isk:~/build
$ uname -a
Linux yoga700-11isk 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
k247@yoga700-11isk:~/build
$

TinkerOS_Android 7 Nougat V14.3.2.82 source files from bitbucket.org.. pulled with..
Code:
repo init -u https://bitbucket.org/TinkerBoard_Android/manifest.git -b sbc/tinkerboard/asus/Android-7.1.2 -m android_20190515_v14.3.2.82.xml

Requirements
Before you download and build the Android source, ensure that your system meets the following requirements,
then see Establishing a Build Environment for installation instructions by operating system.

Hardware requirements
  • A 64-bit environment is required.. 
    (Intel Core m3-6Y30 - 2cores / 4therads.. check..)
  • At least 250GB of free disk space to check out the code and an extra 150 GB to build it.
    If you conduct multiple builds, you need additional space.
    (Samsung 860 EVO 2 TB SATA M.2 (2280).. check..)
  • If you're running Linux, you need at least 16 GB of available RAM/swap
    (max.. 8GB LPDDR3-1866, dual-channel, soldered RAM.. setup swap..)
with only 8GB ram.. setup 16GB swap partition , set filesystem partitions with noatime, in /etc/fstab file..
& set swappness to 40 in /etc/sysctl.conf..
Code:
...
vm.swappiness=40
...

lsblk
Code:
sda      8:0    0   1.8T  0 disk                        2TB EVO 860 SSD
├─sda1   8:1    0   976M  0 part /boot/efi              1GB EFI
├─sda2   8:2    0  15.3G  0 part [SWAP]                 16GB  Swap
├─sda3   8:3    0 238.4G  0 part /                      250GB Root      set noatime,
├─sda4   8:4    0 476.9G  0 part /home                  500GB Home      set noatime,
├─sda5   8:5    0 931.3G  0 part /mnt/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx      1TB Code        set noatime,
└─sda6   8:6    0 116.4G  0 part /mnt/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx      125GB Docker    set noatime,
note.. there is about 83GB of Free unallocated space...

& check Samsung 860 EVO 2 TB SATA M.2 (2280) SSD is setup for [AHCI mode]
sudo lspci -v
Code:
...
00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21) (prog-if 01 [AHCI 1.0])
       Subsystem: Lenovo Sunrise Point-LP SATA Controller [AHCI mode]
       Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 124
       Memory at a1130000 (32-bit, non-prefetchable)
       Memory at a1138000 (32-bit, non-prefetchable)
       I/O ports at 3080
       I/O ports at 3088
       I/O ports at 3060
       Memory at a1136000 (32-bit, non-prefetchable)
       Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
       Capabilities: [70] Power Management version 3
       Capabilities: [a8] SATA HBA v1.0
       Kernel driver in use: ahci
       Kernel modules: ahci
...
note.. reconfigure the BIOS, At boot, press Fn + F2, Configuration-tab.. [SATA Controller Mode] set to AHCI,
enable [Intel Virtual Technology], in Security-tab.. disable [Secure Boot] & Boot-tab.. set to UEFI..

Software requirements
after clean install Ubuntu 20.04.1 LTS.. 
set hostname - yoga700-11isk
LAN FixIP - router DHCP assigs IP Via MAC# / 192.168.0.18 / DNS not auto - 8.8.8.8,8.8.4.4
install Apps...
Code:
sudo apt install htop mc pv lnav iftop arp-scan

Setup sshd
Code:
sudo apt update
sudo apt install ssh openssh-server openssh-client mosh
sudo systemctl enable --now ssh
sudo systemctl status sshd
note.. A configuration file is created in the /etc/ssh folder named sshd_config,
I had to set [StrictModes no] for [PubkeyAuthentication yes] to work.. not sure why.. tbc

Disabling Ubuntu Suspend / Power Management Features from the Command Line
Code:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

for Lenovo Yoga 700-11ISK..  set the screen to go blank when lid is closed.
Then go to settings -> Privacy -> Screen Lock and turn off automatic screen lock.
Code:
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
then edit...
sudo nano /etc/systemd/logind.conf
Code:
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
HandlePowerKey=poweroff
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
LidSwitchIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

Disable Core Dumps
To disable core dumps for all users, open /etc/security/limits.conf, enter:
sudo nano /etc/security/limits.conf
Code:
...
# To disable core dumps for all users
* hard core 0
...
Once a hard limit is set in /etc/security/limits.conf,
the user cannot increase that limit within his own session.

Add fs.suid_dumpable = 0 to /etc/sysctl.conf file:
Code:
echo 'fs.suid_dumpable = 0' >> /etc/sysctl.conf
This will make sure that core dumps can never be made by setuid programs.
Code:
k247@yoga700-11isk:/var/crash
$ sudo sysctl -p
vm.swappiness = 40
fs.suid_dumpable = 0
k247@yoga700-11isk:/var/crash
$
Finally, add the following to /etc/profile to set a soft limit to stop the
creation of core dump files for all users (which is default and must be disabled)
Code:
echo 'ulimit -S -c 0 > /dev/null 2>&1' >> /etc/profile

Disable Error Reporting
disable the Apport and get rid of system crash report completely
sudo rm /var/crash/*
sudo nano /etc/default/apport
Code:
# set this to 0 to disable apport, or to 1 to enable it
# you can temporarily override this with
# sudo service apport start force_start=1
enabled=0
############################

sudo systemctl stop whoopsie
Code:
k247@yoga700-11isk:~
$ sudo systemctl status whoopsie
● whoopsie.service - crash report submission daemon
    Loaded: loaded (/lib/systemd/system/whoopsie.service; disabled; vendor preset: enabled)
    Active: inactive (dead)
k247@yoga700-11isk:~
$

Tweak ubuntu 20.04
Code:
sudo apt install dconf-editor
sudo apt install gnome-tweaks
sudo apt install chrome-gnome-shell
sudo apt install gnome-shell-extensions
sudo apt install ubuntu-restricted-extras
sudo apt install gnome-sushi
sudo apt install rar unrar p7zip-full p7zip-rar

Enable Minimise on Click
Code:
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

Show Battery Percentage
Code:
gsettings set org.gnome.desktop.interface show-battery-percentage true

ubuntu DOCK
Code:
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM
gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode FIXED
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 64
gsettings set org.gnome.shell.extensions.dash-to-dock unity-backlit-items true

Set Locales for UK...
Code:
apt-get update
apt-get install -y locales

sudo nano /etc/locale.gen
Uncomment en_GB.UTF-8 for inclusion in generation

then Generate locale
Code:
sudo locale-gen

then add to file ...
nano ~/.bashrc
Code:
# fix keyboard uk layout & LANG / locales...
export LANG=en_GB.UTF-8
export LANGUAGE=en_GB:en
export LC_ALL=en_GB.UTF-8
for UK....

source ~/.bashrc
locale
Code:
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=en_GB.UTF-8
fixed ;-].. for UK...

Change Time Zone in Ubuntu 20.04 LTS
Code:
sudo apt update
sudo apt install tzdata
sudo dpkg-reconfigure tzdata
Then, select Europe –> London. for UK...

Code:
k247@yoga700-11isk:~$ sudo dpkg-reconfigure tzdata

Current default time zone: 'Europe/London'
Local time is now:      Mon Sep 14 19:32:19 BST 2020.
Universal Time is now:  Mon Sep 14 18:32:19 UTC 2020.

k247@yoga700-11isk:~$

Sync time on Ubuntu 20-04
Code:
k247@yoga700-11isk:~
$ timedatectl
              Local time: Mon 2020-10-12 08:16:52 BST
          Universal time: Mon 2020-10-12 07:16:52 UTC
                RTC time: Mon 2020-10-12 07:16:52
               Time zone: Europe/London (BST, +0100)
System clock synchronized: yes
             NTP service: active
         RTC in local TZ: no
k247@yoga700-11isk:~

sudo nano /etc/systemd/timesyncd.conf
Code:
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See timesyncd.conf(5) for details.

[Time]
NTP=time.google.com
#FallbackNTP=ntp.ubuntu.com
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048

sudo systemctl restart systemd-timesyncd
Code:
$ sudo systemctl status systemd-timesyncd
[sudo] password for k247:
● systemd-timesyncd.service - Network Time Synchronization
    Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
    Active: active (running) since Wed 2020-10-14 04:33:55 BST; 3h 49min ago
      Docs: man:systemd-timesyncd.service(8)
  Main PID: 469 (systemd-timesyn)
    Status: "Initial synchronization to time server 216.239.35.4:123 (time.google.com)."
     Tasks: 2 (limit: 9346)
    Memory: 2.0M
    CGroup: /system.slice/systemd-timesyncd.service
            └─469 /lib/systemd/systemd-timesyncd

Oct 14 04:33:55 yoga700-11isk systemd[1]: Starting Network Time Synchronization...
Oct 14 04:33:55 yoga700-11isk systemd[1]: Started Network Time Synchronization.
Oct 14 04:34:25 yoga700-11isk systemd-timesyncd[469]: Initial synchronization to time server 216.239.35.4:123 (time.google.com).
k247@yoga700-11isk:~

Full update & upgrade System
Code:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo apt-get autoclean

Set up a device for development
On working tinker board with TinkerOS_Android 7 Nougat V14.3.2.82, 
open the Settings app, select Developer options, and then enable USB debugging.
[Image: PNUfAP4.jpg:]
connected USB-A to tinker board micro USB port & tinker board powered via GPIO pins 4 & 6...

Set Lenovo Yoga 700-11ISK  to detect tinker board
install...
sudo apt install adb
Code:
k247@yoga700-11isk:~/temp/tinkerboard/v14_4_0_5$ apt-cache rdepends adb
adb
Reverse Depends:
 android-sdk-platform-tools
 scrcpy
 libandroid-ddms-java
 git-annex
 fdroidcl
 android-tools-adb
k247@yoga700-11isk:~/temp/tinkerboard/v14_4_0_5$
notes..
Ubuntu Linux: There are two things that need to be set up correctly:
each user that wants to use adb needs to be in the plugdev group,
and the system needs to have udev rules installed that cover the device.

plugdev group: If you see an error message that says you're not in the plugdev group,
you'll need to add yourself to the plugdev group:
Code:
sudo usermod -aG plugdev $LOGNAME
Note that groups only get updated on login,
so you'll need to log out for this change to take effect.
When you log back in, you can use id to check that you're now in the plugdev group.
Code:
k247@yoga700-11isk:~
$ id
uid=1000(k247) gid=1000(k247) groups=1000(k247),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),131(lxd),132(sambashare)
k247@yoga700-11isk:~
$

udev rules: The android-sdk-platform-tools-common package contains a community-maintained
default set of udev rules for Android devices. To install:
Code:
apt-get install android-sdk-platform-tools-common

Tuning-nano-Text-Editor-with-nanorc
nano ~/.nanorc
Code:
set constantshow
set mouse
set smooth

# Syntax Highlighting
## Nanorc files
include "/usr/share/nano/nanorc.nanorc"

## C/C++
include "/usr/share/nano/c.nanorc"

## HTML
include "/usr/share/nano/html.nanorc"

## TeX
include "/usr/share/nano/tex.nanorc"

## Quoted emails (under e.g. mutt)
include "/usr/share/nano/mutt.nanorc"

## Patch files
include "/usr/share/nano/patch.nanorc"

## Manpages
include "/usr/share/nano/man.nanorc"

## Groff
include "/usr/share/nano/groff.nanorc"

## Perl
include "/usr/share/nano/perl.nanorc"

## Python
include "/usr/share/nano/python.nanorc"

## Ruby
include "/usr/share/nano/ruby.nanorc"

## Java
include "/usr/share/nano/java.nanorc"

## Assembler
include "/usr/share/nano/asm.nanorc"

## Bourne shell scripts
include "/usr/share/nano/sh.nanorc"

## POV-Ray
include "/usr/share/nano/pov.nanorc"

set morespace
set nohelp

Build Environment Setup
C & Python / PiP
Code:
sudo apt install nano micro htop mc tmux screen coreutils util-linux net-tools grep tree rsync mlocate
sudo apt install git wget curl clang python python2 ecj dx build-essential perl w3m file man proot aapt ltrace cmatrix
sudo apt install linux-headers-$(uname -r)
sudo apt install python3-pip
Code:
k247@yoga700-11isk:~$ pip3 --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
k247@yoga700-11isk:~$
---------------------------------------------------------------
k247@yoga700-11isk:~$ python3 -m pip -V
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
k247@yoga700-11isk:~$

https://www.fosslinux.com/39384/switchin...-20-04.htm
ll /usr/bin/python*

sudo update-alternatives --list python
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
sudo update-alternatives --config python
=========================
set python to 1 for 2.7 default...
Code:
$ python --version
Python 2.7.18
k247@yoga700-11isk:~


AOSP(Android Open Source Project)
Build AOSP Nougat 7.1.2
Dependencies:
Installing required packages (Ubuntu 18.04 /20.04)
sudo apt-get update
Code:
sudo apt-get install git-core gnupg flex bison build-essential zip curl \
zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev \
x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev \
libxml2-utils xsltproc unzip fontconfig
Code:
sudo apt-get install git gperf ccache python-mako make zlib1g-dev:i386 zlib1g-dev zip liblz4-tool
Code:
sudo apt-get install  android-tools-adb bc gnupg imagemagick lib32readline-dev \
liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev \
libxml2 lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm

Prepare your Java environment
To prevent errors generated by having the wrong version of Java installed on your computer,
we will start by removing any conflicting Java version and adding the correct version.
Java 8 is needed to build Android 7.x.x.
Code:
sudo apt-get purge icedtea6-*
Code:
sudo apt-get purge openjdk-* icedtea-*

now ready to fresh install..
Code:
sudo apt-get install openjdk-8-jdk

Code:
k247@yoga700-11isk:~$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode)
k247@yoga700-11isk:~$

Reboot system..

Setup Drv / Folder for Source Code
Lenovo Yoga 700-11ISK can have only one internal SSD, Samsung 860 EVO 2 TB SATA M.2 (2280)
1TB partition setup for source code.. lsblk
Code:
├─sda5   8:5    0 931.3G  0 part /mnt/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx      1TB Code        set noatime,
use cd to change to home folder & then mkdir code
Code:
sudo mount --bind /mnt/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/k247 /home/k247/code
note.. This is not permanent at all, and will be nuked by a restart.

Setup Folder structure for Downloading the Source Code
Code:
cd ~/code
mkdir -p tinkerBoard/aosp/android-7.1.2
cd tinkerBoard/aosp/android-7.1.2
Code:
$ pwd
/home/k247/code/tinkerBoard/aosp/android-7.1.2
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2

so now can have different builds under aosp folder.. ;-]...
Code:
k247@yoga700-11isk:~/code/tinkerBoard/aosp
$ ll
total 28K
drwxrwxr-x  7 k247 k247 4.0K Sep 26 05:20 ./
drwxrwxr-x  3 k247 k247 4.0K Sep 15 22:00 ../
drwxrwxr-x  3 k247 k247 4.0K Sep 18 01:32 android/
drwxrwxr-x 35 k247 k247 4.0K Sep 26 21:08 android-7.1.2/
drwxrwxr-x 36 k247 k247 4.0K Sep 26 20:47 android-7.1.2.k1/
drwxrwxr-x 30 k247 k247 4.0K Sep 18 01:07 android-7.1.2_r39/
drwxrwxr-x 38 k247 k247 4.0K Oct 10 08:18 android-7.1.2_r39.k1/
k247@yoga700-11isk:~/code/tinkerBoard/aosp
$ tree -L 1
.
├── android
├── android-7.1.2
├── android-7.1.2.k1
├── android-7.1.2_r39
└── android-7.1.2_r39.k1

5 directories, 0 files
k247@yoga700-11isk:~/code/tinkerBoard/aosp
$

Installing Repo Tool
Code:
cd
mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
note ~/.profile will setup ~/bin PATH....

Code:
$ ll
total 56K
drwxrwxr-x  2 k247 k247 4.0K Sep 23 03:30 ./
drwxrwxrwx 35 k247 k247 4.0K Oct 10 13:12 ../
-rwxrwxr-x  1 k247 k247 1.3K Sep 20 02:29 cleanK*
-rwxrwxr-x  1 k247 k247  39K Sep 15 23:10 repo*
-rwxrwxr-x  1 k247 k247 1.3K Sep 23 03:30 setAOSPbuildenv*
k247@yoga700-11isk:~/bin

The repo tool uses Git internally and requires that you create a Git configuration
specifying your user name and email address. Execute these commands to do that:
Code:
git config --global user.name "name"
git config --global user.email "name@email.com"
cat ~/.gitconfig

Prepare your Working Directory
Code:
cd ~/code/tinkerBoard/aosp/android-7.1.2
Code:
repo init -u https://bitbucket.org/TinkerBoard_Android/manifest.git -b sbc/tinkerboard/asus/Android-7.1.2 -m android_20190515_v14.3.2.82.xml
Android 7, current release. -b is for branch, -m is for what manifest file to use, which defaults to default.xml.

Code:
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$ repo init -u https://bitbucket.org/TinkerBoard_Android/manifest.git -b sbc/tinkerboard/asus/Android-7.1.2 -m android_20190515_v14.3.2.82.xml
Downloading manifest from https://bitbucket.org/TinkerBoard_Android/manifest.git
remote: Counting objects: 541, done.
remote: Compressing objects: 100% (207/207), done.
remote: Total 541 (delta 345), reused 459 (delta 313)
Receiving objects: 100% (541/541), 387.56 KiB | 997.00 KiB/s, done.
Resolving deltas: 100% (345/345), done.

Your identity is: Name <name@email.com>
If you want to change this, please re-run 'repo init' with --config-name

Testing colorized output (for 'repo diff', 'repo status'):
 black    red      green    yellow   blue     magenta   cyan     white
 bold     dim      ul       reverse
Enable color display in this user account (y/N)? y

repo has been initialized in /home/k247/code/tinkerBoard/aosp/android-7.1.2
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$

Preparing a Compiler Cache
Code:
sudo apt install ccache
sudo /usr/sbin/update-ccache-symlinks
export PATH="/usr/lib/ccache/:$PATH"

ll /usr/lib/ccache/
Code:
total 8.0K
drwxr-xr-x   2 root root 4.0K Sep 15 19:44 ./
drwxr-xr-x 142 root root 4.0K Sep 15 21:16 ../
lrwxrwxrwx   1 root root   16 Sep 15 19:44 c++ -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 c89-gcc -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 c99-gcc -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 cc -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 clang -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 clang++ -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 clang++-10 -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 clang-10 -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 g++ -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 g++-9 -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 gcc -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 gcc-9 -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 x86_64-linux-gnu-g++ -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 x86_64-linux-gnu-g++-9 -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 x86_64-linux-gnu-gcc -> ../../bin/ccache*
lrwxrwxrwx   1 root root   16 Sep 15 19:44 x86_64-linux-gnu-gcc-9 -> ../../bin/ccache*
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$

Configuration:
If you want no limit to the number of files and size of the cache:
Code:
ccache -F 0
ccache -M 0

Show cache statistics:
Code:
ccache -s

Empty the cache and reset the stats:
Code:
ccache -C -z

note..
reboot system after first installing ccache & remember to remount code 
then Prepare your Working Directory before sync repo..

Downloading source or Updating existing source
Code:
repo sync -j4 -c -q
   repo sync is the command.
  • -j4  specifies 4 download tasks at a time. I took down a corporate network running -j8 so please be careful.
  • -c   specifices "do not sync other branches." if i am looking for the 6.0 source code,
          do not also get the branch information for Android 7. This keeps the git info cleaner and speeds the sync up a little.
  • -q   is quiet. otherwise you'll get your console window destroyed with output and it's really hard to tell what your progress is.
Code:
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$ repo sync -j4 -c -q
Fetching projects: 100% (533/533), done.
Checking out projects: 100% (533/533), done.
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$

To enable the use of a compiler cache, set an environment variable named USE_CCACHE.
Code:
export USE_CCACHE=1

Unless you have lots of free disk space, you wouldn't want the cache to grow too large,
so you can limit its size. if you are building your ROM for a single device,
you can limit it to 15 GB. To do so,
ccache -M 15G
Code:
k247@yoga700-11isk:~$ ccache -M 15G
Set cache size limit to 15.0 GB
k247@yoga700-11isk:~$

Configuring Jack
The Jack server, which is responsible for building most of the Java-based portions of the ROM,
requires a lot of memory. To avoid memory allocation errors, you can use an environment variable
named ANDROID_JACK_VM_ARGS to specify how much memory Jack is allowed to use. Usually, allocating
about 50% of your servers RAM is sufficient. This environment variable also specifies other
compilation settings.

Execute the following command to allocate 4 GB of RAM to the Jack server
and preserve the default compilation options Jack needs:

Code:
export ANDROID_JACK_VM_ARGS="-Xmx4g -Dfile.encoding=UTF-8 -XX:+TieredCompilation"

to Fix Error when build: “make: *** [ninja_wrapper] Error 1”
Code:
export LC_ALL=C

Starting the Build
source build/envsetup.sh
Code:
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$ source build/envsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-mips64/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including device/rockchip/rk3288/vendorsetup.sh
including sdk/bash_completion/adb.bash
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$

lunch rk3288-userdebug
Code:
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$ lunch rk3288-userdebug

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
TARGET_PRODUCT=rk3288
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a15
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-47-generic-x86_64-with-Ubuntu-20.04-focal
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NHG47K
OUT_DIR=out
============================================
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$

Compiling source in Tmux session
Code:
tmux -l new -s aosp

Compiling the kernel. [25 mins]
cd kernel
make ARCH=arm rockchip_defconfig
make ARCH=arm rk3288-miniarm.img -j4
Code:
====================================
arch/arm/boot/compressed/atags_to_fdt.c: In function 'merge_fdt_bootargs':
arch/arm/boot/compressed/atags_to_fdt.c:98:1: warning: the frame size of 2056 bytes is larger than 1024 bytes [-Wframe-larger-than=]
..
 Building modules, stage 2.
 MODPOST 1 modules
 CC      drivers/media/usb/gspca/gspca_main.mod.o
 LD [M]  drivers/media/usb/gspca/gspca_main.ko
Pack to resource.img successed!
 Image:  resource.img (with rk3288-miniarm.dtb logo.bmp logo_kernel.bmp) is ready
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/kernel$
================================================================
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/kernel$ ll *.img
-rw-rw-r-- 1 k247 k247 8.2M Sep 16 07:24 kernel.img
-rw-rw-r-- 1 k247 k247  85K Sep 16 07:25 resource.img
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/kernel$

Compiling u-boot. [30 secs]
cd u-boot
make rk3288_secure_defconfig
make -j4
Code:
========
./tools/boot_merger ./tools/rk_tools/RKBOOT/RK3288MINIALL.ini
out:rk3288_loader_v1.06.233.bin
fix opt:rk3288_loader_v1.06.233.bin
merge success(rk3288_loader_v1.06.233.bin)
./tools/loaderimage --pack --trustos tools/rk_tools/bin/rk32/rk3288_tee_ta_v1.30.bin  trust.img
pack input tools/rk_tools/bin/rk32/rk3288_tee_ta_v1.30.bin
pack file size: 619356
crc = 0x9ce3276f
trustos version: Trust os
pack trust.img success!
./tools/loaderimage --pack --uboot u-boot.bin uboot.img
pack input u-boot.bin
pack file size: 510796
crc = 0x18f855cc
uboot version: U-Boot 2014.10-RK3288-06-g36972905f9 (Sep 16 2020 - 07:30:49)
pack uboot.img success!
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/u-boot$
================================================================
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/u-boot$ ll *.img
-rw-rw-r-- 1 k247 k247 4.0M Sep 16 07:31 trust.img
-rw-rw-r-- 1 k247 k247 4.0M Sep 16 07:31 uboot.img
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/u-boot$

Compiling system image. [10 hours - 33 mins] ;-]...
cd ..
make -j4 > buildlog.log 2>&1
Code:
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$ stat buildlog.log
 File: buildlog.log
 Size: 5646557         Blocks: 11032      IO Block: 4096   regular file
Device: 805h/2053d      Inode: 28837826    Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/    k247)   Gid: ( 1000/    k247)
Access: 2020-09-16 08:39:12.638715664 +0100
Modify: 2020-09-16 19:12:08.382940808 +0100
Change: 2020-09-16 19:12:08.382940808 +0100
Birth: -
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$
19h 12m 08s - 08h 39m 12s =10h 32m 56s
Code:
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/out/target/product/rk3288$ ll *.img
-rw-rw-r-- 1 k247 k247 9.7M Sep 16 16:07 boot.img
-rw-rw-r-- 1 k247 k247 6.0M Sep 16 16:07 ramdisk-recovery.img
-rw-rw-r-- 1 k247 k247 1.5M Sep 16 16:07 ramdisk.img
-rw-rw-r-- 1 k247 k247  15M Sep 16 16:07 recovery.img
-rw-r--r-- 1 k247 k247 540M Sep 16 17:12 system.img
-rw-r--r-- 1 k247 k247  34M Sep 16 16:55 vendor0.img
-rw-r--r-- 1 k247 k247  34M Sep 16 16:55 vendor1.img
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/out/target/product/rk3288$

k247@yoga700-11isk:~/code/tinkerBoard/aosp$ du -sh android-7.1.2/
82G     android-7.1.2/
k247@yoga700-11isk:~/code/tinkerBoard/aosp$

Building a single image
cd ~/code/tinkerBoard/aosp/android-7.1.2
./mkimage.sh
Code:
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$ ./mkimage.sh
TARGET_BOARD_PLATFORM=rk3288
TARGET_PRODUCT=rk3288
TARGET_HARDWARE=rk30board
TARGET_BUILD_VARIANT=userdebug
BOARD_SYSTEMIMAGE_PARTITION_SIZE=2147483648
BOARD_USE_SPARSE_SYSTEM_IMAGE=true
system filesysystem is ext4
create boot.img without kernel... done.
create recovery.img without kernel and resource... CRC32=0xB4D4F0CF
OK
done.
create misc.img.... done.
create system.img...done.
create uboot.img...done.
create trust.img...done.
create loader...done.
create resource.img...done.
create kernel.img...done.
create parameter...done.
create vendor.img...done.
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2$

cd RKTools/linux/Linux_Pack_Firmware/rockdev
./collectImages.sh && ./mkupdate.sh
Code:
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/RKTools/linux/Linux_Pack_Firmware/rockdev$ ./collectImages.sh && ./mkupdate.sh
Done
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/resource.img
Add file: ./Image/kernel.img
Add file: ./Image/boot.img
Add file: ./Image/recovery.img
Add file: ./Image/system.img
Add file: ./Image/vendor0.img
Add file: ./Image/vendor1.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.
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/RKTools/linux/Linux_Pack_Firmware/rockdev$

You now have a file, 
RKTools/linux/Linux_Pack_Firmware/rockdev/update.img
#####################################

Code:
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/RKTools/linux/Linux_Pack_Firmware/rockdev$ ll
total 2.1G
drwxrwxr-x 3 k247 k247 4.0K Sep 17 14:39 ./
drwxrwxr-x 3 k247 k247 4.0K Sep 16 02:16 ../
-rwxrwxr-x 1 k247 k247 1.4M Sep 16 02:16 afptool*
-rwxrwxr-x 1 k247 k247  911 Sep 16 02:16 collectImages.sh*
drwxrwxr-x 2 k247 k247 4.0K Sep 17 14:39 Image/
-rwxrwxr-x 1 k247 k247  535 Sep 16 02:16 mkupdate.sh*
-rwxrwxr-x 1 k247 k247  674 Sep 16 02:16 package-file*
-rwxrwxr-x 1 k247 k247  402 Sep 16 02:16 readme.txt*
-rwxrwxr-x 1 k247 k247 1.7M Sep 16 02:16 rkImageMaker*
-rwxrwxr-x 1 k247 k247 438K Sep 16 02:16 secureBootConsole*
-rwxrwxr-x 1 k247 k247 2.4K Sep 16 02:16 secureBootSign.sh*
-rw-rw-r-- 1 k247 k247  470 Sep 16 02:16 unpack.sh
-rw-rw-r-- 1 k247 k247 2.1G Sep 17 14:40 update.img
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/RKTools/linux/Linux_Pack_Firmware/rockdev$
Code:
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/RKTools/linux/Linux_Pack_Firmware/rockdev/Image
$ cat parameter.txt
FIRMWARE_VER:7.1
MACHINE_MODEL:rk3288
MACHINE_ID:007
MANUFACTURER:RK3288
MAGIC: 0x5041524B
ATAG: 0x60000800
MACHINE: 3288
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
CMDLINE: console=ttyFIQ0 androidboot.baseband=N/A androidboot.selinux=permissive androidboot.hardware=rk30board androidboot.console=ttyFIQ0 init=/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00002000@0x00004000(trust),0x00002000@0x00006000(misc),0x00008000@0x00008000(resource),0x0000C000@0x00010000(kernel),0x00010000@0x0001C000(boot),0x00010000@0x0002C000(recovery),0x00038000@0x0003C000(backup),0x00040000@0x00074000(cache),0x00400000@0x000B4000(system),0x00008000@0x004B4000(metadata),0x00019000@0x004BC000(vendor0),0x00019000@0x004D5000(vendor1),-@0x004EE000(userdata)
k247@yoga700-11isk:~/code/tinkerBoard/aosp/android-7.1.2/RKTools/linux/Linux_Pack_Firmware/rockdev/Image

Download SpiImageTools
https://github.com/rockchip-linux/tools/..._v1.36.zip
download win Tool...
https://github.com/rockchip-linux/tools/..._v1.36.zip
from
https://github.com/rockchip-linux/tools/...er/windows
https://github.com/rockchip-linux/tools/..._v1.41.zip

1. Run the program you just downloaded. yes. its in chinese. If you dont read Chinese, thats okay.
2. Just click the top button. it'll pop open a file select dialog, select your update.img you brought over.
3. Now click the bottom button and watch the blue progress bar ping-pong for a while. This can take a while (10+ minutes sometimes).
4. Come back when a chinese dialog popups and hit okay.
   the folder you placed the executable in should now have 3 .img files: boot0.bin, boot1.bin and data.bin.
5. Grab data.bin.

Flashing the image
1. Open etcher.
2. Click "Select Image". It'll warn you it's not bootable. that's okay, Continue.
3. Select your flashing device. You can flash an SD card or the Tinkerboard S directly if you're using one.
4. Click flash and wait for it to complete.

All done, you now should be able to boot into android on your device! 
If you really want some fun, to into Settings->About Device and look at the kernel version. 
It'll have your build machine's name in the description! 
Show it to all of your friends so they think you understand the kernel when you're secretly scared of touching it.

Happy Tinkering!

note... 
read up on.. android_SOP_eng_7.1.2.docx / tbc...
How to update image from OTA difference package...
generate the OTA difference update package...
update image by the OTA difference package...
hmmmm... can this be used with TinkerOS_Android 7 Nougat V14.3.2.82.. ???

Many Thanks to kbungo - Compiling Tinkerboard's Android

[Image: Vhfq5es.png]
---------------- ;-]...
hope it helps,
k,

next> Compiling TinkerOS_Android 7 Nougat V14.3.2.82 in Headless - TMUX session... tbc
Code:
k247@yoga700-11isk:~
$ tail -f build/buildlog.log
[ 99% 35926/35930] host C++: libprotobuf-cpp-full_32 <= external/protobuf/src/google/protobuf/compiler/parser.cc
[ 99% 35927/35930] host SharedLib: libprotobuf-cpp-full_32 (out/host/linux-x86/obj32/lib/libprotobuf-cpp-full.so)
[ 99% 35928/35930] host C: libaudioutils_32 <= system/media/audio_utils/primitives.c
[ 99% 35929/35930] host StaticLib: libaudioutils_32 (out/host/linux-x86/obj32/STATIC_LIBRARIES/libaudioutils_intermediates/libaudioutils.a)
[ 99% 35929/35930] host Executable: net_test_osi_32 (out/host/linux-x86/obj32/EXECUTABLES/net_test_osi_intermediates/net_test_osi32)
[ 99% 35929/35930] host C++: primitives_tests_32 <= system/media/audio_utils/tests/primitives_tests.cpp
[100% 35930/35930] host Executable: primitives_tests_32 (out/host/linux-x86/obj32/EXECUTABLES/primitives_tests_intermediates/primitives_tests32)

#### make completed successfully (07:19:22 (hh:mm:ss)) ####

k247@yoga700-11isk:~
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)