Skip to content

Commit d729fc2

Browse files
knghtbrdXECDesign
authored andcommitted
README.md: Describe more config variables, cleanup
Added some documentation of environment variables to README.md, specifically WORK_DIR and DEPLOY_DIR. Explicitly did not include SCRIPT_DIR at this time because that appears to require some small work before it can be changed. Took the chance for some other syntax cleanups while I was at it, mostly breaking long lines and inserting whitespace where some Markdown parsers require it.
1 parent 0ee2578 commit d729fc2

File tree

1 file changed

+57
-9
lines changed

1 file changed

+57
-9
lines changed

README.md

+57-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
# pi-gen
2+
23
_Tool used to create the raspberrypi.org Raspbian images_
34

5+
46
### TODO
57
1. Documentation
68

9+
710
## Dependencies
811

9-
`quilt parted realpath qemu-user-static debootstrap zerofree pxz zip dosfstools bsdtar libcap2-bin grep rsync`
12+
On Debian-based systems:
13+
14+
```bash
15+
apt-get install quilt parted realpath qemu-user-static debootstrap zerofree pxz zip \
16+
dosfstools bsdtar libcap2-bin grep rsync
17+
```
18+
19+
The file `depends` contains a list of tools needed. The format of this
20+
package is `<tool>[:<debian-package>]`.
21+
1022

1123
## Config
1224

@@ -29,29 +41,57 @@ The following environment variables are supported:
2941
will not be included in the image, making it safe to use an `apt-cacher` or
3042
similar package for development.
3143

44+
* `BASE_DIR` (Default: location of `build.sh`)
45+
46+
**CAUTION**: Currently, changing this value will probably break build.sh
47+
48+
Top-level directory for `pi-gen`. Contains stage directories, build
49+
scripts, and by default both work and deployment directories.
50+
51+
* `WORK_DIR` (Default: `"$BASE_DIR/work"`)
52+
53+
Directory in which `pi-gen` builds the target system. This value can be
54+
changed if you have a suitably large, fast storage location for stages to
55+
be built and cached. Note, `WORK_DIR` stores a complete copy of the target
56+
system for each build stage, amounting to tens of gigabytes in the case of
57+
Raspbian.
58+
59+
* `DEPLOY_DIR` (Default: `"$BASE_DIR/deploy"`)
60+
61+
Output directory for target system images and NOOBS bundles.
62+
63+
3264
A simple example for building Raspbian:
3365

3466
```bash
3567
IMG_NAME='Raspbian'
3668
```
3769

70+
3871
## Docker Build
3972

4073
```bash
4174
vi config # Edit your config file. See above.
4275
./build-docker.sh
4376
```
77+
4478
If everything goes well, your finished image will be in the `deploy/` folder.
4579
You can then remove the build container with `docker rm pigen_work`
4680

4781
If something breaks along the line, you can edit the corresponding scripts, and
4882
continue:
4983

50-
```
84+
```bash
5185
CONTINUE=1 ./build-docker.sh
5286
```
5387

54-
There is a possibility that even when running from a docker container, the installation of `qemu-user-static` will silently fail when building the image because `binfmt-support` _must be enabled on the underlying kernel_. An easy fix is to ensure `binfmt-support` is installed on the host machine before starting the `./build-docker.sh` script (or using your own docker build solution).
88+
There is a possibility that even when running from a docker container, the
89+
installation of `qemu-user-static` will silently fail when building the image
90+
because `binfmt-support` _must be enabled on the underlying kernel_. An easy
91+
fix is to ensure `binfmt-support` is installed on the host machine before
92+
starting the `./build-docker.sh` script (or using your own docker build
93+
solution).
94+
5595

5696
## Stage Anatomy
5797

@@ -104,14 +144,22 @@ maintenance and allows for more easy customization.
104144
the stage that installs all of the things that make Raspbian friendly to
105145
new users.
106146

147+
107148
### Stage specification
108-
If you wish to build up to a specified stage (such as building up to stage 2 for a lite system), place an empty file named `SKIP` in each of the `./stage` directories you wish not to include.
109149

110-
Then remove the `EXPORT*` files from `./stage4` (if building up to stage 2) or from `./stage2` (if building a minimal system).
150+
If you wish to build up to a specified stage (such as building up to stage 2
151+
for a lite system), place an empty file named `SKIP` in each of the `./stage`
152+
directories you wish not to include.
111153

112-
```
154+
Then remove the `EXPORT*` files from `./stage4` (if building up to stage 2) or
155+
from `./stage2` (if building a minimal system).
156+
157+
```bash
113158
# Example for building a lite system
114-
$ touch ./stage3/SKIP ./stage4/SKIP
115-
$ rm stage4/EXPORT*
159+
touch ./stage3/SKIP ./stage4/SKIP
160+
rm stage4/EXPORT*
116161
```
117-
If you wish to build further configurations upon (for example) the lite system, you can also delete the contents of `./stage3` and `./stage4` and replace with your own contents in the same format.
162+
163+
If you wish to build further configurations upon (for example) the lite
164+
system, you can also delete the contents of `./stage3` and `./stage4` and
165+
replace with your own contents in the same format.

0 commit comments

Comments
 (0)