]> gitweb.fluxo.info Git - hydra.git/commitdiff
Provision: using 'root' for install luks volume, mounting sysfs and commenting some...
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 15 Apr 2012 00:36:38 +0000 (21:36 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 15 Apr 2012 00:36:38 +0000 (21:36 -0300)
share/hydractl/provision

index fc0e43ee6c8ade17f5310efeb062de562f58990d..98e526f769235a1889f6583cb698d7e3a07ec2d5 100755 (executable)
@@ -109,9 +109,9 @@ umount /tmp/debootstrap/dev  &> /dev/null
 if [ "$encrypt" == "y" ]; then
   echo "Creating encrypted root device..."
   hydra_safe_run cryptsetup -h sha256 -c aes-cbc-essiv:sha256 -s 256 luksFormat /dev/$vg/root
-  hydra_safe_run cryptsetup luksOpen /dev/$vg/root debootstrap
+  hydra_safe_run cryptsetup luksOpen /dev/$vg/root root
   hydra_safe_run mkfs.ext4 /dev/mapper/debootstrap
-  install_device="/dev/mapper/debootstrap"
+  install_device="/dev/mapper/root"
 else
   echo "Creating root device..."
   mkfs.ext4 /dev/vg/root
@@ -125,7 +125,8 @@ hydra_safe_run debootstrap --arch=$arch $version /tmp/debootstrap/ $mirror
 
 # Initial configuration.
 echo "Applying initial configuration..."
-mount none -t proc /tmp/debootstrap/proc/
+mount none -t proc /tmp/debootstrap/proc
+mount none -t sysfs /tmp/debootstrap/sys
 mount -o bind /dev/ /tmp/debootstrap/dev
 echo LANG=C > /tmp/debootstrap/etc/default/locale
 
@@ -136,8 +137,8 @@ grep nameserver /etc/resolv.conf >> /tmp/debootstrap/etc/resolv.conf
 
 # Hostname configuration.
 echo $hostname.$domain > /tmp/debootstrap/etc/hostname
-echo "127.0.0.1 $hostname $hostname.$domain" >> /tmp/debootstrap/etc/hosts
 echo "127.0.0.1 localhost" >> /tmp/debootstrap/etc/hosts
+echo "127.0.0.1 $hostname $hostname.$domain" >> /tmp/debootstrap/etc/hosts
 
 # Invert hostname contents to avoid http://projects.puppetlabs.com/issues/2533
 tac /tmp/debootstrap/etc/hosts > /tmp/debootstrap/etc/hosts.new
@@ -191,18 +192,18 @@ if [ "$grub" == "y" ]; then
 
   echo "Setting up GRUB..."
   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/grub.cfg <<-EOF
-set menu_color_normal=white/blue
-set menu_color_highlight=yellow/red
-
-menuentry 'Standard: $hostname Debian Server' --class debian --class gnu-linux --class gnu --class os {
-       echo    'Debian Server $hostname...'
-  linux /vmlinuz-2.6.32-5-vserver-amd64 root=/dev/mapper/root ro
-       echo    'Loading initial ramdisk...'
-  initrd /initrd.img-2.6.32-5-vserver-amd64-server
-}
+#  hydra_safe_run grub-install --root-directory=/tmp/debootstrap/boot --no-floppy "$device"
+#  mkdir -p /tmp/debootstrap/boot/grub/
+#  cat >> /tmp/debootstrap/boot/grub/grub.cfg <<-EOF
+#set menu_color_normal=white/blue
+#set menu_color_highlight=yellow/red
+#
+#menuentry 'Standard: $hostname Debian Server' --class debian --class gnu-linux --class gnu --class os {
+#      echo    'Debian Server $hostname...'
+#  linux /vmlinuz-2.6.32-5-vserver-amd64 root=/dev/mapper/root ro
+#      echo    'Loading initial ramdisk...'
+#  initrd /initrd.img-2.6.32-5-vserver-amd64-server
+#}
 EOF
 fi