From eb868eeb1d2eb15d99eaa0625521c418472e8baa Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Tue, 19 Oct 2010 11:08:24 +0800 Subject: [PATCH] make_dev_firmware: provide more usage help for backup files Provide more clear instruction on how to use the backup files, and to try more effort to store backup files BUG=none TEST=emerge-x86-generic vboot-reference; executed make_dev_firmware and got correct message Change-Id: I2062f45dd3019d0e56adc18bdd1861991aafe5ed Review URL: http://codereview.chromium.org/3785014 --- scripts/image_signing/make_dev_firmware.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/image_signing/make_dev_firmware.sh b/scripts/image_signing/make_dev_firmware.sh index b8bf6e9298..f4e7d49d70 100755 --- a/scripts/image_signing/make_dev_firmware.sh +++ b/scripts/image_signing/make_dev_firmware.sh @@ -200,7 +200,24 @@ main() { local backup_file_path="$FLAGS_backup_dir/$backup_file_name" if mkdir -p "$FLAGS_backup_dir" && cp -f "$backup_image" "$backup_file_path"; then - echo "Backup of current firmware image is stored in: $backup_file_path" + true + elif cp -f "$backup_image" "/tmp/$backup_file_name"; then + backup_file_path="/tmp/$backup_file_name" + else + backup_file_path='' + fi + if [ -n "$backup_file_path" -a -s "$backup_file_path" ]; then + # TODO(hungte) maybe we can wrap the flashrom by 'make_dev_firmware.sh -r' + # so that the only command to remember would be make_dev_firmware.sh. + echo " + Backup of current firmware image is stored in: + $backup_file_path + Please copy the backup file to a safe place ASAP. + + To stop using devkeys and restore original firmware, execute command: + flashrom -w [PATH_TO_BACKUP_IMAGE] + Ex: flashrom -w $backup_file_path + " else echo "WARNING: Cannot create file in $FLAGS_backup_dir... Ignore backups." fi