summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivekanand Veeracholan <vveerach@google.com>2021-08-03 01:07:52 +0300
committerPatrick Williams <patrick@stwcx.xyz>2021-08-17 22:12:36 +0300
commitae44d942c692faf6e88a2ad97607fabb2471035e (patch)
treec471fdc3b5172c19ee3ea71bdfbc0e6c15ce41a8
parent782d7195eac9bb9e05f86477b9537dbbee26930c (diff)
downloadopenbmc-ae44d942c692faf6e88a2ad97607fabb2471035e.tar.xz
meta-phosphor: Add option to disable u-boot shell
For security, u-boot shell needs to be disabled. Setting the CONFIG_BOOTDELAY to -2 will disable the prompt for entering into shell. -1 will skip executing the commands. >=0 will prompt to enter shell. -2 will skip the prompt. https://github.com/u-boot/u-boot/blob/51aef405550e603ff702c034f0e2cd0f15bdf2bb/common/autoboot.c#L479 Making it configurable through DISTRO_FEATURES. Add "disable-u-boot-shell" to DISTRO_FEATURES for this feature. Signed-off-by: Vivekanand Veeracholan <vveerach@google.com> Change-Id: I1b1e1a6c2552335b13fb3f1a9561d08f3a0e8f94
-rw-r--r--meta-phosphor/aspeed-layer/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend1
-rw-r--r--meta-phosphor/nuvoton-layer/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend1
-rw-r--r--meta-phosphor/recipes-bsp/u-boot/files/disable-u-boot-shell.cfg2
-rw-r--r--meta-phosphor/recipes-bsp/u-boot/u-boot-obmc.inc5
4 files changed, 9 insertions, 0 deletions
diff --git a/meta-phosphor/aspeed-layer/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend b/meta-phosphor/aspeed-layer/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend
index 452ef7eccf..6ae4b1b3ba 100644
--- a/meta-phosphor/aspeed-layer/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend
+++ b/meta-phosphor/aspeed-layer/recipes-bsp/u-boot/u-boot-aspeed_%.bbappend
@@ -1,3 +1,4 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
require u-boot-aspeed.inc
+require recipes-bsp/u-boot/u-boot-obmc.inc
diff --git a/meta-phosphor/nuvoton-layer/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend b/meta-phosphor/nuvoton-layer/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend
new file mode 100644
index 0000000000..ab57dadb31
--- /dev/null
+++ b/meta-phosphor/nuvoton-layer/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend
@@ -0,0 +1 @@
+require recipes-bsp/u-boot/u-boot-obmc.inc
diff --git a/meta-phosphor/recipes-bsp/u-boot/files/disable-u-boot-shell.cfg b/meta-phosphor/recipes-bsp/u-boot/files/disable-u-boot-shell.cfg
new file mode 100644
index 0000000000..8876eb271c
--- /dev/null
+++ b/meta-phosphor/recipes-bsp/u-boot/files/disable-u-boot-shell.cfg
@@ -0,0 +1,2 @@
+# Setting boot delay to -2 disables entering into U-boot shell
+CONFIG_BOOTDELAY=-2
diff --git a/meta-phosphor/recipes-bsp/u-boot/u-boot-obmc.inc b/meta-phosphor/recipes-bsp/u-boot/u-boot-obmc.inc
new file mode 100644
index 0000000000..47529af44e
--- /dev/null
+++ b/meta-phosphor/recipes-bsp/u-boot/u-boot-obmc.inc
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI:append = '${@bb.utils.contains_any("DISTRO_FEATURES", "disable-u-boot-shell", \
+ " file://disable-u-boot-shell.cfg", \
+ "", d)}'