summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMarcello Sylvester Bauer <sylv@sylv.io>2020-03-02 16:04:19 +0100
committerPatrick Georgi <pgeorgi@google.com>2020-03-23 09:23:11 +0000
commite9aef1fe4548da7bf65f11aec48ff3b40e6461fa (patch)
treed4653c62e6a7d17253aff8824f71c4061821d63b /util
parent0fd179aeb1d63eeab414a47d38ad8dd8514edcb2 (diff)
downloadcoreboot-e9aef1fe4548da7bf65f11aec48ff3b40e6461fa.tar.xz
Doc/security/vboot: Add a script generated device list
Add a script generated list of vboot enabled devices to the documentation. Add a entry to the release checklist. Change-Id: Ibb57d26c5f0cb8efd27ca9a97fd762c25b566f93 Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39200 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util')
-rw-r--r--util/vboot_list/description.md2
-rwxr-xr-xutil/vboot_list/vboot_list.sh55
2 files changed, 57 insertions, 0 deletions
diff --git a/util/vboot_list/description.md b/util/vboot_list/description.md
new file mode 100644
index 0000000000..b994557f6c
--- /dev/null
+++ b/util/vboot_list/description.md
@@ -0,0 +1,2 @@
+Tools to generate a list of vboot enabled devices to the documentation
+`Bash`
diff --git a/util/vboot_list/vboot_list.sh b/util/vboot_list/vboot_list.sh
new file mode 100755
index 0000000000..f3e8975e96
--- /dev/null
+++ b/util/vboot_list/vboot_list.sh
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+
+TOP="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../.. >/dev/null 2>&1 && pwd )"
+MAINBOARDS="src/mainboard"
+OUTPUT_FILE=${1:-$TOP/Documentation/security/vboot/list_vboot.md}
+
+function has_vboot
+{
+ local DIR=$1
+
+ grep -rq "config VBOOT" $DIR
+ return $?
+}
+
+function get_vendor_name
+{
+ local VENDORDIR=$1
+
+ sed -n '/config VENDOR/{n;s/^[\t[:space:]]\+bool "\(.*\)"/\1/;p;}' \
+ $VENDORDIR/Kconfig.name
+}
+
+function get_board_name
+{
+ local BOARDDIR=$1
+
+ sed -n '/config BOARD/{n;s/^[\t[:space:]]\+bool "\(->\s\+\)\?\(.*\)"/\2/;p;}' \
+ $BOARDDIR/Kconfig.name
+}
+
+function list_vboot_boards
+{
+ local VENDORDIR=$1
+ for BOARD in $(ls -d $VENDORDIR/*/)
+ do
+ has_vboot $BOARD || continue
+ get_board_name $BOARD
+ done
+}
+
+function generate_vboot_list
+{
+for VENDOR in $(ls -d $TOP/$MAINBOARDS/*/)
+do
+ has_vboot $VENDOR || continue
+ echo -e "\n## $(get_vendor_name $VENDOR)"
+ IFS=$'\n'
+ for BOARD in $(list_vboot_boards $VENDOR)
+ do
+ echo "- $BOARD"
+ done
+done
+}
+
+(echo "# VBOOT enabled devices"; generate_vboot_list) > $OUTPUT_FILE