Merge "Fix typo in extracting root partition"

This commit is contained in:
Jenkins 2016-10-05 04:00:39 +00:00 committed by Gerrit Code Review
commit 04b05f261e

View File

@ -59,7 +59,7 @@ function extract_image() {
qemu-img convert -f qcow2 -O raw $CACHED_IMAGE $RAW_FILE qemu-img convert -f qcow2 -O raw $CACHED_IMAGE $RAW_FILE
ROOT_PARTITON=p$(sudo kpartx -l $RAW_FILE | awk "/loop[0-9]+p/"|wc -l) ROOT_PARTITION=p$(sudo kpartx -l $RAW_FILE | awk "/loop[0-9]+p/"|wc -l)
sudo udevadm settle sudo udevadm settle
# kpartx fails if no /dev/loop* exists, "losetup -f" prints first unused # kpartx fails if no /dev/loop* exists, "losetup -f" prints first unused
@ -69,7 +69,7 @@ function extract_image() {
# XXX: Parsing stdout is dangerous, would like a better way to discover # XXX: Parsing stdout is dangerous, would like a better way to discover
# the device used for the image. # the device used for the image.
ROOT_LOOPDEV=$(sudo kpartx -av $RAW_FILE | \ ROOT_LOOPDEV=$(sudo kpartx -av $RAW_FILE | \
awk "/loop[0-9]+$ROOT_PARTITON/ {print \$3}") awk "/loop[0-9]+$ROOT_PARTITION/ {print \$3}")
# If running inside Docker, make our nodes manually, because udev will not be working. # If running inside Docker, make our nodes manually, because udev will not be working.
if [ -f /.dockerenv ]; then if [ -f /.dockerenv ]; then
sudo dmsetup --noudevsync mknodes sudo dmsetup --noudevsync mknodes