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
# 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
# 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
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