diff options
Diffstat (limited to 'tools/boot-keys')
-rwxr-xr-x | tools/boot-keys/boot-keys | 28 | ||||
-rwxr-xr-x | tools/boot-keys/boot-keys-helper | 16 |
2 files changed, 22 insertions, 22 deletions
diff --git a/tools/boot-keys/boot-keys b/tools/boot-keys/boot-keys index da56aca9..4c40bdf3 100755 --- a/tools/boot-keys/boot-keys +++ b/tools/boot-keys/boot-keys @@ -20,11 +20,11 @@ usage() { } generate() { - local type=$( boot_keys_type "$@" ) + local type=$(boot_keys_type "$@") - if [ -z "$type" ] + if [[ -z "$type" ]] then - printf '%s\n' 'Unable to determine keys type' >&2 + printf 1>&2 '%s\n' 'Unable to determine keys type' return 1 fi @@ -38,16 +38,16 @@ generate() { sign() { local project=$1 - local prepare_files=$( boot_keys_files "$@" ) - local type=$( boot_keys_type "$@" ) + local prepare_files=$(boot_keys_files "$@") + local type=$(boot_keys_type "$@") local install_path local firmware_path local kernel_path local media - if [ -z "$type" ] + if [[ -z "$type" ]] then - printf '%s\n' 'Unable to determine keys type' >&2 + printf 1>&2 '%s\n' 'Unable to determine keys type' return 1 fi @@ -60,13 +60,13 @@ sign() { boot_keys_cros "$type-prepare" "sign" "$firmware_path" ;; "cros-kernel") - media=$( project_action "media" "$@" ) + media=$(project_action "media" "$@") for medium in $media do kernel_path="$install_path/$KERNEL-$medium.$IMG" - if [ -f "$kernel_path" ] + if [[ -f "$kernel_path" ]] then boot_keys_cros "$type-prepare" "sign" "$kernel_path" else @@ -81,16 +81,16 @@ sign() { verify() { local project=$1 - local prepare_files=$( boot_keys_files "$@" ) - local type=$( boot_keys_type "$@" ) + local prepare_files=$(boot_keys_files "$@") + local type=$(boot_keys_type "$@") local install_path local firmware_path local kernel_path local media - if [ -z "$type" ] + if [[ -z "$type" ]] then - printf '%s\n' 'Unable to determine keys type' >&2 + printf 1>&2 '%s\n' 'Unable to determine keys type' return 1 fi @@ -103,7 +103,7 @@ verify() { boot_keys_cros "$type-prepare" "verify" "$firmware_path" ;; "cros-kernel") - media=$( project_action "media" "$@" ) + media=$(project_action "media" "$@") for medium in $media do diff --git a/tools/boot-keys/boot-keys-helper b/tools/boot-keys/boot-keys-helper index 31e2c16b..464638b9 100755 --- a/tools/boot-keys/boot-keys-helper +++ b/tools/boot-keys/boot-keys-helper @@ -9,13 +9,13 @@ boot_keys_cros() { local cros_script=$1 shift - local vboot_tools_path=$( project_install_path "vboot" "tools" ) - local cros_scripts_path=$( project_install_path "cros-scripts" ) + local vboot_tools_path=$(project_install_path "vboot" "tools") + local cros_scripts_path=$(project_install_path "cros-scripts") local cros_script_path="$cros_scripts_path/$cros_script" - if ! [ -x "$cros_script_path" ] + if ! [[ -x "$cros_script_path" ]] then - printf '%s' "$cros_script script missing from cros-scripts install" >&2 + printf 1>&2 '%s' "$cros_script script missing from cros-scripts install" return 1 fi @@ -34,10 +34,10 @@ boot_keys_files_install_path() { local argument local ifs_save - helper_arguments=$( project_action_helper "arguments" "$project" "$@" ) + helper_arguments=$(project_action_helper "arguments" "$project" "$@") - if [ $? -ne 0 ] || [ -z "$helper_arguments" ] + if [[ $? -ne 0 ]] || [[ -z "$helper_arguments" ]] then project_install_path "$project" "$@" else @@ -45,7 +45,7 @@ boot_keys_files_install_path() { ifs_save=$IFS IFS=$'\n' - for argument in $( printf '%s\n' "$helper_arguments" ) + for argument in $(printf '%s\n' "$helper_arguments") do ( IFS=$ifs_save @@ -63,7 +63,7 @@ boot_keys_files() { local project=$1 shift - local cros_scripts_path=$( project_install_path "cros-scripts" ) + local cros_scripts_path=$(project_install_path "cros-scripts") local cros_boot_keys="$cros_scripts_path/cros-boot-keys" project_action_arguments_verify_recursive "install" "$project" "$@" |