diff --git a/build_library/base_image_util.sh b/build_library/base_image_util.sh index 2ee0053f07..4e337ed67d 100755 --- a/build_library/base_image_util.sh +++ b/build_library/base_image_util.sh @@ -73,8 +73,7 @@ create_base_image() { ROOT_LOOP_DEV=$(sudo losetup --show -f "${ROOT_FS_IMG}") if [ -z "${ROOT_LOOP_DEV}" ] ; then - echo "No free loop device. Free up a loop device or reboot. exiting. " - exit 1 + die "No free loop device. Free up a loop device or reboot. exiting. " fi # Specify a block size and block count to avoid using the hash pad. @@ -106,8 +105,7 @@ create_base_image() { DISK_LABEL="C-STATE" STATEFUL_LOOP_DEV=$(sudo losetup --show -f "${STATEFUL_FS_IMG}") if [ -z "${STATEFUL_LOOP_DEV}" ] ; then - echo "No free loop device. Free up a loop device or reboot. exiting. " - exit 1 + die "No free loop device. Free up a loop device or reboot. exiting. " fi sudo mkfs.ext4 "${STATEFUL_LOOP_DEV}" sudo tune2fs -L "${DISK_LABEL}" -U "${UUID}" -c 0 -i 0 "${STATEFUL_LOOP_DEV}" @@ -126,7 +124,7 @@ create_base_image() { # Perform binding rather than symlinking because directories must exist # on rootfs so that we can bind at run-time since rootfs is read-only. - echo "Binding directories from stateful partition onto the rootfs" + info "Binding directories from stateful partition onto the rootfs" sudo mkdir -p "${ROOT_FS_DIR}/usr/local" sudo mount --bind "${DEV_IMAGE_ROOT}" "${ROOT_FS_DIR}/usr/local" sudo mkdir -p "${ROOT_FS_DIR}/var" diff --git a/build_library/build_gpt.sh b/build_library/build_gpt.sh index 7c914e80d9..18b515bdb7 100755 --- a/build_library/build_gpt.sh +++ b/build_library/build_gpt.sh @@ -67,15 +67,15 @@ build_gpt() { fi # Now populate the partitions. - echo "Copying stateful partition..." + info "Copying stateful partition..." $sudo dd if="$stateful_img" of="$outdev" conv=notrunc bs=512 \ seek=$START_STATEFUL - echo "Copying rootfs..." + info "Copying rootfs..." $sudo dd if="$rootfs_img" of="$outdev" conv=notrunc bs=512 \ seek=$START_ROOTFS_A - echo "Copying EFI system partition..." + info "Copying EFI system partition..." $sudo dd if="$esp_img" of="$outdev" conv=notrunc bs=512 \ seek=$START_ESP diff --git a/build_library/dev_image_util.sh b/build_library/dev_image_util.sh index 0fd03c2b2d..4ce42b4e82 100755 --- a/build_library/dev_image_util.sh +++ b/build_library/dev_image_util.sh @@ -12,7 +12,7 @@ install_dev_packages() { local image_name=$1 - echo "Adding developer packages to ${image_name}" + info "Adding developer packages to ${image_name}" trap "unmount_image ; delete_prompt" EXIT @@ -88,7 +88,7 @@ install_dev_packages() { if [ ${FLAGS_factory_install} -eq ${FLAGS_FALSE} ]; then test_image_content "$ROOT_FS_DIR" fi - echo "Developer image built and stored at ${image_name}" + info "Developer image built and stored at ${image_name}" unmount_image trap - EXIT diff --git a/mount_gpt_image.sh b/mount_gpt_image.sh index 3ab2e99a6d..7c9a8d9c8b 100755 --- a/mount_gpt_image.sh +++ b/mount_gpt_image.sh @@ -73,7 +73,7 @@ fi # Common unmounts for either a device or directory function unmount_image() { - echo "Unmounting image from ${FLAGS_stateful_mountpt}" \ + info "Unmounting image from ${FLAGS_stateful_mountpt}" \ "and ${FLAGS_rootfs_mountpt}" # Don't die on error to force cleanup set +e @@ -185,7 +185,7 @@ function mount_image() { setup_symlinks_on_root "${FLAGS_stateful_mountpt}/dev_image" \ "${FLAGS_stateful_mountpt}/var" "${FLAGS_stateful_mountpt}" fi - echo "Image specified by ${FLAGS_from} mounted at"\ + info "Image specified by ${FLAGS_from} mounted at"\ "${FLAGS_rootfs_mountpt} successfully." }