This is an old revision of the document!


02. Disk image & Debian

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 TODOs)!

2.1. Install Debian into an empty directory

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 create a gzipped archive, and be sure to preserve permissions!

The final results should be something like:

-rw-r--r--  1 root  root  148M 2025-08-07 14:23 debrootfs.tar.gz

2.2. Create the base disk image

๐Ÿ“„ File: 10-create-base-disk.sh

Your task:

  1. Use truncate or dd to allocate the image with the desired size;
  2. Modify the parted invocation (script);
  3. Add partitions for:
    1. rootfsA (ext4)
    2. rootfsB (ext4)
    3. data (ext4)

Keep the partition labels as commented!

2.3. Populate the rootfs partitions

๐Ÿ“„ File: 25-populate-base-disk.sh

Subtasks:

  1. Mount the partitions created previously (already in script);
  2. Extract the previously-obtained Debian debrootfs.tar.gz on each rootfs A/B partition (a simple tar xf will suffice);
ass/labs-2025/04/tasks/02.1754567446.txt.gz ยท Last modified: 2025/08/07 14:50 by florin.stancu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0