qemu support

This commit is contained in:
Bob Mottram 2015-11-22 22:52:59 +00:00
parent ba9507eaca
commit 1ac5bfe548
4 changed files with 39 additions and 5 deletions

View File

@ -154,6 +154,7 @@ rm $CURR_DIR/${PROJECT_NAME}*.img.bz2
rm $CURR_DIR/${PROJECT_NAME}*.img
rm $CURR_DIR/${PROJECT_NAME}*.sig
rm $CURR_DIR/${PROJECT_NAME}*.vdi
rm $CURR_DIR/${PROJECT_NAME}*.qcow2
if [ -d $BUILD_DIR ]; then
rm -rf $BUILD_DIR
@ -166,6 +167,7 @@ else
fi
cp -r /etc/${PROJECT_NAME}/* $BUILD_DIR
rm -rf $BUILD_DIR/vendor
chown -R $CURR_USER:$CURR_USER $BUILD_DIR
cd $BUILD_DIR
@ -194,13 +196,10 @@ mv build/${PROJECT_NAME}*.bz2 ${CURR_DIR}
mv build/${PROJECT_NAME}*.img ${CURR_DIR}
mv build/${PROJECT_NAME}*.sig ${CURR_DIR}
mv build/${PROJECT_NAME}*.vdi ${CURR_DIR}
mv build/${PROJECT_NAME}*.qcow2 ${CURR_DIR}
rm -rf ${BUILD_DIR}
cd ${CURR_DIR}
#if [[ $IMAGE_TYPE == "virtualbox"* ]]; then
# imgfiles=(${PROJECT_NAME}*.img)
# VBoxManage convertdd ${imgfiles[0]} ${imgfiles[0]}.vdi
#fi
clear
echo "
@ -212,7 +211,7 @@ You will be able to log into it with:
Password: $PASSWORD
"
ls -lh ${PROJECT_NAME}*.img ${PROJECT_NAME}*.sig ${PROJECT_NAME}*.bz2 ${PROJECT_NAME}*.vdi
ls -lh ${PROJECT_NAME}*.img ${PROJECT_NAME}*.sig ${PROJECT_NAME}*.bz2 ${PROJECT_NAME}*.vdi ${PROJECT_NAME}*.qcow2
# record the default login credentials for later use
echo "Username: $USERNAME

View File

@ -223,6 +223,11 @@ case "$MACHINE" in
echo "echo \"4 4 1 7\" > /proc/sys/kernel/printk" \
>> /etc/init.d/rc.local
;;
qemu)
# hide irrelevant console keyboard messages.
echo "echo \"4 4 1 7\" > /proc/sys/kernel/printk" \
>> /etc/init.d/rc.local
;;
esac
set_apt_sources $BUILD_MIRROR

View File

@ -89,6 +89,11 @@ case "$MACHINE" in
extra_opts="\
--grub \
--roottype btrfs \
" ;;
qemu)
extra_opts="\
--grub \
--roottype btrfs \
" ;;
all)
extra_opts="\

View File

@ -164,6 +164,31 @@ test-virtualbox: virtualbox
VBoxManage modifyvm $(VM_NAME) --hda none
VBoxManage unregistervm $(VM_NAME) --delete
# build a qemu image
qemu: qemu-i386
qemu-i386: prep
$(eval ARCHITECTURE = i386)
$(eval MACHINE = qemu)
$(MAKE_IMAGE)
# Convert image to qemu format
qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2
$(TAR) $(ARCHIVE) $(NAME).qcow2
@echo ""
$(SIGN)
@echo "Build complete."
qemu-amd64: prep
$(eval ARCHITECTURE = amd64)
$(eval MACHINE = qemu)
$(MAKE_IMAGE)
# Convert image to qemu format
qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2
$(TAR) $(ARCHIVE) $(NAME).qcow2
@echo ""
$(SIGN)
@echo "Build complete."
vendor/vmdebootstrap/vmdebootstrap: vendor-patches/vmdebootstrap/*.patch
freedombone-image-vmdebootstrap