Skip to content

Commit 3514c95

Browse files
committed
update build doc
update build doc Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
1 parent c9a1e31 commit 3514c95

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/building-fcos.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ Note: *You should run this command as non-root*
7878
It's also fully supported to use `podman` as root, but some of the arguments
7979
here need to change for that.
8080

81-
{% raw %}
81+
Save the following shell in /usr/bin/cosa and run chmod 755 /usr/bin/cosa.
82+
8283
```sh
84+
85+
#!/bin/bash
86+
8387
cosa() {
8488
env | grep COREOS_ASSEMBLER
8589
local -r COREOS_ASSEMBLER_CONTAINER_LATEST="quay.io/coreos-assembler/coreos-assembler:latest"
@@ -100,15 +104,17 @@ cosa() {
100104
--userns=keep-id:uid=1000,gid=1000 \
101105
-v=${PWD}:/srv/ --device=/dev/kvm --device=/dev/fuse \
102106
--tmpfs=/tmp -v=/var/tmp:/var/tmp --name=cosa \
107+
${NO_KVM:+-e COSA_NO_KVM=$NO_KVM} \
103108
${COREOS_ASSEMBLER_CONFIG_GIT:+-v=$COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro} \
104109
${COREOS_ASSEMBLER_GIT:+-v=$COREOS_ASSEMBLER_GIT/src/:/usr/lib/coreos-assembler/:ro} \
105110
${COREOS_ASSEMBLER_ADD_CERTS:+-v=/etc/pki/ca-trust:/etc/pki/ca-trust:ro} \
106111
${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} \
107112
${COREOS_ASSEMBLER_CONTAINER:-$COREOS_ASSEMBLER_CONTAINER_LATEST} "$@"
108113
rc=$?; set +x; return $rc
109114
}
115+
116+
cosa "$@"
110117
```
111-
{% endraw %}
112118

113119
This is a bit more complicated than a simple alias, but it allows for
114120
hacking on the assembler or the configs and prints out the environment and
@@ -141,6 +147,7 @@ The environment variables are special purpose:
141147
signed by an authority outside the default bundle already trusted by the
142148
host. Alternatively, one can use `cosa shell` as described below to have a
143149
persistent container in which you can set up the root CA once.
150+
- `NO_KVM`: If your host is a virtual machine and the host doesn't support nested virtualization set NO_KVM=1.
144151

145152
See the [Working on CoreOS Assembler](devel.md) page for examples of how
146153
to use these variables.

0 commit comments

Comments
 (0)