From: Andres Salomon Date: Tue, 2 Jun 2009 23:52:15 +0000 (-0400) Subject: installer: add actual guts.. X-Git-Tag: v0.6~46 X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32396bf1278738e61ba9a0221d7860668d20da62;p=xodist installer: add actual guts.. This just does a simple dd to copy the entire drive, partition tables and all. Obviously, this means if you're installing from a 1GB image onto a 60GB drive, the drive will appear as only a 1GB drive until the tables/filesystem have been resized. This is something we can tweak later.. Signed-off-by: Andres Salomon --- diff --git a/installer b/installer index 0d2f241..98b7427 100755 --- a/installer +++ b/installer @@ -50,17 +50,24 @@ do_install() echo "Error: couldn't find drive to install to!" exit 1 fi + + # don't keep fs mounted while copying it + umount /root - echo "Copying data from $ROOT_SRC => $TARGET" - echo "IF THIS IS INCORRECT, REBOOT NOW OR YOU WILL LOSE DATA! (waiting 15s)" # wait 15s for user realize that they've made a mistake + echo "Copying data from $ROOT_SRC => $TARGET" + echo "IF THIS IS INCORRECT, REBOOT NOW OR YOU WILL LOSE DATA! (waiting 15s)" sleep 15 echo "Too late, starting copy..." -sleep 20 + # ideally, we'll resize the filesystem/partitions later.. + dd if=/dev/$ROOT_SRC of=/dev/$TARGET bs=4k - - echo "Done. Remove installer and reboot." + echo "Done. Remove installer media." + while [ -d /sys/block/$ROOT_SRC ]; do + sleep 1 + done + reboot } for x in $(cat /proc/cmdline); do