summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJinliang Li <jinliang.li@linux.alibaba.com>2018-06-25 17:49:50 +0800
committerJia Zhang <zhang.jia@linux.alibaba.com>2018-06-26 09:40:48 +0800
commit1812c8755bd02f14f18518da13f8f09acc40ded1 (patch)
treebc46ff3c74974af70053787d69109e9e67a6c49d
parent33ec1d1f82cc783fc9640d4105795d85f52213f9 (diff)
downloadmeta-secure-core-1812c8755bd02f14f18518da13f8f09acc40ded1.tar.gz
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 <jinliang.li@linux.alibaba.com>
-rw-r--r--README4
-rw-r--r--meta-efi-secure-boot/recipes-bsp/grub/grub-efi_2.02.bbappend6
2 files changed, 10 insertions, 0 deletions
diff --git a/README b/README
index 37be4fe..8c0ebff 100644
--- a/README
+++ b/README
@@ -92,6 +92,10 @@ DEBUG_FLAGS_forcevariable = ""
92IMAGE_INSTALL += "kernel-image-bzimage" 92IMAGE_INSTALL += "kernel-image-bzimage"
93USER_CLASSES_remove = "image-prelink" 93USER_CLASSES_remove = "image-prelink"
94 94
95# Uncomment this line to modify the root parameter in boot command line if the default one
96# is not working for you. It is helpful when secure boot is enabled.
97#BOOT_CMD_ROOT = "/dev/hda2"
98
95III. Build meta-secure-core 99III. Build meta-secure-core
96=========================== 100===========================
97 101
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() {
76 sed -i 's/^\s*linux\s\+.*bzImage.*/& ima_policy=tcb/g' "$menu" 76 sed -i 's/^\s*linux\s\+.*bzImage.*/& ima_policy=tcb/g' "$menu"
77 } 77 }
78 78
79 # Replace the root parameter in boot command line with BOOT_CMD_ROOT,
80 # which can be configured. It is helpful when secure boot is enabled.
81 [ -n "${BOOT_CMD_ROOT}" ] && {
82 sed -i "s,root=/dev/hda2,root=${BOOT_CMD_ROOT},g" "$menu"
83 }
84
79 # Install the stacked grub configs. 85 # Install the stacked grub configs.
80 install -d "${D}${EFI_BOOT_PATH}" 86 install -d "${D}${EFI_BOOT_PATH}"
81 install -m 0600 "${WORKDIR}/grub-efi.cfg" "${D}${EFI_BOOT_PATH}/grub.cfg" 87 install -m 0600 "${WORKDIR}/grub-efi.cfg" "${D}${EFI_BOOT_PATH}/grub.cfg"