Skip to content

Commit 78aa013

Browse files
committed
osbuild: make disk usage log conditional and add tips
The log disk usage message comming every 10 seconds is quite noisy, hide it when we are in a shell in osbuild. I aslo added a couple of helpful tips in comments given by @dustymabe to work with osbuild.
1 parent 3cc4eb9 commit 78aa013

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/cmd-osbuild

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,12 @@ main() {
408408
else
409409
cmd="runvm_with_cache"
410410
fi
411-
$cmd -- /usr/lib/coreos-assembler/runvm-osbuild \
411+
412+
# To get a shell in the osbuild supermin VM uncomment this.
413+
# osbuild can then be started with `bash tmp/build.<artifact>/cmd.sh`
414+
# See comment about checkpoints in runvm-osbuild
415+
# RUNVM_SHELL=1 \
416+
$cmd -- /usr/lib/coreos-assembler/runvm-osbuild \
412417
--config "${runvm_osbuild_config_json}" \
413418
--mpp "/usr/lib/coreos-assembler/osbuild-manifests/coreos.osbuild.${basearch}.mpp.yaml" \
414419
--outdir "${outdir}" \

src/cmdlib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ rc=0
787787
if [ -z "${RUNVM_SHELL:-}" ]; then
788788
(cd ${workdir}; bash ${tmp_builddir}/cmd.sh |& tee /dev/virtio-ports/cosa-cmdout) || rc=\$?
789789
else
790-
(cd ${workdir}; bash)
790+
(cd ${workdir}; RUNVM_SHELL=${RUNVM_SHELL:-} bash)
791791
fi
792792
echo \$rc > ${rc_file}
793793
if [ -n "\${cachedev}" ]; then

src/runvm-osbuild

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,18 @@ set -x; osbuild-mpp \
117117
"${mppyaml}" "${processed_json}"
118118
set +x
119119

120-
log_disk_usage
120+
if [[ -z "${RUNVM_SHELL:-}" ]]; then
121+
log_disk_usage
122+
fi
121123

122124
# Build the image
123125
set -x
124126
# shellcheck disable=SC2068
127+
# To stop osbuild at a given stage to inspect the state of
128+
# things you can add `--break stage_id` to the following.
129+
# eg : `--break org.osbuild.bootc.install-to-filesystem`
130+
# The osbuild environnement is set up under `/run/osbuild`
131+
# Use it in conjuction with `RUNVM_SHELL=1 in `cmd-osbuild`
125132
osbuild \
126133
--out "$outdir" \
127134
--store "$storedir" \

0 commit comments

Comments
 (0)