[meta-arm] arm-bsp/wic: Introduce custom wks and grub.cfg for N1SDP

Submitted by Khasim Mohammed on Aug. 4, 2020, 10:29 a.m. | Patch ID: 175026

Details

Message ID 20200804102922.18691-1-khasim.mohammed@arm.com
State New
Headers show

Commit Message

Khasim Mohammed Aug. 4, 2020, 10:29 a.m.
The standard canned WKS files like mkefidisk.wks doesn't allow
us to set custom grub.cfg hence a new wks file is created on the
lines of mkefidisk.wks to accept custom grub.cfg as config parameter
to bootloader command.

The custom grub.cfg allows user to select from different boot options
(acpi, devicetree for single and multi chip).

IMAGE_BOOT_FILES is updated to package n1sdp dtbs for single and multi chip
as part of the final image.

Change-Id: I29a64d0bd50d72d912cdcd99dbc593388be786bb
Issue-Id: PLATFORMS-3134
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
---
 meta-arm-bsp/conf/machine/n1sdp.conf |  3 ++-
 meta-arm-bsp/wic/n1sdp-efidisk.wks   | 11 +++++++++++
 meta-arm-bsp/wic/n1sdp-grub.cfg      | 18 ++++++++++++++++++
 3 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 meta-arm-bsp/wic/n1sdp-efidisk.wks
 create mode 100644 meta-arm-bsp/wic/n1sdp-grub.cfg

Patch hide | download patch | download mbox

diff --git a/meta-arm-bsp/conf/machine/n1sdp.conf b/meta-arm-bsp/conf/machine/n1sdp.conf
index a31f33d..506f3dc 100644
--- a/meta-arm-bsp/conf/machine/n1sdp.conf
+++ b/meta-arm-bsp/conf/machine/n1sdp.conf
@@ -16,7 +16,8 @@  IMAGE_FSTYPES += "wic tar.bz2 ext4"
 SERIAL_CONSOLES = "115200;ttyAMA0"
 
 # Set default WKS
-WKS_FILE ?= "${@bb.utils.contains("EFI_PROVIDER", "systemd-boot", "systemd-bootdisk.wks", "mkefidisk.wks", d)}"
+WKS_FILE ?= "n1sdp-efidisk.wks"
+IMAGE_BOOT_FILES ?= "n1sdp-multi-chip.dtb n1sdp-single-chip.dtb"
 WKS_FILE_DEPENDS_append = " ${EXTRA_IMAGEDEPENDS}"
 
 # Use kernel provided by linaro (Contains support for SCMi or HDMI)
diff --git a/meta-arm-bsp/wic/n1sdp-efidisk.wks b/meta-arm-bsp/wic/n1sdp-efidisk.wks
new file mode 100644
index 0000000..d1ebfb8
--- /dev/null
+++ b/meta-arm-bsp/wic/n1sdp-efidisk.wks
@@ -0,0 +1,11 @@ 
+# short-description: Create an EFI disk image
+# long-description: Creates a partitioned EFI disk image that the user
+# can directly dd to boot media. Uses a custom grub.cfg file to configure the boot.
+
+part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
+
+part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024 --uuid=6a60524d-061d-454a-bfd1-38989910eccd
+
+part swap --ondisk sda --size 44 --label swap1 --fstype=swap
+
+bootloader --ptable gpt --configfile="n1sdp-grub.cfg" --timeout=5
diff --git a/meta-arm-bsp/wic/n1sdp-grub.cfg b/meta-arm-bsp/wic/n1sdp-grub.cfg
new file mode 100644
index 0000000..12b77a0
--- /dev/null
+++ b/meta-arm-bsp/wic/n1sdp-grub.cfg
@@ -0,0 +1,18 @@ 
+set debug="loader,mm"
+set term="vt100"
+set default="0"
+set timeout="5"
+
+menuentry 'Arm reference image boot on N1SDP (ACPI)' {
+        linux /Image earlycon=pl011,0x2A400000 console=ttyAMA0,115200 root=PARTUUID=6a60524d-061d-454a-bfd1-38989910eccd rootwait rootfstype=ext4 acpi=force verbose debug
+}
+
+menuentry 'Arm reference image boot on Single-Chip N1SDP (Device Tree)' {
+        devicetree /n1sdp-single-chip.dtb
+        linux /Image earlycon=pl011,0x2A400000 console=ttyAMA0,115200 root=PARTUUID=6a60524d-061d-454a-bfd1-38989910eccd rootwait rootfstype=ext4 verbose debug
+}
+
+menuentry 'Arm reference image boot on Multi-Chip N1SDP (Device Tree)' {
+        devicetree /n1sdp-multi-chip.dtb
+        linux /Image earlycon=pl011,0x2A400000 console=ttyAMA0,115200 root=PARTUUID=6a60524d-061d-454a-bfd1-38989910eccd rootwait rootfstype=ext4 verbose debug
+}