X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=installer;h=dbcd0bc387f43a06a1fe8f277129fb2a6ffda1e3;hb=4352e15f6b81c24fb45a5eb69ff5a4e73641ac3a;hp=0d2f2417b4cd591df73f7310920fc7c8e6b6e5b1;hpb=f2f4abdb6892a1571af9cd01f26047fe808d06dd;p=xodist diff --git a/installer b/installer index 0d2f241..dbcd0bc 100755 --- a/installer +++ b/installer @@ -38,7 +38,7 @@ do_install() echo "Starting installer!" if [ ! -d /root/etc ]; then echo "Error: /root doesn't appear to have a valid filesystem mounted!" - exit 1 + sleep 9999999999 fi ROOT_SRC=$(grep ' /root ' /proc/mounts | cut -d' ' -f1) @@ -48,19 +48,26 @@ do_install() if [ -z "$TARGET" ]; then echo "Error: couldn't find drive to install to!" - exit 1 + sleep 9999999999 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