]> gitweb.fluxo.info Git - hydra.git/commitdiff
Using --root-directory on grub-install at provision
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 13 Apr 2012 03:00:55 +0000 (00:00 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 13 Apr 2012 03:00:55 +0000 (00:00 -0300)
share/hydractl/provision

index ef60edf72d8765a0fa601ef42ab4bbe0c05cb0dc..2269f730e65ef7dc755f7c357689c87008910354 100755 (executable)
@@ -185,13 +185,13 @@ fi
 # Grub.
 if [ "$grub" == "y" ]; then
   echo "Boot device setup..."
-  mkfs.ext3 $boot_device
-  mount $boot_device /tmp/debootstrap/boot
+  hydra_safe_run mkfs.ext3 $boot_device
+  hydra_safe_run mount $boot_device /tmp/debootstrap/boot
   echo "$boot_device /boot ext3 defaults,errors=remount-ro 0 2" >> /tmp/debootstrap/etc/fstab
 
   echo "Setting up GRUB..."
-  chroot /tmp/debootstrap/ apt-get install grub-pc -y
-  grub-install --no-floppy "$device"
+  hydra_safe_run chroot /tmp/debootstrap/ apt-get install grub-pc -y
+  hydra_safe_run grub-install --root-directory=/tmp/debootstrap/boot --no-floppy "$device"
   mkdir -p /tmp/debootstrap/boot/grub/
   cat /tmp/debootstrap/boot/grub/menu.lst <<-EOF
 title $hostname (hd0)
@@ -226,11 +226,11 @@ else
   kernel_arch="$arch"
 fi
 
-chroot /tmp/debootstrap apt-get install linux-image-2.6-vserver-$kernel_arch -y
+hydra_safe_run chroot /tmp/debootstrap apt-get install linux-image-2.6-vserver-$kernel_arch -y
 
 # Initramfs.
 echo "Creating initramfs..."
-chroot /tmp/debootstrap update-initramfs -v -u
+hydra_safe_run chroot /tmp/debootstrap update-initramfs -v -u
 
 # Utils.
 echo "Installing basic utilities..."