Making images from source
đĻ Prerequisitesâ
- A computer running Arch Linux, Arch Linux ARM or any other Arch-based distribution
- Root access
- 15GB of free space
- 8GB of RAM
- A bit of patience
đ Introductionâ
In this guide, we will walk you through the process of making images from source for the Fydetab Duo. This will allow you to create custom images with specific configurations and packages. The format is similar to the mkarchiso tool used to create Arch Linux ISO images, but with some modifications to support the ARM64 architecture and the Fydetab Duo hardware.
- Backend library: ImageForge
- Images repository: GitHub
Image Structureâ
Here is a breakdown of each file in a Fydetab Duo image:
-
fydetab-duo_UEFI.img
: This is the UEFI image file for the Fydetab Duo. It contains the boot loader. -
packages.aarch64
: This file lists the packages that will be installed on the Fydetab Duo. It is used during the image creation process to specify the desired software packages. -
pacman.conf.aarch64
: This is the Pacman configuration file specific to the ARM64 architecture. It is used by the package manager to determine package sources and settings. -
profiledef
: This file defines the profile configuration for the Fydetab Duo image. It specifies various system configurations, such as how to partition the disk, output image name, and other settings. -
rootfs
: This directory contains the root file system for the Fydetab Duo image. It includes all the necessary files and directories that make up the operating system.
Each of these files plays a crucial role in the image creation process, allowing you to customize and configure the Fydetab Duo image according to your specific needs.
Setting up the build environmentâ
1. Install dependenciesâ
Before you can start building the image, you need to install the necessary dependencies. Run the following commands to install them:
sudo pacman -Sy --noconfirm --needed python parted btrfs-progs git wget arch-install-scripts gptfdisk dosfstools multipath-tools
wget https://deb-mirror.fydeos.com/pacman/repo/fyde/aarch64/python-imageforge-0.0.1-1-any.pkg.tar.zst
sudo pacman -U --noconfirm python-imageforge-0.0.1-1-any.pkg.tar.zst
2. Setting up QEMU (optional)â
If you want to build the image on an x86 machine, you can use QEMU to emulate an ARM64 environment. To install QEMU, run the following command:
sudo pacman -S --noconfirm qemu-user-static qemu-user-static-binfmt
Restart the binfmt service to enable QEMU:
sudo systemctl restart systemd-binfmt
3. Clone the repositoryâ
Next, clone the ImageForge repository to your local machine:
git clone https://github.com/Linux-for-Fydetab-Duo/images.git
4. Build the imageâ
Navigate to the images
directory and run the following command to build the image:
sudo ./fydetab-arch/profiledef -c fydetab-arch -w ./work -o ./out
If you have more than 16GB of RAM, you can speed up the build process by changing the work directory to a tmpfs mount point. This will reduce the I/O overhead and speed up the image creation process. Specify -w /tmp/work as the work directory when running the profiledef command.
5. Flash the imageâ
Once the image creation process is complete, you can flash the resulting image to a microSD card or eMMC by following the instructions in the Installation guide.
Common issuesâ
- Download library error:
Sometimes the build process may fail due to a download library error caused by a poor network connection. The error will look like this:
warning: failed to retrieve some files
error: failed to commit transaction (download library error)
Errors occurred, no packages were upgraded.
==> ERROR: Failed to install packages to new root
Traceback (most recent call last):
File "/home/panda/images/fydetab-arch/profiledef", line 82, in <module>
main()
File "/home/panda/images/fydetab-arch/profiledef", line 58, in main
pacstrap_packages()
File "/usr/lib/python3.12/site-packages/imageforge/packages.py", line 23, in pacstrap_packages
subprocess.run(
File "/usr/lib/python3.12/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pacstrap -c -C /home/panda/images/fydetab-arch/pacman.conf.aarch64 -M -G /home/panda/images/work/aarch64 ..... ']' returned non-zero exit status 1.- To fix the issue, you can try running the profiledef command again. If the issue persists, you can make an issue on the ImageForge repository for further assistance.