Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 1.48 KB

rootfs.md

File metadata and controls

41 lines (32 loc) · 1.48 KB

RootFS

The following guide will help you create a linux root filesystem image that can be flashed to a storage medium of your choosing.

Note

The rootfs creation process is generic and should work for any of the distros listed here but this guide will use ARMtix as an example.
This guide only creates a generic rootfs, You will still need a bootfs, bootloader, kernel, modules, firmware, etc...
A script to automate all of this is planned but for now you'll have to do this manually

Requirements

  1. An machine running linux with the same architecture of the desired rootfs (Or set up binfmt)
  2. Your desired distro's rootfs
  3. 4GB or more of storage

Initial setup

  1. Create root.img
    truncate -s 4G rootfs.img

  2. Format it with btrfs
    mkfs.btrfs rootfs.img -qL rootfs

  3. Create a mount dir
    mkdir /tmp/mount
    3.1. Mount the root
    mount rootfs.img /tmp/mount -o rw,noatime,compress=zstd

  4. Start downloading your rootfs to the mount
    curl -#L "https://armtixlinux.org/images/armtix-dinit-20241207.tar.xz" --keepalive-time 120 | bsdtar -xpC /tmp/mount/

  5. (Optional) Chroot into the rootfs
    mount -t proc /proc /tmp/mount/proc/
    mount -t sysfs /sys /tmp/mount/sys/
    mount --rbind /dev /tmp/mount/dev/
    chroot /tmp/mount

  6. Cleanup
    umount -fR /tmp/mount/{proc,sys,dev}
    umount -fR /tmp/mount
    sync

And that's it! You can now flash your rootfs to your target device.