From 7b53916c30315a50608da453e371ff62b7345f0a Mon Sep 17 00:00:00 2001 From: Volodymyr Fedorov Date: Wed, 5 Jan 2022 13:54:02 +0100 Subject: [PATCH] TT#157450 Add extra logging entries and copy logs later Add extra deployment statuses for grub-install and try to have more data logged. Change-Id: Id06dfad1264f781157631c51035ab219cfc30070 --- templates/scripts/includes/deployment.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/scripts/includes/deployment.sh b/templates/scripts/includes/deployment.sh index f4dc8ef..42cef71 100755 --- a/templates/scripts/includes/deployment.sh +++ b/templates/scripts/includes/deployment.sh @@ -2352,12 +2352,10 @@ EOF fi # if [ -n "$PUPPET" ] ; then -if [ -r "${INSTALL_LOG}" ] && [ -d "${TARGET}"/var/log/ ] ; then - cp "${INSTALL_LOG}" "${TARGET}"/var/log/ -fi if [[ "${SWRAID}" = "true" ]] ; then if efi_support ; then + set_deploy_status "swraidinstallefigrub" grml-chroot "${TARGET}" mount /boot/efi # if efivarfs kernel module is loaded, but efivars isn't, @@ -2377,6 +2375,7 @@ if [[ "${SWRAID}" = "true" ]] ; then efibootmgr --create --disk "/dev/${SWRAID_DISK2}" -p 2 -w --label 'NGCP Fallback' --load '\EFI\debian\grubx64.efi' fi + set_deploy_status "swraidinstallgrub" for disk in "${SWRAID_DISK1}" "${SWRAID_DISK2}" ; do grml-chroot "${TARGET}" grub-install "/dev/$disk" done @@ -2384,6 +2383,12 @@ if [[ "${SWRAID}" = "true" ]] ; then grml-chroot "${TARGET}" update-grub fi +if [ -r "${INSTALL_LOG}" ] && [ -d "${TARGET}"/var/log/ ] ; then + set_deploy_status "copylogfiles" + cp "${INSTALL_LOG}" "${TARGET}"/var/log/ + sync +fi + # unmount /ngcp-data partition inside chroot (if available) if [ -n "${DATA_PARTITION}" ] ; then grml-chroot "${TARGET}" umount /ngcp-data @@ -2410,6 +2415,7 @@ dmsetup remove_all || true declare efidev1 efidev2 if [[ "${SWRAID}" = "true" ]] ; then if efi_support ; then + set_deploy_status "swraidclonegrub" partlabel="EFI System" max_tries=60 get_pvdevice_by_label_with_retries "/dev/${SWRAID_DISK1}" "${partlabel}" "${max_tries}" efidev1