This is an old revision of the document!
Youโll be running scripts in ./scripts
, either one by one or all together via ./run-all.sh
.
The scripts are templates โ you may need to complete missing parts (search for TODO
s)!
Yes, really, you can easily do this!
You will use the debootstrap official tool to install a minimal Debian (you can also install deb-based derivatives like Ubuntu!) base system.
๐ Edit the 05-debootstrap.sh
script.
Since we need to install the Debian binaries executable on a 64-bit ARM architecture, we will need to split the installation into two stages: first, the .deb (Debian install packages) are downloaded from a Debian mirror server and unpacked into the target rootfs directory. Afterwards, since Debian will need to run some scripts to setup its distro system, we must emulate the target architecture. Enter qemu which will help us to just that!
Finally, we need to obtain the artifacts/debrootfs.tar.gz
archive with the contents of our newly-created Aarch64 Debian. Use tar
to c
reate a gz
ipped archive, and be sure to p
reserve permissions!
The final results should be something like:
-rw-r--r-- 1 root root 148M 2025-08-07 14:23 debrootfs.tar.gz
๐ File: 10-create-base-disk.sh
Your task:
truncate
or dd
to allocate the image with the desired size;parted
invocation (script);
๐ File: 25-populate-base-disk.sh
Subtasks:
debrootfs.tar.gz
on each rootfs A/B partition (a simple tar xf
will suffice);