From a204e434c67ea7fb0ebb2614730ae85b81af4e7a Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Wed, 22 Oct 2014 15:19:04 -0700 Subject: [PATCH 1/2] grub_install: use sudo when reprobing --- build_library/grub_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_library/grub_install.sh b/build_library/grub_install.sh index 4861369083..59a6912323 100755 --- a/build_library/grub_install.sh +++ b/build_library/grub_install.sh @@ -108,7 +108,7 @@ if [[ ! -b "${LOOP_DEV}p1" ]]; then break fi warn "looback device node still ${LOOP_DEV}p1 missing, reprobing..." - blockdev --rereadpt ${LOOP_DEV} + sudo blockdev --rereadpt ${LOOP_DEV} sleep 0.5 done if [[ ! -b "${LOOP_DEV}p1" ]]; then From f0618ab541e1794945a768214d9f506caf9ba4bb Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Wed, 22 Oct 2014 15:19:27 -0700 Subject: [PATCH 2/2] build_library: use jq to parse JSON --- build_library/build_image_util.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build_library/build_image_util.sh b/build_library/build_image_util.sh index 13bbbfd09f..e8e1b760e6 100755 --- a/build_library/build_image_util.sh +++ b/build_library/build_image_util.sh @@ -169,8 +169,7 @@ assert_image_size() { local size size=$(qemu-img info -f "${disk_type}" --output json "${disk_img}" | \ - gawk 'match($0, /"virtual-size": ([0-9]+),/, val) {print val[1]}' ; \ - exit ${PIPESTATUS[0]}) + jq --raw-output '.["virtual-size"]' ; exit ${PIPESTATUS[0]}) if [[ $? -ne 0 ]]; then die_notrace "assert failed: could not read image size" fi