How to build a rootfs

Use krep rootfs to build a Kreato Linux root filesystem. krep replaces the standalone Kreastrap tool but keeps its INI configuration format.

Requirements

Rootfs builds require Linux and root privileges. Use a disposable Kreato Linux build environment with kpkg, configured package repositories, and the native build dependencies. You also need Git, a C toolchain, Nim with Nimble, and Make. The full krep build needs native libraries including OpenSSL and libarchive. make deps installs the Nim dependencies, not the host libraries.

Rootfs builds can install host packages and use chroots and mounts. Do not run them on a host you cannot safely change. A container needs the permissions needed for these operations; an unprivileged container is not sufficient for every build.

Build krep

git clone https://github.com/kreatolinux/src
cd src
make deps
make krep
./out/krep rootfs --help

The build stages resources in out/share/krep. To install both the executable and resources, use sudo make install_krep (default prefix: /usr/local). Building krep on macOS does not make the Linux image tasks work there.

Select a profile and output directory

Profiles live in krep/data/rootfs/arch/ARCHITECTURE/configs/. The defaults are --arch=amd64 and --buildType=builder. Check which profiles exist for your architecture before selecting one. An architecture option alone does not provide a cross-compilation environment.

Copy a profile and review it before building:

cp krep/data/rootfs/arch/amd64/configs/builder.conf ./rootfs.conf
# Edit rootfs.conf, especially General.BuildDirectory, before continuing.
sudo ./out/krep rootfs --arch=amd64 --buildType=builder --configPath="$PWD/rootfs.conf"

[General] BuildDirectory selects the rootfs output directory. Bundled profiles use /out; this is not the source tree’s ./out binary directory. Relative output paths are resolved against the directory where you invoke krep. BuildPackages=yes builds packages from source; BuildPackages=no installs binaries from the configured repository. Availability depends on that repository.

The [Core] section selects libc, compiler, core utilities, TLS library, and init. The [Extras] section adds packages. See kreastrap.conf(5) for the retained INI format. Do not use the output rootfs directory for unrelated files.

Resources and sandboxing

  • --dataDir=/path/assets/rootfs selects a command-specific resource directory.
  • --configPath=/path/profile.conf overrides the selected profile.
  • --overlayPath=/path/overlay overrides the overlay directory. The configuration’s useOverlay setting still controls whether it is used.
  • KREP_DATA_DIR=/path/assets selects a unified data root with rootfs/ and iso/ children. Pass it explicitly through sudo env if needed.
  • --useCacheIfPossible defaults to true.
  • --noSandbox defaults to false. It disables kpkg’s source-build sandbox; only use it inside an appropriate external isolation boundary.

Use the result

The command writes a rootfs directory, including /etc/kreato-release. It does not itself produce a rootfs tarball. Review the result and its login policy before using it. Use the installation guide for an installed system, or prepare its kernel, indexed modules, init, and services for krep iso.

Kreato Linux

An independent Linux(R) distribution focused on modularity, simplicity and code readability.

It is inspired from projects such as KISS Linux, Gentoo and Arch Linux. Its main mission is to be tinkerer’s Linux(R) distribution.