The Problem statement:
Our customer expressed their desire to know if Android (AOSP) was already ported by community to the RiscV platform and if we could provide a detailed summary of the current status of AOSP compilation/build and Qemu emulation progress for RiscV
Introduction to AOSP:
Android is an open source operating system for mobile devices and an open source project led by Google. Android Open Source Project (AOSP) repository offers the information and source code needed to create custom variants of the Android OS, port devices and accessories to the Android platform, and ensure that the devices meet the compatibility requirements that keep the Android ecosystem a healthy and stable environment for millions of users.
AOSP build requirements:
1. Follow instructions to download AOSP source code from this link https://source.android.com/docs/setup/download/downloading
2. Follow Readme.md to configure and build AOSP from this link https://github.com/google/android-riscv64
3. Follow the instructions to setup cuttlefish for riscv64 at this link https://source.android.com/docs/setup/create/cuttlefish-use
To build the target AOSP project, follow the steps below:
# Start a Baremetal instance on AWS
# Install basic dependencies on the instance
$> sudo apt-get update && sudo apt-get install build-essential repo
# Clone the source code to Baremetal instance.
$> mkdir ~/aosp
$> cd aosp
$> sudo ln -s /usr/bin/python3 /usr/bin/python
$> git config --global user.name <github username>
$> git config --global user.email <github email>
$> repo init -u https://android.googlesource.com/platform/manifest
$> repo sync
Note: The above command “repo sync” takes some time to download the sources to the folder.
# Once the sources are downloaded successfully, next run the configure command as below.
$> source build/envsetup.sh
$> lunch aosp_cf_riscv64_phone-trunk_staging-userdebug
Figure 2: Run the configuration command “lunch”
# Next, run the command to compile and build the AOSP sources
$> make –j
Figure 3: Run the build command “make”
# Build Error: make fails with permission error for /dev/loop*
Figure 4: Error as a result of missing loop devices and permissions
# Solution:
In case, loop devices are not available, then we need to create them.
Run command to grant user “ubuntu” permissions to modify loop devices.
$> sudo chown ubuntu /dev/loop*
# After granting permissions and some minutes later, the AOSP build completes successfully.
Figure 5: Error as a result of missing loop devices and root permissions
# Verify the images in the directory “vscoc_riscv64” as shown below.
Figure 6: Resulting Binaries of AOSP build
This completes Part-I of our blog. In the next part, i.e; Part-II, we shall launch the Cuttlefish Emulator and boot Android !!
Comentarios