Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
Signed-off-by: gbionescu <[email protected]>
  • Loading branch information
gbionescu committed Sep 4, 2024
1 parent cdcbcf0 commit 4df4bbe
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -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`.

0 comments on commit 4df4bbe

Please sign in to comment.