summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-04-14 21:36:38 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-04-14 21:36:38 -0300
commitac843435c1226fe3501e7eb9275c66c4a73d8fce (patch)
tree987509dee7e72edb71dc0650740408c641b7a2d6 /share
parent9218b68b29eee4bd7ea3a87483e8144db0cc08a2 (diff)
downloadhydra-ac843435c1226fe3501e7eb9275c66c4a73d8fce.tar.gz
hydra-ac843435c1226fe3501e7eb9275c66c4a73d8fce.tar.bz2
Provision: using 'root' for install luks volume, mounting sysfs and commenting some grub code
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/provision33
1 files changed, 17 insertions, 16 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision
index fc0e43e..98e526f 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -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