Handle EFI installing better and support non-EFI

This commit is contained in:
Joshua Boniface 2023-09-01 15:41:53 -04:00
parent a2b257ef9e
commit 71b109eff4
1 changed files with 16 additions and 8 deletions

View File

@ -158,6 +158,7 @@ exec 2> >( tee -ia ${logfile} >/dev/null )
cleanup() { cleanup() {
set +o errexit set +o errexit
echo -n "Cleaning up... " echo -n "Cleaning up... "
umount ${target}/run >&2
umount ${target}/sys >&2 umount ${target}/sys >&2
umount ${target}/proc >&2 umount ${target}/proc >&2
umount ${target}/dev/pts >&2 umount ${target}/dev/pts >&2
@ -305,20 +306,27 @@ mount --bind /dev ${target}/dev >&2
mount --bind /dev/pts ${target}/dev/pts >&2 mount --bind /dev/pts ${target}/dev/pts >&2
mount --bind /proc ${target}/proc >&2 mount --bind /proc ${target}/proc >&2
mount --bind /sys ${target}/sys >&2 mount --bind /sys ${target}/sys >&2
chroot ${target} grub-install --target=x86_64-efi ${target_disk} >&2 mount --bind /run ${target}/run >&2
chroot ${target} update-grub >&2 if [[ -d /sys/firmware/efi ]]; then
bios_target="x86_64-efi"
else
bios_target="i386-pc"
fi
chroot ${target} grub-install --target=${bios_target} ${target_disk} >&2
chroot ${target} grub-mkconfig -o /boot/grub/grub.cfg >&2
echo "done." echo "done."
cleanup cleanup
titlestring_text="| PVC node installation finished. Press <Enter> to reboot into the installed system. |" titlestring_text="| PVC node installation finished. Next steps: |"
titlestring_len="$( wc -c <<<"${titlestring_text}" )" titlestring_len="$( wc -c <<<"${titlestring_text}" )"
for i in $( seq 2 ${titlestring_len} ); do echo -n "-"; done; echo for i in $( seq 2 85 ); do echo -n "-"; done; echo
echo "${titlestring_text}" echo "${titlestring_text}"
echo "| On successful boot, verify the system is configured as you would expect, add any |" echo "| 1. Press <enter> to reboot the system. |"
echo "| additional interfaces to the /etc/network/interfaces file, and then run the PVC |" echo "| 2. Boot the PVC base hypervisor and verify SSH access (IP shown on login screen). |"
echo "| Ansible role against this host to complete deploying this PVC node. |" echo "| 3. Configure /etc/network/interfaces to the cluster specifications. |"
for i in $( seq 2 ${titlestring_len} ); do echo -n "-"; done; echo echo "| 4. Proceed with system deployment via PVC Ansible."
for i in $( seq 2 85 ); do echo -n "-"; done; echo
echo echo
read read