Debian Codegraph @

util/vboot_list/vboot_list.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 TOP="$( cd "$( dirnamescip-shell system . . dirname. "${BASH_SOURCE[0]}" )"/../.. >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 && pwdscip-shell system . . pwd. )"
4 MAINBOARDS="src/mainboard"
5 OUTPUT_FILE=${1:-$TOP/Documentation/security/vboot/list_vboot.md}
6
7 function has_vbootscip-shell shell coreboot 25.09+dfsg-1 has_vboot().
8 {
9 local DIR=$1
10
11 grepscip-shell system . . grep. -rq "config VBOOT" $DIR
12 return $?
13 }
14
15 function get_vendor_namescip-shell shell coreboot 25.09+dfsg-1 get_vendor_name().
16 {
17 local VENDORDIR=$1
18
19 sedscip-shell system . . sed. -n '/config VENDOR/{n;s/^[\t[:space:]]\+bool "\(.*\)"/\1/;p;}scip-shell filesystem . . `/config VENDOR/{n;s/^[\t[:space:]]\+bool "\(.*\)"/\1/;p;}`.' \
20 $VENDORDIR/Kconfig.name
21 }
22
23 function get_board_namescip-shell shell coreboot 25.09+dfsg-1 get_board_name().
24 {
25 local BOARDDIR=$1
26
27 sedscip-shell system . . sed. -n '/config BOARD/{n;s/^[\t[:space:]]\+bool "\(->\s\+\)\?\(.*\)"/\2/;p;}scip-shell filesystem . . `/config BOARD/{n;s/^[\t[:space:]]\+bool "\(->\s\+\)\?\(.*\)"/\2/;p;}`.' \
28 $BOARDDIR/Kconfig.name
29 }
30
31 function list_vboot_boardsscip-shell shell coreboot 25.09+dfsg-1 list_vboot_boards().
32 {
33 local VENDORDIR=$1
34 for BOARD in $(lsscip-shell system . . ls. -d $VENDORDIR/*/)
35 do
36 has_vbootscip-shell shell coreboot 25.09+dfsg-1 has_vboot(). $BOARD || continue
37 get_board_namescip-shell shell coreboot 25.09+dfsg-1 get_board_name(). $BOARD
38 done
39 }
40
41 function generate_vboot_listscip-shell shell coreboot 25.09+dfsg-1 generate_vboot_list().
42 {
43 for VENDOR in $(lsscip-shell system . . ls. -d $TOP/$MAINBOARDS/*/)
44 do
45 has_vbootscip-shell shell coreboot 25.09+dfsg-1 has_vboot(). $VENDOR || continue
46 echoscip-shell system . . echo. -e "\n## $(get_vendor_namescip-shell shell coreboot 25.09+dfsg-1 get_vendor_name(). $VENDOR)"
47 IFS=$'\n'
48 for BOARD in $(list_vboot_boardsscip-shell shell coreboot 25.09+dfsg-1 list_vboot_boards(). $VENDOR)
49 do
50 echoscip-shell system . . echo. "- $BOARD"
51 done
52 done
53 }
54
55 (echoscip-shell system . . echo. "# vboot-enabled devices"; generate_vboot_listscip-shell shell coreboot 25.09+dfsg-1 generate_vboot_list().) > $OUTPUT_FILE