diff options
author | Hung-Te Lin <hungte@chromium.org> | 2018-10-26 09:25:47 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-10-26 12:14:54 -0700 |
commit | 5c904692b5c3279b3258deaf98a65336f62d1df8 (patch) | |
tree | d3b371cdf332f00d567766c11f6668ff4fbf1d3d /scripts | |
parent | e1cc2b8ef8d27945043daf0e961fa1ddd40acfd4 (diff) | |
download | vboot-5c904692b5c3279b3258deaf98a65336f62d1df8.tar.gz |
image_signing: make_dev_ssd: Revise backup output when inside chroot
Storing backup files inside /mnt/stateful_partition should be done only
on DUTs running ChromeOS. For chroot or other environment, we should
just store in current folder if available.
Also fixed that the warning message when backup files can't be generated
should be printed using "warn" instead of "warning".
BUG=None
TEST=./make_dev_ssd.sh -i image --edit_config --partitions 2
Change-Id: Ie81e810951e7fc72f350de847440a8f0372bc9be
Reviewed-on: https://chromium-review.googlesource.com/1300893
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/image_signing/make_dev_ssd.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/image_signing/make_dev_ssd.sh b/scripts/image_signing/make_dev_ssd.sh index 5871a190..de851db0 100755 --- a/scripts/image_signing/make_dev_ssd.sh +++ b/scripts/image_signing/make_dev_ssd.sh @@ -14,9 +14,16 @@ load_shflags || exit 1 # Constants used by DEFINE_* VBOOT_BASE='/usr/share/vboot' DEFAULT_KEYS_FOLDER="$VBOOT_BASE/devkeys" -DEFAULT_BACKUP_FOLDER='/mnt/stateful_partition/backups' DEFAULT_PARTITIONS='2 4' +# Only store backup in stateful partition if available. +if [ -d /mnt/stateful_partition ]; then + DEFAULT_BACKUP_FOLDER="/mnt/stateful_partition" +else + DEFAULT_BACKUP_FOLDER="$(pwd)" +fi +DEFAULT_BACKUP_FOLDER="${DEFAULT_BACKUP_FOLDER}/cros_sign_backups" + # TODO(hungte) The default image selection is no longer a SSD, so the script # works more like "make_dev_image". We may change the file name in future. ROOTDEV="$(rootdev -s 2>/dev/null)" @@ -281,7 +288,7 @@ resign_ssd_kernel() { cp -f "$old_blob" "$backup_file_path"; then info "Backup of ${name} is stored in: ${backup_file_path}" else - warning "Cannot create file in ${FLAGS_backup_dir} ... Ignore backups." + warn "Cannot create file in ${FLAGS_backup_dir} ... Ignore backups." fi debug_msg "Writing $name to partition $kernel_index" |