This repo builds an ext4
or an initrd
using Docker containers.
Note: some assembly required.
Your user needs to be able to run docker
.
If not, run scripts with sudo: sudo build-rootfs.sh
.
Simply run:
./build-rootfs.sh <rootfs-type>
Where rootfs-type
is one of the root filesystem generators that starts with type-
.
For example, to generate an Ubuntu 21.04
rootfs, run:
./build-rootfs.sh ubuntu21.04
Note: By default, all images are generated as sparse files.
The initrd is built using ./build-initrd.sh
. By default it's based on the alpine image.
Each rootfs generator consists of 3 files:
-
init-rootfs.sh
: creates the root filesystem and formats it. This is needed because a distribution may take a larger amount of space -
inside-container.sh
: what is installed in a rootfs. Here this script usually finishes with copying the rootfs contents to a mounted rootfs.ext4 file. -
run-container.sh
: controls the container lifetime. For example the Ubuntu container is started twice because systemd needs to be initialized.
Just add a new folder with the 3 files described above
- Need a larger image? Change
init-rootfs.sh
.