From 4df4bbe337dc6312ec1f838a291393faa349893e Mon Sep 17 00:00:00 2001 From: gbionescu Date: Wed, 4 Sep 2024 05:58:33 -0400 Subject: [PATCH] update readme Signed-off-by: gbionescu --- README.md | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 82fc96c..acfbf83 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,21 @@ # Rootfs image builder -This repo builds an `ext4` or an `initrd` using Docker containers. +This repo builds root filesystem images or initrd images based on Docker containers. Note: *some assembly required.* -## Prerequisites +Images are generated by: +1. Pulling a base image from Docker Hub. +2. Installing systemd or any other init system. Alpine uses OpenRC while Amazon Linux and Ubuntu use systemd. +3. Installs sshd and other utilities to make the image usable. +4. Sets `root:root` as the default user and password. +5. Packs the docker container into a rootfs/initrd image. + +See the [releases](https://github.com/gbionescu/build-rootfs/releases) page for pre-built images and kernel. -Your user needs to be able to run `docker`. +## Prerequisites -If not, run scripts with sudo: `sudo build-rootfs.sh`. +Have `docker` installed. ## Building a rootfs @@ -20,10 +27,10 @@ Simply run: Where `rootfs-type` is one of the root filesystem generators that starts with `type-`. -For example, to generate an `Ubuntu 21.04` rootfs, run: +For example, to generate an `alpine` rootfs, run: ```bash -./build-rootfs.sh ubuntu21.04 +./build-rootfs.sh alpine ``` Notes: @@ -68,7 +75,19 @@ twice because systemd needs to be initialized. Just add a new folder with the 3 files described above +### Tests + +Currently the built-in tests build the rootfs for all the types and run them with QEMU. + +Tests poll the serial console output for the `login:` prompt. + +To run the tests, simply run: + +```bash +./tests/test-all.sh +``` + ## Troubleshooting - Need a larger image? Change `init-rootfs.sh`. - +- Need to install more packages? Change `inside-container.sh`. \ No newline at end of file