diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2017-06-23 13:55:22 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2017-06-23 13:55:22 -0400 |
commit | 4e50a92041c9f30deef1a32c995b9d5634cbed22 (patch) | |
tree | 889014b8974bb439a7a665ce991036ea5d41fd01 /projects/cros-scripts | |
parent | bdb6c0e643f9d4b4ce3e0ceba113c04bd45d5116 (diff) | |
download | librebootfr-4e50a92041c9f30deef1a32c995b9d5634cbed22.tar.gz librebootfr-4e50a92041c9f30deef1a32c995b9d5634cbed22.zip |
Remove unnecessary 'env' invocation from printf.
This reverts part of pull request #217 which called the 'env'
binary for each printf invocation.
Diffstat (limited to 'projects/cros-scripts')
-rwxr-xr-x | projects/cros-scripts/install/cros-boot-keys | 54 | ||||
-rwxr-xr-x | projects/cros-scripts/install/cros-firmware-prepare | 72 | ||||
-rwxr-xr-x | projects/cros-scripts/install/cros-kernel-install | 50 | ||||
-rwxr-xr-x | projects/cros-scripts/install/cros-kernel-prepare | 32 | ||||
-rwxr-xr-x | projects/cros-scripts/install/cros-medium-setup | 46 |
5 files changed, 127 insertions, 127 deletions
diff --git a/projects/cros-scripts/install/cros-boot-keys b/projects/cros-scripts/install/cros-boot-keys index dffdc9b9..bd60a4e2 100755 --- a/projects/cros-scripts/install/cros-boot-keys +++ b/projects/cros-scripts/install/cros-boot-keys @@ -31,16 +31,16 @@ ALGORITHMS="7 7 11 7 7 4 11 11 11" MODES="7 7 11 7 10" usage() { - env printf '%s\n' "$executable [action]" >&2 + printf '%s\n' "$executable [action]" >&2 - env printf '\n%s\n' 'Actions:' >&2 - env printf '%s\n' ' generate - Generate a set of keys' >&2 - env printf '%s\n' ' verify - Verify keyblocks' >&2 + printf '\n%s\n' 'Actions:' >&2 + printf '%s\n' ' generate - Generate a set of keys' >&2 + printf '%s\n' ' verify - Verify keyblocks' >&2 - env printf '\n%s\n' 'Environment variables:' >&2 - env printf '%s\n' ' KEYS_VERSION - Version to give the keys' >&2 - env printf '%s\n' ' VBOOT_KEYS_PATH - Path to the vboot keys' >&2 - env printf '%s\n' ' VBOOT_TOOLS_PATH - Path to vboot tools' >&2 + printf '\n%s\n' 'Environment variables:' >&2 + printf '%s\n' ' KEYS_VERSION - Version to give the keys' >&2 + printf '%s\n' ' VBOOT_KEYS_PATH - Path to the vboot keys' >&2 + printf '%s\n' ' VBOOT_TOOLS_PATH - Path to vboot tools' >&2 } keys_override_confirm() { @@ -68,9 +68,9 @@ keys_override_confirm() { return 0 fi - env printf '%s\n' 'This is going to override keys stored in the following directory:' - env printf '%s\n' " $VBOOT_KEYS_PATH" - env printf '%s' 'Press enter to confirm: ' + printf '%s\n' 'This is going to override keys stored in the following directory:' + printf '%s\n' " $VBOOT_KEYS_PATH" + printf '%s' 'Press enter to confirm: ' read confirm } @@ -89,8 +89,8 @@ generate() { for key in $KEYS do - algorithm=$( env printf '%s\n' "$algorithms" | sed "s/$REGEXP/\1/g" ) - algorithms=$( env printf '%s\n' "$algorithms" | sed "s/$REGEXP/\2/g" ) + algorithm=$( printf '%s\n' "$algorithms" | sed "s/$REGEXP/\1/g" ) + algorithms=$( printf '%s\n' "$algorithms" | sed "s/$REGEXP/\2/g" ) key_length=$(( 1 << (10 + ($algorithm / 3)) )) @@ -104,23 +104,23 @@ generate() { rm -f "$VBOOT_KEYS_PATH/$key.$PEM" "$VBOOT_KEYS_PATH/$key.$CRT" "$VBOOT_KEYS_PATH/$key.$KEYB" done - env printf '\n%s\n' "Generated keys $KEYS" + printf '\n%s\n' "Generated keys $KEYS" for keyblock in $KEYBLOCKS do - pubkey=$( env printf '%s\n' "$subkeys" | sed "s/$REGEXP/\1/g" ) - subkeys=$( env printf '%s\n' "$subkeys" | sed "s/$REGEXP/\2/g" ) - privkey=$( env printf '%s\n' "$subkeys" | sed "s/$REGEXP/\1/g" ) - subkeys=$( env printf '%s\n' "$subkeys" | sed "s/$REGEXP/\2/g" ) + pubkey=$( printf '%s\n' "$subkeys" | sed "s/$REGEXP/\1/g" ) + subkeys=$( printf '%s\n' "$subkeys" | sed "s/$REGEXP/\2/g" ) + privkey=$( printf '%s\n' "$subkeys" | sed "s/$REGEXP/\1/g" ) + subkeys=$( printf '%s\n' "$subkeys" | sed "s/$REGEXP/\2/g" ) - mode=$( env printf '%s\n' "$modes" | sed "s/$REGEXP/\1/g" ) - modes=$( env printf '%s\n' "$modes" | sed "s/$REGEXP/\2/g" ) + mode=$( printf '%s\n' "$modes" | sed "s/$REGEXP/\1/g" ) + modes=$( printf '%s\n' "$modes" | sed "s/$REGEXP/\2/g" ) futility vbutil_keyblock --pack "$VBOOT_KEYS_PATH/$keyblock.$KEYBLOCK" --flags "$mode" --datapubkey "$VBOOT_KEYS_PATH/$pubkey.$VBPUBK" --signprivate "$VBOOT_KEYS_PATH/$privkey.$VBPRIVK" futility vbutil_keyblock --unpack "$VBOOT_KEYS_PATH/$keyblock.$KEYBLOCK" --signpubkey "$VBOOT_KEYS_PATH/$privkey.$VBPUBK" done - env printf '\n%s\n' "Generated keyblocks $KEYBLOCKS" + printf '\n%s\n' "Generated keyblocks $KEYBLOCKS" } verify() { @@ -130,15 +130,15 @@ verify() { for keyblock in $KEYBLOCKS do - pubkey=$( env printf '%s\n' "$subkeys" | sed "s/$REGEXP/\1/g" ) - subkeys=$( env printf '%s\n' "$subkeys" | sed "s/$REGEXP/\2/g" ) - privkey=$( env printf '%s\n' "$subkeys" | sed "s/$REGEXP/\1/g" ) - subkeys=$( env printf '%s\n' "$subkeys" | sed "s/$REGEXP/\2/g" ) + pubkey=$( printf '%s\n' "$subkeys" | sed "s/$REGEXP/\1/g" ) + subkeys=$( printf '%s\n' "$subkeys" | sed "s/$REGEXP/\2/g" ) + privkey=$( printf '%s\n' "$subkeys" | sed "s/$REGEXP/\1/g" ) + subkeys=$( printf '%s\n' "$subkeys" | sed "s/$REGEXP/\2/g" ) futility vbutil_keyblock --unpack "$VBOOT_KEYS_PATH/$keyblock.$KEYBLOCK" --signpubkey "$VBOOT_KEYS_PATH/$privkey.$VBPUBK" done - env printf '\n%s\n' "Verified keyblocks $KEYBLOCKS" + printf '\n%s\n' "Verified keyblocks $KEYBLOCKS" } requirements() { @@ -151,7 +151,7 @@ requirements() { if [ -z "$requirement_path" ] then - env printf '%s\n' "Missing requirement: $requirement" >&2 + printf '%s\n' "Missing requirement: $requirement" >&2 exit 1 fi done diff --git a/projects/cros-scripts/install/cros-firmware-prepare b/projects/cros-scripts/install/cros-firmware-prepare index d2e15f29..ad10e5c9 100755 --- a/projects/cros-scripts/install/cros-firmware-prepare +++ b/projects/cros-scripts/install/cros-firmware-prepare @@ -22,34 +22,34 @@ VBPUBK="vbpubk" GBB_FLAGS="dev_screen_short_delay load_option_roms enable_alternate_os force_dev_switch_on force_dev_boot_usb disable_fw_rollback_check enter_triggers_tonorm force_dev_boot_legacy faft_key_overide disable_ec_software_sync default_dev_boot_lefacy disable_pd_software_sync disable_lid_shutdown dev_boot_fastboot_full_cap enable_serial" usage() { - env printf '%s\n' "$executable [action] [firmware image] [gbb action|vpd action] [gbb file|gbb flag|vpd file]" >&2 + printf '%s\n' "$executable [action] [firmware image] [gbb action|vpd action] [gbb file|gbb flag|vpd file]" >&2 - env printf '\n%s\n' 'Actions:' >&2 - env printf '%s\n' ' sign - Sign firmware image' >&2 - env printf '%s\n' ' verify - Verify firmware image' >&2 - env printf '%s\n' ' gbb - Google Binary Block' >&2 + printf '\n%s\n' 'Actions:' >&2 + printf '%s\n' ' sign - Sign firmware image' >&2 + printf '%s\n' ' verify - Verify firmware image' >&2 + printf '%s\n' ' gbb - Google Binary Block' >&2 - env printf '\n%s\n' 'GBB actions:' >&2 - env printf '%s\n' ' extract - Extract GBB from firmware image to path' >&2 - env printf '%s\n' ' replace - Replace GBB from path to firmware image' >&2 - env printf '%s\n' ' list - List enabled GBB flags' >&2 - env printf '%s\n' ' enable - Enable GBB flag' >&2 - env printf '%s\n' ' disable - Disable GBB flag' >&2 + printf '\n%s\n' 'GBB actions:' >&2 + printf '%s\n' ' extract - Extract GBB from firmware image to path' >&2 + printf '%s\n' ' replace - Replace GBB from path to firmware image' >&2 + printf '%s\n' ' list - List enabled GBB flags' >&2 + printf '%s\n' ' enable - Enable GBB flag' >&2 + printf '%s\n' ' disable - Disable GBB flag' >&2 - env printf '\n%s\n' 'GBB flags:' >&2 + printf '\n%s\n' 'GBB flags:' >&2 for flag in $GBB_FLAGS do - env printf '%s\n' " $flag" >&2 + printf '%s\n' " $flag" >&2 done - env printf '\n%s\n' 'VPD actions:' >&2 - env printf '%s\n' ' extract - Extract VPD from firmware image to path' >&2 - env printf '%s\n' ' replace - Replace VPD from path to firmware image' >&2 + printf '\n%s\n' 'VPD actions:' >&2 + printf '%s\n' ' extract - Extract VPD from firmware image to path' >&2 + printf '%s\n' ' replace - Replace VPD from path to firmware image' >&2 - env printf '\n%s\n' 'Environment variables:' >&2 - env printf '%s\n' ' VBOOT_KEYS_PATH - Path to the vboot keys' >&2 - env printf '%s\n' ' VBOOT_TOOLS_PATH - Path to vboot tools' >&2 + printf '\n%s\n' 'Environment variables:' >&2 + printf '%s\n' ' VBOOT_KEYS_PATH - Path to the vboot keys' >&2 + printf '%s\n' ' VBOOT_TOOLS_PATH - Path to vboot tools' >&2 } sign() { @@ -58,15 +58,15 @@ sign() { futility sign --signprivate="$VBOOT_KEYS_PATH/firmware_data_key.$VBPRIVK" --keyblock "$VBOOT_KEYS_PATH/firmware.$KEYBLOCK" --kernelkey "$VBOOT_KEYS_PATH/kernel_subkey.$VBPUBK" --infile "$firmware_image_path" futility gbb_utility -s --recoverykey="$VBOOT_KEYS_PATH/recovery_key.$VBPUBK" --rootkey="$VBOOT_KEYS_PATH/root_key.$VBPUBK" "$firmware_image_path" "$firmware_image_path" - env printf '\n%s\n' "Signed firmwares image $firmware_image_path" + printf '\n%s\n' "Signed firmwares image $firmware_image_path" } verify() { local firmware_image_path=$1 - futility verify -k "$VBOOT_KEYS_PATH/root_key.$VBPUBK" "$firmware_image_path" || ( env printf '\n%s\n' "Bad firmware image signature!" >&2 && return 1 ) + futility verify -k "$VBOOT_KEYS_PATH/root_key.$VBPUBK" "$firmware_image_path" || ( printf '\n%s\n' "Bad firmware image signature!" >&2 && return 1 ) - env printf '\n%s\n' "Verified firmware image $firmware_image_path" + printf '\n%s\n' "Verified firmware image $firmware_image_path" } gbb() { @@ -91,7 +91,7 @@ gbb() { futility dump_fmap -x "$firmware_image_path" "GBB:$gbb_file_path" - env printf '\n%s\n' "Extracted GBB from $firmware_image_path to $gbb_file_path" + printf '\n%s\n' "Extracted GBB from $firmware_image_path to $gbb_file_path" ;; "replace") if [ -z "$gbb_file_path" ] @@ -102,10 +102,10 @@ gbb() { futility load_fmap "$firmware_image_path" "GBB:$gbb_file_path" - env printf '\n%s\n' "Replaced GBB from $gbb_file_path to $firmware_image_path" + printf '\n%s\n' "Replaced GBB from $gbb_file_path to $firmware_image_path" ;; "list") - env printf '%s\n' "GBB flags in $firmware_image_path:" + printf '%s\n' "GBB flags in $firmware_image_path:" flags=$( gbb_flags_get "$firmware_image_path" ) @@ -115,7 +115,7 @@ gbb() { if (( $flags & $flag_value )) then - env printf '%s\n' " $flag" + printf '%s\n' " $flag" fi i=$(( $i + 1 )) @@ -134,15 +134,15 @@ gbb() { if [ -z "$flag_value" ] then - env printf '%s\n' "Invalid GBB flag: $gbb_flag" >&2 + printf '%s\n' "Invalid GBB flag: $gbb_flag" >&2 exit 1 fi - flags=$( env printf "0x%x\n" $(( $flags | $flag_value )) ) + flags=$( printf "0x%x\n" $(( $flags | $flag_value )) ) gbb_flags_set "$firmware_image_path" "$flags" - env printf '\n%s\n' "Enabled GBB flag $gbb_flag in $firmware_image_path" + printf '\n%s\n' "Enabled GBB flag $gbb_flag in $firmware_image_path" ;; "disable") if [ -z "$gbb_flag" ] @@ -156,15 +156,15 @@ gbb() { if [ -z "$flag_value" ] then - env printf '%s\n' "Invalid GBB flag: $gbb_flag" >&2 + printf '%s\n' "Invalid GBB flag: $gbb_flag" >&2 exit 1 fi - flags=$( env printf "0x%x\n" $(( $flags & ~$flag_value )) ) + flags=$( printf "0x%x\n" $(( $flags & ~$flag_value )) ) gbb_flags_set "$firmware_image_path" "$flags" - env printf '\n%s\n' "Disabled GBB flag $gbb_flag in $firmware_image_path" + printf '\n%s\n' "Disabled GBB flag $gbb_flag in $firmware_image_path" ;; *) usage @@ -196,7 +196,7 @@ gbb_flag_value() { do if [ "$gbb_flag" = "$flag" ] then - env printf '%d\n' $(( 1 << $i )) + printf '%d\n' $(( 1 << $i )) return fi @@ -213,12 +213,12 @@ vpd() { "extract") futility dump_fmap -x "$firmware_image_path" "RO_VPD:$vpd_file_path" - env printf '\n%s\n' "Extracted VPD from $firmware_image_path to $vpd_file_path" + printf '\n%s\n' "Extracted VPD from $firmware_image_path to $vpd_file_path" ;; "replace") futility load_fmap "$firmware_image_path" "RO_VPD:$vpd_file_path" - env printf '\n%s\n' "Replaced VPD from $vpd_file_path to $firmware_image_path" + printf '\n%s\n' "Replaced VPD from $vpd_file_path to $firmware_image_path" ;; *) usage @@ -237,7 +237,7 @@ requirements() { if [ -z "$requirement_path" ] then - env printf '%s\n' "Missing requirement: $requirement" >&2 + printf '%s\n' "Missing requirement: $requirement" >&2 exit 1 fi done diff --git a/projects/cros-scripts/install/cros-kernel-install b/projects/cros-scripts/install/cros-kernel-install index e45915e9..37575e6b 100755 --- a/projects/cros-scripts/install/cros-kernel-install +++ b/projects/cros-scripts/install/cros-kernel-install @@ -23,22 +23,22 @@ MODEL="model" NAME="name" usage() { - env printf '%s\n' "$executable [action] [storage] [kernel image|kernel modules]" >&2 + printf '%s\n' "$executable [action] [storage] [kernel image|kernel modules]" >&2 - env printf '\n%s\n' 'Actions:' >&2 - env printf '%s\n' ' backup - Backup kernel image' >&2 - env printf '%s\n' ' image - Install kernel image' >&2 - env printf '%s\n' ' modules - Install kernel modules' >&2 + printf '\n%s\n' 'Actions:' >&2 + printf '%s\n' ' backup - Backup kernel image' >&2 + printf '%s\n' ' image - Install kernel image' >&2 + printf '%s\n' ' modules - Install kernel modules' >&2 usage_storage - env printf '\n%s\n' 'Environment variables:' >&2 - env printf '%s\n' ' VBOOT_KEYS_PATH - Path to the vboot keys' >&2 - env printf '%s\n' ' VBOOT_TOOLS_PATH - Path to vboot tools' >&2 + printf '\n%s\n' 'Environment variables:' >&2 + printf '%s\n' ' VBOOT_KEYS_PATH - Path to the vboot keys' >&2 + printf '%s\n' ' VBOOT_TOOLS_PATH - Path to vboot tools' >&2 } usage_storage() { - env printf '\n%s\n' 'Storage:' >&2 + printf '\n%s\n' 'Storage:' >&2 local nodes=$( ls "$SYS_BLOCK_PATH" ) local node_path @@ -58,7 +58,7 @@ usage_storage() { continue fi - env printf '%s\n' " $node_path - $name" >&2 + printf '%s\n' " $node_path - $name" >&2 done } @@ -68,9 +68,9 @@ storage_affect_confirm() { local name=$( storage_name "$storage_path" ) local confirm - env printf '%s\n' 'This is going to affect the following storage:' - env printf '%s\n' " $storage_path - $name" - env printf '%s' 'Press enter to confirm: ' + printf '%s\n' 'This is going to affect the following storage:' + printf '%s\n' " $storage_path - $name" + printf '%s' 'Press enter to confirm: ' read confirm } @@ -95,17 +95,17 @@ storage_name() { return 0 fi - name=$( env printf '%s\n' "$name" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" ) + name=$( printf '%s\n' "$name" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" ) if [ -f "$vendor_path" ] then vendor=$( cat "$vendor_path" ) - vendor=$( env printf '%s\n' "$vendor" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" ) + vendor=$( printf '%s\n' "$vendor" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" ) name="$vendor $name" fi - env printf '%s\n' "$name" + printf '%s\n' "$name" } storage_partition_path() { @@ -124,7 +124,7 @@ storage_partition_path() { return 1 fi - env printf '%s\n' "$storage_partition_path" + printf '%s\n' "$storage_partition_path" } storage_partition_mount_path() { @@ -132,7 +132,7 @@ storage_partition_mount_path() { local storage_partition_mount_path=$( udisksctl info -b "$storage_partition_path" | grep "MountPoints" | sed "s/.*MountPoints:[[:space:]]*\(.*\)/\1/g" ) - env printf '%s\n' "$storage_partition_mount_path" + printf '%s\n' "$storage_partition_mount_path" } storage_kernel_path() { @@ -155,13 +155,13 @@ backup() { if [ -z "$storage_kernel_path" ] then - env printf '%s\n' "No kernel partition found on storage $storage_path" >&2 + printf '%s\n' "No kernel partition found on storage $storage_path" >&2 return 1 fi cat "$storage_kernel_path" > "$kernel_image_path" - env printf '\n%s\n' "Backed up kernel image to $kernel_image_path" + printf '\n%s\n' "Backed up kernel image to $kernel_image_path" } image() { @@ -172,7 +172,7 @@ image() { if [ -z "$storage_kernel_path" ] then - env printf '%s\n' "No kernel partition found on storage $storage_path" >&2 + printf '%s\n' "No kernel partition found on storage $storage_path" >&2 return 1 fi @@ -181,7 +181,7 @@ image() { cat "$kernel_image_path" > "$storage_kernel_path" sync - env printf '\n%s\n' "Installed kernel image on storage $storage_path" + printf '\n%s\n' "Installed kernel image on storage $storage_path" } modules() { @@ -192,7 +192,7 @@ modules() { if [ -z "$storage_rootfs_path" ] then - env printf '%s\n' "No rootfs partition found on storage $storage_path" >&2 + printf '%s\n' "No rootfs partition found on storage $storage_path" >&2 return 1 fi @@ -208,7 +208,7 @@ modules() { udisksctl unmount -b "$storage_rootfs_path" - env printf '\n%s\n' "Installed kernel modules on storage $storage_path" + printf '\n%s\n' "Installed kernel modules on storage $storage_path" } requirements() { @@ -221,7 +221,7 @@ requirements() { if [ -z "$requirement_path" ] then - env printf '%s\n' "Missing requirement: $requirement" >&2 + printf '%s\n' "Missing requirement: $requirement" >&2 exit 1 fi done diff --git a/projects/cros-scripts/install/cros-kernel-prepare b/projects/cros-scripts/install/cros-kernel-prepare index e1c7cacb..bfd667c0 100755 --- a/projects/cros-scripts/install/cros-kernel-prepare +++ b/projects/cros-scripts/install/cros-kernel-prepare @@ -27,21 +27,21 @@ FIT="fit" IMG="img" usage() { - env printf '%s\n' "$executable [action] [kernel files|kernel image] [medium]" >&2 + printf '%s\n' "$executable [action] [kernel files|kernel image] [medium]" >&2 - env printf '\n%s\n' 'Actions:' >&2 - env printf '%s\n' ' pack - Pack kernel files to a medium-specific image' >&2 - env printf '%s\n' ' sign - Sign kernel image' >&2 - env printf '%s\n' ' verify - Very kernel image signatures' >&2 + printf '\n%s\n' 'Actions:' >&2 + printf '%s\n' ' pack - Pack kernel files to a medium-specific image' >&2 + printf '%s\n' ' sign - Sign kernel image' >&2 + printf '%s\n' ' verify - Very kernel image signatures' >&2 - env printf '\n%s\n' 'Medium:' >&2 - env printf '%s\n' ' usb - External USB storage' >&2 - env printf '%s\n' ' mmc - External SD card storage' >&2 - env printf '%s\n' ' emmc - Internal storage' >&2 + printf '\n%s\n' 'Medium:' >&2 + printf '%s\n' ' usb - External USB storage' >&2 + printf '%s\n' ' mmc - External SD card storage' >&2 + printf '%s\n' ' emmc - Internal storage' >&2 - env printf '\n%s\n' 'Environment variables:' >&2 - env printf '%s\n' ' VBOOT_KEYS_PATH - Path to the vboot keys' >&2 - env printf '%s\n' ' VBOOT_TOOLS_PATH - Path to vboot tools' >&2 + printf '\n%s\n' 'Environment variables:' >&2 + printf '%s\n' ' VBOOT_KEYS_PATH - Path to the vboot keys' >&2 + printf '%s\n' ' VBOOT_TOOLS_PATH - Path to vboot tools' >&2 } pack() { @@ -59,7 +59,7 @@ pack() { mkimage -f "$kernel_its_path" "$kernel_fit_path" futility vbutil_kernel --pack "$kernel_image_path" --version 1 --arch "$arch" --keyblock "$VBOOT_KEYS_PATH/kernel.$KEYBLOCK" --signprivate "$VBOOT_KEYS_PATH/kernel_data_key.$VBPRIVK" --config "$cmdline_path" --vmlinuz "$kernel_fit_path" --bootloader "$bootloader_path" - env printf '\n%s\n' "Packed kernel image $kernel_image_path" + printf '\n%s\n' "Packed kernel image $kernel_image_path" } sign() { @@ -67,7 +67,7 @@ sign() { futility vbutil_kernel --repack "$kernel_image_path" --version 1 --keyblock "$VBOOT_KEYS_PATH/kernel.$KEYBLOCK" --signprivate "$VBOOT_KEYS_PATH/kernel_data_key.$VBPRIVK" --oldblob "$kernel_image_path" - env printf '\n%s\n' "Signed kernel image $kernel_image_path" + printf '\n%s\n' "Signed kernel image $kernel_image_path" } verify() { @@ -75,7 +75,7 @@ verify() { futility vbutil_kernel --verify "$kernel_image_path" --signpubkey "$VBOOT_KEYS_PATH/kernel_subkey.$VBPUBK" - env printf '\n%s\n' "Verified kernel image $kernel_image_path" + printf '\n%s\n' "Verified kernel image $kernel_image_path" } requirements() { @@ -88,7 +88,7 @@ requirements() { if [ -z "$requirement_path" ] then - env printf '%s\n' "Missing requirement: $requirement" >&2 + printf '%s\n' "Missing requirement: $requirement" >&2 exit 1 fi done diff --git a/projects/cros-scripts/install/cros-medium-setup b/projects/cros-scripts/install/cros-medium-setup index b33c6744..b50fad76 100755 --- a/projects/cros-scripts/install/cros-medium-setup +++ b/projects/cros-scripts/install/cros-medium-setup @@ -32,22 +32,22 @@ GPT_SIZE=34 KERNEL_SIZE=16384 usage() { - env printf '%s\n' "$executable [action] [storage] [rootfs tarball|kernel files] [medium]" >&2 + printf '%s\n' "$executable [action] [storage] [rootfs tarball|kernel files] [medium]" >&2 - env printf '\n%s\n' 'Actions:' >&2 - env printf '%s\n' ' partitions - Setup partitions on storage' >&2 - env printf '%s\n' ' rootfs - Install rootfs tarball to storage' >&2 - env printf '%s\n' ' kernel - Install kernel files to storage' >&2 + printf '\n%s\n' 'Actions:' >&2 + printf '%s\n' ' partitions - Setup partitions on storage' >&2 + printf '%s\n' ' rootfs - Install rootfs tarball to storage' >&2 + printf '%s\n' ' kernel - Install kernel files to storage' >&2 usage_storage - env printf '\n%s\n' 'Environment variables:' >&2 - env printf '%s\n' ' KERNEL_PATH - Path to the kernel image' >&2 - env printf '%s\n' ' VBOOT_TOOLS_PATH - Path to vboot tools' >&2 + printf '\n%s\n' 'Environment variables:' >&2 + printf '%s\n' ' KERNEL_PATH - Path to the kernel image' >&2 + printf '%s\n' ' VBOOT_TOOLS_PATH - Path to vboot tools' >&2 } usage_storage() { - env printf '\n%s\n' 'Storage:' >&2 + printf '\n%s\n' 'Storage:' >&2 local nodes=$( ls "$SYS_BLOCK_PATH" ) local node_path @@ -67,7 +67,7 @@ usage_storage() { continue fi - env printf '%s\n' " $node_path - $name" >&2 + printf '%s\n' " $node_path - $name" >&2 done } @@ -77,9 +77,9 @@ storage_affect_confirm() { local name=$( storage_name "$storage_path" ) local confirm - env printf '%s\n' 'This is going to affect the following storage:' - env printf '%s\n' " $storage_path - $name" - env printf '%s' 'Press enter to confirm: ' + printf '%s\n' 'This is going to affect the following storage:' + printf '%s\n' " $storage_path - $name" + printf '%s' 'Press enter to confirm: ' read confirm } @@ -104,17 +104,17 @@ storage_name() { return 0 fi - name=$( env printf '%s\n' "$name" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" ) + name=$( printf '%s\n' "$name" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" ) if [ -f "$vendor_path" ] then vendor=$( cat "$vendor_path" ) - vendor=$( env printf '%s\n' "$vendor" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" ) + vendor=$( printf '%s\n' "$vendor" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" ) name="$vendor $name" fi - env printf '%s\n' "$name" + printf '%s\n' "$name" } storage_partition_path() { @@ -133,7 +133,7 @@ storage_partition_path() { return 1 fi - env printf '%s\n' "$storage_partition_path" + printf '%s\n' "$storage_partition_path" } storage_partition_mount_path() { @@ -141,7 +141,7 @@ storage_partition_mount_path() { local storage_partition_mount_path=$( udisksctl info -b "$storage_partition_path" | grep "MountPoints" | sed "s/.*MountPoints:[[:space:]]*\(.*\)/\1/g" ) - env printf '%s\n' "$storage_partition_mount_path" + printf '%s\n' "$storage_partition_mount_path" } partitions() { @@ -161,7 +161,7 @@ partitions() { udisksctl unmount -b "$partition" || true done - ( env printf '%s\n' "g" ; env printf '%s\n' "w" ) | fdisk "$storage_path" + ( printf '%s\n' "g" ; printf '%s\n' "w" ) | fdisk "$storage_path" cgpt create "$storage_path" @@ -180,7 +180,7 @@ partitions() { mkfs.ext4 -F "$storage_rootfs_path" - env printf '\n%s\n' "Setup partitions on storage $storage_path" + printf '\n%s\n' "Setup partitions on storage $storage_path" } rootfs() { @@ -201,7 +201,7 @@ rootfs() { udisksctl unmount -b "$storage_rootfs_path" - env printf '\n%s\n' "Installed rootfs on storage $storage_path" + printf '\n%s\n' "Installed rootfs on storage $storage_path" } kernel() { @@ -230,7 +230,7 @@ kernel() { udisksctl unmount -b "$storage_rootfs_path" - env printf '\n%s\n' "Installed kernel on storage $storage_path" + printf '\n%s\n' "Installed kernel on storage $storage_path" } requirements() { @@ -243,7 +243,7 @@ requirements() { if [ -z "$requirement_path" ] then - env printf '%s\n' "Missing requirement: $requirement" >&2 + printf '%s\n' "Missing requirement: $requirement" >&2 exit 1 fi done |