summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-01-02 16:41:59 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-01-02 16:41:59 -0200
commitd5b908872ce21a4c3a7783015b0f373f4f8e8b0c (patch)
treecda8fcb93739df662d6eff4958bc79d4fe28fc2a /share
parent89a529bbd989df9161c36eb66cd2839479c5ed35 (diff)
downloadhydra-d5b908872ce21a4c3a7783015b0f373f4f8e8b0c.tar.gz
hydra-d5b908872ce21a4c3a7783015b0f373f4f8e8b0c.tar.bz2
Mount home and var during and kernel package image at provision
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/provision33
1 files changed, 31 insertions, 2 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision
index b8d198f..fd989cf 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -160,15 +160,40 @@ fi
mkdir -p /tmp/debootstrap
umount /tmp/debootstrap/proc &> /dev/null
umount /tmp/debootstrap/dev &> /dev/null
+umount /tmp/debootstrap/home &> /dev/null
+umount /tmp/debootstrap/var &> /dev/null
# Create devices
hydra_create_volume root
hydra_create_volume home
hydra_create_volume var
+# Mount root volume
+hydra_safe_run mount $install_device /tmp/debootstrap/
+
+# Mount additional volumes
+if [ "$home_size" != "0" ]; then
+ mkdir tmp/debootstrap/home
+
+ if [ "$encrypt" == "y" ]; then
+ hydra_safe_run mount /dev/mapper/home /tmp/debootstrap/home
+ else
+ hydra_safe_run mount /dev/mapper/$vg-home /tmp/debootstrap/home
+ fi
+fi
+
+if [ "$var_size" != "0" ]; then
+ mkdir tmp/debootstrap/var
+
+ if [ "$encrypt" == "y" ]; then
+ hydra_safe_run mount /dev/mapper/var /tmp/debootstrap/var
+ else
+ hydra_safe_run mount /dev/mapper/$vg-var /tmp/debootstrap/var
+ fi
+fi
+
# Initial system install.
echo "Installing base system..."
-hydra_safe_run mount $install_device /tmp/debootstrap/
hydra_safe_run debootstrap --arch=$arch $version /tmp/debootstrap/ $mirror
# Initial configuration.
@@ -313,7 +338,11 @@ else
kernel_arch="$arch"
fi
-hydra_safe_run chroot /tmp/debootstrap apt-get install linux-image-2.6-vserver-$kernel_arch -y
+if [ "$version" == "squeeze" ]; then
+ hydra_safe_run chroot /tmp/debootstrap apt-get install linux-image-2.6-vserver-$kernel_arch -y
+else
+ hydra_safe_run chroot /tmp/debootstrap apt-get install linux-image-$kernel_arch -y
+fi
# Initramfs.
echo "Creating initramfs..."