Prototype fast installer using a special guest.
[invirt/packages/invirt-autoinstaller.git] / partial / copying-installer.sh
diff --git a/partial/copying-installer.sh b/partial/copying-installer.sh
new file mode 100644 (file)
index 0000000..79678a2
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+# hda is the copying-installer image itself
+# hdb is unused (was the source image)
+# hdc is the target image
+# hdd is the arguments image
+
+exec 3</dev/hdd
+read -r -u 3 HOSTNAME
+read -r -u 3 ROOTPW
+exec 3<&-
+
+mount /dev/hdc1 /mnt/new
+/mnt/new/post-copy /mnt/new "$HOSTNAME" "$ROOTPW"
+umount /mnt/new
+sync