From d080cb27c657daf7e19d24804e473b10575a6302 Mon Sep 17 00:00:00 2001 From: Khasim Syed Mohammed Date: Mon, 27 Jul 2020 16:00:30 +0530 Subject: [PATCH] arm-bsp/wic: Introduce custom wks and grub.cfg for N1SDP 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 Signed-off-by: Ross Burton --- 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 diff --git a/meta-arm-bsp/conf/machine/n1sdp.conf b/meta-arm-bsp/conf/machine/n1sdp.conf index a31f33d1..506f3dcf 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 00000000..d1ebfb82 --- /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 00000000..12b77a01 --- /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 +}