From 1812c8755bd02f14f18518da13f8f09acc40ded1 Mon Sep 17 00:00:00 2001 From: Jinliang Li Date: Mon, 25 Jun 2018 17:49:50 +0800 Subject: Add root parameter configuration in boot command line. It is helpful when secure boot is enabled, because you can not modify boot command line after boot-menu.inc is signed before deploying. Signed-off-by: Jinliang Li --- README | 4 ++++ meta-efi-secure-boot/recipes-bsp/grub/grub-efi_2.02.bbappend | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/README b/README index 37be4fe..8c0ebff 100644 --- a/README +++ b/README @@ -92,6 +92,10 @@ DEBUG_FLAGS_forcevariable = "" IMAGE_INSTALL += "kernel-image-bzimage" USER_CLASSES_remove = "image-prelink" +# Uncomment this line to modify the root parameter in boot command line if the default one +# is not working for you. It is helpful when secure boot is enabled. +#BOOT_CMD_ROOT = "/dev/hda2" + III. Build meta-secure-core =========================== diff --git a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi_2.02.bbappend b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi_2.02.bbappend index 87ebc08..2890895 100644 --- a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi_2.02.bbappend +++ b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi_2.02.bbappend @@ -76,6 +76,12 @@ do_install_append_class-target() { sed -i 's/^\s*linux\s\+.*bzImage.*/& ima_policy=tcb/g' "$menu" } + # Replace the root parameter in boot command line with BOOT_CMD_ROOT, + # which can be configured. It is helpful when secure boot is enabled. + [ -n "${BOOT_CMD_ROOT}" ] && { + sed -i "s,root=/dev/hda2,root=${BOOT_CMD_ROOT},g" "$menu" + } + # Install the stacked grub configs. install -d "${D}${EFI_BOOT_PATH}" install -m 0600 "${WORKDIR}/grub-efi.cfg" "${D}${EFI_BOOT_PATH}/grub.cfg" -- cgit v1.2.3-54-g00ecf