diff --git a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc index 7501bf5b..a6752391 100644 --- a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc +++ b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc @@ -15,7 +15,14 @@ GUEST_PART_SIZE ?= "4097" GUEST_PART_SIZE_UNIT ?= "M" # The GRUB_CFG_FILE affects arm-autonomy-n1sdp-efidisk.wks.in file -GRUB_CFG_FILE ?= "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg" +# +# When alternate-kernel DISTRO_FEATURE is present we set the +# arm-autonomy-n1sdp-rt-grub.cfg by default. This GRUB config file has +# additional entries for booting with the PREEMPT_RT kernel. +GRUB_CFG_FILE ?= "${@bb.utils.contains('DISTRO_FEATURES','alternate-kernel', \ + '${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-rt-grub.cfg', \ + '${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg' \ + , d)}" # From arm-autonomy-n1sdp-efidisk.wks.in, the /boot partition is /dev/sda1, and # the "/" partition is /dev/sda2. @@ -60,3 +67,16 @@ IMAGE_EFI_BOOT_FILES += "\ ${@ d.getVar('KERNEL_RT_IMAGE',d) or '' \ if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \ d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}" + + +EFIDIR ?= "/EFI/BOOT" +GRUB_CFG_EXTRA_FILE ?= "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg;.${EFIDIR}}" + +# When alternate-kernel DISTRO_FEATURE is present we set the +# arm-autonomy-n1sdp-rt-grub.cfg by default. This GRUB config file has +# additional entries for booting with the PREEMPT_RT kernel and also includes +# the main GRUB config file set by GRUB_CFG_EXTRA_FILE. +IMAGE_EFI_BOOT_FILES += "\ +${@ d.getVar('GRUB_CFG_EXTRA_FILE',d) or '' \ +if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \ +d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}" diff --git a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-rt-grub.cfg b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-rt-grub.cfg new file mode 100644 index 00000000..31d0bbf8 --- /dev/null +++ b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-rt-grub.cfg @@ -0,0 +1,28 @@ +set term="vt100" +set default="3" +set timeout="5" + +source $prefix/arm-autonomy-n1sdp-grub.cfg + +menuentry 'N1SDP PREEMPT_RT ACPI Boot' { + linux /Image-preempt-rt $kernel_cmdline acpi=force +} + +menuentry 'N1SDP PREEMPT_RT Single-Chip Boot (Device Tree)' { + devicetree /n1sdp-single-chip.dtb + linux /Image-preempt-rt $kernel_cmdline +} + +menuentry 'N1SDP PREEMPT_RT Multi-Chip Boot (Device Tree)' { + devicetree /n1sdp-multi-chip.dtb + linux /Image-preempt-rt $kernel_cmdline +} + +menuentry 'N1SDP PREEMPT_RT Arm Autonomy (Xen) Single-Chip Boot (Device Tree)' { + # no_argumants under here is a workaround for a bug + # also any kernel or dom0 cmdline arguments has to be passed via dtb + # because any arguments put here will be ignored by xen + xen_hypervisor /xen.efi no_arguments=use_dtb_for_xen_or_kernel_cmdline + xen_module /Image-preempt-rt + devicetree /n1sdp-single-chip-xen.dtb +}