[meta-arm,6/8] arm-autonomy/n1sdp: Add GRUB config when including alternate kernel

Submitted by Diego Sueiro on Nov. 17, 2020, 10:04 a.m. | Patch ID: 178088

Details

Message ID 20201117100449.20111-7-diego.sueiro@arm.com
State New
Headers show

Commit Message

Diego Sueiro Nov. 17, 2020, 10:04 a.m.
For N1SDP as arm-autonomy-host, when alternate-kernel DISTRO_FEATURE is present
we set, as GRUB config, the arm-autonomy-n1sdp-rt-grub.cfg which includes
additional entries for booting with the PREEMPT_RT kernel.

Change-Id: If40aee159ae5ba0efd3d9a5a16ee1c1167fb0504
Issue-Id: SCM-1654
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>

---
 .../conf/machine/n1sdp-extra-settings.inc     | 22 ++++++++++++++-
 .../wic/arm-autonomy-n1sdp-rt-grub.cfg        | 28 +++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletion(-)
 create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-rt-grub.cfg

-- 
2.17.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#1383): https://lists.yoctoproject.org/g/meta-arm/message/1383
Mute This Topic: https://lists.yoctoproject.org/mt/78313169/1003190
Group Owner: meta-arm+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub [mhalstead@linuxfoundation.org]
-=-=-=-=-=-=-=-=-=-=-=-

Patch hide | download patch | download mbox

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 7501bf5..a675239 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 0000000..31d0bbf
--- /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
+}