Debian Codegraph @

3rdparty/vboot/scripts/keygeneration/make_arv_root.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # Copyright 2022 The ChromiumOS Authors
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5 #
6 # Create AP RO verification Root key pair for PreMp signing.
7
8 # Load common constants and functions.
9 # shellcheck source=common.sh
10 . "$(dirnamescip-shell system . . dirname. "$0")/common.sh"
11
12 usagescip-shell shell coreboot 25.09+dfsg-1 usage().() {
13 catscip-shell system . . cat. <<EOF
14 Usage: $0 [destination directory]
15
16 Output: arv_root.vbprivk and arv_root.vbpubk created in [destination dirctory]
17 which by default is "./${ARV_ROOT_DIR}"
18 EOF
19 exit 1
20 }
21
22 mainscip-shell shell coreboot 25.09+dfsg-1 main().() {
23 local key_dir
24
25 case $# in
26 (0) # Use default directory.
27 key_dir="${ARV_ROOT_DIR}"
28 ;;
29 (1)
30 key_dir="$1"
31 ;;
32 (*)
33 usagescip-shell shell coreboot 25.09+dfsg-1 usage().
34 esac
35
36 if [[ -d ${key_dir} ]]; then
37 die "Destination directory \"${key_dir}\" exists. There can be only one!"
38 fi
39
40 mkdirscip-shell system . . mkdir. -p "${key_dir}" || die "Failed to create \"${key_dir}\"."
41
42 cd "${key_dir}" || die "Failed to cd to \"${key_dir}\"."
43
44 make_pair "${ARV_ROOT_NAME_BASE}" "${ARV_ROOT_ALGOID}"
45 }
46
47 mainscip-shell shell coreboot 25.09+dfsg-1 main(). "$@"