Skip to content
Browse files

Tweaks to production image generator

  • Loading branch information...
1 parent 5c71a40 commit 70a6d731a2bf449dbd2dde530483fb118408e81e @klange committed Feb 22, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 image-builder/create-image.sh
View
8 image-builder/create-image.sh
@@ -24,6 +24,8 @@ if [ "$REPLY" == "n" ] ; then
exit
fi
+type kpartx >/dev/null 2>&1 || { echo "Trying to install kpartx..."; apt-get install kpartx; }
+
# Create a 1GiB blank disk image.
dd if=/dev/zero of=$DISK bs=4096 count=262144
@@ -63,4 +65,10 @@ grub-install --boot-directory=/mnt/boot /dev/loop1
./clean-up.sh
+if [ -n "$SUDO_USER" ] ; then
+ echo "Reassigning permissions on disk image to $SUDO_USER"
+ chown $SUDO_USER:$SUDO_USER $DISK
+fi
+
+
echo "Done. You can boot the disk image with qemu now."

0 comments on commit 70a6d73

Please sign in to comment.
Something went wrong with that request. Please try again.