Where to find out about Android Open Source Project
Download the Source
https://source.android.com/setup/downloading
sudo apt-get install curl
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
mkdir repo
cd repo
sudo apt-get install git
git config --global user.name "John Mehan"
git config --global user.email "john.mehan@irdeto.com"
repo init -u https://android.googlesource.com/platform/manifest
repo sync
Getting a Branch
If you want to use a particular branch, checkout the list of branches at: https://source.android.com/setup/build-numbers
repo init -u https://android.googlesource.com/platform/manifest -b android-8.1.0_r1
repo sync
Building
See https://source.android.com/setup/building
Clean up
make clobber
Setup Environment
source build/envsetup.sh
Using HiKey 960
See https://source.android.com/setup/devices
From the root folder:
wget https://dl.google.com/dl/android/aosp/arm-hikey960-OPR-cf4e0c80.tgz
tar xzf arm-hikey960-OPR-cf4e0c80.tgz
./extract-arm-hikey960.sh
Add Car Packages
cd device/linaro/hikey
vi hikey960.mk
Update the hikey960.mk:
ifndef TARGET_KERNEL_USE
TARGET_KERNEL_USE=4.9
endif
TARGET_PREBUILT_KERNEL := device/linaro/hikey-kernel/Image.gz-hikey960-$(TARGET_KERNEL_USE)
TARGET_PREBUILT_DTB := device/linaro/hikey-kernel/hi3660-hikey960.dtb-$(TARGET_KERNEL_USE)
ifeq ($(TARGET_KERNEL_USE), 4.4)
HIKEY_USE_LEGACY_TI_BLUETOOTH := true
else
HIKEY_USE_LEGACY_TI_BLUETOOTH := false
endif
#
# Inherit the full_base and device configurations
$(call inherit-product, device/linaro/hikey/hikey960/device-hikey960.mk)
$(call inherit-product, device/linaro/hikey/device-common.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
#
# Overrides
PRODUCT_NAME := hikey960
PRODUCT_DEVICE := hikey960
PRODUCT_BRAND := Android
PRODUCT_MODEL := AOSP on hikey960
BOARD_IS_AUTOMOTIVE := 1
PRODUCT_PACKAGES += \
vehicle.default \
android.car \
car-service-lib-for-test \
libvehiclenetwork-native \
libvehiclenetwork-java \
libvehiclenetwork-audio-helper \
libvehiclenetworkproto-native \
vehicle_network_service \
CarServiceTest \
vns_policy.xml \
vehicle_tests \
candump \
cansend \
cansniffer \
android.car.cluster.loggingrenderer
PRODUCT_PACKAGE_OVERLAYS := packages/services/Car/car_product/overlay
PRODUCT_COPY_FILES += \
device/generic/car/common/android.hardware.dummy.xml:system/etc/permissions/handheld_core_hardware.xml \
packages/services/Car/car_product/init/init.car.rc:root/init.car.rc \
packages/services/Car/car_product/init/init.bootstat.rc:root/init.bootstat.rc
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.type.automotive.xml:system/etc/permissions/android.hardware.type.automotive.xml \
frameworks/native/data/etc/android.hardware.screen.landscape.xml:system/etc/permissions/android.hardware.screen.landscape.xml
PRODUCT_PROPERTY_OVERRIDES += \
android.car.drawer.unlimited=true \
android.car.hvac.demo=true \
com.android.car.radio.demo=true \
com.android.car.radio.demo.dual=true
Build
lunch <BUILD-BUILDTYPE>
All build targets take the form BUILD-BUILDTYPE
, where the BUILD
is a codename referring to the particular feature combination.
BuiltType | Use |
---|---|
user | limited access; suited for production |
userdebug | like "user" but with root access and debuggability; preferred for debugging |
eng | development configuration with additional debugging tools |
For more information about building for and running on actual hardware, see Running Builds.
> lunch
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
7. full_fugu-userdebug
8. aosp_fugu-userdebug
9. car_emu_arm64-userdebug
10. aosp_car_emu_arm64-userdebug
11. car_emu_arm-userdebug
12. aosp_car_emu_arm-userdebug
13. car_emu_x86_64-userdebug
14. aosp_car_emu_x86_64-userdebug
15. aosp_car_emu_x86-userdebug
16. car_emu_x86-userdebug
17. mini_emulator_arm64-userdebug
18. m_e_arm-userdebug
19. m_e_mips64-eng
20. m_e_mips-userdebug
21. mini_emulator_x86_64-userdebug
22. mini_emulator_x86-userdebug
23. uml-userdebug
24. aosp_dragon-userdebug
25. aosp_dragon-eng
26. aosp_marlin-userdebug
27. aosp_marlin_svelte-userdebug
28. aosp_sailfish-userdebug
29. aosp_muskie-userdebug
30. aosp_walleye-userdebug
31. aosp_walleye_test-userdebug
32. aosp_taimen-userdebug
33. aosp_angler-userdebug
34. aosp_bullhead-userdebug
35. aosp_bullhead_svelte-userdebug
36. hikey-userdebug
37. hikey960-userdebug
Make
make -j4
Connect to the board
Connect the USB-C to the HiKey-960 board and power it up.
adb kill-server
adb start-server
adb shell
You should be able to get a shell prompt.
If you get the following error, you may need to install an additional package
error: insufficient permissions for device: user in plugdev group; are your udev rules wrong?
See [http://developer.android.com/tools/device.html] for more information
sudo apt-get install android-sdk-platform-tools-common
This package includes the udev rules to make adb work properly.
Flash device
Select fastboot mode turning ON switch 1 and 3 (for details, refer to the HiKey960 user guide).
Power the board.
Flash initial images:
> cd device/linaro/hikey/installer/hikey960
> ./flash-all.sh
References
Andriod Open Source Project | https://source.android.com/ |
Downloading AOSP | https://source.android.com/setup/downloading |
Building AOSP | https://source.android.com/setup/building |
Using Repo | https://source.android.com/setup/using-repo |
AOSP Releases/Branches | https://source.android.com/setup/build-numbers |