1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00
devlib/doc/tools.rst
Metin Kaya 1431bebd80 tools/buildroot: Add support for generating Linux target system images
Integrate buildroot into devlib in order to ease building kernel and
root filesystem images via 'generate-kernel-initrd.sh' helper script.

As its name suggests, the script builds kernel image which also includes
an initial RAM disk per default config files located under
configs/<arch>/.

Provide config files for buildroot and Linux kernel as well as a
post-build.sh script which tweaks (e.g., allowing root login on SSH)
target's root filesystem.

doc/tools.rst talks about details of kernel and rootfs configuration.

Signed-off-by: Metin Kaya <metin.kaya@arm.com>
2024-03-20 12:16:12 +00:00

86 lines
2.9 KiB
ReStructuredText

Tools
=====
Android
-------
``tools/android/install_base.sh`` script installs Android command line tools
for Linux and creates Android Virtual Devices (AVD).
The script creates ``android-sdk-linux`` directory under ``tools/android`` and
sets it as ``ANDROID_HOME`` directory (see
https://developer.android.com/tools/variables).
Your ``ANDROID_USER_HOME`` and ``ANDROID_EMULATOR_HOME`` environment variables
point to ``tools/android/android-sdk-linux/.android``. Hence, removing
``android-sdk-linux`` folder will clean all artefacts of ``install_base.sh``.
It fetches Android command line tools, then installs Android SDK
Platform-Tools, SDK Platform 31 (for Android 12) & 34 (for Android 14), and
Google APIs for platforms 31 & 34 for the associated ABI type.
Finally the script creates AVDs per Pixel 6 for Android 12 & 14.
Shell commands below illustrate how to list available AVDs and run them via
Android emulator:
.. code:: shell
ANDROID_HOME="/devlib/tools/android/android-sdk-linux"
export ANDROID_HOME
EMULATOR="${ANDROID_HOME}/emulator/emulator"
export ANDROID_EMULATOR_HOME="${ANDROID_HOME}/.android"
# List available AVDs:
${EMULATOR} -list-avds
# Run devlib-p6-14 AVD in emulator:
${EMULATOR} -avd devlib-p6-14 -no-window -no-snapshot -memory 2048 &
# After ~30 seconds, the emulated device will be ready:
adb -s emulator-5554 shell "lsmod"
Building buildroot
------------------
``buildroot/generate-kernel-initrd.sh`` helper script downloads and builds
``buildroot`` per config files located under ``tools/buildroot/configs``
for the specified architecture.
The script roughly checks out ``2023.11.1`` tag of ``buildroot``, copies config
files for buildroot (e.g., ``configs/aarch64/arm-power_aarch64_defconfig``) and
kernel (e.g., ``configs/aarch64/linux.config``) to necessary places under
buildroot directory, and runs ``make arm-power_aarch64_defconfig && make``
commands.
As its name suggests, ``generate-kernel-initrd.sh`` builds kernel image with an
initial RAM disk per default config files.
There is also ``post-build.sh`` script in order to make following tunings on
root filesystem generated by ``buildroot``:
- allow root login on SSH.
- increase number of concurrent SSH connections/channels to let devlib
consumers hammering the target system.
In order to keep rootfs minimal, only OpenSSH and util-linux packages
are enabled in the default configuration files.
DHCP client and SSH server services are enabled on target system startup.
SCHED_MC, SCHED_SMT and UCLAMP_TASK scheduler features are enabled for aarch64
kernel.
If you need to make changes on ``buildroot``, rootfs or kernel of target
system, you may want to run commands similar to these:
.. code:: shell
$ cd tools/buildroot/buildroot-v2023.11.1-aarch64
$ make menuconfig # or 'make linux-menuconfig' if you want to configure kernel
$ make
See https://buildroot.org/downloads/manual/manual.html for details.