Merge pull request #6 from CanonicalLtd/fix_issue_4

Fix issue 4
This commit is contained in:
Adam Stokes 2015-06-17 14:58:56 -04:00
commit 2bad57c76a
2 changed files with 24 additions and 2 deletions

View File

@ -24,6 +24,7 @@ PKG_DEPS="
qemu-utils
kpartx
parted
gdisk
extlinux
simplestreams
syslinux-common
@ -133,6 +134,10 @@ install_deps() {
install_src() {
local dldir=${1}; shift;
mkdir -p ${dldir} || {
log "ERROR: failed to mkdir $dldir";
return 1;
}
log "Acquiring src packages..."
while [ $# -gt 0 ]; do
@ -408,7 +413,7 @@ generate_img() {
sudo mount -o bind /dev ${mnt}/dev &&
sudo mkdir -p ${mnt}/boot/extlinux &&
sudo extlinux --install ${mnt}/boot/extlinux &&
sudo cp -av ${syslinux_path}/*menu* ${mnt}/boot/extlinux &&
sudo cp -av ${syslinux_path}/*.c32 ${mnt}/boot/extlinux &&
sudo cp -av ${splash} ${mnt}/boot/extlinux &&
cat ${extlinux_conf} | sudo tee ${mnt}/boot/extlinux/extlinux.conf &&
sudo mkdir -p ${mnt}/var/lib/cloud/seed &&

View File

@ -14,12 +14,29 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
ARCH=${ARCH-"x86_64"}
ARCH=${ARCH-"`uname -m`"}
MEM=${MEM-"1024"}
INSTALLER=${INSTALLER-"installer.img"}
TARGET=${TARGET-"target.img"}
SPORT=2445
QEMU=`which qemu-system-$ARCH`;
if [ -z $QEMU ]; then
case $ARCH in
i386|x86_64) PKG=qemu-system-x86 ;;
arm*) PKG=qemu-system-arm ;;
ppc*) PKG=qemu-system-ppc ;;
*)
echo "Unsupported arch: $ARCH";
exit 1;
;;
esac
sudo apt-get install $PKG || {
echo "Failed to install qemu-system package $PKG";
exit 1;
}
fi
[ ! -f ${TARGET} ] && {
qemu-img create -f raw ${TARGET} 10G || exit 1
}