Skip to content

Commit 24dcb19

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

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/building-fcos.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,12 @@ Note: *You should run this command as non-root*
7777

7878
It's also fully supported to use `podman` as root, but some of the arguments
7979
here need to change for that.
80+
Save the following shell in /usr/local/bin/cosa and run `sudo chmod 755 /usr/local/bin/cosa`.
8081

81-
{% raw %}
8282
```sh
83+
84+
#!/bin/bash
85+
8386
cosa() {
8487
env | grep COREOS_ASSEMBLER
8588
local -r COREOS_ASSEMBLER_CONTAINER_LATEST="quay.io/coreos-assembler/coreos-assembler:latest"
@@ -100,15 +103,17 @@ cosa() {
100103
--userns=keep-id:uid=1000,gid=1000 \
101104
-v=${PWD}:/srv/ --device=/dev/kvm --device=/dev/fuse \
102105
--tmpfs=/tmp -v=/var/tmp:/var/tmp --name=cosa \
106+
${NO_KVM:+-e COSA_NO_KVM=$NO_KVM} \
103107
${COREOS_ASSEMBLER_CONFIG_GIT:+-v=$COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro} \
104108
${COREOS_ASSEMBLER_GIT:+-v=$COREOS_ASSEMBLER_GIT/src/:/usr/lib/coreos-assembler/:ro} \
105109
${COREOS_ASSEMBLER_ADD_CERTS:+-v=/etc/pki/ca-trust:/etc/pki/ca-trust:ro} \
106110
${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} \
107111
${COREOS_ASSEMBLER_CONTAINER:-$COREOS_ASSEMBLER_CONTAINER_LATEST} "$@"
108112
rc=$?; set +x; return $rc
109113
}
114+
115+
cosa "$@"
110116
```
111-
{% endraw %}
112117

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

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

0 commit comments

Comments
 (0)