-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_stepbystep.txt
85 lines (69 loc) · 2.97 KB
/
build_stepbystep.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Tested in ubuntu 18.04
# Prepare environment
$ sudo apt-get purge openjdk-* icedtea-* icedtea6-*
$ sudo apt-get update
$ sudo apt-get install openjdk-9-jdk
$ java -version
$ sudo apt-get install bison g++-multilib git gcc gperf libxml2-utils make zlib1g-dev:i386 zip liblz4-tool libncurses5 libssl-dev bc flex
$ sudo apt-get install bison flex gperf git-core gnupg zip tofrodos \
> build-essential g++-multilib libc6-dev libc6-dev-i386 ia32-libs mingw32 \
> zlib1g-dev lib32z1-dev x11proto-core-dev libx11-dev \
> lib32readline5-dev libgl1-mesa-dev lib32ncurses5-dev
# Config default enviroment
$ cd ~
$ sudo su
$ source /home/quan/.bashrc
# Download Android source with patches(local_manifests)
$ mkdir boot
$ cd boot
$ repo init -u https://android.googlesource.com/platform/manifest -b android-10.0.0_r32
$ git clone https://github.com/android-rpi/local_manifests .repo/local_manifests -b android10
$ git config --global http.sslVerify false
$ repo sync --force-sync
- If still getting errors: $ repo sync --force-sync system/core
- A few solutions: {
$ apt-get install gnutls-bin
$ git config --global http.postBuffer 1048576000
$ repo sync --force-sync
or:
$ sudo sysctl -w net.ipv4.tcp_window_scaling=0
$ repo sync --force-sync
}
# Build Kernel
$ sudo apt install gcc-arm-linux-gnueabihf libssl-dev
$ cd kernel/rpi
$ ARCH=arm scripts/kconfig/merge_config.sh arch/arm/configs/bcm2709_defconfig kernel/configs/android-base.config kernel/configs/android-recommended.config
$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make zImage
$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make dtbs
$ sudo apt install python-mako
$ prebuilts/jdk/jdk9/linux-x86/bin/java -XX:+PrintFlagsFinal -version | grep "HeapSize"
$ export _JAVA_OPTIONS="-Xmx4g"
$ source build/envsetup.sh
$ lunch rpi3-eng
$ make -j1 ramdisk systemimage vendorimage
#Create sd card partition
$ apt install gparted
$ gparted
# Prepare sd card
Partitions of the card should be set-up like followings.
p1 256MB for BOOT : Do fdisk : W95 FAT32(LBA) & Bootable, mkfs.vfat
p2 640MB for /system : Do fdisk, new primary partition
p3 128MB for /vendor : Do fdisk, new primary partition
p4 remainings for /data : Do fdisk, mkfs.ext4
Set volume label for /data partition as userdata
: use -L option of mkfs.ext4, e2label command, or -n option of mkfs.vfat
# Write system & vendor partition
$ cd out/target/product/rpi3
$ sudo dd if=system.img of=/dev/<p2> bs=1M
$ sudo dd if=vendor.img of=/dev/<p3> bs=1M
# Copy kernel & ramdisk to BOOT partition
$ cd ~/boot && mkdir temp
$ mount /dev/<p1>:/ temp
$ cp device/brcm/rpi3/boot/* temp
$ cp kernel/rpi/arch/arm/boot/zImage temp
$ cp kernel/rpi/arch/arm/boot/dts/bcm2710-rpi-3-b.dtb temp
$ cp kernel/rpi/arch/arm/boot/dts/overlays/vc4-kms-v3d.dtbo temp/overlays/vc4-kms-v3d.dtbo
$ cp out/target/product/rpi3/ramdisk.img temp
# HDMI_MODE : If DVI monitor does not work, try followings for p1:/config.txt
hdmi_group=2
hdmi_mode=85