1
1
# Rootfs image builder
2
2
3
- This repo builds an ` ext4 ` or an ` initrd ` using Docker containers.
3
+ This repo builds root filesystem images or initrd images based on Docker containers.
4
4
5
5
Note: * some assembly required.*
6
6
7
- ## Prerequisites
7
+ Images are generated by:
8
+ 1 . Pulling a base image from Docker Hub.
9
+ 2 . Installing systemd or any other init system. Alpine uses OpenRC while Amazon Linux and Ubuntu use systemd.
10
+ 3 . Installs sshd and other utilities to make the image usable.
11
+ 4 . Sets ` root:root ` as the default user and password.
12
+ 5 . Packs the docker container into a rootfs/initrd image.
13
+
14
+ See the [ releases] ( https://github.com/gbionescu/build-rootfs/releases ) page for pre-built images and kernel.
8
15
9
- Your user needs to be able to run ` docker ` .
16
+ ## Prerequisites
10
17
11
- If not, run scripts with sudo: ` sudo build-rootfs.sh ` .
18
+ Have ` docker ` installed .
12
19
13
20
## Building a rootfs
14
21
@@ -20,10 +27,10 @@ Simply run:
20
27
21
28
Where ` rootfs-type ` is one of the root filesystem generators that starts with ` type- ` .
22
29
23
- For example, to generate an ` Ubuntu 21.04 ` rootfs, run:
30
+ For example, to generate an ` alpine ` rootfs, run:
24
31
25
32
``` bash
26
- ./build-rootfs.sh ubuntu21.04
33
+ ./build-rootfs.sh alpine
27
34
```
28
35
29
36
Notes:
@@ -68,7 +75,19 @@ twice because systemd needs to be initialized.
68
75
69
76
Just add a new folder with the 3 files described above
70
77
78
+ ### Tests
79
+
80
+ Currently the built-in tests build the rootfs for all the types and run them with QEMU.
81
+
82
+ Tests poll the serial console output for the ` login: ` prompt.
83
+
84
+ To run the tests, simply run:
85
+
86
+ ``` bash
87
+ ./tests/test-all.sh
88
+ ```
89
+
71
90
## Troubleshooting
72
91
73
92
- Need a larger image? Change ` init-rootfs.sh ` .
74
-
93
+ - Need to install more packages? Change ` inside-container.sh ` .
0 commit comments