#!/bin/sh -e img_url="http://maas.ubuntu.com/images/ephemeral-v2/daily/trusty/armhf/20140618.1/root-image.gz" img_gz="/tmp/root-image.gz" img="/tmp/root-image" u_boot_files=" /usr/bin/mkimage /usr/bin/fw_printenv /usr/share/doc/u-boot-tools/changelog.Debian.gz /usr/share/man/man1/mkimage.1.gz /usr/bin/fw_setenv " if [ ! -f "$img" ]; then if [ ! -f "$img_gz" ]; then wget "$img_url" -O "$img_gz.tmp" && mv "$img_gz.tmp" "$img_gz" fi zcat "$img_gz" > "$img.tmp" && mv "$img.tmp" "$img" fi sudo mount-image-callback "$img" -- sh -c \ 'cd $MOUNTPOINT && for f in "$@"; do ls -l ./${f#/}; done' -- \ $u_boot_files