Skip to content

Commit ff377e0

Browse files
authored
Merge pull request #2389 from community-scripts/fix/fedora-vm-console
Report Fedora image customization failures accurately
2 parents b99d638 + efb9238 commit ff377e0

3 files changed

Lines changed: 60 additions & 3 deletions

File tree

‎.github/workflows/bash-syntax.yml‎

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.github/workflows/scripts/fedora-image-test.sh‎

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎vm/fedora-vm.sh‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,14 @@ rm -rf "$TEMP_DIR"
122122
vm_prepare_cloud_image "$WORK_FILE" "$HN" || true
123123

124124
msg_info "Customizing ${FILE}"
125-
virt-customize -q -a "$WORK_FILE" --run-command "systemctl enable serial-getty@ttyS0.service" >/dev/null 2>&1 || true
126-
virt-customize -q -a "$WORK_FILE" --selinux-relabel >/dev/null 2>&1 || true
127-
msg_ok "Customized image"
125+
CUSTOMIZE_FAILURES_BEFORE=${#_VM_PREPARE_FAILED[@]}
126+
_vm_customize "Fedora serial console" "$WORK_FILE" --run-command "systemctl enable serial-getty@ttyS0.service"
127+
_vm_customize "Fedora SELinux relabel" "$WORK_FILE" --selinux-relabel
128+
if ((${#_VM_PREPARE_FAILED[@]} == CUSTOMIZE_FAILURES_BEFORE)); then
129+
msg_ok "Customized image"
130+
else
131+
msg_warn "Fedora image customization incomplete; see warnings above"
132+
fi
128133

129134
STORAGE_TYPE=$(pvesm status -storage "$STORAGE" | awk 'NR>1 {print $2}')
130135
vm_apply_storage_layout "$STORAGE_TYPE"

0 commit comments

Comments
 (0)