]> gitweb.fluxo.info Git - hydra.git/commitdiff
Bootless: misc fixes
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 3 Sep 2013 01:49:17 +0000 (22:49 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 3 Sep 2013 01:49:17 +0000 (22:49 -0300)
share/hydra/bootless

index 819a4649fd575839fa1a33180f6f1bc28ee3ffbf..3e856555c9b27105de34bd3ac46cab59ea2457b1 100755 (executable)
@@ -96,7 +96,7 @@ EOF
   hydra_bootless_device ${usbdevice} ${device}
 
   # Mount
-  tmpdir=`mktemp -d`
+  tmpdir=`mktemp --tmpdir=/tmp -d`
   $sudo mount ${device} ${tmpdir}
   if [ $? != 0 ]; then
     echo "Error: failed to mount \"${device}\" filesystem in \"${tmpdir}\" (errno: $?)."
@@ -115,7 +115,9 @@ EOF
     fi
 
     (
-      cd ${tmpdir}/boot && git annex init && git config annex.sshcaching false && git annex untrust here && git annex sync && git annex get .
+      cd ${tmpdir}/boot && $sudo git annex init && \
+         $sudo git config annex.sshcaching false && \
+         $sudo git annex untrust here && $sudo git annex sync && $sudo git annex get .
     )
 
     if [ $? != 0 ]; then
@@ -135,8 +137,7 @@ EOF
   #quit" | grub --device-map=${devicemap} --batch
   
   # Grub 2
-  #$sudo grub-install --root-directory=${tmpdir} ${usbdevice} --force
-  $sudo grub-install --boot-directory=${tmpdir} --allow-floppy --force ${usbdevice}
+  $sudo grub-install --boot-directory=${tmpdir} --force ${usbdevice}
   if [ $? != 0 ]; then
     echo "Error: grub-install failed (errno: $?)."
     exit 1
@@ -181,7 +182,7 @@ function hydra_bootless_update {
     exit 1
   fi
 
-  tmpdir=`mktemp -d`
+  tmpdir=`mktemp --tmpdir=/tmp -d`
   $sudo mount ${device} ${tmpdir}
   if [ $? != 0 ]; then
     echo "Error: failed to mount \"${device}\" filesystem in \"${tmpdir}\" (errno: $?)."
@@ -191,7 +192,7 @@ function hydra_bootless_update {
   # Copy data
   if [ -d "${tmpdir}/boot/.git" ]; then
     #( cd ${tmpdir}/boot && $sudo git pull origin master )
-    ( cd ${tmpdir}/boot && $sudo git annex sync && git annex get . )
+    ( cd ${tmpdir}/boot && $sudo git annex sync && $sudo git annex get . )
   else
     hydra_bootless_rsync ${BOOTLESS_DIR} ${tmpdir}/boot
   fi
@@ -373,7 +374,7 @@ function hydra_bootless_image {
   fi
 
   # Copy data
-  tmpdir=`mktemp -d`
+  tmpdir=`mktemp --tmpdir=/tmp -d`
   hydra_bootless_rsync ${BOOTLESS_DIR} ${tmpdir}/boot
 
   # Make rescue disk