Android车机DIY开发之软件篇(十一) NXP AutomotiveOS编译
Google 在汽车上也提供了用于汽车的 Google 汽车服务(GAS,Google Automotive Service),包含有 Google 地图、应用市场、Google 汽车助理等等。Google 汽车服务同样没有开源,而是以软件包的形式提供给制造商。 目前国内汽车搭载的 Android 系统都是在标准的 Android Automotive OS 基础上对架构重新进行了定制及应用的本地化适配。
SystemUI 位置 /frameworks/base/packages/SystemUI
CarSystemUI 位置 packages/apps/Car/SystemUI
CarLuncher 位置packages/apps/Car/Launcher
CarServices 位置packages/services/Car/service
CarAPI 位置packages/Car/car-lib car-support-lib
编译镜像文件位置 device/generic/car/XXX.mk
Android Studio for Platform
1. 下载地址
nxp下载地址
解压automotive-14.0.0_2.1.0.tar.gz 到 ~/.
2.在HOME执行
sudo rm -rf /usr/bin/python
sudo ln -s /usr/bin/python2 /usr/bin/python
git config --global user.name “赵川”
git config --global user.email"zc1508890767@gmail.com"
sudo apt-get install libqt5x11extras5
sudo dpkg -i nekoray-3.26-2023-12-09-debian-x64.deb
设置代理
git config --global http.proxy http://127.0.0.1:2081
git config --global https.proxy https://127.0.0.1:2081
浏览器登录https://android.googlesource.com/new-password,并用gmail帐号登录;
按网页上指示运行
谷歌镜像
mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=${PATH}:~/bin
source ~/imx-automotive-14.0.0_2.1.0/imx_android_setup.sh
mkdir ~/bin
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=${PATH}:~/bin
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
source ~/imx-automotive-12.0.0_1.1/imx_android_setup.sh
基于清华大学镜像服务器,修改 android_build/.repo/manifests/ 目录下 .xml 文件,如下所示:
fetch="https://android.googlesource.com/"改为
fetch="https://aosp.tuna.tsinghua.edu.cn"
review="https://android-review.googlesource.com/"/>
<defaultrevision="refs/tags/android-14.0.0.2.1.0"
上面这条命令会执行很长时间~~~~~~
下载A内核交叉编译工具链
[下载网页](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads/12-3-rel1)
AArch32 arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi.tar.xz
AArch64 arm-gnu-toolchain-12.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
AArch32 :
```bash
sudo tar -xvJf arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi.tar.xz -C /opt
export AARCH32_GCC_CROSS_COMPILE=/opt/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-
```
AArch64:
```bash
sudo tar -xvJf arm-gnu-toolchain-12.3.rel1-x86_64-aarch64-none-linuxgnu.tar.xz -C /opt
export AARCH64_GCC_CROSS_COMPILE=/opt/arm-gnu-toolchain-12.3.rel1-x86_64-
aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
```
运行:
```bash
sudo git clone -b main-kernel-build-2024 --single-branch --depth 1 https://
android.googlesource.com/platform/prebuilts/clang/host/linux-x86 /opt/
prebuilt-android-clang
cd /opt/prebuilt-android-clang
sudo git fetch origin 3bd47139ac0e3593d4707ac0eeb2d45aa7411b67
sudo git checkout 3bd47139ac0e3593d4707ac0eeb2d45aa7411b67
export CLANG_PATH=/opt/prebuilt-android-clang
export LIBCLANG_PATH=/opt/prebuilt-android-clang/clang-r510928/lib
```
```bash
sudo git clone -b main-kernel-build-2024 --single-branch --depth 1 https://
android.googlesource.com/kernel/prebuilts/build-tools /opt/prebuilt-androidkernel-build-tools
cd /opt/prebuilt-android-kernel-build-tools
sudo git fetch origin ae85d23af20f61220b114fc3f7bb6f77cc140365
sudo git checkout ae85d23af20f61220b114fc3f7bb6f77cc140365
export PATH=/opt/prebuilt-android-kernel-build-tools/linux-x86/bin:$PATH
```
/etc/profile
下载Arm Cortex-M4内核交叉编译工具链
[下载网页](https://developer.arm.com/downloads/-/gnu-rm)
```bash
sudo tar -jxvf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 -C /opt
export ARMGCC_DIR=/opt/gcc-arm-none-eabi-7-2018-q2-update
```
```bash
wget https://github.com/Kitware/CMake/releases/download/v3.13.2/
cmake-3.13.2.tar.gz
tar -xzvf cmake-3.13.2.tar.gz; cd cmake-3.13.2;
sudo ./bootstrap
sudo make
sudo make install
```
## 3.编译
source build/envsetup.sh
lunch
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_barbet-userdebug
4. aosp_bluejay-userdebug
5. aosp_bluejay_car-userdebug
6. aosp_bramble-userdebug
7. aosp_bramble_car-userdebug
8. aosp_car_arm-userdebug
9. aosp_car_arm64-userdebug
10. aosp_car_x86-userdebug
11. aosp_car_x86_64-userdebug
12. aosp_cf_arm64_auto-userdebug
13. aosp_cf_arm64_phone-userdebug
14. aosp_cf_x86_64_foldable-userdebug
15. aosp_cf_x86_64_pc-userdebug
16. aosp_cf_x86_64_phone-userdebug
17. aosp_cf_x86_64_tv-userdebug
18. aosp_cf_x86_auto-userdebug
19. aosp_cf_x86_phone-userdebug
20. aosp_cf_x86_tv-userdebug
21. aosp_cheetah-userdebug
22. aosp_cloudripper-userdebug
23. aosp_coral-userdebug
24. aosp_coral_car-userdebug
25. aosp_flame-userdebug
26. aosp_flame_car-userdebug
27. aosp_oriole-userdebug
28. aosp_oriole_car-userdebug
29. aosp_panther-userdebug
30. aosp_raven-userdebug
31. aosp_raven_car-userdebug
32. aosp_ravenclaw-userdebug
33. aosp_redfin-userdebug
34. aosp_redfin_car-userdebug
35. aosp_redfin_vf-userdebug
36. aosp_slider-userdebug
37. aosp_sunfish-userdebug
38. aosp_sunfish_car-userdebug
39. aosp_trout_arm64-userdebug
40. aosp_trout_x86-userdebug
41. aosp_whitefin-userdebug
42. aosp_x86-eng
43. aosp_x86_64-eng
44. arm_krait-eng
45. arm_v7_v8-eng
46. armv8-eng
47. armv8_cortex_a55-eng
48. armv8_kryo385-eng
49. beagle_x15-userdebug
50. beagle_x15_auto-userdebug
51. car_ui_portrait-userdebug
52. car_x86_64-userdebug
53. db845c-userdebug
54. evk_6sl-user
55. evk_6sl-userdebug
56. evk_7ulp-user
57. evk_7ulp-userdebug
58. evk_7ulp_revb-user
59. evk_7ulp_revb-userdebug
60. evk_8mm-user
61. evk_8mm-userdebug
62. evk_8mn-user
63. evk_8mn-userdebug
64. evk_8mp-user
65. evk_8mp-userdebug
66. evk_8mq-user
67. evk_8mq-userdebug
68. evk_8ulp-user
69. evk_8ulp-userdebug
70. evk_93-user
71. evk_93-userdebug
72. gsi_car_arm64-userdebug
73. gsi_car_x86_64-userdebug
74. hikey-userdebug
75. hikey64_only-userdebug
76. hikey960-userdebug
77. hikey960_tv-userdebug
78. hikey_tv-userdebug
79. mek_8q-user
80. mek_8q-userdebug
81. mek_8q_car-user
82. mek_8q_car-userdebug
83. mek_8q_car2-user
84. mek_8q_car2-userdebug
85. poplar-eng
86. poplar-user
87. poplar-userdebug
88. qemu_trusty_arm64-userdebug
89. rb5-userdebug
90. sabreauto_6q-user
91. sabreauto_6q-userdebug
92. sabresd_6dq-user
93. sabresd_6dq-userdebug
94. sabresd_6dq_car-user
95. sabresd_6dq_car-userdebug
96. sabresd_6sx-user
97. sabresd_6sx-userdebug
98. sabresd_7d-user
99. sabresd_7d-userdebug
100. sdk_car_arm-userdebug
101. sdk_car_arm64-userdebug
102. sdk_car_portrait_x86_64-userdebug
103. sdk_car_x86-userdebug
104. sdk_car_x86_64-userdebug
105. sdk_pc_x86_64-userdebug
106. silvermont-eng
107. uml-userdebug
108. watch_8ulp-user
109. watch_8ulp-userdebug
110. yukawa-userdebug
111. yukawa_sei510-userdebug
./imx-make.sh -j4 2>&1 | tee build-log.txt
编译选项
| mek_8q_car-trunk_staginguserdebug | i.MX 8QuadXPlus/8QuadMax MEK Board with the EVSfunction enabled on the Arm Cortex-M4 CPU core|
|--|--|
| mek_8q_car2-trunk_staginguserdebug | i.MX 8QuadMax/8QuadXPlus MEK Board with the EVS function enabled on the Arm Cortex-A CPU cores (Power mode switch demo is running on the Cortex-M4 core in thisconfiguration) |
|--|--|
| | |