This chapter describes the procedure for creating an image the same as the factory default image.
We recommend latest version of sources because of troubleshooting, function addition and updating.
![[警告]](images/warning.png) | |
---|
The development process involves working with basic libraries, applications and system configuration files. While all files are altered only under the working directory, in order to ensure the PC operating system is not inadvertently damaged from any mistakes made during development please perform all work as a general user and not a root user. |
7.1. Building the Bootloader
This section explains the procedure for creating an image file from the source code of the bootloader "U-Boot".
![[ティップ]](images/tip.png) | |
---|
Default configurations for SPI flash memory and SD/eMMC ware merged since u-boot-x1-at16 . |
手順7.1 Building the Bootloader
Preparing Source Code
Prepare and extract the U-Boot source code archive.
Applying Default Configuration
Enter the U-Boot directory and apply the default configuration for Armadillo-IoT Gateway G3. Specify x1_config
as the default config.
Building
The make command is used to perform the build.
Confirming the creation of the Image File
When the build finishes an image file is created in the U-Boot directory.
7.2. Building the Linux Kernel
This section explains the procedure for creating an image file from the Linux kernel source code and initramfs archive.
- Files required for the build
linux-4.9-x1-at[version].tar.gz |
initramfs_x1-[version].cpio.gz |
手順7.2 Building the Linux Kernel
Extracting the Archive
Extract the Linux kernel source code archive.
Creating a Symbolic Link to the Initramfs Archive
Move to the Linux kernel directory and create a symbolic link to the initramfs archive.
Configuration
Perform the configuration.
Building
To do the build, run the following commands.
Confirming the creation of the Image File
When the build finishes, image files (the Linux kernel and DTB) are created under the arch/arm/boot/directory and arch/arm/boot/dts/ directory.
7.3. Building a Debian GNU/Linux Root File System
The following shows how to build a Debian GNU/Linux root file system using x1-debian-builder.
x1-debuan-builder is a tool that can be used on Linux running on a PC such as ATDE to build armhf architecture Debian GNU/Linux root file systems for Armadillo-IoTG3.
Depending on how it is used, after starting Armadillo-IoT G3 the first time the ssh secret key, operation log, shell command history, the configuration files associated with the hardware UUID and so on are generated on the root file system. If the root file system is then copied as-is to another Armadillo-IoT G3 , there is a possibility that behavior differences may occur due to key leakage or UUID mismatch. Therefore it is recommended to use x1-debuan-builder and build a new root file system for use in mass production etc.
7.3.1. Creating the Factory Default Root File System Archive
The procedure for building the root file system archive of the factory default state is as follows. As packages are obtained over the internet it will depending on the connection speed, but will generally take around 40 minutes.
7.3.2. Creating a Customized Root File System Archive
The root file system can be modified by altering the files under x1-debian-builder-[VERSION]
/aiotg3_resources and executing the build.sh script.
7.3.2.1. Adding Files and Directories
All files and directories under aiotg3_resources except for the resources directory are copied directly to the root file system. Both the UID and GID of the files become "root".
7.3.2.2. Changing Packages
The packages to be installed on the root file system can be customized by altering aiotg3_resources/resources/packages.
One package name is written per line. Please use package names in the form that can be correctly used as the argument to "apt-get install" on Armadillo-IoT G3.
If an incorrect package name is specified, the following error message is displayed in the build log and the archive is generated without the package.
![[ティップ]](images/tip.png) | |
---|
Other packages that the package depends on are automatically installed by the apt command without needing to specify them. Also, packages that form the base of Debian GNU/Linux such as apt and dpkg are also automatically installed. |
![[ティップ]](images/tip.png) | |
---|
The packages include the lua and ruby interpreters and a web server (lighttpd). If they are not required just delete each package's line. |
![[警告]](images/warning.png) | |
---|
For packages such as openssh-server that automatically generate private keys when installed, as a general rule do not add them to the packages and instead use "apt-get install" to install them separately after starting Armadillo. If openssh-server is added to packages, it will be possible to log in to all Armadillo which the built root file system archive is written to using a single public key. If intentionally using the same secret key for multiple Armadillo, understand that it can lead to vulnerabilities and take appropriate measures before using it. |