Skip to content

Commit e64c822

Browse files
jbtrystramdustymabe
authored andcommitted
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 0515a94 commit e64c822

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/cmd-osbuild

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

src/cmdlib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ rc=0
774774
if [ -z "${RUNVM_SHELL:-}" ]; then
775775
(cd ${workdir}; bash ${tmp_builddir}/cmd.sh |& tee /dev/virtio-ports/cosa-cmdout) || rc=\$?
776776
else
777-
(cd ${workdir}; bash)
777+
(cd ${workdir}; RUNVM_SHELL=${RUNVM_SHELL:-} bash)
778778
fi
779779
echo \$rc > ${rc_file}
780780
if [ -n "\${cachedev}" ]; then

src/runvm-osbuild

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,18 @@ set -x; osbuild-mpp \
122122
"${mppyaml}" "${processed_json}"
123123
set +x
124124

125-
log_disk_usage
125+
if [[ -z "${RUNVM_SHELL:-}" ]]; then
126+
log_disk_usage
127+
fi
126128

127129
# Build the image
128130
set -x
129131
# shellcheck disable=SC2068
132+
# To stop osbuild at a given stage to inspect the state of
133+
# things you can add `--break stage_id` to the following.
134+
# eg : `--break org.osbuild.bootc.install-to-filesystem`
135+
# The osbuild environnement is set up under `/run/osbuild`
136+
# Use it in conjuction with `RUNVM_SHELL=1 in `cmd-osbuild`
130137
osbuild \
131138
--out "$outdir" \
132139
--store "$storedir" \

0 commit comments

Comments
 (0)