Repository navigation
Expand file tree
/
Copy pathREADME.build
More file actions
107 lines (72 loc) · 3.56 KB
/
Copy pathREADME.build
File metadata and controls
107 lines (72 loc) · 3.56 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# this is a high level guide on how to build android
# for Raspberry Pi4 (rpi4) - this is NOT a beginners guide!
# So the requirement that you have either build android before or
# have enough experiences to understand what is important here
Builds as 64bit only so make sure you have propper firmware
on you rpi4. Same is true if you want to use an USB boot device
# sync omni source
Refer to http://source.android.com/source/downloading.html
Refer to https://github.com/omnirom/android
$ repo init -u git://github.com/omnirom/android.git -b android-11
If you want to use the contents of omni-private.xml please check
https://github.com/omnirom/android/README and head over to send us a short
email notice. Otherwise you can simple remove the include of that xml
file and build without
Independent of that you must have a ssh key in your github account
this is a requirement for easy syuncing
If you want to build with microG add the contents of <device>/repo/local_manifest.xml
to .repo/local_manifests/local_manifest.xml
$ repo sync
# Build Android source
Refer to http://source.android.com/source/building.html
# install needed host packages
This depends on your distro. There is also a list on the google
page linked above. The following list should be an example
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 kpartx sudo dosfstools rsync libncurses5 libssl-dev python3-mako unzip
# prepare environment
$ export ROM_BUILDTYPE=<MICROG|WEEKLY>
$ export TEMPORARY_DISABLE_PATH_RESTRICTIONS=true
$ export PRODUCT_EXCLUDE_EXTRA_PACKAGES=true
$ source build/envsetup.sh
# start build
# we dont build an OTA therefore we cant use
# brunch and lunch but simply use
$ breakfast rpi4 userdebug
$ m
after the buils is complete the generated image files are located in
out/target/product/rpi4/
# prepare boot device (sdcard or USB device)
Devices with GPT partition table cant be used as an USB boot device
You must use MBR (msdos) parition table
The boot devices MUST contain 4 partitions with the following layout
(parition sizes here are the minimum - userdata should be made bigger
if you have the space)
Device Start End Sectors Size Id Type
boot 2 262145 262144 128M c W95 FAT32 (LBA)
system 264192 4458495 4194304 2G 83 Linux
vendor 4458496 4982783 524288 256M 83 Linux
userdata 4982784 16777215 11794432 5.6G 83 Linux
THE PARTITION ORDER MUST BE LIKE THIS
Starting with android-11 project quotas are mandatory in userdata
parition. Prebuilt images have it enabled but if you recreate your
userdata you MUST enable project quotas with e.g.
tune2fs -O project,quota <userdata partition device>
Using resize2fs will keep quota setting intact
# boot device mode
Switching between booting from sdcard and USB is done in ALL config.txt*
files by enabling the needed overlay
...
# booting from sdcard
dtoverlay=rpi-android-sdcard
# booting from usb
dtoverlay=rpi-android-usb
....
You can still mess with the fstab if you want and dont use the overlay
# flash to boot device
I will keep it to your experience how you get the img files
on to your boot device in the according partitions (system and vendor)
Boot partition needs special treatment so I recommend to
look at one of my prebuilt zip files to see what must be in that
partition
The files in the scripts dir are what I use to create and update
feel free to adjust and update to your needs if you want