From 2dbc906c060a36a980da3dfcc2106512d17ab86a Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Mon, 9 Dec 2019 14:58:18 +0100 Subject: [PATCH] dib_elements: Fix grub console for UEFI too When UEFI is used instead of BIOS, the location of `grub.cfg` is different. However, DIB only handles /boot/grub2/grub.cfg, so we copy the same grub.cfg to the EFI System Partition (ESP) explicitly. While at it, add ttyAMA0 (the default serial console on aarch64). Signed-off-by: Alexandru Avadanii Change-Id: I2da27559fce2cabc129f18cea743919ecd09ef4e --- dib_elements/myproduct/finalise.d/99-fix-grub-console | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dib_elements/myproduct/finalise.d/99-fix-grub-console b/dib_elements/myproduct/finalise.d/99-fix-grub-console index 951e39f..cb4e889 100755 --- a/dib_elements/myproduct/finalise.d/99-fix-grub-console +++ b/dib_elements/myproduct/finalise.d/99-fix-grub-console @@ -19,5 +19,16 @@ fi set -eu set -o pipefail -sed -i -e "s/console=ttyS0,115200/console=ttyS1,115200/g" /etc/default/grub +sed -i -e "s/console=ttyS0,115200/console=ttyS1,115200 console=ttyAMA0,115200/g" /etc/default/grub grub2-mkconfig -o /boot/grub2/grub.cfg + +# DIB only handles grub.cfg in /boot/grub2/grub.cfg, so we handle the UEFI grub.cfg explicitly +for efi_boot_dir in \ + /boot/efi/EFI/BOOT \ + /boot/efi/EFI/centos +do + if [ -d "${efi_boot_dir}" ]; then + rm -f "${efi_boot_dir}/grub.cfg" + cp /boot/grub2/grub.cfg "${efi_boot_dir}" + fi +done -- 2.16.6